php-internal-docs
8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_getopt.h
Go to the documentation of this file.
1
/*
2
+----------------------------------------------------------------------+
3
| Copyright (c) The PHP Group |
4
+----------------------------------------------------------------------+
5
| This source file is subject to version 3.01 of the PHP license, |
6
| that is bundled with this package in the file LICENSE, and is |
7
| available through the world-wide-web at the following url: |
8
| https://www.php.net/license/3_01.txt |
9
| If you did not receive a copy of the PHP license and are unable to |
10
| obtain it through the world-wide-web, please send a note to |
11
| license@php.net so we can mail you a copy immediately. |
12
+----------------------------------------------------------------------+
13
| Author: Marcus Boerger <helly@php.net> |
14
+----------------------------------------------------------------------+
15
*/
16
17
#ifndef PHP_GETOPT_H
18
#define PHP_GETOPT_H
19
20
#include "
php.h
"
21
22
/* Define structure for one recognized option (both single char and long name).
23
* If short_open is '-' this is the last option. */
24
typedef
struct
_opt_struct
{
25
char
opt_char
;
26
int
need_param
;
27
char
*
opt_name
;
28
}
opt_struct
;
29
30
BEGIN_EXTERN_C
()
31
/* holds the index of the latest fetched element from the opts array */
32
extern
PHPAPI
int
php_optidx
;
33
PHPAPI
int
php_getopt
(
int
argc,
char
* const *argv, const
opt_struct
opts[],
char
**optarg,
int
*optind,
int
show_err,
int
arg_start);
34
END_EXTERN_C
()
35
36
/* php_getopt will return this value if there is an error in arguments */
37
#define PHP_GETOPT_INVALID_ARG (-2)
38
39
#endif
php_optidx
PHPAPI int php_optidx
Definition
getopt.c:53
php_getopt
PHPAPI int php_getopt(int argc, char *const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err, int arg_start)
Definition
getopt.c:55
php.h
PHPAPI
#define PHPAPI
Definition
php.h:71
opt_struct
struct _opt_struct opt_struct
_opt_struct
Definition
php_getopt.h:24
_opt_struct::need_param
int need_param
Definition
php_getopt.h:26
_opt_struct::opt_name
char * opt_name
Definition
php_getopt.h:27
_opt_struct::opt_char
char opt_char
Definition
php_getopt.h:25
END_EXTERN_C
#define END_EXTERN_C()
Definition
zend_portability.h:29
BEGIN_EXTERN_C
#define BEGIN_EXTERN_C()
Definition
zend_portability.h:28
main
php_getopt.h
Generated on Sat Aug 23 2025 01:46:12 for php-internal-docs by
1.13.2