PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
stringutils.h
Go to the documentation of this file.
1 /*
2  * psql - the PostgreSQL interactive terminal
3  *
4  * Copyright (c) 2000-2017, PostgreSQL Global Development Group
5  *
6  * src/bin/psql/stringutils.h
7  */
8 #ifndef STRINGUTILS_H
9 #define STRINGUTILS_H
10 
11 /* The cooler version of strtok() which knows about quotes and doesn't
12  * overwrite your input */
13 extern char *strtokx(const char *s,
14  const char *whitespace,
15  const char *delim,
16  const char *quote,
17  char escape,
18  bool e_strings,
19  bool del_quotes,
20  int encoding);
21 
22 extern void strip_quotes(char *source, char quote, char escape, int encoding);
23 
24 extern char *quote_if_needed(const char *source, const char *entails_quote,
25  char quote, char escape, int encoding);
26 
27 #endif /* STRINGUTILS_H */
char * quote_if_needed(const char *source, const char *entails_quote, char quote, char escape, int encoding)
Definition: stringutils.c:291
char * strtokx(const char *s, const char *whitespace, const char *delim, const char *quote, char escape, bool e_strings, bool del_quotes, int encoding)
Definition: stringutils.c:52
static char * encoding
Definition: initdb.c:123
void strip_quotes(char *source, char quote, char escape, int encoding)
Definition: stringutils.c:240