PostgreSQL Source Code
git master
Loading...
Searching...
No Matches
pg_getopt_ctx.h
Go to the documentation of this file.
1
/*
2
* Re-entrant version of the standard getopt(3) function.
3
*
4
* Portions Copyright (c) 2026, PostgreSQL Global Development Group
5
*
6
* src/include/port/pg_getopt_ctx.h
7
*/
8
#ifndef PG_GETOPT_CTX_H
9
#define PG_GETOPT_CTX_H
10
11
typedef
struct
12
{
13
int
nargc
;
14
char
*
const
*
nargv
;
15
const
char
*
ostr
;
16
17
/*
18
* Caller can modify 'opterr' between pg_getopt_start() and the first call
19
* to pg_getopt_next(). Equivalent to the global variable of the same
20
* name in standard getopt(3).
21
*/
22
int
opterr
;
23
24
/*
25
* Output variables set by pg_getopt_next(). These are equivalent to the
26
* global variables with same names in standard getopt(3).
27
*/
28
char
*
optarg
;
29
int
optind
;
30
int
optopt
;
31
32
/* internal state */
33
char
*
place
;
34
}
pg_getopt_ctx
;
35
36
extern
void
pg_getopt_start
(
pg_getopt_ctx
*ctx,
int
nargc,
char
*
const
*nargv,
const
char
*ostr);
37
extern
int
pg_getopt_next
(
pg_getopt_ctx
*ctx);
38
39
#endif
/* PG_GETOPT_CTX_H */
pg_getopt_next
int pg_getopt_next(pg_getopt_ctx *ctx)
Definition
pg_getopt_ctx.c:72
pg_getopt_start
void pg_getopt_start(pg_getopt_ctx *ctx, int nargc, char *const *nargv, const char *ostr)
Definition
pg_getopt_ctx.c:54
pg_getopt_ctx
Definition
pg_getopt_ctx.h:12
pg_getopt_ctx::optind
int optind
Definition
pg_getopt_ctx.h:29
pg_getopt_ctx::optarg
char * optarg
Definition
pg_getopt_ctx.h:28
pg_getopt_ctx::nargv
char *const * nargv
Definition
pg_getopt_ctx.h:14
pg_getopt_ctx::place
char * place
Definition
pg_getopt_ctx.h:33
pg_getopt_ctx::ostr
const char * ostr
Definition
pg_getopt_ctx.h:15
pg_getopt_ctx::optopt
int optopt
Definition
pg_getopt_ctx.h:30
pg_getopt_ctx::nargc
int nargc
Definition
pg_getopt_ctx.h:13
pg_getopt_ctx::opterr
int opterr
Definition
pg_getopt_ctx.h:22
src
include
port
pg_getopt_ctx.h
Generated on Thu Apr 2 2026 22:13:16 for PostgreSQL Source Code by
1.9.8