Back to index

php5  5.3.10
php_getopt.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Author: Marcus Boerger <helly@php.net>                               |
00016    +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: php_getopt.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef PHP_GETOPT_H
00022 #define PHP_GETOPT_H
00023 
00024 #include "php.h"
00025 
00026 #ifdef NETWARE
00027 /*
00028 As NetWare LibC has optind and optarg macros defined in unistd.h our local variables were getting mistakenly preprocessed so undeffing optind and optarg
00029 */
00030 #undef optarg
00031 #undef optind
00032 #endif
00033 
00034 /* Define structure for one recognized option (both single char and long name).
00035  * If short_open is '-' this is the last option. */
00036 typedef struct _opt_struct {
00037        char opt_char;
00038        int  need_param;
00039        char * opt_name;
00040 } opt_struct;
00041 
00042 BEGIN_EXTERN_C()
00043 /* holds the index of the latest fetched element from the opts array */
00044 extern PHPAPI int php_optidx;
00045 PHPAPI int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err, int arg_start);
00046 END_EXTERN_C()
00047 
00048 #endif
00049 
00050 /*
00051  * Local variables:
00052  * tab-width: 4
00053  * c-basic-offset: 4
00054  * End:
00055  * vim600: noet sw=4 ts=4 fdm=marker
00056  * vim<600: noet sw=4 ts=4
00057  */