PostgreSQL Source Code
git master
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
c
d
g
h
i
k
l
m
p
r
s
t
Functions
Variables
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
c
d
f
h
i
n
o
p
r
s
t
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
pg_getopt.h
Go to the documentation of this file.
1
/*
2
* Postgres files that use getopt(3) always include this file.
3
* We must cope with three different scenarios:
4
* 1. We're using the platform's getopt(), and we should just import the
5
* appropriate declarations.
6
* 2. The platform lacks getopt(), and we must declare everything.
7
* 3. The platform has getopt(), but we're not using it because we don't
8
* like its behavior. The declarations we make here must be compatible
9
* with both the platform's getopt() and our src/port/getopt.c.
10
*
11
* Portions Copyright (c) 1987, 1993, 1994
12
* The Regents of the University of California. All rights reserved.
13
*
14
* Portions Copyright (c) 2003-2025, PostgreSQL Global Development Group
15
*
16
* src/include/pg_getopt.h
17
*/
18
/* IWYU pragma: always_keep */
19
#ifndef PG_GETOPT_H
20
#define PG_GETOPT_H
21
22
/* POSIX says getopt() is provided by unistd.h */
23
#include <
unistd.h
>
/* IWYU pragma: export */
24
25
/* rely on the system's getopt.h if present */
26
#ifdef HAVE_GETOPT_H
27
#include <getopt.h>
/* IWYU pragma: export */
28
#endif
29
30
/*
31
* If we have <getopt.h>, assume it declares these variables, else do that
32
* ourselves. (We used to just declare them unconditionally, but Cygwin
33
* doesn't like that.)
34
*/
35
#ifndef HAVE_GETOPT_H
36
37
extern
PGDLLIMPORT
char
*
optarg
;
38
extern
PGDLLIMPORT
int
optind
;
39
extern
PGDLLIMPORT
int
opterr
;
40
extern
PGDLLIMPORT
int
optopt
;
41
42
#endif
/* HAVE_GETOPT_H */
43
44
/*
45
* Some platforms have optreset but fail to declare it in <getopt.h>, so cope.
46
* Cygwin, however, doesn't like this either.
47
*/
48
#if defined(HAVE_INT_OPTRESET) && !defined(__CYGWIN__)
49
extern
PGDLLIMPORT
int
optreset;
50
#endif
51
52
/* Provide getopt() declaration if the platform doesn't have it */
53
#ifndef HAVE_GETOPT
54
extern
int
getopt
(
int
nargc,
char
*
const
*nargv,
const
char
*ostr);
55
#endif
56
57
#endif
/* PG_GETOPT_H */
PGDLLIMPORT
#define PGDLLIMPORT
Definition:
c.h:1291
optind
PGDLLIMPORT int optind
Definition:
getopt.c:51
optopt
PGDLLIMPORT int optopt
Definition:
getopt.c:52
opterr
PGDLLIMPORT int opterr
Definition:
getopt.c:50
getopt
int getopt(int nargc, char *const *nargv, const char *ostr)
Definition:
getopt.c:72
optarg
PGDLLIMPORT char * optarg
Definition:
getopt.c:53
unistd.h
src
include
pg_getopt.h
Generated on Sun Apr 13 2025 06:13:27 for PostgreSQL Source Code by
1.9.4