-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmisc.h
52 lines (43 loc) · 1.5 KB
/
misc.h
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* File: misc.h
*
* Description: See "misc.c"
*
* Comments: See "readme.txt" for copyright and license information.
*
*/
#ifndef __MISC_H__
#define __MISC_H__
#include <stdio.h>
#ifndef WIN32
#include <unistd.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
char *strncpy_null(char *dst, const char *src, ssize_t len);
#ifndef HAVE_STRLCPY
size_t strlcat(char *, const char *, size_t);
#endif /* HAVE_STRLCPY */
char *my_trim(char *string);
char *make_string(const SQLCHAR *s, SQLINTEGER len, char *buf, size_t bufsize);
SQLCHAR *make_lstring_ifneeded(ConnectionClass *, const SQLCHAR *s, ssize_t len, BOOL);
char *schema_strcat(char *buf, const char *fmt, const SQLCHAR *s, SQLLEN len,
const SQLCHAR *, SQLLEN, ConnectionClass *conn);
char *schema_strcat1(char *buf, const char *fmt, const char *s1,
const char *s, ssize_t len,
const SQLCHAR *, int, ConnectionClass *conn);
int snprintf_add(char *buf, size_t size, const char *format, ...);
size_t snprintf_len(char *buf, size_t size, const char *format, ...);
/* #define GET_SCHEMA_NAME(nspname) (stricmp(nspname, "public") ? nspname : "") */
char *quote_table(const pgNAME schema, pgNAME table);
#define GET_SCHEMA_NAME(nspname) (nspname)
/* defines for return value of my_strcpy */
#define STRCPY_SUCCESS 1
#define STRCPY_FAIL 0
#define STRCPY_TRUNCATED (-1)
#define STRCPY_NULL (-2)
ssize_t my_strcpy(char *dst, ssize_t dst_len, const char *src, ssize_t src_len);
#ifdef __cplusplus
}
#endif
#endif /* __MISC_H__ */