30
30
#endif
31
31
#include <fcntl.h>
32
32
33
- #if DBA_CDB_BUILTIN
33
+ #ifdef DBA_CDB_BUILTIN
34
34
# include "libcdb/cdb.h"
35
35
# include "libcdb/cdb_make.h"
36
36
# include "libcdb/uint32.h"
45
45
46
46
typedef struct {
47
47
struct cdb c ;
48
- #if DBA_CDB_BUILTIN
48
+ #ifdef DBA_CDB_BUILTIN
49
49
struct cdb_make m ;
50
50
php_stream * file ;
51
51
int make ;
@@ -58,7 +58,7 @@ typedef struct {
58
58
59
59
DBA_OPEN_FUNC (cdb )
60
60
{
61
- #if DBA_CDB_BUILTIN
61
+ #ifdef DBA_CDB_BUILTIN
62
62
php_stream * file = 0 ;
63
63
int make ;
64
64
#else
@@ -69,7 +69,7 @@ DBA_OPEN_FUNC(cdb)
69
69
70
70
switch (info -> mode ) {
71
71
case DBA_READER :
72
- #if DBA_CDB_BUILTIN
72
+ #ifdef DBA_CDB_BUILTIN
73
73
make = 0 ;
74
74
file = info -> fp ;
75
75
#else
@@ -80,7 +80,7 @@ DBA_OPEN_FUNC(cdb)
80
80
}
81
81
#endif
82
82
break ;
83
- #if DBA_CDB_BUILTIN
83
+ #ifdef DBA_CDB_BUILTIN
84
84
case DBA_TRUNC :
85
85
make = 1 ;
86
86
file = info -> fp ;
@@ -98,7 +98,7 @@ DBA_OPEN_FUNC(cdb)
98
98
cdb = pemalloc (sizeof (dba_cdb ), info -> flags & DBA_PERSISTENT );
99
99
memset (cdb , 0 , sizeof (dba_cdb ));
100
100
101
- #if DBA_CDB_BUILTIN
101
+ #ifdef DBA_CDB_BUILTIN
102
102
if (make ) {
103
103
cdb_make_start (& cdb -> m , file );
104
104
} else {
@@ -119,7 +119,7 @@ DBA_CLOSE_FUNC(cdb)
119
119
CDB_INFO ;
120
120
121
121
/* cdb_free does not close associated file */
122
- #if DBA_CDB_BUILTIN
122
+ #ifdef DBA_CDB_BUILTIN
123
123
if (cdb -> make ) {
124
124
cdb_make_finish (& cdb -> m );
125
125
} else {
@@ -132,7 +132,7 @@ DBA_CLOSE_FUNC(cdb)
132
132
pefree (cdb , info -> flags & DBA_PERSISTENT );
133
133
}
134
134
135
- #if DBA_CDB_BUILTIN
135
+ #ifdef DBA_CDB_BUILTIN
136
136
# define php_cdb_read (cdb , buf , len , pos ) cdb_read(cdb, buf, len, pos)
137
137
# define php_cdb_findnext (cdb , key , len ) cdb_findnext(cdb, key, len)
138
138
# define php_cdb_find (cdb , key , len ) cdb_find(cdb, key, len)
@@ -148,7 +148,7 @@ DBA_FETCH_FUNC(cdb)
148
148
zend_string * fetched_val = NULL ;
149
149
unsigned int len ;
150
150
151
- #if DBA_CDB_BUILTIN
151
+ #ifdef DBA_CDB_BUILTIN
152
152
if (cdb -> make )
153
153
return NULL ; /* database was opened writeonly */
154
154
#endif
@@ -173,7 +173,7 @@ DBA_FETCH_FUNC(cdb)
173
173
174
174
DBA_UPDATE_FUNC (cdb )
175
175
{
176
- #if DBA_CDB_BUILTIN
176
+ #ifdef DBA_CDB_BUILTIN
177
177
CDB_INFO ;
178
178
179
179
if (!cdb -> make )
@@ -190,7 +190,7 @@ DBA_EXISTS_FUNC(cdb)
190
190
{
191
191
CDB_INFO ;
192
192
193
- #if DBA_CDB_BUILTIN
193
+ #ifdef DBA_CDB_BUILTIN
194
194
if (cdb -> make )
195
195
return FAILURE ; /* database was opened writeonly */
196
196
#endif
@@ -205,7 +205,7 @@ DBA_DELETE_FUNC(cdb)
205
205
}
206
206
207
207
/* {{{ cdb_file_read */
208
- #if DBA_CDB_BUILTIN
208
+ #ifdef DBA_CDB_BUILTIN
209
209
# define cdb_file_read (fildes , buf , size ) php_stream_read(fildes, buf, size)
210
210
#else
211
211
# define cdb_file_read (fildes , buf , size ) read(fildes, buf, size)
@@ -218,7 +218,7 @@ DBA_DELETE_FUNC(cdb)
218
218
219
219
/* {{{ cdb_file_lseek
220
220
php_stream_seek does not return actual position */
221
- #if DBA_CDB_BUILTIN
221
+ #ifdef DBA_CDB_BUILTIN
222
222
zend_off_t cdb_file_lseek (php_stream * fp , zend_off_t offset , int whence ) {
223
223
php_stream_seek (fp , offset , whence );
224
224
return php_stream_tell (fp );
@@ -243,7 +243,7 @@ DBA_FIRSTKEY_FUNC(cdb)
243
243
char buf [8 ];
244
244
zend_string * key ;
245
245
246
- #if DBA_CDB_BUILTIN
246
+ #ifdef DBA_CDB_BUILTIN
247
247
if (cdb -> make )
248
248
return NULL ; /* database was opened writeonly */
249
249
#endif
@@ -283,7 +283,7 @@ DBA_NEXTKEY_FUNC(cdb)
283
283
char buf [8 ];
284
284
zend_string * key ;
285
285
286
- #if DBA_CDB_BUILTIN
286
+ #ifdef DBA_CDB_BUILTIN
287
287
if (cdb -> make )
288
288
return NULL ; /* database was opened writeonly */
289
289
#endif
@@ -319,7 +319,7 @@ DBA_SYNC_FUNC(cdb)
319
319
320
320
DBA_INFO_FUNC (cdb )
321
321
{
322
- #if DBA_CDB_BUILTIN
322
+ #ifdef DBA_CDB_BUILTIN
323
323
if (!strcmp (hnd -> name , "cdb" )) {
324
324
return estrdup (cdb_version ());
325
325
} else {
0 commit comments