Thanks to visit codestin.com
Credit goes to doxygen.postgresql.org

PostgreSQL Source Code git master
string.h
Go to the documentation of this file.
1/*
2 * string.h
3 * string handling helpers
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/common/string.h
9 */
10#ifndef COMMON_STRING_H
11#define COMMON_STRING_H
12
13#include <signal.h>
14
15typedef struct StringInfoData *StringInfo; /* avoid including stringinfo.h
16 * here */
17
19{
20 /* To avoid including <setjmp.h> here, jmpbuf is declared "void *" */
21 void *jmpbuf; /* existing longjmp buffer */
22 volatile sig_atomic_t *enabled; /* flag that enables longjmp-on-interrupt */
23 bool canceled; /* indicates whether cancellation occurred */
25
26/* functions in src/common/string.c */
27extern bool pg_str_endswith(const char *str, const char *end);
28extern int strtoint(const char *pg_restrict str, char **pg_restrict endptr,
29 int base);
30extern char *pg_clean_ascii(const char *str, int alloc_flags);
31extern int pg_strip_crlf(char *str);
32extern bool pg_is_ascii(const char *str);
33
34/* functions in src/common/pg_get_line.c */
35extern char *pg_get_line(FILE *stream, PromptInterruptContext *prompt_ctx);
36extern bool pg_get_line_buf(FILE *stream, StringInfo buf);
37extern bool pg_get_line_append(FILE *stream, StringInfo buf,
38 PromptInterruptContext *prompt_ctx);
39
40/* functions in src/common/sprompt.c */
41extern char *simple_prompt(const char *prompt, bool echo);
42extern char *simple_prompt_extended(const char *prompt, bool echo,
43 PromptInterruptContext *prompt_ctx);
44
45#endif /* COMMON_STRING_H */
const char * str
static char * buf
Definition: pg_test_fsync.c:72
char * simple_prompt_extended(const char *prompt, bool echo, PromptInterruptContext *prompt_ctx)
Definition: sprompt.c:53
char * pg_get_line(FILE *stream, PromptInterruptContext *prompt_ctx)
Definition: pg_get_line.c:59
char * pg_clean_ascii(const char *str, int alloc_flags)
Definition: string.c:85
bool pg_get_line_append(FILE *stream, StringInfo buf, PromptInterruptContext *prompt_ctx)
Definition: pg_get_line.c:124
int pg_strip_crlf(char *str)
Definition: string.c:154
char * simple_prompt(const char *prompt, bool echo)
Definition: sprompt.c:38
bool pg_is_ascii(const char *str)
Definition: string.c:132
bool pg_get_line_buf(FILE *stream, StringInfo buf)
Definition: pg_get_line.c:95
struct StringInfoData * StringInfo
Definition: string.h:15
int strtoint(const char *pg_restrict str, char **pg_restrict endptr, int base)
Definition: string.c:50
bool pg_str_endswith(const char *str, const char *end)
Definition: string.c:31
struct PromptInterruptContext PromptInterruptContext
volatile sig_atomic_t * enabled
Definition: string.h:22