Refine the interactions between the hooks provided by the different modules.
[lttv.git] / ltt / branches / poly / include / lttv / option.h
index 09fd803bfc82ae3499158b8e0eb2f2e042ed2f6c..4447f9f6bfd56202e5da2ff8fb33bbf0a1326c9a 100644 (file)
@@ -1,29 +1,33 @@
 #ifndef OPTION_H
 #define OPTION_H
 
-/* Options parsing mechanism */
-
-/* Define a new command line option with a long name (--long_name), a short
+/* Define a new option with a long name (--long_name), a short
    one character name (-c), a descriptive text, the argument type, and a
    pointer to where the argument value will be stored. For an option of
    type LTTV_OPT_NONE, the argument is a boolean value set to true when the
-   option is present. */
-
-/* Initial draft by Michel Dagenais May 2003
- * Reworked by Mathieu Desnoyers, May 2003
- */
+   option is present. The option hook is called if non NULL. */
 
-typedef enum _lttv_option_type 
+typedef enum _LttvOptionType
 {LTTV_OPT_NONE, LTTV_OPT_STRING, LTTV_OPT_INT, LTTV_OPT_LONG } 
-lttv_option_type;
+LttvOptionType;
 
-typedef void (*lttv_option_hook)(void *hook_data);
+typedef void (*LttvOptionHook)(void *hook_data);
 
 void lttv_option_add(const char *long_name, const char char_name,
-               const char *description, const char *argDescription,
-               const lttv_option_type t, void *p,
-               const lttv_option_hook h, void *hook_data);
+               const char *description, const char *arg_description,
+               const LttvOptionType t, void *p,
+               const LttvOptionHook h, void *hook_data);
+
+
+/* Remove an option */
+
+void lttv_option_remove(const char *long_name);
+
 
+/* Parse command line options. It is possible to add options (through the
+   hooks being called) while the parsing is done. The new options will be
+   used for subsequent command line arguments. */
 
+void lttv_option_parse(int argc, char **argv);
 
 #endif // OPTION_H
This page took 0.023641 seconds and 4 git commands to generate.