PostgreSQL Source Code git master
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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-2025, 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
19typedef void (*help_handler) (const char *progname);
20
21extern void handle_help_version_opts(int argc, char *argv[],
22 const char *fixed_progname,
23 help_handler hlp);
24extern bool option_parse_int(const char *optarg, const char *optname,
25 int min_range, int max_range,
26 int *result);
27extern 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:170
const char * progname
Definition: main.c:44
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:53