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. */
24typedef struct _opt_struct {
27 char * opt_name;
29
31/* holds the index of the latest fetched element from the opts array */
32extern PHPAPI int php_optidx;
33PHPAPI int php_getopt(int argc, char* const *argv, const opt_struct opts[], char **optarg, int *optind, int show_err, int arg_start);
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
PHPAPI int php_optidx
Definition getopt.c:53
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
#define PHPAPI
Definition php.h:71
struct _opt_struct opt_struct
char * opt_name
Definition php_getopt.h:27
char opt_char
Definition php_getopt.h:25
#define END_EXTERN_C()
#define BEGIN_EXTERN_C()