apr_getopt.h

Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
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 /* __cplusplus */
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  /* ! APR_GETOPT_H */

Generated on Mon Nov 26 11:47:26 2007 for Apache Portable Runtime by  doxygen 1.5.2