PostgreSQL Source Code git master
Loading...
Searching...
No Matches
oauth-utils.h File Reference
#include "libpq-fe.h"
#include "pqexpbuffer.h"
Include dependency graph for oauth-utils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define libpq_gettext(x)   (x)
 
#define pglock_thread()   pg_g_threadlock(true)
 
#define pgunlock_thread()   pg_g_threadlock(false)
 

Typedefs

typedef char *(* libpq_gettext_func) (const char *msgid)
 

Enumerations

enum  PGTernaryBool { PG_BOOL_UNKNOWN = 0 , PG_BOOL_YES , PG_BOOL_NO }
 

Functions

PGDLLEXPORT void libpq_oauth_init (libpq_gettext_func gettext_impl)
 
int pq_block_sigpipe (sigset_t *osigset, bool *sigpipe_pending)
 
void pq_reset_sigpipe (sigset_t *osigset, bool sigpipe_pending, bool got_epipe)
 

Variables

pgthreadlock_t pg_g_threadlock
 

Macro Definition Documentation

◆ libpq_gettext

#define libpq_gettext (   x)    (x)

Definition at line 44 of file oauth-utils.h.

◆ pglock_thread

#define pglock_thread ( )    pg_g_threadlock(true)

Definition at line 49 of file oauth-utils.h.

◆ pgunlock_thread

#define pgunlock_thread ( )    pg_g_threadlock(false)

Definition at line 50 of file oauth-utils.h.

Typedef Documentation

◆ libpq_gettext_func

typedef char *(* libpq_gettext_func) (const char *msgid)

Definition at line 21 of file oauth-utils.h.

Enumeration Type Documentation

◆ PGTernaryBool

Enumerator
PG_BOOL_UNKNOWN 
PG_BOOL_YES 
PG_BOOL_NO 

Definition at line 31 of file oauth-utils.h.

32{
33 PG_BOOL_UNKNOWN = 0, /* Currently unknown */
34 PG_BOOL_YES, /* Yes (true) */
35 PG_BOOL_NO /* No (false) */
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

Function Documentation

◆ libpq_oauth_init()

PGDLLEXPORT void libpq_oauth_init ( libpq_gettext_func  gettext_impl)
extern

Definition at line 46 of file oauth-utils.c.

47{
50}
pgthreadlock_t PQgetThreadLock(void)
static libpq_gettext_func libpq_gettext_impl
Definition oauth-utils.c:36
pgthreadlock_t pg_g_threadlock
Definition oauth-utils.c:35
static int fb(int x)

References fb(), libpq_gettext_impl, pg_g_threadlock, and PQgetThreadLock().

◆ pq_block_sigpipe()

int pq_block_sigpipe ( sigset_t osigset,
bool sigpipe_pending 
)
extern

Definition at line 94 of file oauth-utils.c.

95{
98
101
102 /* Block SIGPIPE and save previous mask for later reset */
104 if (SOCK_ERRNO)
105 return -1;
106
107 /* We can have a pending SIGPIPE only if it was blocked before */
109 {
110 /* Is there a pending SIGPIPE? */
111 if (sigpending(&sigset) != 0)
112 return -1;
113
115 *sigpipe_pending = true;
116 else
117 *sigpipe_pending = false;
118 }
119 else
120 *sigpipe_pending = false;
121
122 return 0;
123}
#define SOCK_ERRNO
Definition oauth-utils.c:86
#define SOCK_ERRNO_SET(e)
Definition oauth-utils.c:87
#define SIGPIPE
Definition win32_port.h:163

◆ pq_reset_sigpipe()

void pq_reset_sigpipe ( sigset_t osigset,
bool  sigpipe_pending,
bool  got_epipe 
)
extern

Definition at line 130 of file oauth-utils.c.

131{
133 int signo;
135
136 /* Clear SIGPIPE only if none was pending */
137 if (got_epipe && !sigpipe_pending)
138 {
139 if (sigpending(&sigset) == 0 &&
141 {
143
146
148 }
149 }
150
151 /* Restore saved block mask */
153
155}

Variable Documentation

◆ pg_g_threadlock

pgthreadlock_t pg_g_threadlock
extern

Definition at line 35 of file oauth-utils.c.