00001 
00012 #ifndef _GK_GETOPT_H_
00013 #define _GK_GETOPT_H_
00014 
00015 
00016 
00017 extern CMK_THREADLOCAL char *gk_optarg;
00018 extern CMK_THREADLOCAL int gk_optind;
00019 extern CMK_THREADLOCAL int gk_opterr;
00020 extern CMK_THREADLOCAL int gk_optopt;
00021 
00022 
00030 struct gk_option {
00031   char *name;       
00032   int has_arg;      
00036   int *flag;        
00037   int val;          
00048 };
00049 
00050 
00051 #define no_argument     0
00052 #define required_argument   1
00053 #define optional_argument   2
00054 
00055 
00056 
00057 extern int gk_getopt(int __argc, char **__argv, char *__shortopts);
00058 extern int gk_getopt_long(int __argc, char **__argv, char *__shortopts,
00059               struct gk_option *__longopts, int *__longind);
00060 extern int gk_getopt_long_only (int __argc, char **__argv,
00061               char *__shortopts, struct gk_option *__longopts, int *__longind);
00062 
00063 
00064 
00065 #endif
00066