]> granicus.if.org Git - postgresql/blob - src/interfaces/odbc/misc.h
Version 06-30-0248
[postgresql] / src / interfaces / odbc / misc.h
1
2 /* File:            misc.h
3  *
4  * Description:     See "misc.c"
5  *
6  * Comments:        See "notice.txt" for copyright and license information.
7  *
8  */
9
10 #ifndef __MISC_H__
11 #define __MISC_H__
12
13 #ifdef HAVE_CONFIG_H
14 #include <config.h>
15 #endif
16
17 #ifdef UNIX
18 #include "gpps.h"
19 #define SQLGetPrivateProfileString(a,b,c,d,e,f) GetPrivateProfileString(a,b,c,d,e,f)
20 #endif
21
22 #include <stdio.h>
23
24 /*      Uncomment MY_LOG define to compile in the mylog() statements.
25         Then, debug logging will occur if 'Debug' is set to 1 in the ODBCINST.INI
26         portion of the registry.  You may have to manually add this key.
27         This logfile is intended for development use, not for an end user!
28 */
29 // #define MY_LOG
30
31
32 /*      Uncomment Q_LOG to compile in the qlog() statements (Communications log, i.e. CommLog).
33         This logfile contains serious log statements that are intended for an
34         end user to be able to read and understand.  It is controlled by the
35         'CommLog' flag in the ODBCINST.INI portion of the registry (see above),
36         which is manipulated on the setup/connection dialog boxes.
37 */
38 #define Q_LOG
39
40
41 #ifdef MY_LOG
42 #ifdef UNIX
43 #define MYLOGFILE       "/tmp/mylog.log"
44 #else
45 #define MYLOGFILE       "c:\\mylog.log"
46 #endif
47 void mylog();   /* prototype */
48 #else
49 #define mylog    // mylog
50 #endif
51
52 #ifdef Q_LOG
53 #ifdef UNIX
54 #define QLOGFILE        "/tmp/psqlodbc.log"
55 #else
56 #define QLOGFILE        "c:\\psqlodbc.log"
57 #endif
58 void qlog();    /* prototype */
59 #else
60 #define qlog    // qlog
61 #endif
62
63 void remove_newlines(char *string);
64 char *strncpy_null(char *dst, const char *src, int len);
65 char *trim(char *string);
66 char *make_string(char *s, int len, char *buf);
67 char *my_strcat(char *buf, char *fmt, char *s, int len);
68
69 /* defines for return value of my_strcpy */
70 #define STRCPY_SUCCESS          1
71 #define STRCPY_FAIL                     0
72 #define STRCPY_TRUNCATED        -1
73 #define STRCPY_NULL                     -2
74
75 int my_strcpy(char *dst, int dst_len, char *src, int src_len);
76
77 #endif