summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2004-11-04 00:40:06 +0000
committerTor Lillqvist <tml@src.gnome.org>2004-11-04 00:40:06 +0000
commit5ddd4874a6bf6599a194bbc29b4f2b637e069ebb (patch)
tree53e6d48bc045e85a3eb9dc8e027b82bf7f0a9ae3
parent912ba0d43cf76ab76f338fb5beab98102da4d868 (diff)
downloadglib-5ddd4874a6bf6599a194bbc29b4f2b637e069ebb.tar.gz
Add G_OPTION_FLAG_REVERSE, to reverse the sense of a G_OPTION_ARG_NONE
2004-11-04 Tor Lillqvist <tml@iki.fi> * glib/goption.h (enum GOptionFlags): Add G_OPTION_FLAG_REVERSE, to reverse the sense of a G_OPTION_ARG_NONE (boolean) option. * glib/goption.c (parse_arg): Obey the above flag.
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-2-105
-rw-r--r--ChangeLog.pre-2-125
-rw-r--r--ChangeLog.pre-2-65
-rw-r--r--ChangeLog.pre-2-85
-rw-r--r--glib/goption.c2
-rw-r--r--glib/goption.h3
7 files changed, 28 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ef5c40e2d..e000728e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2004-11-04 Tor Lillqvist <tml@iki.fi>
+ * glib/goption.h (enum GOptionFlags): Add G_OPTION_FLAG_REVERSE,
+ to reverse the sense of a G_OPTION_ARG_NONE (boolean) option.
+
+ * glib/goption.c (parse_arg): Obey the above flag.
+
* glib/gconvert.c (g_filename_display_name): Document that the
result is guaranteed to be non-NULL.
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index ef5c40e2d..e000728e7 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,5 +1,10 @@
2004-11-04 Tor Lillqvist <tml@iki.fi>
+ * glib/goption.h (enum GOptionFlags): Add G_OPTION_FLAG_REVERSE,
+ to reverse the sense of a G_OPTION_ARG_NONE (boolean) option.
+
+ * glib/goption.c (parse_arg): Obey the above flag.
+
* glib/gconvert.c (g_filename_display_name): Document that the
result is guaranteed to be non-NULL.
diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12
index ef5c40e2d..e000728e7 100644
--- a/ChangeLog.pre-2-12
+++ b/ChangeLog.pre-2-12
@@ -1,5 +1,10 @@
2004-11-04 Tor Lillqvist <tml@iki.fi>
+ * glib/goption.h (enum GOptionFlags): Add G_OPTION_FLAG_REVERSE,
+ to reverse the sense of a G_OPTION_ARG_NONE (boolean) option.
+
+ * glib/goption.c (parse_arg): Obey the above flag.
+
* glib/gconvert.c (g_filename_display_name): Document that the
result is guaranteed to be non-NULL.
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index ef5c40e2d..e000728e7 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,5 +1,10 @@
2004-11-04 Tor Lillqvist <tml@iki.fi>
+ * glib/goption.h (enum GOptionFlags): Add G_OPTION_FLAG_REVERSE,
+ to reverse the sense of a G_OPTION_ARG_NONE (boolean) option.
+
+ * glib/goption.c (parse_arg): Obey the above flag.
+
* glib/gconvert.c (g_filename_display_name): Document that the
result is guaranteed to be non-NULL.
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index ef5c40e2d..e000728e7 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,5 +1,10 @@
2004-11-04 Tor Lillqvist <tml@iki.fi>
+ * glib/goption.h (enum GOptionFlags): Add G_OPTION_FLAG_REVERSE,
+ to reverse the sense of a G_OPTION_ARG_NONE (boolean) option.
+
+ * glib/goption.c (parse_arg): Obey the above flag.
+
* glib/gconvert.c (g_filename_display_name): Document that the
result is guaranteed to be non-NULL.
diff --git a/glib/goption.c b/glib/goption.c
index 35a4e3d07..afafa9bcb 100644
--- a/glib/goption.c
+++ b/glib/goption.c
@@ -654,7 +654,7 @@ parse_arg (GOptionContext *context,
change = get_change (context, G_OPTION_ARG_NONE,
entry->arg_data);
- *(gboolean *)entry->arg_data = TRUE;
+ *(gboolean *)entry->arg_data = !(entry->flags & G_OPTION_FLAG_REVERSE);
break;
}
case G_OPTION_ARG_STRING:
diff --git a/glib/goption.h b/glib/goption.h
index 1b62d7c2d..fca5802d5 100644
--- a/glib/goption.h
+++ b/glib/goption.h
@@ -33,7 +33,8 @@ typedef struct _GOptionEntry GOptionEntry;
typedef enum
{
G_OPTION_FLAG_HIDDEN = 1 << 0,
- G_OPTION_FLAG_IN_MAIN = 1 << 1
+ G_OPTION_FLAG_IN_MAIN = 1 << 1,
+ G_OPTION_FLAG_REVERSE = 1 << 2
} GOptionFlags;
typedef enum