summaryrefslogtreecommitdiff
path: root/ext/dba/libcdb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dba/libcdb')
-rw-r--r--ext/dba/libcdb/cdb.c32
-rw-r--r--ext/dba/libcdb/cdb.h12
-rw-r--r--ext/dba/libcdb/cdb_make.c28
-rw-r--r--ext/dba/libcdb/cdb_make.h10
4 files changed, 41 insertions, 41 deletions
diff --git a/ext/dba/libcdb/cdb.c b/ext/dba/libcdb/cdb.c
index c8caf8b8f2..d6578d017d 100644
--- a/ext/dba/libcdb/cdb.c
+++ b/ext/dba/libcdb/cdb.c
@@ -43,7 +43,7 @@
#endif
/* {{{ cdb_match */
-static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos TSRMLS_DC)
+static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos)
{
char buf[32];
unsigned int n;
@@ -52,7 +52,7 @@ static int cdb_match(struct cdb *c, char *key, unsigned int len, uint32 pos TSRM
n = sizeof(buf);
if (n > len)
n = len;
- if (cdb_read(c, buf, n, pos TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, n, pos) == -1)
return -1;
if (memcmp(buf, key, n))
return 0;
@@ -79,29 +79,29 @@ uint32 cdb_hash(char *buf, unsigned int len)
/* }}} */
/* {{{ cdb_free */
-void cdb_free(struct cdb *c TSRMLS_DC)
+void cdb_free(struct cdb *c)
{
}
/* }}} */
/* {{{ cdb_findstart */
-void cdb_findstart(struct cdb *c TSRMLS_DC)
+void cdb_findstart(struct cdb *c)
{
c->loop = 0;
}
/* }}} */
/* {{{ cdb_init */
-void cdb_init(struct cdb *c, php_stream *fp TSRMLS_DC)
+void cdb_init(struct cdb *c, php_stream *fp)
{
- cdb_free(c TSRMLS_CC);
- cdb_findstart(c TSRMLS_CC);
+ cdb_free(c);
+ cdb_findstart(c);
c->fp = fp;
}
/* }}} */
/* {{{ cdb_read */
-int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos TSRMLS_DC)
+int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos)
{
if (php_stream_seek(c->fp, pos, SEEK_SET) == -1) {
errno = EPROTO;
@@ -126,7 +126,7 @@ int cdb_read(struct cdb *c, char *buf, unsigned int len, uint32 pos TSRMLS_DC)
/* }}} */
/* {{{ cdb_findnext */
-int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
+int cdb_findnext(struct cdb *c, char *key, unsigned int len)
{
char buf[8];
uint32 pos;
@@ -134,7 +134,7 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
if (!c->loop) {
u = cdb_hash(key, len);
- if (cdb_read(c, buf, 8, (u << 3) & 2047 TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, 8, (u << 3) & 2047) == -1)
return -1;
uint32_unpack(buf + 4,&c->hslots);
if (!c->hslots)
@@ -148,7 +148,7 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
}
while (c->loop < c->hslots) {
- if (cdb_read(c, buf, 8, c->kpos TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, 8, c->kpos) == -1)
return -1;
uint32_unpack(buf + 4, &pos);
if (!pos)
@@ -159,11 +159,11 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
c->kpos = c->hpos;
uint32_unpack(buf, &u);
if (u == c->khash) {
- if (cdb_read(c, buf, 8, pos TSRMLS_CC) == -1)
+ if (cdb_read(c, buf, 8, pos) == -1)
return -1;
uint32_unpack(buf, &u);
if (u == len)
- switch(cdb_match(c, key, len, pos + 8 TSRMLS_CC)) {
+ switch(cdb_match(c, key, len, pos + 8)) {
case -1:
return -1;
case 1:
@@ -179,10 +179,10 @@ int cdb_findnext(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
/* }}} */
/* {{{ cdb_find */
-int cdb_find(struct cdb *c, char *key, unsigned int len TSRMLS_DC)
+int cdb_find(struct cdb *c, char *key, unsigned int len)
{
- cdb_findstart(c TSRMLS_CC);
- return cdb_findnext(c, key, len TSRMLS_CC);
+ cdb_findstart(c);
+ return cdb_findnext(c, key, len);
}
/* }}} */
diff --git a/ext/dba/libcdb/cdb.h b/ext/dba/libcdb/cdb.h
index 4b4a7ff2ff..8c281fe5fe 100644
--- a/ext/dba/libcdb/cdb.h
+++ b/ext/dba/libcdb/cdb.h
@@ -40,14 +40,14 @@ struct cdb {
uint32 cdb_hash(char *, unsigned int);
-void cdb_free(struct cdb * TSRMLS_DC);
-void cdb_init(struct cdb *, php_stream *fp TSRMLS_DC);
+void cdb_free(struct cdb *);
+void cdb_init(struct cdb *, php_stream *fp);
-int cdb_read(struct cdb *, char *, unsigned int, uint32 TSRMLS_DC);
+int cdb_read(struct cdb *, char *, unsigned int, uint32);
-void cdb_findstart(struct cdb * TSRMLS_DC);
-int cdb_findnext(struct cdb *, char *, unsigned int TSRMLS_DC);
-int cdb_find(struct cdb *, char *, unsigned int TSRMLS_DC);
+void cdb_findstart(struct cdb *);
+int cdb_findnext(struct cdb *, char *, unsigned int);
+int cdb_find(struct cdb *, char *, unsigned int);
#define cdb_datapos(c) ((c)->dpos)
#define cdb_datalen(c) ((c)->dlen)
diff --git a/ext/dba/libcdb/cdb_make.c b/ext/dba/libcdb/cdb_make.c
index b6236f085e..3be1157769 100644
--- a/ext/dba/libcdb/cdb_make.c
+++ b/ext/dba/libcdb/cdb_make.c
@@ -38,7 +38,7 @@
#include "uint32.h"
/* {{{ cdb_make_write */
-static int cdb_make_write(struct cdb_make *c, char *buf, uint32 sz TSRMLS_DC) {
+static int cdb_make_write(struct cdb_make *c, char *buf, uint32 sz) {
return php_stream_write(c->fp, buf, sz) == sz ? 0 : -1;
}
@@ -56,7 +56,7 @@ static int cdb_posplus(struct cdb_make *c, uint32 len)
/* }}} */
/* {{{ cdb_make_start */
-int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC)
+int cdb_make_start(struct cdb_make *c, php_stream * f)
{
c->head = 0;
c->split = 0;
@@ -65,7 +65,7 @@ int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC)
c->fp = f;
c->pos = sizeof(c->final);
if (php_stream_seek(f, c->pos, SEEK_SET) == -1) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Fseek failed");
+ php_error_docref(NULL, E_NOTICE, "Fseek failed");
return -1;
}
return php_stream_tell(c->fp);
@@ -73,7 +73,7 @@ int cdb_make_start(struct cdb_make *c, php_stream * f TSRMLS_DC)
/* }}} */
/* {{{ cdb_make_addend */
-int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datalen, uint32 h TSRMLS_DC)
+int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datalen, uint32 h)
{
struct cdb_hplist *head;
@@ -101,7 +101,7 @@ int cdb_make_addend(struct cdb_make *c, unsigned int keylen, unsigned int datale
/* }}} */
/* {{{ cdb_make_addbegin */
-int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int datalen TSRMLS_DC)
+int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int datalen)
{
char buf[8];
@@ -116,26 +116,26 @@ int cdb_make_addbegin(struct cdb_make *c, unsigned int keylen, unsigned int data
uint32_pack(buf, keylen);
uint32_pack(buf + 4, datalen);
- if (cdb_make_write(c, buf, 8 TSRMLS_CC) != 0)
+ if (cdb_make_write(c, buf, 8) != 0)
return -1;
return 0;
}
/* {{{ cdb_make_add */
-int cdb_make_add(struct cdb_make *c,char *key,unsigned int keylen,char *data,unsigned int datalen TSRMLS_DC)
+int cdb_make_add(struct cdb_make *c,char *key,unsigned int keylen,char *data,unsigned int datalen)
{
- if (cdb_make_addbegin(c, keylen, datalen TSRMLS_CC) == -1)
+ if (cdb_make_addbegin(c, keylen, datalen) == -1)
return -1;
- if (cdb_make_write(c, key, keylen TSRMLS_CC) != 0)
+ if (cdb_make_write(c, key, keylen) != 0)
return -1;
- if (cdb_make_write(c, data, datalen TSRMLS_CC) != 0)
+ if (cdb_make_write(c, data, datalen) != 0)
return -1;
- return cdb_make_addend(c, keylen, datalen, cdb_hash(key, keylen) TSRMLS_CC);
+ return cdb_make_addend(c, keylen, datalen, cdb_hash(key, keylen));
}
/* }}} */
/* {{{ cdb_make_finish */
-int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
+int cdb_make_finish(struct cdb_make *c)
{
char buf[8];
int i;
@@ -211,7 +211,7 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
for (u = 0;u < len;++u) {
uint32_pack(buf, c->hash[u].h);
uint32_pack(buf + 4, c->hash[u].p);
- if (cdb_make_write(c, buf, 8 TSRMLS_CC) != 0)
+ if (cdb_make_write(c, buf, 8) != 0)
return -1;
if (cdb_posplus(c, 8) == -1)
return -1;
@@ -231,7 +231,7 @@ int cdb_make_finish(struct cdb_make *c TSRMLS_DC)
php_stream_rewind(c->fp);
if (php_stream_tell(c->fp) != 0)
return -1;
- if (cdb_make_write(c, c->final, sizeof(c->final) TSRMLS_CC) != 0)
+ if (cdb_make_write(c, c->final, sizeof(c->final)) != 0)
return -1;
return php_stream_flush(c->fp);
}
diff --git a/ext/dba/libcdb/cdb_make.h b/ext/dba/libcdb/cdb_make.h
index d33fcb15da..a9a0e85143 100644
--- a/ext/dba/libcdb/cdb_make.h
+++ b/ext/dba/libcdb/cdb_make.h
@@ -54,11 +54,11 @@ struct cdb_make {
php_stream * fp;
};
-int cdb_make_start(struct cdb_make *, php_stream * TSRMLS_DC);
-int cdb_make_addbegin(struct cdb_make *, unsigned int, unsigned int TSRMLS_DC);
-int cdb_make_addend(struct cdb_make *, unsigned int, unsigned int, uint32 TSRMLS_DC);
-int cdb_make_add(struct cdb_make *, char *, unsigned int, char *, unsigned int TSRMLS_DC);
-int cdb_make_finish(struct cdb_make * TSRMLS_DC);
+int cdb_make_start(struct cdb_make *, php_stream *);
+int cdb_make_addbegin(struct cdb_make *, unsigned int, unsigned int);
+int cdb_make_addend(struct cdb_make *, unsigned int, unsigned int, uint32);
+int cdb_make_add(struct cdb_make *, char *, unsigned int, char *, unsigned int);
+int cdb_make_finish(struct cdb_make *);
char *cdb_make_version();
#endif