00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00022 #ifndef GLOBUS_OPTIONS_H
00023 #define GLOBUS_OPTIONS_H 1
00024
00025 #include "globus_common_include.h"
00026
00027
00028 #ifdef __cplusplus
00029 extern "C" {
00030 #endif
00031
00032 enum
00033 {
00034 GLOBUS_OPTIONS_HELP = 1,
00035 GLOBUS_OPTIONS_NOT_ENOUGH_ARGS,
00036 GLOBUS_OPTIONS_INVALID_PARAMETER,
00037 GLOBUS_OPTIONS_UNKNOWN
00038 };
00039
00040 typedef struct globus_l_options_handle_s * globus_options_handle_t;
00041
00042 typedef
00043 globus_result_t
00044 (*globus_options_callback_t)(
00045 globus_options_handle_t opts_handle,
00046 char * cmd,
00047 char ** parm,
00048 void * arg,
00049 int * out_parms_used);
00050
00051 typedef
00052 globus_result_t
00053 (*globus_options_unknown_callback_t)(
00054 globus_options_handle_t opts_handle,
00055 void * unknown_arg,
00056 int argc,
00057 char ** argv);
00058
00059 typedef struct globus_options_entry_s
00060 {
00061 char * opt_name;
00062 char * short_opt;
00063 char * env;
00064 char * parms_desc;
00065 char * description;
00066 int arg_count;
00067 globus_options_callback_t func;
00068 } globus_options_entry_t;
00069
00070 #define GLOBUS_OPTIONS_END {NULL, NULL, NULL, NULL, NULL, 0, NULL}
00071
00072 globus_result_t
00073 globus_options_init(
00074 globus_options_handle_t * out_handle,
00075 globus_options_unknown_callback_t unknown_func,
00076 void * unknown_arg);
00077
00078 globus_result_t
00079 globus_options_add_table(
00080 globus_options_handle_t handle,
00081 globus_options_entry_t * table,
00082 void * user_arg);
00083
00084 globus_result_t
00085 globus_options_destroy(
00086 globus_options_handle_t handle);
00087
00088 globus_result_t
00089 globus_options_command_line_process(
00090 globus_options_handle_t handle,
00091 int argc,
00092 char ** argv);
00093
00094 globus_result_t
00095 globus_options_env_process(
00096 globus_options_handle_t handle);
00097
00098 globus_result_t
00099 globus_options_file_process(
00100 globus_options_handle_t handle,
00101 char * filename);
00102
00103 globus_result_t
00104 globus_options_xinetd_file_process(
00105 globus_options_handle_t handle,
00106 char * filename,
00107 char * service_name);
00108
00109 void
00110 globus_options_help(
00111 globus_options_handle_t handle);
00112
00113 #ifdef __cplusplus
00114 }
00115 #endif
00116
00117 #endif