Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * Re-entrant version of the standard getopt(3) function.
 *
 * Portions Copyright (c) 2026, PostgreSQL Global Development Group
 *
 * src/include/port/pg_getopt_ctx.h
 */
#ifndef PG_GETOPT_CTX_H
#define PG_GETOPT_CTX_H
 
typedef struct
{
    int         nargc;
    char       *const *nargv;
    const char *ostr;
 
    /*
     * Caller can modify 'opterr' between pg_getopt_start() and the first call
     * to pg_getopt_next().  Equivalent to the global variable of the same
     * name in standard getopt(3).
     */
    int         opterr;
 
    /*
     * Output variables set by pg_getopt_next().  These are equivalent to the
     * global variables with same names in standard getopt(3).
     */
    char       *optarg;
    int         optind;
    int         optopt;
 
    /* internal state */
    char       *place;
} pg_getopt_ctx;
 
extern void pg_getopt_start(pg_getopt_ctx *ctx, int nargc, char *const *nargv, const char *ostr);
extern int  pg_getopt_next(pg_getopt_ctx *ctx);
 
#endif                          /* PG_GETOPT_CTX_H */