Debian Codegraph @

lib/usual/pgutil.h

raw symbols SCIP
1 /*
2 * libusual - Utility library for C
3 *
4 * Copyright (c) 2007-2009 Marko Kreen, Skype Technologies OÜ
5 *
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18
19 /**
20 * @file
21 *
22 * Utility functions for PostgreSQL data formats.
23 */
24 #ifndef _USUAL_PGUTIL_H_
25 #define _USUAL_PGUTIL_H_
26
27 #include <usual/string.h>
28
29 /** Check if string is reserver word for PostgreSQL. */
30 bool pg_is_reserved_word(const char *str);
31
32 /** Quote value as string for PostgreSQL */
33 bool pg_quote_literal(char *_dst, const char *_src, int dstlen);
34
35 /** Quote value as ident for PostgreSQL */
36 bool pg_quote_ident(char *_dst, const char *_src, int dstlen);
37
38 /** Quote fully-qualified ident for PostgreSQL */
39 bool pg_quote_fqident(char *_dst, const char *_src, int dstlen);
40
41 /** Parse PostgreSQL array. */
42 struct StrList *pg_parse_array(const char *pgarr, CxMem *cx);
43
44 #endif