PostgreSQL Source Code git master
Loading...
Searching...
No Matches
oauth-utils.h
Go to the documentation of this file.
1/*-------------------------------------------------------------------------
2 *
3 * oauth-utils.h
4 *
5 * Definitions providing missing libpq internal APIs
6 *
7 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
9 *
10 * src/interfaces/libpq-oauth/oauth-utils.h
11 *
12 *-------------------------------------------------------------------------
13 */
14
15#ifndef OAUTH_UTILS_H
16#define OAUTH_UTILS_H
17
18#include "libpq-fe.h"
19#include "pqexpbuffer.h"
20
21typedef char *(*libpq_gettext_func) (const char *msgid);
22
23/* Initializes libpq-oauth. */
25
26/*
27 * Duplicated APIs, copied from libpq (primarily libpq-int.h, which we cannot
28 * depend on here).
29 */
30
31typedef enum
32{
33 PG_BOOL_UNKNOWN = 0, /* Currently unknown */
34 PG_BOOL_YES, /* Yes (true) */
35 PG_BOOL_NO /* No (false) */
37
38extern bool oauth_unsafe_debugging_enabled(void);
39extern int pq_block_sigpipe(sigset_t *osigset, bool *sigpipe_pending);
40extern void pq_reset_sigpipe(sigset_t *osigset, bool sigpipe_pending, bool got_epipe);
41
42#ifdef ENABLE_NLS
43extern char *libpq_gettext(const char *msgid) pg_attribute_format_arg(1);
44#else
45#define libpq_gettext(x) (x)
46#endif
47
49
50#define pglock_thread() pg_g_threadlock(true)
51#define pgunlock_thread() pg_g_threadlock(false)
52
53#endif /* OAUTH_UTILS_H */
#define pg_attribute_format_arg(a)
Definition c.h:261
#define PGDLLEXPORT
Definition c.h:1438
void(* pgthreadlock_t)(int acquire)
Definition libpq-fe.h:477
PGDLLEXPORT void libpq_oauth_init(libpq_gettext_func gettext_impl)
Definition oauth-utils.c:46
void pq_reset_sigpipe(sigset_t *osigset, bool sigpipe_pending, bool got_epipe)
#define libpq_gettext(x)
Definition oauth-utils.h:45
int pq_block_sigpipe(sigset_t *osigset, bool *sigpipe_pending)
pgthreadlock_t pg_g_threadlock
Definition oauth-utils.c:35
PGTernaryBool
Definition oauth-utils.h:32
@ PG_BOOL_YES
Definition oauth-utils.h:34
@ PG_BOOL_NO
Definition oauth-utils.h:35
@ PG_BOOL_UNKNOWN
Definition oauth-utils.h:33
char *(* libpq_gettext_func)(const char *msgid)
Definition oauth-utils.h:21
bool oauth_unsafe_debugging_enabled(void)
Definition oauth-utils.c:82
static int fb(int x)