Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
_GOptionEntry Struct Reference

#include <goption.h>

Data Fields

const gcharlong_name
 
gchar short_name
 
gint flags
 
GOptionArg arg
 
gpointer arg_data
 
const gchardescription
 
const gchararg_description
 

Detailed Description

GOptionEntry: @long_name: The long name of an option can be used to specify it in a commandline as --long_name. Every option must have a long name. To resolve conflicts if multiple option groups contain the same long name, it is also possible to specify the option as --groupname-long_name. @short_name: If an option has a short name, it can be specified -short_name in a commandline. @short_name must be a printable ASCII character different from '-', or zero if the option has no short name. @flags: Flags from GOptionFlags

  • : The type of the option, as a GOptionArg @arg_data: If the
  • type is G_OPTION_ARG_CALLBACK, then @arg_data must point to a GOptionArgFunc callback function, which will be called to handle the extra argument. Otherwise, @arg_data is a pointer to a location to store the value, the required type of the location depends on the
  • type:
    • G_OPTION_ARG_NONE: gboolean
    • G_OPTION_ARG_STRING: gchar*
    • G_OPTION_ARG_INT: gint
    • G_OPTION_ARG_FILENAME: gchar*
    • G_OPTION_ARG_STRING_ARRAY: gchar**
    • G_OPTION_ARG_FILENAME_ARRAY: gchar**
    • G_OPTION_ARG_DOUBLE: gdouble If
  • type is G_OPTION_ARG_STRING or G_OPTION_ARG_FILENAME, the location will contain a newly allocated string if the option was given. That string needs to be freed by the callee using g_free(). Likewise if
  • type is G_OPTION_ARG_STRING_ARRAY or G_OPTION_ARG_FILENAME_ARRAY, the data should be freed using g_strfreev(). @description: the description for the option in --help output. The @description is translated using the @translate_func of the group, see g_option_group_set_translation_domain(). @arg_description: The placeholder to use for the extra argument parsed by the option in --help output. The @arg_description is translated using the @translate_func of the group, see g_option_group_set_translation_domain().

A GOptionEntry struct defines a single option. To have an effect, they must be added to a GOptionGroup with g_option_context_add_main_entries() or g_option_group_add_entries().

Definition at line 261 of file goption.h.

Field Documentation

◆ arg

GOptionArg _GOptionEntry::arg

Definition at line 267 of file goption.h.

◆ arg_data

gpointer _GOptionEntry::arg_data

Definition at line 268 of file goption.h.

◆ arg_description

const gchar* _GOptionEntry::arg_description

Definition at line 271 of file goption.h.

◆ description

const gchar* _GOptionEntry::description

Definition at line 270 of file goption.h.

◆ flags

gint _GOptionEntry::flags

Definition at line 265 of file goption.h.

◆ long_name

const gchar* _GOptionEntry::long_name

Definition at line 263 of file goption.h.

◆ short_name

gchar _GOptionEntry::short_name

Definition at line 264 of file goption.h.


The documentation for this struct was generated from the following file: