Add G_OPTION_FLAG_NO_ARG and G_OPTION_FLAG_FILENAME to allow greater
[platform/upstream/glib.git] / glib / goption.h
index 2921253..dcd36e4 100644 (file)
 
 G_BEGIN_DECLS
 
-/* Should go into gtypes.h */
-typedef const gchar * (*GTranslateFunc) (const gchar *str,
-                                        gpointer     data);
-
 typedef struct _GOptionContext GOptionContext;
 typedef struct _GOptionGroup   GOptionGroup;
 typedef struct _GOptionEntry   GOptionEntry;
@@ -38,6 +34,9 @@ typedef enum
 {
   G_OPTION_FLAG_HIDDEN       = 1 << 0,
   G_OPTION_FLAG_IN_MAIN      = 1 << 1,
+  G_OPTION_FLAG_REVERSE      = 1 << 2,
+  G_OPTION_FLAG_NO_ARG       = 1 << 3,
+  G_OPTION_FLAG_FILENAME     = 1 << 4
 } GOptionFlags;
 
 typedef enum
@@ -48,7 +47,7 @@ typedef enum
   G_OPTION_ARG_CALLBACK,
   G_OPTION_ARG_FILENAME,
   G_OPTION_ARG_STRING_ARRAY,
-  G_OPTION_ARG_FILENAME_ARRAY,
+  G_OPTION_ARG_FILENAME_ARRAY
 } GOptionArg;
 
 typedef gboolean (*GOptionArgFunc) (const gchar    *option_name,
@@ -66,7 +65,7 @@ typedef void (*GOptionErrorFunc) (GOptionContext *context,
                                  gpointer        data,
                                  GError        **error);
 
-#define G_OPTION_ERROR (g_option_context_error_quark ())
+#define G_OPTION_ERROR (g_option_error_quark ())
 
 typedef enum
 {
@@ -75,22 +74,24 @@ typedef enum
   G_OPTION_ERROR_FAILED
 } GOptionError;
 
-GQuark g_option_context_error_quark (void) G_GNUC_CONST;
+GQuark g_option_error_quark (void);
 
 
 struct _GOptionEntry
 {
-  const char *long_name;
-  char        short_name;
-  int         flags;
+  const gchar *long_name;
+  gchar        short_name;
+  gint         flags;
 
-  GOptionArg  arg;
-  gpointer    arg_data;
+  GOptionArg   arg;
+  gpointer     arg_data;
   
-  const char *description;
-  const char *arg_description;
+  const gchar *description;
+  const gchar *arg_description;
 };
 
+#define G_OPTION_REMAINING ""
+
 GOptionContext *g_option_context_new              (const gchar         *parameter_string);
 void            g_option_context_free             (GOptionContext      *context);
 void           g_option_context_set_help_enabled (GOptionContext      *context,
@@ -117,7 +118,7 @@ GOptionGroup *g_option_context_get_main_group (GOptionContext *context);
 
 GOptionGroup *g_option_group_new                    (const gchar        *name,
                                                     const gchar        *description,
-                                                    const char         *help_description,
+                                                    const gchar        *help_description,
                                                     gpointer            user_data,
                                                     GDestroyNotify      destroy);
 void         g_option_group_set_parse_hooks        (GOptionGroup       *group,
@@ -136,9 +137,6 @@ void          g_option_group_set_translation_domain (GOptionGroup       *group,
                                                     const gchar        *domain);
 
 
-
-
-
 G_END_DECLS
 
 #endif /* __G_OPTION_H__ */