Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_options.h
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2006 University of Chicago
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
22 #ifndef GLOBUS_OPTIONS_H
23 #define GLOBUS_OPTIONS_H 1
24 
25 #include "globus_common_include.h"
26 
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 enum
33 {
34  GLOBUS_OPTIONS_HELP = 1,
35  GLOBUS_OPTIONS_NOT_ENOUGH_ARGS,
36  GLOBUS_OPTIONS_INVALID_PARAMETER,
37  GLOBUS_OPTIONS_UNKNOWN
38 };
39 
40 typedef struct globus_l_options_handle_s * globus_options_handle_t;
41 
42 typedef
44 (*globus_options_callback_t)(
45  globus_options_handle_t opts_handle,
46  char * cmd,
47  char ** parm,
48  void * arg,
49  int * out_parms_used);
50 
51 typedef
53 (*globus_options_unknown_callback_t)(
54  globus_options_handle_t opts_handle,
55  void * unknown_arg,
56  int argc,
57  char ** argv);
58 
59 typedef struct globus_options_entry_s
60 {
61  char * opt_name; /* long and filename */
62  char * short_opt;
63  char * env;
64  char * parms_desc;
65  char * description;
66  int arg_count;
67  globus_options_callback_t func;
68 } globus_options_entry_t;
69 
70 #define GLOBUS_OPTIONS_END {NULL, NULL, NULL, NULL, NULL, 0, NULL}
71 
73 globus_options_init(
74  globus_options_handle_t * out_handle,
75  globus_options_unknown_callback_t unknown_func,
76  void * unknown_arg);
77 
79 globus_options_add_table(
80  globus_options_handle_t handle,
81  globus_options_entry_t * table,
82  void * user_arg);
83 
85 globus_options_destroy(
86  globus_options_handle_t handle);
87 
89 globus_options_command_line_process(
90  globus_options_handle_t handle,
91  int argc,
92  char ** argv);
93 
95 globus_options_env_process(
96  globus_options_handle_t handle);
97 
99 globus_options_file_process(
100  globus_options_handle_t handle,
101  char * filename);
102 
104 globus_options_xinetd_file_process(
105  globus_options_handle_t handle,
106  char * filename,
107  char * service_name);
108 
109 void
110 globus_options_help(
111  globus_options_handle_t handle);
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #endif /* GLOBUS_OPTIONS_H */
uint32_t globus_result_t
Definition: globus_types.h:99
Include System Headers.