Apache2
apr_getopt.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. 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 
17 #ifndef APR_GETOPT_H
18 #define APR_GETOPT_H
19 
25 #include "apr_pools.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30 
42 typedef void (apr_getopt_err_fn_t)(void *arg, const char *err, ...);
43 
45 typedef struct apr_getopt_t apr_getopt_t;
46 
50 struct apr_getopt_t {
56  void *errarg;
58  int ind;
60  int opt;
62  int reset;
64  int argc;
66  const char **argv;
68  char const* place;
74  int skip_end;
75 };
76 
79 
85  const char *name;
87  int optch;
89  int has_arg;
91  const char *description;
92 };
93 
104  int argc, const char * const *argv);
105 
123  char *option_ch, const char **option_arg);
124 
151  const apr_getopt_option_t *opts,
152  int *option_ch,
153  const char **option_arg);
156 #ifdef __cplusplus
157 }
158 #endif
159 
160 #endif /* ! APR_GETOPT_H */
APR memory allocation.
dav_error * err
Definition: mod_dav.h:203
int apr_status_t
Definition: apr_errno.h:44
apr_status_t apr_getopt(apr_getopt_t *os, const char *opts, char *option_ch, const char **option_arg)
apr_status_t apr_getopt_long(apr_getopt_t *os, const apr_getopt_option_t *opts, int *option_ch, const char **option_arg)
apr_status_t apr_getopt_init(apr_getopt_t **os, apr_pool_t *cont, int argc, const char *const *argv)
void() apr_getopt_err_fn_t(void *arg, const char *err,...)
Definition: apr_getopt.h:42
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
#define APR_DECLARE(x)
Definition: macros.h:6
Definition: apr_getopt.h:83
int optch
Definition: apr_getopt.h:87
const char * name
Definition: apr_getopt.h:85
const char * description
Definition: apr_getopt.h:91
int has_arg
Definition: apr_getopt.h:89
Definition: apr_getopt.h:50
int skip_start
Definition: apr_getopt.h:72
const char ** argv
Definition: apr_getopt.h:66
void * errarg
Definition: apr_getopt.h:56
int opt
Definition: apr_getopt.h:60
int argc
Definition: apr_getopt.h:64
apr_pool_t * cont
Definition: apr_getopt.h:52
apr_getopt_err_fn_t * errfn
Definition: apr_getopt.h:54
int interleave
Definition: apr_getopt.h:70
char const * place
Definition: apr_getopt.h:68
int ind
Definition: apr_getopt.h:58
int reset
Definition: apr_getopt.h:62
int skip_end
Definition: apr_getopt.h:74