* any later version.
*
*/
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
#include <glib.h>
#include <glib-object.h>
#include <glib/gstdio.h>
return plist;
}
+gboolean
+ghb_lock_file(const gchar *name)
+{
+#if !defined(_WIN32)
+ gchar *config, *path;
+ int fd, lock = 0;
+
+ config = ghb_get_user_config_dir(NULL);
+ path = g_strdup_printf ("%s/%s", config, name);
+ fd = open(path, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR);
+ if (fd >= 0)
+ lock = lockf(fd, F_TLOCK, 0);
+ if (lock)
+ close(fd);
+ g_free(config);
+ g_free(path);
+ return !lock;
+#else
+ return 1;
+#endif
+}
+
static void
remove_plist(const gchar *name)
{
value_map_t deint_xlat[] =
{
- {"0", "none"},
+ {"0", "off"},
{"1", "custom"},
{"2", "fast"},
{"3", "slow"},
value_map_t denoise_xlat[] =
{
- {"0", "none"},
+ {"0", "off"},
{"1", "custom"},
{"2", "weak"},
{"3", "medium"},
value_map_t detel_xlat[] =
{
- {"0", "none"},
+ {"0", "off"},
{"1", "custom"},
{"2", "default"},
{NULL, NULL}
value_map_t decomb_xlat[] =
{
- {"0", "none"},
+ {"0", "off"},
{"1", "custom"},
{"2", "default"},
{NULL, NULL}