Main Page | Class List | Directories | File List | Class Members | File Members

getopt.h

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

© sourcejam.com 2005-2008