~ubuntu-branches/ubuntu/lucid/psqlodbc/lucid

« back to all changes in this revision

Viewing changes to misc.h

  • Committer: Bazaar Package Importer
  • Author(s): Peter Eisentraut
  • Date: 2008-05-09 10:40:32 UTC
  • mfrom: (1.1.5 upstream) (4.1.1 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080509104032-brus47zgn7ak380w
Tags: 1:08.03.0200-1
* New upstream release
  - Disables some broken code (closes: #396218)
  - Obsoletes psqlodbc-413534.diff and most of psqlodbc-358949.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#include "psqlodbc.h"
13
13
 
14
14
#include <stdio.h>
 
15
#ifndef  WIN32
 
16
#include <unistd.h>
 
17
#endif
15
18
 
 
19
#ifdef __cplusplus
 
20
extern "C" {
 
21
#endif
16
22
/*      Uncomment MY_LOG define to compile in the mylog() statements.
17
23
        Then, debug logging will occur if 'Debug' is set to 1 in the ODBCINST.INI
18
24
        portion of the registry.  You may have to manually add this key.
65
71
#else
66
72
#define MYLOGDIR                        "c:"
67
73
#endif /* WIN32 */
68
 
extern void mylog(char *fmt,...);
 
74
extern void mylog(const char *fmt,...);
 
75
extern void forcelog(const char *fmt,...);
69
76
 
70
77
#else /* MY_LOG */
71
78
#ifndef WIN32
75
82
#define mylog   if (0) MyLog            /* mylog */
76
83
#endif /* WIN32 */
77
84
#endif /* MY_LOG */
78
 
#define inolog  mylog   /* for really temporary debug */
 
85
#define inolog  if (get_mylog() > 1) mylog /* for really temporary debug */
79
86
 
80
87
#ifdef Q_LOG
81
88
#define QLOGFILE                        "psqlodbc_"
116
123
#endif
117
124
 
118
125
 
119
 
void    remove_newlines(char *string);
120
 
char    *strncpy_null(char *dst, const char *src, int len);
121
 
char    *trim(char *string);
122
 
char    *make_string(const char *s, int len, char *buf, size_t bufsize);
123
 
char    *make_lstring_ifneeded(ConnectionClass *, const char *s, int len, BOOL);
124
 
char    *my_strcat(char *buf, const char *fmt, const char *s, int len);
125
 
char    *schema_strcat(char *buf, const char *fmt, const char *s, int len,
 
126
void    InitializeLogging();
 
127
void    FinalizeLogging();
 
128
 
 
129
void            remove_newlines(char *string);
 
130
char       *strncpy_null(char *dst, const char *src, ssize_t len);
 
131
char       *trim(char *string);
 
132
char       *make_string(const char *s, ssize_t len, char *buf, size_t bufsize);
 
133
char       *make_lstring_ifneeded(ConnectionClass *, const char *s, ssize_t len, BOOL);
 
134
char       *my_strcat(char *buf, const char *fmt, const char *s, ssize_t len);
 
135
char       *schema_strcat(char *buf, const char *fmt, const char *s, ssize_t len,
126
136
                const char *, int, ConnectionClass *conn);
127
 
char    *my_strcat1(char *buf, const char *fmt, const char *s1, const char *s, int len);
128
 
char    *schema_strcat1(char *buf, const char *fmt, const char *s1,
129
 
                                const char *s, int len,
 
137
char       *my_strcat1(char *buf, const char *fmt, const char *s1, const char *s, ssize_t len);
 
138
char       *schema_strcat1(char *buf, const char *fmt, const char *s1,
 
139
                                const char *s, ssize_t len,
130
140
                                const char *, int, ConnectionClass *conn);
 
141
int                     snprintf_add(char *buf, size_t size, const char *format, ...);
 
142
size_t                  snprintf_len(char *buf, size_t size, const char *format, ...);
131
143
/* #define      GET_SCHEMA_NAME(nspname)        (stricmp(nspname, "public") ? nspname : "") */
132
144
#define GET_SCHEMA_NAME(nspname)        (nspname)
133
145
 
137
149
#define STRCPY_TRUNCATED        (-1)
138
150
#define STRCPY_NULL                     (-2)
139
151
 
140
 
int     my_strcpy(char *dst, int dst_len, const char *src, int src_len);
141
 
int     contains_token(char *data, char *token);
 
152
ssize_t                 my_strcpy(char *dst, ssize_t dst_len, const char *src, ssize_t src_len);
142
153
 
143
154
/* Define a type for defining a constant string expression */
144
155
#define CSTR static const char * const
145
156
 
 
157
#ifdef __cplusplus
 
158
}
146
159
#endif
 
160
#endif /* __MISC_H__ */