00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __EH_OPT_CONTEXT_H__
00022 #define __EH_OPT_CONTEXT_H__
00023
00024 #include <stdio.h>
00025 #include <glib.h>
00026 #include <utils/eh_types.h>
00027
00028 new_handle( Eh_opt_context );
00029
00030 typedef struct
00031 {
00032 const gchar* long_name;
00033 gchar short_name;
00034
00035 const gchar* description;
00036 const gchar* arg_description;
00037
00038 const gchar* default_val;
00039 }
00040 Eh_opt_entry;
00041
00042
00043
00044
00045
00046 Eh_opt_context eh_opt_create_context ( const gchar* name ,
00047 const gchar* description ,
00048 const gchar* help_description );
00049 Eh_opt_context eh_destroy_context ( Eh_opt_context context );
00050 Eh_opt_context eh_opt_set_context ( Eh_opt_context context ,
00051 Eh_opt_entry* entries );
00052 gboolean eh_opt_parse_context( Eh_opt_context context ,
00053 gint* argc ,
00054 gchar*** argv ,
00055 GError** error );
00056 void eh_opt_print_label_value( Eh_opt_context context , char *label );
00057
00058 char* eh_opt_value ( Eh_opt_context context , char* label );
00059 char* eh_opt_str_value ( Eh_opt_context c , char* label );
00060 gboolean eh_opt_bool_value ( Eh_opt_context c , char *label );
00061 int eh_opt_key_value ( Eh_opt_context c , char *label ,
00062 char *keys[] );
00063 gint eh_opt_int_value ( Eh_opt_context c , char *label );
00064 double eh_opt_dbl_value ( Eh_opt_context c , char *label );
00065
00066 void eh_opt_print_key_file ( Eh_opt_context c , FILE *fp );
00067 void eh_opt_print_all_opts ( Eh_opt_context c , FILE *fp );
00068
00069
00070 #endif
00071