PostgreSQL Source Code  git master
option_utils.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * Command line option processing facilities for frontend code
4  *
5  * Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
6  * Portions Copyright (c) 1994, Regents of the University of California
7  *
8  * src/include/fe_utils/option_utils.h
9  *
10  *-------------------------------------------------------------------------
11  */
12 #ifndef OPTION_UTILS_H
13 #define OPTION_UTILS_H
14 
15 #include "postgres_fe.h"
16 
17 #include "common/file_utils.h"
18 
19 typedef void (*help_handler) (const char *progname);
20 
21 extern void handle_help_version_opts(int argc, char *argv[],
22  const char *fixed_progname,
23  help_handler hlp);
24 extern bool option_parse_int(const char *optarg, const char *optname,
25  int min_range, int max_range,
26  int *result);
27 extern bool parse_sync_method(const char *optarg,
29 
30 #endif /* OPTION_UTILS_H */
DataDirSyncMethod
Definition: file_utils.h:28
static DataDirSyncMethod sync_method
Definition: initdb.c:168
const char * progname
Definition: main.c:45
void(* help_handler)(const char *progname)
Definition: option_utils.h:19
bool option_parse_int(const char *optarg, const char *optname, int min_range, int max_range, int *result)
Definition: option_utils.c:50
void handle_help_version_opts(int argc, char *argv[], const char *fixed_progname, help_handler hlp)
Definition: option_utils.c:24
bool parse_sync_method(const char *optarg, DataDirSyncMethod *sync_method)
Definition: option_utils.c:90
PGDLLIMPORT char * optarg
Definition: getopt.c:52