summaryrefslogtreecommitdiff
path: root/src/bin/psql/stringutils.h
blob: b47425e8644c319d469b5e1958fcebd9b3c75f2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * psql - the PostgreSQL interactive terminal
 *
 * Copyright (c) 2000-2021, 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 */