00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef REPLACE_GETOPT_H
00020 #define REPLACE_GETOPT_H
00021
00022 extern char *spamc_optarg;
00023 extern int spamc_optreset;
00024 extern int spamc_optind;
00025 extern int spamc_opterr;
00026 extern int spamc_optopt;
00027 int spamc_getopt(int argc, char* const *argv, const char *optstr);
00028
00029 struct option {
00030 #if (defined __STDC__ && __STDC__) || defined __cplusplus
00031 const char *name;
00032 #else
00033 char *name;
00034 #endif
00035 int has_arg;
00036 int *flag;
00037 int val;
00038 };
00039
00040 int spamc_getopt_long(int argc, char* const argv[], const char *optstring,
00041 struct option *longopts, int *longindex);
00042
00043 int spamc_getopt_long_only(int argc, char* const *argv, const char *optstr,
00044 const struct option *longoptions, int *longopt);
00045
00046 #define no_argument (0)
00047 #define required_argument (1)
00048 #define optional_argument (2)
00049
00050 #endif