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-2020, 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 struct StringInfoData; /* avoid including stringinfo.h here */
14 
15 /* functions in src/common/string.c */
16 extern bool pg_str_endswith(const char *str, const char *end);
17 extern int strtoint(const char *pg_restrict str, char **pg_restrict endptr,
18  int base);
19 extern void pg_clean_ascii(char *str);
20 extern int pg_strip_crlf(char *str);
21 
22 /* functions in src/common/pg_get_line.c */
23 extern char *pg_get_line(FILE *stream);
24 extern bool pg_get_line_buf(FILE *stream, struct StringInfoData *buf);
25 extern bool pg_get_line_append(FILE *stream, struct StringInfoData *buf);
26 
27 /* functions in src/common/sprompt.c */
28 extern char *simple_prompt(const char *prompt, bool echo);
29 
30 #endif /* COMMON_STRING_H */
void pg_clean_ascii(char *str)
Definition: string.c:82
bool pg_get_line_append(FILE *stream, struct StringInfoData *buf)
static char * buf
Definition: pg_test_fsync.c:67
bool pg_get_line_buf(FILE *stream, struct StringInfoData *buf)
char * pg_get_line(FILE *stream)
Definition: pg_get_line.c:52
bool pg_str_endswith(const char *str, const char *end)
Definition: string.c:31
char * simple_prompt(const char *prompt, bool echo)
Definition: sprompt.c:38
int strtoint(const char *pg_restrict str, char **pg_restrict endptr, int base)
Definition: string.c:50
int pg_strip_crlf(char *str)
Definition: string.c:105