diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:17:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:17:33 +0000 |
commit | 5e45211a64149b3c659b90ff2de6fa982a5a93ed (patch) | |
tree | 739caf8c461053357daa9f162bef34516c7bf452 /src/bin/psql/stringutils.h | |
parent | Initial commit. (diff) | |
download | postgresql-15-5e45211a64149b3c659b90ff2de6fa982a5a93ed.tar.xz postgresql-15-5e45211a64149b3c659b90ff2de6fa982a5a93ed.zip |
Adding upstream version 15.5.upstream/15.5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/bin/psql/stringutils.h')
-rw-r--r-- | src/bin/psql/stringutils.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/bin/psql/stringutils.h b/src/bin/psql/stringutils.h new file mode 100644 index 0000000..5d49422 --- /dev/null +++ b/src/bin/psql/stringutils.h @@ -0,0 +1,28 @@ +/* + * psql - the PostgreSQL interactive terminal + * + * Copyright (c) 2000-2022, PostgreSQL Global Development Group + * + * src/bin/psql/stringutils.h + */ +#ifndef STRINGUTILS_H +#define STRINGUTILS_H + +/* The cooler version of strtok() which knows about quotes and doesn't + * overwrite your input */ +extern char *strtokx(const char *s, + const char *whitespace, + const char *delim, + const char *quote, + char escape, + bool e_strings, + bool del_quotes, + int encoding); + +extern void strip_quotes(char *source, char quote, char escape, int encoding); + +extern char *quote_if_needed(const char *source, const char *entails_quote, + char quote, char escape, bool force_quote, + int encoding); + +#endif /* STRINGUTILS_H */ |