00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef APR_GETOPT_H
00017 #define APR_GETOPT_H
00018
00024 #include "apr_pools.h"
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00039 typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...);
00040
00042 typedef struct apr_getopt_t apr_getopt_t;
00043
00047 struct apr_getopt_t {
00049 apr_pool_t *cont;
00051 apr_getopt_err_fn_t *errfn;
00053 void *errarg;
00055 int ind;
00057 int opt;
00059 int reset;
00061 int argc;
00063 const char **argv;
00065 char const* place;
00067 int interleave;
00069 int skip_start;
00071 int skip_end;
00072 };
00073
00075 typedef struct apr_getopt_option_t apr_getopt_option_t;
00076
00080 struct apr_getopt_option_t {
00082 const char *name;
00084 int optch;
00086 int has_arg;
00088 const char *description;
00089 };
00090
00100 APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont,
00101 int argc, const char * const *argv);
00102
00119 APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts,
00120 char *option_ch, const char **option_arg);
00121
00147 APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os,
00148 const apr_getopt_option_t *opts,
00149 int *option_ch,
00150 const char **option_arg);
00153 #ifdef __cplusplus
00154 }
00155 #endif
00156
00157 #endif