| 1 |
/* |
| 2 |
* psql - the PostgreSQL interactive terminal |
| 3 |
* |
| 4 |
* Copyright (c) 2000-2025, 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, bool force_quote, |
| 26 |
int encoding); |
| 27 |
|
| 28 |
#endif /* STRINGUTILS_H */ |