Tizen Native API  7.0
Ecore Getopt

This group contains powerful getopt replacement.

This replacement handles both short (-X) or long options (--ABC) options, with various actions supported, like storing one value and already converting to required type, counting number of occurrences, setting true or false values, show help, license, copyright and even support user-defined callbacks.

It is provided a set of C Pre Processor macros so definition is straightforward.

Values will be stored elsewhere indicated by an array of pointers to values, it is given in separate to parser description so you can use multiple values with the same parser.

Functions

void ecore_getopt_help (FILE *fp, const Ecore_Getopt *info)
Eina_Bool ecore_getopt_help_category (FILE *fp, const Ecore_Getopt *info, const char *category)
Eina_Bool ecore_getopt_parser_has_duplicates (const Ecore_Getopt *parser)
int ecore_getopt_parse (const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc, char **argv)
int ecore_getopt_parse_positional (const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc, char **argv, int start)
Eina_Listecore_getopt_list_free (Eina_List *list)
Eina_Bool ecore_getopt_callback_geometry_parse (const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage)
Eina_Bool ecore_getopt_callback_size_parse (const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage)

Defines

#define ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, type, arg_requirement, default_value)
 Definition for macro that helps to fill the Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE(shortname, longname, help, type)
 Definition for macro that fills an option in Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE_STR(shortname, longname, help)   ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_STR)
 Definition for macro that fill Ecore_Getopt_Desc table with an option of type string.
#define ECORE_GETOPT_STORE_BOOL(shortname, longname, help)   ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_BOOL)
 Definition for macro that fill Ecore_Getopt_Desc table with an option of type boolean.
#define ECORE_GETOPT_STORE_SHORT(shortname, longname, help)   ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_SHORT)
 Definition for macro that fill Ecore_Getopt_Desc table with an option of type short.
#define ECORE_GETOPT_STORE_INT(shortname, longname, help)   ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_INT)
 Definition for macro that fill Ecore_Getopt_Desc table with an option of type int.
#define ECORE_GETOPT_STORE_LONG(shortname, longname, help)   ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_LONG)
 Definition for macro that fill Ecore_Getopt_Desc table with an option of type long.
#define ECORE_GETOPT_STORE_USHORT(shortname, longname, help)   ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_USHORT)
 Definition for macro that fill Ecore_Getopt_Desc table with an option of type ushort.
#define ECORE_GETOPT_STORE_UINT(shortname, longname, help)   ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_UINT)
 Definition for macro that fill Ecore_Getopt_Desc table with an option of type uint.
#define ECORE_GETOPT_STORE_ULONG(shortname, longname, help)   ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_ULONG)
 Definition for macro that fill Ecore_Getopt_Desc table with an option of type ulong.
#define ECORE_GETOPT_STORE_DOUBLE(shortname, longname, help)   ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_DOUBLE)
 Definition for macro that fill Ecore_Getopt_Desc table with an option of type double.
#define ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, type)
#define ECORE_GETOPT_STORE_METAVAR_STR(shortname, longname, help, metavar)   ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_STR)
 Definition for filling Ecore_Getopt_Desc table with an option of type string and metavar.
#define ECORE_GETOPT_STORE_METAVAR_BOOL(shortname, longname, help, metavar)   ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_BOOL)
 Definition for filling Ecore_Getopt_Desc table with an option of type boolean and metavar.
#define ECORE_GETOPT_STORE_METAVAR_SHORT(shortname, longname, help, metavar)   ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_SHORT)
 Definition for filling Ecore_Getopt_Desc table with an option of type short and metavar.
#define ECORE_GETOPT_STORE_METAVAR_INT(shortname, longname, help, metavar)   ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_INT)
 Definition for filling Ecore_Getopt_Desc table with an option of type int and metavar.
#define ECORE_GETOPT_STORE_METAVAR_LONG(shortname, longname, help, metavar)   ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_LONG)
 Definition for filling Ecore_Getopt_Desc table with an option of type long and metavar.
#define ECORE_GETOPT_STORE_METAVAR_USHORT(shortname, longname, help, metavar)   ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_USHORT)
 Definition for filling Ecore_Getopt_Desc table with an option of type unsigned short and metavar.
#define ECORE_GETOPT_STORE_METAVAR_UINT(shortname, longname, help, metavar)   ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_UINT)
 Definition for filling Ecore_Getopt_Desc table with an option of type unsigned int and metavar.
#define ECORE_GETOPT_STORE_METAVAR_ULONG(shortname, longname, help, metavar)   ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_ULONG)
 Definition for filling Ecore_Getopt_Desc table with an option of type unsigned long and metavar.
#define ECORE_GETOPT_STORE_METAVAR_DOUBLE(shortname, longname, help, metavar)   ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_DOUBLE)
 Definition for filling Ecore_Getopt_Desc table with an option of type double and metavar.
#define ECORE_GETOPT_STORE_DEF(shortname, longname, help, type, default_value)
#define ECORE_GETOPT_STORE_DEF_STR(shortname, longname, help, default_value)
 Definition for filling Ecore_Getopt_Desc table with an option of type string and default value.
#define ECORE_GETOPT_STORE_DEF_BOOL(shortname, longname, help, default_value)
 Definition for filling Ecore_Getopt_Desc table with an option of type boolean and default value.
#define ECORE_GETOPT_STORE_DEF_SHORT(shortname, longname, help, default_value)
 Definition for filling Ecore_Getopt_Desc table with an option of type short and default value.
#define ECORE_GETOPT_STORE_DEF_INT(shortname, longname, help, default_value)
 Definition for filling Ecore_Getopt_Desc table with an option of type int and default value.
#define ECORE_GETOPT_STORE_DEF_LONG(shortname, longname, help, default_value)
 Definition for filling Ecore_Getopt_Desc table with an option of type long and default value.
#define ECORE_GETOPT_STORE_DEF_USHORT(shortname, longname, help, default_value)
 Definition for filling Ecore_Getopt_Desc table with an option of type unsigned short and default value.
#define ECORE_GETOPT_STORE_DEF_UINT(shortname, longname, help, default_value)
 Definition for filling Ecore_Getopt_Desc table with an option of type unsigned int and default value.
#define ECORE_GETOPT_STORE_DEF_ULONG(shortname, longname, help, default_value)
 Definition for filling Ecore_Getopt_Desc table with an option of type unsigned long and default value.
#define ECORE_GETOPT_STORE_DEF_DOUBLE(shortname, longname, help, default_value)
 Definition for filling Ecore_Getopt_Desc table with an option of type double and default value.
#define ECORE_GETOPT_STORE_FULL_STR(shortname, longname, help, metavar, arg_requirement, default_value)
 Definition for filling full string type option description in Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE_FULL_BOOL(shortname, longname, help, metavar, arg_requirement, default_value)
 Definition for filling full boolean type option description in Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE_FULL_SHORT(shortname, longname, help, metavar, arg_requirement, default_value)
 Definition for filling full short type option description in Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE_FULL_INT(shortname, longname, help, metavar, arg_requirement, default_value)
 Definition for filling full int type option description in Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE_FULL_LONG(shortname, longname, help, metavar, arg_requirement, default_value)
 Definition for filling full long type option description in Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE_FULL_USHORT(shortname, longname, help, metavar, arg_requirement, default_value)
 Definition for filling full unsigned short type option description in Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE_FULL_UINT(shortname, longname, help, metavar, arg_requirement, default_value)
 Definition for filling full unsigned int type option description in Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE_FULL_ULONG(shortname, longname, help, metavar, arg_requirement, default_value)
 Definition for filling full unsigned long type option description in Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE_FULL_DOUBLE(shortname, longname, help, metavar, arg_requirement, default_value)
 Definition for filling full double type option description in Ecore_Getopt_Desc table.
#define ECORE_GETOPT_STORE_CONST(shortname, longname, help, value)
 Definition for filling Ecore_Getopt_Desc table with a constant value.
#define ECORE_GETOPT_STORE_TRUE(shortname, longname, help)
 Definition for filling Ecore_Getopt_Desc table with a true boolean value.
#define ECORE_GETOPT_STORE_FALSE(shortname, longname, help)
 Definition for filling Ecore_Getopt_Desc table with a false boolean value.
#define ECORE_GETOPT_CHOICE(shortname, longname, help, choices_array)
 Definition for filling Ecore_Getopt_Desc table with a true boolean value.
#define ECORE_GETOPT_CHOICE_METAVAR(shortname, longname, help, metavar, choices_array)
 Definition for filling Ecore_Getopt_Desc table with a choice.
#define ECORE_GETOPT_APPEND(shortname, longname, help, sub_type)
 Definition for filling Ecore_Getopt_Desc table with an append action.
#define ECORE_GETOPT_APPEND_METAVAR(shortname, longname, help, metavar, type)
 Definition for filling Ecore_Getopt_Desc table with an append action and a metavar.
#define ECORE_GETOPT_COUNT(shortname, longname, help)
 Definition for filling Ecore_Getopt_Desc table with an count action.
#define ECORE_GETOPT_CALLBACK_FULL(shortname, longname, help, metavar, callback_func, callback_data, argument_requirement, default_value)
 Definition for filling Ecore_Getopt_Desc table with an callback action and argument requirements.
#define ECORE_GETOPT_CALLBACK_NOARGS(shortname, longname, help, callback_func, callback_data)
 Definition for filling Ecore_Getopt_Desc table with an callback action and no arguments.
#define ECORE_GETOPT_CALLBACK_ARGS(shortname, longname, help, metavar, callback_func, callback_data)
 Definition for filling Ecore_Getopt_Desc table with an callback action.
#define ECORE_GETOPT_HELP(shortname, longname)
 Definition for filling Ecore_Getopt_Desc table with a help action.
#define ECORE_GETOPT_VERSION(shortname, longname)
 Definition for filling Ecore_Getopt_Desc table with a version action.
#define ECORE_GETOPT_COPYRIGHT(shortname, longname)
 Definition for filling Ecore_Getopt_Desc table with a copyright action.
#define ECORE_GETOPT_LICENSE(shortname, longname)
 Definition for filling Ecore_Getopt_Desc table with a license action.
#define ECORE_GETOPT_BREAK(shortname, longname)
 Definition for filling Ecore_Getopt_Desc table with a break action.
#define ECORE_GETOPT_BREAK_STR(shortname, longname, help)
 Definition for filling Ecore_Getopt_Desc table with a break action with help message.
#define ECORE_GETOPT_SENTINEL   {0, NULL, NULL, NULL, 0, {.dummy = NULL}}
 Definition for filling Ecore_Getopt_Desc table with a sentinel to indicate the end of descriptions.
#define ECORE_GETOPT_VALUE_STR(val)   {.strp = &(val)}
 Definition for options that store a single value in a variable of type string.
#define ECORE_GETOPT_VALUE_BOOL(val)   {.boolp = &(val)}
 Definition for options that store a single value in a variable of type boolean.
#define ECORE_GETOPT_VALUE_SHORT(val)   {.shortp = &(val)}
 Definition for options that store a single value in a variable of type short.
#define ECORE_GETOPT_VALUE_INT(val)   {.intp = &(val)}
 Definition for options that store a single value in a variable of type int.
#define ECORE_GETOPT_VALUE_LONG(val)   {.longp = &(val)}
 Definition for options that store a single value in a variable of type long.
#define ECORE_GETOPT_VALUE_USHORT(val)   {.ushortp = &(val)}
 Definition for options that store a single value in a variable of type unsigned short.
#define ECORE_GETOPT_VALUE_UINT(val)   {.uintp = &(val)}
 Definition for options that store a single value in a variable of type unsigned int.
#define ECORE_GETOPT_VALUE_ULONG(val)   {.ulongp = &(val)}
 Definition for options that store a single value in a variable of type unsigned long.
#define ECORE_GETOPT_VALUE_DOUBLE(val)   {.doublep = &(val)}
 Definition for options that store a single value in a variable of type double.
#define ECORE_GETOPT_VALUE_PTR(val)   {.ptrp = &(val)}
 Definition for options that store a single value in a variable of type pointer.
#define ECORE_GETOPT_VALUE_PTR_CAST(val)   {.ptrp = (void **)&(val)}
 Definition for options that store a single value in a variable of type pointer casted.
#define ECORE_GETOPT_VALUE_LIST(val)   {.listp = &(val)}
 Definition for options that store a single value in a variable of type list.
#define ECORE_GETOPT_VALUE_NONE   {.ptrp = NULL}
 Definition for options that store a NULL value.

Define Documentation

#define ECORE_GETOPT_APPEND (   shortname,
  longname,
  help,
  sub_type 
)
Value:
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_APPEND,  \
   {.append_type = sub_type}}

Definition for filling Ecore_Getopt_Desc table with an append action.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
sub_typeThe type of the new value to store.
#define ECORE_GETOPT_APPEND_METAVAR (   shortname,
  longname,
  help,
  metavar,
  type 
)
Value:
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_APPEND,            \
   {.append_type = type}}

Definition for filling Ecore_Getopt_Desc table with an append action and a metavar.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
typeThe type of the new value to store.
Examples:
ecore_thread_example.c.
#define ECORE_GETOPT_BREAK (   shortname,
  longname 
)
Value:
{shortname, longname, "stop parsing options.", NULL,    \
   ECORE_GETOPT_ACTION_BREAK,                   \
   {.dummy = NULL}}

Definition for filling Ecore_Getopt_Desc table with a break action.

Parameters:
shortnameThe option short name.
longnameThe option long name.
#define ECORE_GETOPT_BREAK_STR (   shortname,
  longname,
  help 
)
Value:
{shortname, longname, help, NULL,    \
   ECORE_GETOPT_ACTION_BREAK,                   \
   {.dummy = NULL}}

Definition for filling Ecore_Getopt_Desc table with a break action with help message.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_CALLBACK_ARGS (   shortname,
  longname,
  help,
  metavar,
  callback_func,
  callback_data 
)
Value:
ECORE_GETOPT_CALLBACK_FULL(shortname, longname, help, metavar,                                     \
                             callback_func, callback_data,                                           \
                             ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES,                                  \
                             NULL)

Definition for filling Ecore_Getopt_Desc table with an callback action.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
callback_funcThe callback function to call.
callback_dataThe data to pass to the callback.
#define ECORE_GETOPT_CALLBACK_FULL (   shortname,
  longname,
  help,
  metavar,
  callback_func,
  callback_data,
  argument_requirement,
  default_value 
)
Value:
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_CALLBACK,                                                                      \
   {.callback = {callback_func, callback_data,                                                                                            \
                 argument_requirement, default_value}}}

Definition for filling Ecore_Getopt_Desc table with an callback action and argument requirements.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
callback_funcThe callback function to call.
callback_dataThe data to pass to the callback.
argument_requirementThe required arguments to this option.
default_valueThe default values for these arguments.
#define ECORE_GETOPT_CALLBACK_NOARGS (   shortname,
  longname,
  help,
  callback_func,
  callback_data 
)
Value:
ECORE_GETOPT_CALLBACK_FULL(shortname, longname, help, NULL,                                 \
                             callback_func, callback_data,                                    \
                             ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO,                            \
                             NULL)

Definition for filling Ecore_Getopt_Desc table with an callback action and no arguments.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
callback_funcThe callback function to call.
callback_dataThe data to pass to the callback.
#define ECORE_GETOPT_CHOICE (   shortname,
  longname,
  help,
  choices_array 
)
Value:
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_CHOICE,       \
   {.choices = choices_array}}

Definition for filling Ecore_Getopt_Desc table with a true boolean value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
choices_arrayAn string array of different choices.
#define ECORE_GETOPT_CHOICE_METAVAR (   shortname,
  longname,
  help,
  metavar,
  choices_array 
)
Value:
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_CHOICE,                     \
   {.choices = choices_array}}

Definition for filling Ecore_Getopt_Desc table with a choice.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
choices_arrayAn string array of different choices.
#define ECORE_GETOPT_COPYRIGHT (   shortname,
  longname 
)
Value:
{shortname, longname, "show copyright.", NULL,    \
   ECORE_GETOPT_ACTION_COPYRIGHT,                   \
   {.dummy = NULL}}

Definition for filling Ecore_Getopt_Desc table with a copyright action.

Parameters:
shortnameThe copyright option short name.
longnameThe copyright option long name.
#define ECORE_GETOPT_COUNT (   shortname,
  longname,
  help 
)
Value:
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_COUNT, \
   {.dummy = NULL}}

Definition for filling Ecore_Getopt_Desc table with an count action.

This will store the number of time the option has been passed to the command line.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_HELP (   shortname,
  longname 
)
Value:
{shortname, longname, "show this message.", "CATEGORY", \
   ECORE_GETOPT_ACTION_HELP,                              \
   {.dummy = NULL}}

Definition for filling Ecore_Getopt_Desc table with a help action.

Parameters:
shortnameThe help option short name.
longnameThe help option long name.
Examples:
ecore_thread_example.c.
#define ECORE_GETOPT_LICENSE (   shortname,
  longname 
)
Value:
{shortname, longname, "show license.", NULL,    \
   ECORE_GETOPT_ACTION_LICENSE,                   \
   {.dummy = NULL}}

Definition for filling Ecore_Getopt_Desc table with a license action.

Parameters:
shortnameThe license option short name.
longnameThe license option long name.
#define ECORE_GETOPT_STORE (   shortname,
  longname,
  help,
  type 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, NULL, type, \
                          ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES, {})

Definition for macro that fills an option in Ecore_Getopt_Desc table.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
typeThe option value type.
#define ECORE_GETOPT_STORE_BOOL (   shortname,
  longname,
  help 
)    ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_BOOL)

Definition for macro that fill Ecore_Getopt_Desc table with an option of type boolean.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_STORE_CONST (   shortname,
  longname,
  help,
  value 
)
Value:
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_CONST, \
   {.store_const = value}}

Definition for filling Ecore_Getopt_Desc table with a constant value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
valueThe constant value to store.
#define ECORE_GETOPT_STORE_DEF (   shortname,
  longname,
  help,
  type,
  default_value 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, NULL, type,               \
                          ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL,          \
                          default_value)

Definition for macro that helps to fill the Ecore_Getopt_Desc table with a default value.

#define ECORE_GETOPT_STORE_DEF_BOOL (   shortname,
  longname,
  help,
  default_value 
)
Value:
ECORE_GETOPT_STORE_DEF(shortname, longname, help,                           \
                         ECORE_GETOPT_TYPE_BOOL,                              \
                         {.boolv = default_value})

Definition for filling Ecore_Getopt_Desc table with an option of type boolean and default value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_DEF_DOUBLE (   shortname,
  longname,
  help,
  default_value 
)
Value:
ECORE_GETOPT_STORE_DEF(shortname, longname, help,                             \
                         ECORE_GETOPT_TYPE_DOUBLE,                              \
                         {.doublev = default_value})

Definition for filling Ecore_Getopt_Desc table with an option of type double and default value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_DEF_INT (   shortname,
  longname,
  help,
  default_value 
)
Value:
ECORE_GETOPT_STORE_DEF(shortname, longname, help,                          \
                         ECORE_GETOPT_TYPE_INT,                              \
                         {.intv = default_value})

Definition for filling Ecore_Getopt_Desc table with an option of type int and default value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_DEF_LONG (   shortname,
  longname,
  help,
  default_value 
)
Value:
ECORE_GETOPT_STORE_DEF(shortname, longname, help,                           \
                         ECORE_GETOPT_TYPE_LONG,                              \
                         {.longv = default_value})

Definition for filling Ecore_Getopt_Desc table with an option of type long and default value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_DEF_SHORT (   shortname,
  longname,
  help,
  default_value 
)
Value:
ECORE_GETOPT_STORE_DEF(shortname, longname, help,                            \
                         ECORE_GETOPT_TYPE_SHORT,                              \
                         {.shortv = default_value})

Definition for filling Ecore_Getopt_Desc table with an option of type short and default value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_DEF_STR (   shortname,
  longname,
  help,
  default_value 
)
Value:
ECORE_GETOPT_STORE_DEF(shortname, longname, help,                          \
                         ECORE_GETOPT_TYPE_STR,                              \
                         {.strv = default_value})

Definition for filling Ecore_Getopt_Desc table with an option of type string and default value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_DEF_UINT (   shortname,
  longname,
  help,
  default_value 
)
Value:
ECORE_GETOPT_STORE_DEF(shortname, longname, help,                           \
                         ECORE_GETOPT_TYPE_UINT,                              \
                         {.uintv = default_value})

Definition for filling Ecore_Getopt_Desc table with an option of type unsigned int and default value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_DEF_ULONG (   shortname,
  longname,
  help,
  default_value 
)
Value:
ECORE_GETOPT_STORE_DEF(shortname, longname, help,                            \
                         ECORE_GETOPT_TYPE_ULONG,                              \
                         {.ulongv = default_value})

Definition for filling Ecore_Getopt_Desc table with an option of type unsigned long and default value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_DEF_USHORT (   shortname,
  longname,
  help,
  default_value 
)
Value:
ECORE_GETOPT_STORE_DEF(shortname, longname, help,                             \
                         ECORE_GETOPT_TYPE_USHORT,                              \
                         {.ushortv = default_value})

Definition for filling Ecore_Getopt_Desc table with an option of type unsigned short and default value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_DOUBLE (   shortname,
  longname,
  help 
)    ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_DOUBLE)

Definition for macro that fill Ecore_Getopt_Desc table with an option of type double.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_STORE_FALSE (   shortname,
  longname,
  help 
)
Value:
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_FALSE, \
   {.dummy = NULL}}

Definition for filling Ecore_Getopt_Desc table with a false boolean value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_STORE_FULL_BOOL (   shortname,
  longname,
  help,
  metavar,
  arg_requirement,
  default_value 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar,                                            \
                          ECORE_GETOPT_TYPE_BOOL,                                                        \
                          arg_requirement,                                                               \
                          {.boolv = default_value})

Definition for filling full boolean type option description in Ecore_Getopt_Desc table.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
arg_requirementThe option argument requirements.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_FULL_DOUBLE (   shortname,
  longname,
  help,
  metavar,
  arg_requirement,
  default_value 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar,                                              \
                          ECORE_GETOPT_TYPE_DOUBLE,                                                        \
                          arg_requirement,                                                                 \
                          {.doublev = default_value})

Definition for filling full double type option description in Ecore_Getopt_Desc table.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
arg_requirementThe option argument requirements.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_FULL_INT (   shortname,
  longname,
  help,
  metavar,
  arg_requirement,
  default_value 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar,                                           \
                          ECORE_GETOPT_TYPE_INT,                                                        \
                          arg_requirement,                                                              \
                          {.intv = default_value})

Definition for filling full int type option description in Ecore_Getopt_Desc table.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
arg_requirementThe option argument requirements.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_FULL_LONG (   shortname,
  longname,
  help,
  metavar,
  arg_requirement,
  default_value 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar,                                            \
                          ECORE_GETOPT_TYPE_LONG,                                                        \
                          arg_requirement,                                                               \
                          {.longv = default_value})

Definition for filling full long type option description in Ecore_Getopt_Desc table.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
arg_requirementThe option argument requirements.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_FULL_SHORT (   shortname,
  longname,
  help,
  metavar,
  arg_requirement,
  default_value 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar,                                             \
                          ECORE_GETOPT_TYPE_SHORT,                                                        \
                          arg_requirement,                                                                \
                          {.shortv = default_value})

Definition for filling full short type option description in Ecore_Getopt_Desc table.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
arg_requirementThe option argument requirements.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_FULL_STR (   shortname,
  longname,
  help,
  metavar,
  arg_requirement,
  default_value 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar,                                           \
                          ECORE_GETOPT_TYPE_STR,                                                        \
                          arg_requirement,                                                              \
                          {.strv = default_value})

Definition for filling full string type option description in Ecore_Getopt_Desc table.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
arg_requirementThe option argument requirements.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_FULL_UINT (   shortname,
  longname,
  help,
  metavar,
  arg_requirement,
  default_value 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar,                                            \
                          ECORE_GETOPT_TYPE_UINT,                                                        \
                          arg_requirement,                                                               \
                          {.uintv = default_value})

Definition for filling full unsigned int type option description in Ecore_Getopt_Desc table.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
arg_requirementThe option argument requirements.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_FULL_ULONG (   shortname,
  longname,
  help,
  metavar,
  arg_requirement,
  default_value 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar,                                             \
                          ECORE_GETOPT_TYPE_ULONG,                                                        \
                          arg_requirement,                                                                \
                          {.ulongv = default_value})

Definition for filling full unsigned long type option description in Ecore_Getopt_Desc table.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
arg_requirementThe option argument requirements.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_FULL_USHORT (   shortname,
  longname,
  help,
  metavar,
  arg_requirement,
  default_value 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar,                                              \
                          ECORE_GETOPT_TYPE_USHORT,                                                        \
                          arg_requirement,                                                                 \
                          {.ushortv = default_value})

Definition for filling full unsigned short type option description in Ecore_Getopt_Desc table.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
arg_requirementThe option argument requirements.
default_valueThe default value for the parameter of the option.
#define ECORE_GETOPT_STORE_INT (   shortname,
  longname,
  help 
)    ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_INT)

Definition for macro that fill Ecore_Getopt_Desc table with an option of type int.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
Examples:
ecore_thread_example.c.
#define ECORE_GETOPT_STORE_LONG (   shortname,
  longname,
  help 
)    ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_LONG)

Definition for macro that fill Ecore_Getopt_Desc table with an option of type long.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_STORE_METAVAR (   shortname,
  longname,
  help,
  metavar,
  type 
)
Value:
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, type,          \
                          ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES, {})

Definition for macro that helps to fill the Ecore_Getopt_Desc table with a metavar after the description of the option.

#define ECORE_GETOPT_STORE_METAVAR_BOOL (   shortname,
  longname,
  help,
  metavar 
)    ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_BOOL)

Definition for filling Ecore_Getopt_Desc table with an option of type boolean and metavar.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
#define ECORE_GETOPT_STORE_METAVAR_DOUBLE (   shortname,
  longname,
  help,
  metavar 
)    ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_DOUBLE)

Definition for filling Ecore_Getopt_Desc table with an option of type double and metavar.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
#define ECORE_GETOPT_STORE_METAVAR_INT (   shortname,
  longname,
  help,
  metavar 
)    ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_INT)

Definition for filling Ecore_Getopt_Desc table with an option of type int and metavar.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
#define ECORE_GETOPT_STORE_METAVAR_LONG (   shortname,
  longname,
  help,
  metavar 
)    ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_LONG)

Definition for filling Ecore_Getopt_Desc table with an option of type long and metavar.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
#define ECORE_GETOPT_STORE_METAVAR_SHORT (   shortname,
  longname,
  help,
  metavar 
)    ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_SHORT)

Definition for filling Ecore_Getopt_Desc table with an option of type short and metavar.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
#define ECORE_GETOPT_STORE_METAVAR_STR (   shortname,
  longname,
  help,
  metavar 
)    ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_STR)

Definition for filling Ecore_Getopt_Desc table with an option of type string and metavar.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
#define ECORE_GETOPT_STORE_METAVAR_UINT (   shortname,
  longname,
  help,
  metavar 
)    ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_UINT)

Definition for filling Ecore_Getopt_Desc table with an option of type unsigned int and metavar.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
#define ECORE_GETOPT_STORE_METAVAR_ULONG (   shortname,
  longname,
  help,
  metavar 
)    ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_ULONG)

Definition for filling Ecore_Getopt_Desc table with an option of type unsigned long and metavar.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
#define ECORE_GETOPT_STORE_METAVAR_USHORT (   shortname,
  longname,
  help,
  metavar 
)    ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_USHORT)

Definition for filling Ecore_Getopt_Desc table with an option of type unsigned short and metavar.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
metavarThe metavar message concerning the parameter of the option.
#define ECORE_GETOPT_STORE_SHORT (   shortname,
  longname,
  help 
)    ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_SHORT)

Definition for macro that fill Ecore_Getopt_Desc table with an option of type short.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_STORE_STR (   shortname,
  longname,
  help 
)    ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_STR)

Definition for macro that fill Ecore_Getopt_Desc table with an option of type string.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_STORE_TRUE (   shortname,
  longname,
  help 
)
Value:
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_TRUE, \
   {.dummy = NULL}}

Definition for filling Ecore_Getopt_Desc table with a true boolean value.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_STORE_UINT (   shortname,
  longname,
  help 
)    ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_UINT)

Definition for macro that fill Ecore_Getopt_Desc table with an option of type uint.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_STORE_ULONG (   shortname,
  longname,
  help 
)    ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_ULONG)

Definition for macro that fill Ecore_Getopt_Desc table with an option of type ulong.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_STORE_USHORT (   shortname,
  longname,
  help 
)    ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_USHORT)

Definition for macro that fill Ecore_Getopt_Desc table with an option of type ushort.

Parameters:
shortnameThe option short name.
longnameThe option long name.
helpThe help message concerning this option.
#define ECORE_GETOPT_VALUE_BOOL (   val)    {.boolp = &(val)}

Definition for options that store a single value in a variable of type boolean.

Parameters:
valThe value to store.
Examples:
ecore_thread_example.c.
#define ECORE_GETOPT_VALUE_DOUBLE (   val)    {.doublep = &(val)}

Definition for options that store a single value in a variable of type double.

Parameters:
valThe value to store.
#define ECORE_GETOPT_VALUE_INT (   val)    {.intp = &(val)}

Definition for options that store a single value in a variable of type int.

Parameters:
valThe value to store.
Examples:
ecore_thread_example.c.
#define ECORE_GETOPT_VALUE_LIST (   val)    {.listp = &(val)}

Definition for options that store a single value in a variable of type list.

Parameters:
valThe value to store.
Examples:
ecore_thread_example.c.
#define ECORE_GETOPT_VALUE_LONG (   val)    {.longp = &(val)}

Definition for options that store a single value in a variable of type long.

Parameters:
valThe value to store.
#define ECORE_GETOPT_VALUE_NONE   {.ptrp = NULL}

Definition for options that store a NULL value.

Parameters:
valThe value to store.
Examples:
ecore_thread_example.c.
#define ECORE_GETOPT_VALUE_PTR (   val)    {.ptrp = &(val)}

Definition for options that store a single value in a variable of type pointer.

Parameters:
valThe value to store.
#define ECORE_GETOPT_VALUE_PTR_CAST (   val)    {.ptrp = (void **)&(val)}

Definition for options that store a single value in a variable of type pointer casted.

Parameters:
valThe value to store.
#define ECORE_GETOPT_VALUE_SHORT (   val)    {.shortp = &(val)}

Definition for options that store a single value in a variable of type short.

Parameters:
valThe value to store.
#define ECORE_GETOPT_VALUE_STR (   val)    {.strp = &(val)}

Definition for options that store a single value in a variable of type string.

Parameters:
valThe value to store.
#define ECORE_GETOPT_VALUE_UINT (   val)    {.uintp = &(val)}

Definition for options that store a single value in a variable of type unsigned int.

Parameters:
valThe value to store.
#define ECORE_GETOPT_VALUE_ULONG (   val)    {.ulongp = &(val)}

Definition for options that store a single value in a variable of type unsigned long.

Parameters:
valThe value to store.
#define ECORE_GETOPT_VALUE_USHORT (   val)    {.ushortp = &(val)}

Definition for options that store a single value in a variable of type unsigned short.

Parameters:
valThe value to store.
#define ECORE_GETOPT_VERSION (   shortname,
  longname 
)
Value:
{shortname, longname, "show program version.", NULL, \
   ECORE_GETOPT_ACTION_VERSION,                        \
   {.dummy = NULL}}

Definition for filling Ecore_Getopt_Desc table with a version action.

Parameters:
shortnameThe version option short name.
longnameThe version option long name.

Enumeration Type Documentation

Enumeration for defining the actions to do when parsing command line parameters.

Enumerator:
ECORE_GETOPT_ACTION_STORE 

Store a value

ECORE_GETOPT_ACTION_STORE_CONST 

Store a const

ECORE_GETOPT_ACTION_STORE_TRUE 

Store TRUE

ECORE_GETOPT_ACTION_STORE_FALSE 

Store FALSE

ECORE_GETOPT_ACTION_CHOICE 

Store a choice between several values

ECORE_GETOPT_ACTION_APPEND 

Allocate and store a new value of type Ecore_Getopt_Type

ECORE_GETOPT_ACTION_COUNT 

Store a count number

ECORE_GETOPT_ACTION_CALLBACK 

Call a callback

ECORE_GETOPT_ACTION_HELP 

Show help text

ECORE_GETOPT_ACTION_VERSION 

Show version

ECORE_GETOPT_ACTION_COPYRIGHT 

Show copyright

ECORE_GETOPT_ACTION_LICENSE 

Show license

ECORE_GETOPT_ACTION_BREAK 

Stop parsing options

Enumeration for defining if the command line options require an argument.

Enumerator:
ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO 

Argument is not required

ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES 

Argument is required

ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL 

Argument is optional

Enumeration for defining the type of the values to store when using append action.

Enumerator:
ECORE_GETOPT_TYPE_STR 

Value of type string

ECORE_GETOPT_TYPE_BOOL 

Value of type boolean

ECORE_GETOPT_TYPE_SHORT 

Value of type short

ECORE_GETOPT_TYPE_INT 

Value of type int

ECORE_GETOPT_TYPE_LONG 

Value of type long

ECORE_GETOPT_TYPE_USHORT 

Value of type unsigned short

ECORE_GETOPT_TYPE_UINT 

Value of type unsigned int

ECORE_GETOPT_TYPE_ULONG 

Value of type unsigned long

ECORE_GETOPT_TYPE_DOUBLE 

Value of type double


Function Documentation

Eina_Bool ecore_getopt_callback_geometry_parse ( const Ecore_Getopt parser,
const Ecore_Getopt_Desc desc,
const char *  str,
void *  data,
Ecore_Getopt_Value storage 
)

Helper ecore_getopt callback to parse geometry (x:y:w:h).

Parameters:
parserThis parameter isn't in use.
descThis parameter isn't in use.
strGeometry value
dataThis parameter isn't in use.
storageMust be a pointer to Eina_Rectangle and will be used to store the four values passed in the given string.
Returns:
EINA_TRUE on success, EINA_FALSE on incorrect geometry value.

This is a helper function to be used with ECORE_GETOPT_CALLBACK_*().

callback_data value is ignored, you can safely use NULL.

Since :
3.0
Eina_Bool ecore_getopt_callback_size_parse ( const Ecore_Getopt parser,
const Ecore_Getopt_Desc desc,
const char *  str,
void *  data,
Ecore_Getopt_Value storage 
)

Helper ecore_getopt callback to parse geometry size (WxH).

Parameters:
parserThis parameter isn't in use.
descThis parameter isn't in use.
strsize value
dataThis parameter isn't in use.
storageMust be a pointer to Eina_Rectangle and will be used to store the two values passed in the given string and 0 in the x and y fields.
Returns:
EINA_TRUE on success, EINA_FALSE on incorrect size value.

callback_data value is ignored, you can safely use NULL.

Since :
3.0
void ecore_getopt_help ( FILE *  fp,
const Ecore_Getopt info 
)

Shows nicely formatted help message for the given parser.

Parameters:
fpThe file the message will be printed on.
infoThe structure containing information about command line options.
See also:
ecore_getopt_help_category()
Since :
3.0
Eina_Bool ecore_getopt_help_category ( FILE *  fp,
const Ecore_Getopt info,
const char *  category 
)

Shows help for a single category (along with program usage and description).

Parameters:
fpThe file the message will be printed on.
infoThe structure containing information about command line options.
categoryThe category to print.
Returns:
EINA_TRUE when the category exists, EINA_FALSE otherwise.
See also:
ecore_getopt_help()
Since :
3.0

Utilities to free list and nodes allocated by ECORE_GETOPT_ACTION_APPEND.

Parameters:
listPointer to list to be freed.
Returns:
always NULL, so you can easily make your list head NULL.
Since :
3.0
int ecore_getopt_parse ( const Ecore_Getopt parser,
Ecore_Getopt_Value values,
int  argc,
char **  argv 
)

Parses command line parameters.

Walks the command line parameters and parse them based on parser description, doing actions based on parser->descs->action, like showing help text, license, copyright, storing values in values and so on.

It is expected that values is of the same size than parser->descs, options that do not need a value it will be left untouched.

All values are expected to be initialized before use. Options with action ECORE_GETOPT_ACTION_STORE and non required arguments (others than ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES), are expected to provide a value in def to be used.

The following actions will store 1 on value as a boolean (value->boolp) if it's not NULL to indicate these actions were executed:

  • ECORE_GETOPT_ACTION_HELP
  • ECORE_GETOPT_ACTION_VERSION
  • ECORE_GETOPT_ACTION_COPYRIGHT
  • ECORE_GETOPT_ACTION_LICENSE

Just ECORE_GETOPT_ACTION_APPEND will allocate memory and thus need to be freed. For consistency between all of appended subtypes, eina_list->data will contain an allocated memory with the value, that is, for ECORE_GETOPT_TYPE_STR it will contain a copy of the argument, ECORE_GETOPT_TYPE_INT a pointer to an allocated integer and so on.

If parser is in strict mode (see Ecore_Getopt->strict), then any error will abort parsing and -1 is returned. Otherwise it will try to continue as far as possible.

This function may reorder argv elements.

Translation of help strings (description), metavar, usage, license and copyright may be translated, standard/global gettext() call will be applied on them if ecore was compiled with such support.

This function will not parse positional arguments! If these are declared (metavar is defined with both shortname and longname being empty), then you must call ecore_getopt_parse_positional() with the last argument (start) being the result of this function. This is done so you can have "quit options", those that once called you want to exit without doing further parsing, as is the case with help, license, copyright, version and eventually others you may define.

Parameters:
parserDescription of how to work.
valuesWhere to store values, it is assumed that this is a vector of the same size as parser->descs. Values should be previously initialized.
argcHow many elements in argv. If not provided it will be retrieved with ecore_app_args_get().
argvCommand line parameters.
Returns:
Index of first non-option parameter or -1 on error.
See also:
ecore_getopt_parse_positional()
Since :
3.0
Examples:
ecore_thread_example.c.
int ecore_getopt_parse_positional ( const Ecore_Getopt parser,
Ecore_Getopt_Value values,
int  argc,
char **  argv,
int  start 
)

Parses command line positional parameters.

Walks the command line positional parameters (those that do not start with "-" or "--") and parse them based on parser description, doing actions based on parser->descs->action, like storing values of some type.

It is expected that values is of the same size than parser->descs, same as with ecore_getopt_parse().

All values are expected to be initialized before use.

Unlike the ecore_getopt_parse(), only the following options are supported:

  • ECORE_GETOPT_ACTION_STORE
  • ECORE_GETOPT_ACTION_CHOICE
  • ECORE_GETOPT_ACTION_APPEND
  • ECORE_GETOPT_ACTION_CALLBACK

There is a special case for ECORE_GETOPT_ACTION_APPEND as it will consume all remaining elements. It is also special in the sense that it will allocate memory and thus need to be freed. For consistency between all of appended subtypes, eina_list->data will contain an allocated memory with the value, that is, for ECORE_GETOPT_TYPE_STR it will contain a copy of the argument, ECORE_GETOPT_TYPE_INT a pointer to an allocated integer and so on.

If parser is in strict mode (see Ecore_Getopt->strict), then any error will abort parsing and -1 is returned. Otherwise it will try to continue as far as possible.

Translation of help strings (description) and metavar may be done, standard/global gettext() call will be applied on them if ecore was compiled with such support.

Parameters:
parserDescription of how to work.
valuesWhere to store values, it is assumed that this is a vector of the same size as parser->descs. Values should be previously initialized.
argcHow many elements in argv. If not provided it will be retrieved with ecore_app_args_get().
argvCommand line parameters.
startThe initial position argument to look at, usually the return of ecore_getopt_parse(). If less than 1, will try to find it automatically.
Returns:
Index of first non-option parameter or -1 on error. If the last positional argument is of action ECORE_GETOPT_ACTION_APPEND then it will be the same as argc.
Since :
3.0

Checks parser for duplicate entries, print them out.

Returns:
EINA_TRUE if there are duplicates, EINA_FALSE otherwise.
Parameters:
parserThe parser to be checked.
Since :
3.0