-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmisc.h
46 lines (37 loc) · 1.14 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
/* 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_STRLCAT
size_t strlcat(char *, const char *, size_t);
#endif /* HAVE_STRLCAT */
char *my_trim(char *string);
char *make_string(const SQLCHAR *s, SQLINTEGER len, char *buf, size_t bufsize);
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, const 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__ */