00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef APR_GETOPT_H
00018 #define APR_GETOPT_H
00019
00025 #include "apr_pools.h"
00026
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030
00040 typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...);
00041
00043 typedef struct apr_getopt_t apr_getopt_t;
00044
00048 struct apr_getopt_t {
00050 apr_pool_t *cont;
00052 apr_getopt_err_fn_t *errfn;
00054 void *errarg;
00056 int ind;
00058 int opt;
00060 int reset;
00062 int argc;
00064 const char **argv;
00066 char const* place;
00068 int interleave;
00070 int skip_start;
00072 int skip_end;
00073 };
00074
00076 typedef struct apr_getopt_option_t apr_getopt_option_t;
00077
00081 struct apr_getopt_option_t {
00083 const char *name;
00085 int optch;
00087 int has_arg;
00089 const char *description;
00090 };
00091
00101 APR_DECLARE(apr_status_t) apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont,
00102 int argc, const char * const *argv);
00103
00120 APR_DECLARE(apr_status_t) apr_getopt(apr_getopt_t *os, const char *opts,
00121 char *option_ch, const char **option_arg);
00122
00148 APR_DECLARE(apr_status_t) apr_getopt_long(apr_getopt_t *os,
00149 const apr_getopt_option_t *opts,
00150 int *option_ch,
00151 const char **option_arg);
00154 #ifdef __cplusplus
00155 }
00156 #endif
00157
00158 #endif