diff options
Diffstat (limited to 'ext/dba')
-rw-r--r-- | ext/dba/dba.c | 124 | ||||
-rw-r--r-- | ext/dba/dba_cdb.c | 22 | ||||
-rw-r--r-- | ext/dba/dba_db2.c | 2 | ||||
-rw-r--r-- | ext/dba/dba_db3.c | 5 | ||||
-rw-r--r-- | ext/dba/dba_db4.c | 7 | ||||
-rw-r--r-- | ext/dba/dba_dbm.c | 2 | ||||
-rw-r--r-- | ext/dba/dba_flatfile.c | 16 | ||||
-rw-r--r-- | ext/dba/dba_gdbm.c | 4 | ||||
-rw-r--r-- | ext/dba/dba_inifile.c | 20 | ||||
-rw-r--r-- | ext/dba/dba_qdbm.c | 2 | ||||
-rw-r--r-- | ext/dba/dba_tcadb.c | 2 | ||||
-rw-r--r-- | ext/dba/libcdb/cdb.c | 32 | ||||
-rw-r--r-- | ext/dba/libcdb/cdb.h | 12 | ||||
-rw-r--r-- | ext/dba/libcdb/cdb_make.c | 28 | ||||
-rw-r--r-- | ext/dba/libcdb/cdb_make.h | 10 | ||||
-rw-r--r-- | ext/dba/libflatfile/flatfile.c | 26 | ||||
-rw-r--r-- | ext/dba/libflatfile/flatfile.h | 12 | ||||
-rw-r--r-- | ext/dba/libinifile/inifile.c | 100 | ||||
-rw-r--r-- | ext/dba/libinifile/inifile.h | 18 | ||||
-rw-r--r-- | ext/dba/php_dba.h | 44 |
20 files changed, 243 insertions, 245 deletions
diff --git a/ext/dba/dba.c b/ext/dba/dba.c index de4ea4c464..2ca9092e65 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -200,7 +200,7 @@ ZEND_GET_MODULE(dba) /* these are used to get the standard arguments */ /* {{{ php_dba_myke_key */ -static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS_DC) +static size_t php_dba_make_key(zval *key, char **key_str, char **key_free) { if (Z_TYPE_P(key) == IS_ARRAY) { zval *group, *name; @@ -208,7 +208,7 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS size_t len; if (zend_hash_num_elements(Z_ARRVAL_P(key)) != 2) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)"); + php_error_docref(NULL, E_RECOVERABLE_ERROR, "Key does not have exactly two elements: (key, name)"); return -1; } zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(key), &pos); @@ -245,10 +245,10 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS zval *key; \ char *key_str, *key_free; \ size_t key_len; \ - if (zend_parse_parameters(ac TSRMLS_CC, "zr", &key, &id) == FAILURE) { \ + if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) { \ return; \ } \ - if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\ + if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {\ RETURN_FALSE; \ } @@ -259,19 +259,19 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS zend_long skip = 0; \ switch(ac) { \ case 2: \ - if (zend_parse_parameters(ac TSRMLS_CC, "zr", &key, &id) == FAILURE) { \ + if (zend_parse_parameters(ac, "zr", &key, &id) == FAILURE) { \ return; \ } \ break; \ case 3: \ - if (zend_parse_parameters(ac TSRMLS_CC, "zlr", &key, &skip, &id) == FAILURE) { \ + if (zend_parse_parameters(ac, "zlr", &key, &skip, &id) == FAILURE) { \ return; \ } \ break; \ default: \ WRONG_PARAM_COUNT; \ } \ - if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) {\ + if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) {\ RETURN_FALSE; \ } @@ -298,14 +298,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS /* check whether the user has write access */ #define DBA_WRITE_CHECK \ if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \ + php_error_docref(NULL, E_WARNING, "You cannot perform a modification to a database without proper access"); \ RETURN_FALSE; \ } /* the same check, but with a call to DBA_ID_DONE before returning */ #define DBA_WRITE_CHECK_WITH_ID \ if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \ + php_error_docref(NULL, E_WARNING, "You cannot perform a modification to a database without proper access"); \ DBA_ID_DONE; \ RETURN_FALSE; \ } @@ -387,7 +387,7 @@ static int le_pdb; /* }}} */ /* {{{ dba_fetch_resource -PHPAPI void dba_fetch_resource(dba_info **pinfo, zval **id TSRMLS_DC) +PHPAPI void dba_fetch_resource(dba_info **pinfo, zval **id) { dba_info *info; DBA_ID_FETCH @@ -408,10 +408,10 @@ PHPAPI dba_handler *dba_get_handler(const char* handler_name) /* {{{ dba_close */ -static void dba_close(dba_info *info TSRMLS_DC) +static void dba_close(dba_info *info) { if (info->hnd) { - info->hnd->close(info TSRMLS_CC); + info->hnd->close(info); } if (info->path) { pefree(info->path, info->flags&DBA_PERSISTENT); @@ -439,28 +439,28 @@ static void dba_close(dba_info *info TSRMLS_DC) /* {{{ dba_close_rsrc */ -static void dba_close_rsrc(zend_resource *rsrc TSRMLS_DC) +static void dba_close_rsrc(zend_resource *rsrc) { dba_info *info = (dba_info *)rsrc->ptr; - dba_close(info TSRMLS_CC); + dba_close(info); } /* }}} */ /* {{{ dba_close_pe_rsrc_deleter */ -int dba_close_pe_rsrc_deleter(zval *el, void *pDba TSRMLS_DC) +int dba_close_pe_rsrc_deleter(zval *el, void *pDba) { return ((zend_resource *)Z_PTR_P(el))->ptr == pDba ? ZEND_HASH_APPLY_REMOVE: ZEND_HASH_APPLY_KEEP; } /* }}} */ /* {{{ dba_close_pe_rsrc */ -static void dba_close_pe_rsrc(zend_resource *rsrc TSRMLS_DC) +static void dba_close_pe_rsrc(zend_resource *rsrc) { dba_info *info = (dba_info *)rsrc->ptr; /* closes the resource by calling dba_close_rsrc() */ - zend_hash_apply_with_argument(&EG(persistent_list), dba_close_pe_rsrc_deleter, info TSRMLS_CC); + zend_hash_apply_with_argument(&EG(persistent_list), dba_close_pe_rsrc_deleter, info); } /* }}} */ @@ -472,17 +472,17 @@ ZEND_INI_MH(OnUpdateDefaultHandler) if (!new_value->len) { DBA_G(default_hptr) = NULL; - return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage); } for (hptr = handler; hptr->name && strcasecmp(hptr->name, new_value->val); hptr++); if (!hptr->name) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No such handler: %s", new_value->val); + php_error_docref(NULL, E_WARNING, "No such handler: %s", new_value->val); return FAILURE; } DBA_G(default_hptr) = hptr; - return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage); } PHP_INI_BEGIN() @@ -560,11 +560,11 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) char *key_str, *key_free; size_t key_len; - if (zend_parse_parameters(ac TSRMLS_CC, "zsr", &key, &val, &val_len, &id) == FAILURE) { + if (zend_parse_parameters(ac, "zsr", &key, &val, &val_len, &id) == FAILURE) { return; } - if ((key_len = php_dba_make_key(key, &key_str, &key_free TSRMLS_CC)) == 0) { + if ((key_len = php_dba_make_key(key, &key_str, &key_free)) == 0) { RETURN_FALSE; } @@ -572,7 +572,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) DBA_WRITE_CHECK_WITH_ID; - if (info->hnd->update(info, key_str, key_len, val, val_len, mode TSRMLS_CC) == SUCCESS) { + if (info->hnd->update(info, key_str, key_len, val, val_len, mode) == SUCCESS) { DBA_ID_DONE; RETURN_TRUE; } @@ -586,7 +586,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ php_find_dbm */ -dba_info *php_dba_find(const char* path TSRMLS_DC) +dba_info *php_dba_find(const char* path) { zend_resource *le; dba_info *info; @@ -681,7 +681,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) if (ac==2) { hptr = DBA_G(default_hptr); if (!hptr) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No default handler selected"); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No default handler selected"); FREENOW; RETURN_FALSE; } @@ -690,7 +690,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) } if (!hptr->name) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No such handler: %s", Z_STRVAL(args[2])); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "No such handler: %s", Z_STRVAL(args[2])); FREENOW; RETURN_FALSE; } @@ -721,13 +721,13 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) case 'l': lock_flag = DBA_LOCK_ALL; if ((hptr->flags & DBA_LOCK_ALL) == 0) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_NOTICE, "Handler %s does locking internally", hptr->name); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_NOTICE, "Handler %s does locking internally", hptr->name); } break; default: case '-': if ((hptr->flags & DBA_LOCK_ALL) == 0) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Locking cannot be disabled for handler %s", hptr->name); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Locking cannot be disabled for handler %s", hptr->name); FREENOW; RETURN_FALSE; } @@ -776,7 +776,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) file_mode = "w+b"; break; default: - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode"); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode"); FREENOW; RETURN_FALSE; } @@ -789,17 +789,17 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) if (*pmode=='t') { pmode++; if (!lock_flag) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)"); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "You cannot combine modifiers - (no lock) and t (test lock)"); FREENOW; RETURN_FALSE; } if (!lock_mode) { if ((hptr->flags & DBA_LOCK_ALL) == 0) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s uses its own locking which doesn't support mode modifier t (test lock)", hptr->name); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s uses its own locking which doesn't support mode modifier t (test lock)", hptr->name); FREENOW; RETURN_FALSE; } else { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (test lock) obsolete", hptr->name); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Handler %s doesn't uses locking for this mode which makes modifier t (test lock) obsolete", hptr->name); FREENOW; RETURN_FALSE; } @@ -808,7 +808,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) } } if (*pmode) { - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode"); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Illegal DBA mode"); FREENOW; RETURN_FALSE; } @@ -827,7 +827,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) * the problem is some systems would allow read during write */ if (hptr->flags & DBA_LOCK_ALL) { - if ((other = php_dba_find(info->path TSRMLS_CC)) != NULL) { + if ((other = php_dba_find(info->path)) != NULL) { if ( ( (lock_mode&LOCK_EX) && (other->lock.mode&(LOCK_EX|LOCK_SH)) ) || ( (other->lock.mode&LOCK_EX) && (lock_mode&(LOCK_EX|LOCK_SH)) ) ) { @@ -882,7 +882,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) efree(lock_name); } if (!info->lock.fp) { - dba_close(info TSRMLS_CC); + dba_close(info); /* stream operation already wrote an error message */ FREENOW; RETURN_FALSE; @@ -903,7 +903,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) info->fp = php_stream_open_wrapper(info->path, file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|persistent_flag, NULL); } if (!info->fp) { - dba_close(info TSRMLS_CC); + dba_close(info); /* stream operation already wrote an error message */ FREENOW; RETURN_FALSE; @@ -913,8 +913,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) * file contents with O_APPEND being set. */ if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&info->fd, 1)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not cast stream"); - dba_close(info TSRMLS_CC); + php_error_docref(NULL, E_WARNING, "Could not cast stream"); + dba_close(info); FREENOW; RETURN_FALSE; #ifdef F_SETFL @@ -927,9 +927,9 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) } } - if (error || hptr->open(info, &error TSRMLS_CC) != SUCCESS) { - dba_close(info TSRMLS_CC); - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", hptr->name, error?": ":"", error?error:""); + if (error || hptr->open(info, &error) != SUCCESS) { + dba_close(info); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Driver initialization failed for handler: %s%s%s", hptr->name, error?": ":"", error?error:""); FREENOW; RETURN_FALSE; } @@ -944,8 +944,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) new_le.type = le_pdb; new_le.ptr = info; if (zend_hash_str_update_mem(&EG(persistent_list), key, keylen, &new_le, sizeof(zend_resource)) == NULL) { - dba_close(info TSRMLS_CC); - php_error_docref2(NULL TSRMLS_CC, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Could not register persistent resource"); + dba_close(info); + php_error_docref2(NULL, Z_STRVAL(args[0]), Z_STRVAL(args[1]), E_WARNING, "Could not register persistent resource"); FREENOW; RETURN_FALSE; } @@ -980,7 +980,7 @@ PHP_FUNCTION(dba_close) zval *id; dba_info *info = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) { return; } @@ -996,7 +996,7 @@ PHP_FUNCTION(dba_exists) { DBA_ID_GET2; - if(info->hnd->exists(info, key_str, key_len TSRMLS_CC) == SUCCESS) { + if(info->hnd->exists(info, key_str, key_len) == SUCCESS) { DBA_ID_DONE; RETURN_TRUE; } @@ -1016,7 +1016,7 @@ PHP_FUNCTION(dba_fetch) if (ac==3) { if (!strcmp(info->hnd->name, "cdb")) { if (skip < 0) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s accepts only skip values greater than or equal to zero, using skip=0", info->hnd->name); + php_error_docref(NULL, E_NOTICE, "Handler %s accepts only skip values greater than or equal to zero, using skip=0", info->hnd->name); skip = 0; } } else if (!strcmp(info->hnd->name, "inifile")) { @@ -1027,17 +1027,17 @@ PHP_FUNCTION(dba_fetch) * value to 0 ensures the first value. */ if (skip < -1) { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s accepts only skip value -1 and greater, using skip=0", info->hnd->name); + php_error_docref(NULL, E_NOTICE, "Handler %s accepts only skip value -1 and greater, using skip=0", info->hnd->name); skip = 0; } } else { - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Handler %s does not support optional skip parameter, the value will be ignored", info->hnd->name); + php_error_docref(NULL, E_NOTICE, "Handler %s does not support optional skip parameter, the value will be ignored", info->hnd->name); skip = 0; } } else { skip = 0; } - if((val = info->hnd->fetch(info, key_str, key_len, skip, &len TSRMLS_CC)) != NULL) { + if((val = info->hnd->fetch(info, key_str, key_len, skip, &len)) != NULL) { DBA_ID_DONE; RETVAL_STRINGL(val, len); efree(val); @@ -1059,12 +1059,12 @@ PHP_FUNCTION(dba_key_split) if (ZEND_NUM_ARGS() != 1) { WRONG_PARAM_COUNT; } - if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "z", &zkey) == SUCCESS) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS(), "z", &zkey) == SUCCESS) { if (Z_TYPE_P(zkey) == IS_NULL || (Z_TYPE_P(zkey) == IS_FALSE)) { RETURN_BOOL(0); } } - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &key, &key_len) == FAILURE) { RETURN_BOOL(0); } array_init(return_value); @@ -1087,13 +1087,13 @@ PHP_FUNCTION(dba_firstkey) zval *id; dba_info *info = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) { return; } DBA_FETCH_RESOURCE(info, id); - fkey = info->hnd->firstkey(info, &len TSRMLS_CC); + fkey = info->hnd->firstkey(info, &len); if (fkey) { RETVAL_STRINGL(fkey, len); @@ -1114,13 +1114,13 @@ PHP_FUNCTION(dba_nextkey) zval *id; dba_info *info = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) { return; } DBA_FETCH_RESOURCE(info, id); - nkey = info->hnd->nextkey(info, &len TSRMLS_CC); + nkey = info->hnd->nextkey(info, &len); if (nkey) { RETVAL_STRINGL(nkey, len); @@ -1141,7 +1141,7 @@ PHP_FUNCTION(dba_delete) DBA_WRITE_CHECK_WITH_ID; - if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS) + if(info->hnd->delete(info, key_str, key_len) == SUCCESS) { DBA_ID_DONE; RETURN_TRUE; @@ -1176,7 +1176,7 @@ PHP_FUNCTION(dba_optimize) zval *id; dba_info *info = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) { return; } @@ -1184,7 +1184,7 @@ PHP_FUNCTION(dba_optimize) DBA_WRITE_CHECK; - if (info->hnd->optimize(info TSRMLS_CC) == SUCCESS) { + if (info->hnd->optimize(info) == SUCCESS) { RETURN_TRUE; } @@ -1199,13 +1199,13 @@ PHP_FUNCTION(dba_sync) zval *id; dba_info *info = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &id) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &id) == FAILURE) { return; } DBA_FETCH_RESOURCE(info, id); - if (info->hnd->sync(info TSRMLS_CC) == SUCCESS) { + if (info->hnd->sync(info) == SUCCESS) { RETURN_TRUE; } @@ -1220,7 +1220,7 @@ PHP_FUNCTION(dba_handlers) dba_handler *hptr; zend_bool full_info = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &full_info) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|b", &full_info) == FAILURE) { RETURN_FALSE; } @@ -1229,7 +1229,7 @@ PHP_FUNCTION(dba_handlers) for(hptr = handler; hptr->name; hptr++) { if (full_info) { // TODO: avoid reallocation ??? - char *str = hptr->info(hptr, NULL TSRMLS_CC); + char *str = hptr->info(hptr, NULL); add_assoc_string(return_value, hptr->name, str); efree(str); } else { diff --git a/ext/dba/dba_cdb.c b/ext/dba/dba_cdb.c index 17419dcf2e..deab119861 100644 --- a/ext/dba/dba_cdb.c +++ b/ext/dba/dba_cdb.c @@ -104,9 +104,9 @@ DBA_OPEN_FUNC(cdb) #if DBA_CDB_BUILTIN if (make) { - cdb_make_start(&cdb->m, file TSRMLS_CC); + cdb_make_start(&cdb->m, file); } else { - cdb_init(&cdb->c, file TSRMLS_CC); + cdb_init(&cdb->c, file); } cdb->make = make; #else @@ -125,9 +125,9 @@ DBA_CLOSE_FUNC(cdb) /* cdb_free does not close associated file */ #if DBA_CDB_BUILTIN if (cdb->make) { - cdb_make_finish(&cdb->m TSRMLS_CC); + cdb_make_finish(&cdb->m); } else { - cdb_free(&cdb->c TSRMLS_CC); + cdb_free(&cdb->c); } #else cdb_free(&cdb->c); @@ -137,9 +137,9 @@ DBA_CLOSE_FUNC(cdb) } #if DBA_CDB_BUILTIN -# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos TSRMLS_CC) -# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len TSRMLS_CC) -# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len TSRMLS_CC) +# define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos) +# define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len) +# define php_cdb_find(cdb, key, len) cdb_find(cdb, key, len) #else # define php_cdb_read(cdb, buf, len, pos) cdb_read(cdb, buf, len, pos) # define php_cdb_findnext(cdb, key, len) cdb_findnext(cdb, key, len) @@ -186,7 +186,7 @@ DBA_UPDATE_FUNC(cdb) return FAILURE; /* database was opened readonly */ if (!mode) return FAILURE; /* cdb_make dosn't know replace */ - if (cdb_make_add(&cdb->m, key, keylen, val, vallen TSRMLS_CC) != -1) + if (cdb_make_add(&cdb->m, key, keylen, val, vallen) != -1) return SUCCESS; #endif return FAILURE; @@ -225,12 +225,12 @@ DBA_DELETE_FUNC(cdb) /* {{{ cdb_file_lseek php_stream_seek does not return actual position */ #if DBA_CDB_BUILTIN -int cdb_file_lseek(php_stream *fp, off_t offset, int whence TSRMLS_DC) { +int cdb_file_lseek(php_stream *fp, off_t offset, int whence) { php_stream_seek(fp, offset, whence); return php_stream_tell(fp); } #else -int cdb_file_lseek(int fd, off_t offset, int whence TSRMLS_DC) { +int cdb_file_lseek(int fd, off_t offset, int whence) { return lseek(fd, offset, whence); } #endif @@ -238,7 +238,7 @@ int cdb_file_lseek(int fd, off_t offset, int whence TSRMLS_DC) { #define CSEEK(n) do { \ if (n >= cdb->eod) return NULL; \ - if (cdb_file_lseek(cdb->file, (off_t)n, SEEK_SET TSRMLS_CC) != (off_t) n) return NULL; \ + if (cdb_file_lseek(cdb->file, (off_t)n, SEEK_SET) != (off_t) n) return NULL; \ } while (0) diff --git a/ext/dba/dba_db2.c b/ext/dba/dba_db2.c index 6643eebcde..bde08427ee 100644 --- a/ext/dba/dba_db2.c +++ b/ext/dba/dba_db2.c @@ -164,7 +164,7 @@ DBA_FIRSTKEY_FUNC(db2) } /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db2(info, newlen TSRMLS_CC); + return dba_nextkey_db2(info, newlen); } DBA_NEXTKEY_FUNC(db2) diff --git a/ext/dba/dba_db3.c b/ext/dba/dba_db3.c index 3f31222d9e..5e8f1da4ad 100644 --- a/ext/dba/dba_db3.c +++ b/ext/dba/dba_db3.c @@ -37,9 +37,8 @@ static void php_dba_db3_errcall_fcn(const char *errpfx, char *msg) { - TSRMLS_FETCH(); - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg); + php_error_docref(NULL, E_NOTICE, "%s%s", errpfx?errpfx:"", msg); } #define DB3_DATA dba_db3_data *dba = info->dbf @@ -187,7 +186,7 @@ DBA_FIRSTKEY_FUNC(db3) } /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db3(info, newlen TSRMLS_CC); + return dba_nextkey_db3(info, newlen); } DBA_NEXTKEY_FUNC(db3) diff --git a/ext/dba/dba_db4.c b/ext/dba/dba_db4.c index a9752a7bf6..393c565b2a 100644 --- a/ext/dba/dba_db4.c +++ b/ext/dba/dba_db4.c @@ -42,13 +42,12 @@ static void php_dba_db4_errcall_fcn( #endif const char *errpfx, const char *msg) { - TSRMLS_FETCH(); #if (DB_VERSION_MAJOR == 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 8)) /* Bug 51086, Berkeley DB 4.8.26 */ /* This code suppresses a BDB 4.8+ error message, thus keeping PHP test compatibility */ { - const char *function = get_active_function_name(TSRMLS_C); + const char *function = get_active_function_name(); if (function && (!strcmp(function,"dba_popen") || !strcmp(function,"dba_open")) && (!strncmp(msg, "fop_read_meta", sizeof("fop_read_meta")-1) || !strncmp(msg, "BDB0004 fop_read_meta", sizeof("BDB0004 fop_read_meta")-1))) { @@ -57,7 +56,7 @@ static void php_dba_db4_errcall_fcn( } #endif - php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s%s", errpfx?errpfx:"", msg); + php_error_docref(NULL, E_NOTICE, "%s%s", errpfx?errpfx:"", msg); } #define DB4_DATA dba_db4_data *dba = info->dbf @@ -239,7 +238,7 @@ DBA_FIRSTKEY_FUNC(db4) } /* we should introduce something like PARAM_PASSTHRU... */ - return dba_nextkey_db4(info, newlen TSRMLS_CC); + return dba_nextkey_db4(info, newlen); } DBA_NEXTKEY_FUNC(db4) diff --git a/ext/dba/dba_dbm.c b/ext/dba/dba_dbm.c index b369f11c70..47a2e5a2af 100644 --- a/ext/dba/dba_dbm.c +++ b/ext/dba/dba_dbm.c @@ -195,7 +195,7 @@ DBA_INFO_FUNC(dbm) #if DBA_GDBM if (!strcmp(DBM_VERSION, "GDBM")) { - return dba_info_gdbm(hnd, info TSRMLS_CC); + return dba_info_gdbm(hnd, info); } #endif return estrdup(DBM_VERSION); diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c index 9be6e9be18..49f39cf2a8 100644 --- a/ext/dba/dba_flatfile.c +++ b/ext/dba/dba_flatfile.c @@ -67,7 +67,7 @@ DBA_FETCH_FUNC(flatfile) FLATFILE_DATA; FLATFILE_GKEY; - gval = flatfile_fetch(dba, gkey TSRMLS_CC); + gval = flatfile_fetch(dba, gkey); if (gval.dptr) { if (newlen) { *newlen = gval.dsize; @@ -87,16 +87,16 @@ DBA_UPDATE_FUNC(flatfile) gval.dptr = (char *) val; gval.dsize = vallen; - switch(flatfile_store(dba, gkey, gval, mode==1 ? FLATFILE_INSERT : FLATFILE_REPLACE TSRMLS_CC)) { + switch(flatfile_store(dba, gkey, gval, mode==1 ? FLATFILE_INSERT : FLATFILE_REPLACE)) { case 0: return SUCCESS; case 1: return FAILURE; case -1: - php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible"); + php_error_docref1(NULL, key, E_WARNING, "Operation not possible"); return FAILURE; default: - php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Unknown return value"); + php_error_docref2(NULL, key, val, E_WARNING, "Unknown return value"); return FAILURE; } } @@ -107,7 +107,7 @@ DBA_EXISTS_FUNC(flatfile) FLATFILE_DATA; FLATFILE_GKEY; - gval = flatfile_fetch(dba, gkey TSRMLS_CC); + gval = flatfile_fetch(dba, gkey); if (gval.dptr) { efree(gval.dptr); return SUCCESS; @@ -119,7 +119,7 @@ DBA_DELETE_FUNC(flatfile) { FLATFILE_DATA; FLATFILE_GKEY; - return(flatfile_delete(dba, gkey TSRMLS_CC) == -1 ? FAILURE : SUCCESS); + return(flatfile_delete(dba, gkey) == -1 ? FAILURE : SUCCESS); } DBA_FIRSTKEY_FUNC(flatfile) @@ -129,7 +129,7 @@ DBA_FIRSTKEY_FUNC(flatfile) if (dba->nextkey.dptr) { efree(dba->nextkey.dptr); } - dba->nextkey = flatfile_firstkey(dba TSRMLS_CC); + dba->nextkey = flatfile_firstkey(dba); if (dba->nextkey.dptr) { if (newlen) { *newlen = dba->nextkey.dsize; @@ -150,7 +150,7 @@ DBA_NEXTKEY_FUNC(flatfile) if (dba->nextkey.dptr) { efree(dba->nextkey.dptr); } - dba->nextkey = flatfile_nextkey(dba TSRMLS_CC); + dba->nextkey = flatfile_nextkey(dba); if (dba->nextkey.dptr) { if (newlen) { *newlen = dba->nextkey.dsize; diff --git a/ext/dba/dba_gdbm.c b/ext/dba/dba_gdbm.c index bea2f4cf58..5f2fd1076d 100644 --- a/ext/dba/dba_gdbm.c +++ b/ext/dba/dba_gdbm.c @@ -110,10 +110,10 @@ DBA_UPDATE_FUNC(gdbm) case 1: return FAILURE; case -1: - php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", gdbm_strerror(gdbm_errno)); + php_error_docref2(NULL, key, val, E_WARNING, "%s", gdbm_strerror(gdbm_errno)); return FAILURE; default: - php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Unknown return value"); + php_error_docref2(NULL, key, val, E_WARNING, "Unknown return value"); return FAILURE; } } diff --git a/ext/dba/dba_inifile.c b/ext/dba/dba_inifile.c index aaae690344..333438163c 100644 --- a/ext/dba/dba_inifile.c +++ b/ext/dba/dba_inifile.c @@ -42,7 +42,7 @@ #define INIFILE_GKEY \ key_type ini_key; \ if (!key) { \ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "No key specified"); \ + php_error_docref(NULL, E_WARNING, "No key specified"); \ return 0; \ } \ ini_key = inifile_key_split((char*)key) /* keylen not needed here */ @@ -52,7 +52,7 @@ DBA_OPEN_FUNC(inifile) { - info->dbf = inifile_alloc(info->fp, info->mode == DBA_READER, info->flags&DBA_PERSISTENT TSRMLS_CC); + info->dbf = inifile_alloc(info->fp, info->mode == DBA_READER, info->flags&DBA_PERSISTENT); return info->dbf ? SUCCESS : FAILURE; } @@ -71,7 +71,7 @@ DBA_FETCH_FUNC(inifile) INIFILE_DATA; INIFILE_GKEY; - ini_val = inifile_fetch(dba, &ini_key, skip TSRMLS_CC); + ini_val = inifile_fetch(dba, &ini_key, skip); *newlen = ini_val.value ? strlen(ini_val.value) : 0; INIFILE_DONE; return ini_val.value; @@ -88,14 +88,14 @@ DBA_UPDATE_FUNC(inifile) ini_val.value = val; if (mode == 1) { - res = inifile_append(dba, &ini_key, &ini_val TSRMLS_CC); + res = inifile_append(dba, &ini_key, &ini_val); } else { - res = inifile_replace(dba, &ini_key, &ini_val TSRMLS_CC); + res = inifile_replace(dba, &ini_key, &ini_val); } INIFILE_DONE; switch(res) { case -1: - php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible"); + php_error_docref1(NULL, key, E_WARNING, "Operation not possible"); return FAILURE; default: case 0: @@ -112,7 +112,7 @@ DBA_EXISTS_FUNC(inifile) INIFILE_DATA; INIFILE_GKEY; - ini_val = inifile_fetch(dba, &ini_key, 0 TSRMLS_CC); + ini_val = inifile_fetch(dba, &ini_key, 0); INIFILE_DONE; if (ini_val.value) { inifile_val_free(&ini_val); @@ -129,7 +129,7 @@ DBA_DELETE_FUNC(inifile) INIFILE_DATA; INIFILE_GKEY; - res = inifile_delete_ex(dba, &ini_key, &found TSRMLS_CC); + res = inifile_delete_ex(dba, &ini_key, &found); INIFILE_DONE; return (res == -1 || !found ? FAILURE : SUCCESS); @@ -139,7 +139,7 @@ DBA_FIRSTKEY_FUNC(inifile) { INIFILE_DATA; - if (inifile_firstkey(dba TSRMLS_CC)) { + if (inifile_firstkey(dba)) { char *result = inifile_key_string(&dba->curr.key); *newlen = strlen(result); return result; @@ -156,7 +156,7 @@ DBA_NEXTKEY_FUNC(inifile) return NULL; } - if (inifile_nextkey(dba TSRMLS_CC)) { + if (inifile_nextkey(dba)) { char *result = inifile_key_string(&dba->curr.key); *newlen = strlen(result); return result; diff --git a/ext/dba/dba_qdbm.c b/ext/dba/dba_qdbm.c index 023e5e9b27..c755cb98eb 100644 --- a/ext/dba/dba_qdbm.c +++ b/ext/dba/dba_qdbm.c @@ -102,7 +102,7 @@ DBA_UPDATE_FUNC(qdbm) } if (dpecode != DP_EKEEP) { - php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "%s", dperrmsg(dpecode)); + php_error_docref2(NULL, key, val, E_WARNING, "%s", dperrmsg(dpecode)); } return FAILURE; diff --git a/ext/dba/dba_tcadb.c b/ext/dba/dba_tcadb.c index 99c10c2f07..e4771eb641 100644 --- a/ext/dba/dba_tcadb.c +++ b/ext/dba/dba_tcadb.c @@ -122,7 +122,7 @@ DBA_UPDATE_FUNC(tcadb) return SUCCESS; } - php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Error updating data"); + php_error_docref2(NULL, key, val, E_WARNING, "Error updating data"); return FAILURE; } 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 diff --git a/ext/dba/libflatfile/flatfile.c b/ext/dba/libflatfile/flatfile.c index 8eae2d2508..361cc42519 100644 --- a/ext/dba/libflatfile/flatfile.c +++ b/ext/dba/libflatfile/flatfile.c @@ -47,30 +47,30 @@ /* {{{ flatfile_store */ -int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC) { +int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode) { if (mode == FLATFILE_INSERT) { - if (flatfile_findkey(dba, key_datum TSRMLS_CC)) { + if (flatfile_findkey(dba, key_datum)) { return 1; } php_stream_seek(dba->fp, 0L, SEEK_END); - php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", key_datum.dsize); + php_stream_printf(dba->fp, "%zu\n", key_datum.dsize); php_stream_flush(dba->fp); if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) { return -1; } - php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", value_datum.dsize); + php_stream_printf(dba->fp, "%zu\n", value_datum.dsize); php_stream_flush(dba->fp); if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) { return -1; } } else { /* FLATFILE_REPLACE */ - flatfile_delete(dba, key_datum TSRMLS_CC); - php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", key_datum.dsize); + flatfile_delete(dba, key_datum); + php_stream_printf(dba->fp, "%zu\n", key_datum.dsize); php_stream_flush(dba->fp); if (php_stream_write(dba->fp, key_datum.dptr, key_datum.dsize) < key_datum.dsize) { return -1; } - php_stream_printf(dba->fp TSRMLS_CC, "%zu\n", value_datum.dsize); + php_stream_printf(dba->fp, "%zu\n", value_datum.dsize); if (php_stream_write(dba->fp, value_datum.dptr, value_datum.dsize) < value_datum.dsize) { return -1; } @@ -83,11 +83,11 @@ int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode T /* {{{ flatfile_fetch */ -datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) { +datum flatfile_fetch(flatfile *dba, datum key_datum) { datum value_datum = {NULL, 0}; char buf[16]; - if (flatfile_findkey(dba, key_datum TSRMLS_CC)) { + if (flatfile_findkey(dba, key_datum)) { if (php_stream_gets(dba->fp, buf, sizeof(buf))) { value_datum.dsize = atoi(buf); value_datum.dptr = safe_emalloc(value_datum.dsize, 1, 1); @@ -103,7 +103,7 @@ datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC) { /* {{{ flatfile_delete */ -int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) { +int flatfile_delete(flatfile *dba, datum key_datum) { char *key = key_datum.dptr; size_t size = key_datum.dsize; size_t buf_size = FLATFILE_BLOCK_SIZE; @@ -161,7 +161,7 @@ int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC) { /* {{{ flatfile_findkey */ -int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) { +int flatfile_findkey(flatfile *dba, datum key_datum) { size_t buf_size = FLATFILE_BLOCK_SIZE; char *buf = emalloc(buf_size); size_t num; @@ -209,7 +209,7 @@ int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC) { /* {{{ flatfile_firstkey */ -datum flatfile_firstkey(flatfile *dba TSRMLS_DC) { +datum flatfile_firstkey(flatfile *dba) { datum res; size_t num; size_t buf_size = FLATFILE_BLOCK_SIZE; @@ -257,7 +257,7 @@ datum flatfile_firstkey(flatfile *dba TSRMLS_DC) { /* {{{ flatfile_nextkey */ -datum flatfile_nextkey(flatfile *dba TSRMLS_DC) { +datum flatfile_nextkey(flatfile *dba) { datum res; size_t num; size_t buf_size = FLATFILE_BLOCK_SIZE; diff --git a/ext/dba/libflatfile/flatfile.h b/ext/dba/libflatfile/flatfile.h index 2cd8db3521..9325d80be7 100644 --- a/ext/dba/libflatfile/flatfile.h +++ b/ext/dba/libflatfile/flatfile.h @@ -37,12 +37,12 @@ typedef struct { #define FLATFILE_INSERT 1 #define FLATFILE_REPLACE 0 -int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode TSRMLS_DC); -datum flatfile_fetch(flatfile *dba, datum key_datum TSRMLS_DC); -int flatfile_delete(flatfile *dba, datum key_datum TSRMLS_DC); -int flatfile_findkey(flatfile *dba, datum key_datum TSRMLS_DC); -datum flatfile_firstkey(flatfile *dba TSRMLS_DC); -datum flatfile_nextkey(flatfile *dba TSRMLS_DC); +int flatfile_store(flatfile *dba, datum key_datum, datum value_datum, int mode); +datum flatfile_fetch(flatfile *dba, datum key_datum); +int flatfile_delete(flatfile *dba, datum key_datum); +int flatfile_findkey(flatfile *dba, datum key_datum); +datum flatfile_firstkey(flatfile *dba); +datum flatfile_nextkey(flatfile *dba); char *flatfile_version(); #endif diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index 6b64872649..52c5d730bc 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -79,13 +79,13 @@ void inifile_line_free(line_type *ln) /* }}} */ /* {{{ inifile_alloc */ -inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC) +inifile * inifile_alloc(php_stream *fp, int readonly, int persistent) { inifile *dba; if (!readonly) { if (!php_stream_truncate_supported(fp)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't truncate this stream"); + php_error_docref(NULL, E_WARNING, "Can't truncate this stream"); return NULL; } } @@ -164,7 +164,7 @@ static char *etrim(const char *str) /* {{{ inifile_findkey */ -static int inifile_read(inifile *dba, line_type *ln TSRMLS_DC) { +static int inifile_read(inifile *dba, line_type *ln) { char *fline; char *pos; @@ -224,7 +224,7 @@ static int inifile_read(inifile *dba, line_type *ln TSRMLS_DC) { * 1 = GROUP-EQUAL,NAME-DIFFERENT * 2 = DIFFERENT */ -static int inifile_key_cmp(const key_type *k1, const key_type *k2 TSRMLS_DC) +static int inifile_key_cmp(const key_type *k1, const key_type *k2) { assert(k1->group && k1->name && k2->group && k2->name); @@ -242,12 +242,12 @@ static int inifile_key_cmp(const key_type *k1, const key_type *k2 TSRMLS_DC) /* {{{ inifile_fetch */ -val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) { +val_type inifile_fetch(inifile *dba, const key_type *key, int skip) { line_type ln = {{NULL,NULL},{NULL}}; val_type val; int res, grp_eq = 0; - if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key TSRMLS_CC)) { + if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key)) { /* we got position already from last fetch */ php_stream_seek(dba->fp, dba->next.pos, SEEK_SET); } else { @@ -259,8 +259,8 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) { if (skip == -1) { skip = 0; } - while(inifile_read(dba, &ln TSRMLS_CC)) { - if (!(res=inifile_key_cmp(&ln.key, key TSRMLS_CC))) { + while(inifile_read(dba, &ln)) { + if (!(res=inifile_key_cmp(&ln.key, key))) { if (!skip) { val.value = estrdup(ln.val.value ? ln.val.value : ""); /* allow faster access by updating key read into next */ @@ -285,22 +285,22 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) { /* {{{ inifile_firstkey */ -int inifile_firstkey(inifile *dba TSRMLS_DC) { +int inifile_firstkey(inifile *dba) { inifile_line_free(&dba->curr); dba->curr.pos = 0; - return inifile_nextkey(dba TSRMLS_CC); + return inifile_nextkey(dba); } /* }}} */ /* {{{ inifile_nextkey */ -int inifile_nextkey(inifile *dba TSRMLS_DC) { +int inifile_nextkey(inifile *dba) { line_type ln = {{NULL,NULL},{NULL}}; /*inifile_line_free(&dba->next); ??? */ php_stream_seek(dba->fp, dba->curr.pos, SEEK_SET); ln.key.group = estrdup(dba->curr.key.group ? dba->curr.key.group : ""); - inifile_read(dba, &ln TSRMLS_CC); + inifile_read(dba, &ln); inifile_line_free(&dba->curr); dba->curr = ln; return ln.key.group || ln.key.name; @@ -309,12 +309,12 @@ int inifile_nextkey(inifile *dba TSRMLS_DC) { /* {{{ inifile_truncate */ -static int inifile_truncate(inifile *dba, size_t size TSRMLS_DC) +static int inifile_truncate(inifile *dba, size_t size) { int res; if ((res=php_stream_truncate_set_size(dba->fp, size)) != 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in ftruncate: %d", res); + php_error_docref(NULL, E_WARNING, "Error in ftruncate: %d", res); return FAILURE; } php_stream_seek(dba->fp, size, SEEK_SET); @@ -325,7 +325,7 @@ static int inifile_truncate(inifile *dba, size_t size TSRMLS_DC) /* {{{ inifile_find_group * if found pos_grp_start points to "[group_name]" */ -static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp_start TSRMLS_DC) +static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp_start) { int ret = FAILURE; @@ -339,8 +339,8 @@ static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp line_type ln = {{NULL,NULL},{NULL}}; res = 1; - while(inifile_read(dba, &ln TSRMLS_CC)) { - if ((res=inifile_key_cmp(&ln.key, key TSRMLS_CC)) < 2) { + while(inifile_read(dba, &ln)) { + if ((res=inifile_key_cmp(&ln.key, key)) < 2) { ret = SUCCESS; break; } @@ -362,15 +362,15 @@ static int inifile_find_group(inifile *dba, const key_type *key, size_t *pos_grp * only valid after a call to inifile_find_group * if any next group is found pos_grp_start points to "[group_name]" or whitespace before that */ -static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp_start TSRMLS_DC) +static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp_start) { int ret = FAILURE; line_type ln = {{NULL,NULL},{NULL}}; *pos_grp_start = php_stream_tell(dba->fp); ln.key.group = estrdup(key->group); - while(inifile_read(dba, &ln TSRMLS_CC)) { - if (inifile_key_cmp(&ln.key, key TSRMLS_CC) == 2) { + while(inifile_read(dba, &ln)) { + if (inifile_key_cmp(&ln.key, key) == 2) { ret = SUCCESS; break; } @@ -383,7 +383,7 @@ static int inifile_next_group(inifile *dba, const key_type *key, size_t *pos_grp /* {{{ inifile_copy_to */ -static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifile **ini_copy TSRMLS_DC) +static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifile **ini_copy) { php_stream *fp; @@ -392,18 +392,18 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi return SUCCESS; } if ((fp = php_stream_temp_create(0, 64 * 1024)) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create temporary stream"); + php_error_docref(NULL, E_WARNING, "Could not create temporary stream"); *ini_copy = NULL; return FAILURE; } - if ((*ini_copy = inifile_alloc(fp, 1, 0 TSRMLS_CC)) == NULL) { + if ((*ini_copy = inifile_alloc(fp, 1, 0)) == NULL) { /* writes error */ return FAILURE; } php_stream_seek(dba->fp, pos_start, SEEK_SET); if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end); + php_error_docref(NULL, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end); return FAILURE; } return SUCCESS; @@ -413,7 +413,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi /* {{{ inifile_filter * copy from to dba while ignoring key name (group must equal) */ -static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found TSRMLS_DC) +static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend_bool *found) { size_t pos_start = 0, pos_next = 0, pos_curr; int ret = SUCCESS; @@ -421,8 +421,8 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend php_stream_seek(from->fp, 0, SEEK_SET); php_stream_seek(dba->fp, 0, SEEK_END); - while(inifile_read(from, &ln TSRMLS_CC)) { - switch(inifile_key_cmp(&ln.key, key TSRMLS_CC)) { + while(inifile_read(from, &ln)) { + switch(inifile_key_cmp(&ln.key, key)) { case 0: if (found) { *found = (zend_bool) 1; @@ -431,7 +431,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend if (pos_start != pos_next) { php_stream_seek(from->fp, pos_start, SEEK_SET); if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); + php_error_docref(NULL, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); ret = FAILURE; } php_stream_seek(from->fp, pos_curr, SEEK_SET); @@ -450,7 +450,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend if (pos_start != pos_next) { php_stream_seek(from->fp, pos_start, SEEK_SET); if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); + php_error_docref(NULL, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); ret = FAILURE; } } @@ -461,7 +461,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key, zend /* {{{ inifile_delete_replace_append */ -static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found TSRMLS_DC) +static int inifile_delete_replace_append(inifile *dba, const key_type *key, const val_type *value, int append, zend_bool *found) { size_t pos_grp_start=0, pos_grp_next; inifile *ini_tmp = NULL; @@ -482,26 +482,26 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons assert(!append || (key->name && value)); /* missuse */ /* 1 - 3 */ - inifile_find_group(dba, key, &pos_grp_start TSRMLS_CC); - inifile_next_group(dba, key, &pos_grp_next TSRMLS_CC); + inifile_find_group(dba, key, &pos_grp_start); + inifile_next_group(dba, key, &pos_grp_next); if (append) { ret = SUCCESS; } else { - ret = inifile_copy_to(dba, pos_grp_start, pos_grp_next, &ini_tmp TSRMLS_CC); + ret = inifile_copy_to(dba, pos_grp_start, pos_grp_next, &ini_tmp); } /* 4 */ if (ret == SUCCESS) { fp_tmp = php_stream_temp_create(0, 64 * 1024); if (!fp_tmp) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not create temporary stream"); + php_error_docref(NULL, E_WARNING, "Could not create temporary stream"); ret = FAILURE; } else { php_stream_seek(dba->fp, 0, SEEK_END); if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) { php_stream_seek(dba->fp, pos_grp_next, SEEK_SET); if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream"); + php_error_docref(NULL, E_WARNING, "Could not copy remainder to temporary stream"); ret = FAILURE; } } @@ -511,7 +511,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons /* 5 */ if (ret == SUCCESS) { if (!value || (key->name && strlen(key->name))) { - ret = inifile_truncate(dba, append ? pos_grp_next : pos_grp_start TSRMLS_CC); /* writes error on fail */ + ret = inifile_truncate(dba, append ? pos_grp_next : pos_grp_start); /* writes error on fail */ } } @@ -519,7 +519,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons if (key->name && strlen(key->name)) { /* 6 */ if (!append && ini_tmp) { - ret = inifile_filter(dba, ini_tmp, key, found TSRMLS_CC); + ret = inifile_filter(dba, ini_tmp, key, found); } /* 7 */ @@ -528,9 +528,9 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons */ if (value) { if (pos_grp_start == pos_grp_next && key->group && strlen(key->group)) { - php_stream_printf(dba->fp TSRMLS_CC, "[%s]\n", key->group); + php_stream_printf(dba->fp, "[%s]\n", key->group); } - php_stream_printf(dba->fp TSRMLS_CC, "%s=%s\n", key->name, value->value ? value->value : ""); + php_stream_printf(dba->fp, "%s=%s\n", key->name, value->value ? value->value : ""); } } @@ -542,7 +542,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons php_stream_seek(fp_tmp, 0, SEEK_SET); php_stream_seek(dba->fp, 0, SEEK_END); if (SUCCESS != php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) { - php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated"); + php_error_docref(NULL, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated"); ret = FAILURE; } } @@ -564,41 +564,41 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons /* {{{ inifile_delete */ -int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC) +int inifile_delete(inifile *dba, const key_type *key) { - return inifile_delete_replace_append(dba, key, NULL, 0, NULL TSRMLS_CC); + return inifile_delete_replace_append(dba, key, NULL, 0, NULL); } /* }}} */ /* {{{ inifile_delete_ex */ -int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC) +int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found) { - return inifile_delete_replace_append(dba, key, NULL, 0, found TSRMLS_CC); + return inifile_delete_replace_append(dba, key, NULL, 0, found); } /* }}} */ /* {{{ inifile_relace */ -int inifile_replace(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC) +int inifile_replace(inifile *dba, const key_type *key, const val_type *value) { - return inifile_delete_replace_append(dba, key, value, 0, NULL TSRMLS_CC); + return inifile_delete_replace_append(dba, key, value, 0, NULL); } /* }}} */ /* {{{ inifile_replace_ex */ -int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found TSRMLS_DC) +int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *value, zend_bool *found) { - return inifile_delete_replace_append(dba, key, value, 0, found TSRMLS_CC); + return inifile_delete_replace_append(dba, key, value, 0, found); } /* }}} */ /* {{{ inifile_append */ -int inifile_append(inifile *dba, const key_type *key, const val_type *value TSRMLS_DC) +int inifile_append(inifile *dba, const key_type *key, const val_type *value) { - return inifile_delete_replace_append(dba, key, value, 1, NULL TSRMLS_CC); + return inifile_delete_replace_append(dba, key, value, 1, NULL); } /* }}} */ diff --git a/ext/dba/libinifile/inifile.h b/ext/dba/libinifile/inifile.h index 9de43b62f5..24bc2dfec9 100644 --- a/ext/dba/libinifile/inifile.h +++ b/ext/dba/libinifile/inifile.h @@ -45,14 +45,14 @@ typedef struct { line_type next; } inifile; -val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC); -int inifile_firstkey(inifile *dba TSRMLS_DC); -int inifile_nextkey(inifile *dba TSRMLS_DC); -int inifile_delete(inifile *dba, const key_type *key TSRMLS_DC); -int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found TSRMLS_DC); -int inifile_replace(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC); -int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found TSRMLS_DC); -int inifile_append(inifile *dba, const key_type *key, const val_type *val TSRMLS_DC); +val_type inifile_fetch(inifile *dba, const key_type *key, int skip); +int inifile_firstkey(inifile *dba); +int inifile_nextkey(inifile *dba); +int inifile_delete(inifile *dba, const key_type *key); +int inifile_delete_ex(inifile *dba, const key_type *key, zend_bool *found); +int inifile_replace(inifile *dba, const key_type *key, const val_type *val); +int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, zend_bool *found); +int inifile_append(inifile *dba, const key_type *key, const val_type *val); char *inifile_version(); key_type inifile_key_split(const char *group_name); @@ -62,7 +62,7 @@ void inifile_key_free(key_type *key); void inifile_val_free(val_type *val); void inifile_line_free(line_type *ln); -inifile * inifile_alloc(php_stream *fp, int readonly, int persistent TSRMLS_DC); +inifile * inifile_alloc(php_stream *fp, int readonly, int persistent); void inifile_free(inifile *dba, int persistent); #endif diff --git a/ext/dba/php_dba.h b/ext/dba/php_dba.h index d19000cf0f..3421b5de93 100644 --- a/ext/dba/php_dba.h +++ b/ext/dba/php_dba.h @@ -74,44 +74,44 @@ extern zend_module_entry dba_module_entry; typedef struct dba_handler { char *name; /* handler name */ int flags; /* whether and how dba does locking and other flags*/ - int (*open)(dba_info *, char **error TSRMLS_DC); - void (*close)(dba_info * TSRMLS_DC); - char* (*fetch)(dba_info *, char *, int, int, int * TSRMLS_DC); - int (*update)(dba_info *, char *, int, char *, int, int TSRMLS_DC); - int (*exists)(dba_info *, char *, int TSRMLS_DC); - int (*delete)(dba_info *, char *, int TSRMLS_DC); - char* (*firstkey)(dba_info *, int * TSRMLS_DC); - char* (*nextkey)(dba_info *, int * TSRMLS_DC); - int (*optimize)(dba_info * TSRMLS_DC); - int (*sync)(dba_info * TSRMLS_DC); - char* (*info)(struct dba_handler *hnd, dba_info * TSRMLS_DC); + int (*open)(dba_info *, char **error); + void (*close)(dba_info *); + char* (*fetch)(dba_info *, char *, int, int, int *); + int (*update)(dba_info *, char *, int, char *, int, int); + int (*exists)(dba_info *, char *, int); + int (*delete)(dba_info *, char *, int); + char* (*firstkey)(dba_info *, int *); + char* (*nextkey)(dba_info *, int *); + int (*optimize)(dba_info *); + int (*sync)(dba_info *); + char* (*info)(struct dba_handler *hnd, dba_info *); /* dba_info==NULL: Handler info, dba_info!=NULL: Database info */ } dba_handler; /* common prototypes which must be supplied by modules */ #define DBA_OPEN_FUNC(x) \ - int dba_open_##x(dba_info *info, char **error TSRMLS_DC) + int dba_open_##x(dba_info *info, char **error) #define DBA_CLOSE_FUNC(x) \ - void dba_close_##x(dba_info *info TSRMLS_DC) + void dba_close_##x(dba_info *info) #define DBA_FETCH_FUNC(x) \ - char *dba_fetch_##x(dba_info *info, char *key, int keylen, int skip, int *newlen TSRMLS_DC) + char *dba_fetch_##x(dba_info *info, char *key, int keylen, int skip, int *newlen) #define DBA_UPDATE_FUNC(x) \ - int dba_update_##x(dba_info *info, char *key, int keylen, char *val, int vallen, int mode TSRMLS_DC) + int dba_update_##x(dba_info *info, char *key, int keylen, char *val, int vallen, int mode) #define DBA_EXISTS_FUNC(x) \ - int dba_exists_##x(dba_info *info, char *key, int keylen TSRMLS_DC) + int dba_exists_##x(dba_info *info, char *key, int keylen) #define DBA_DELETE_FUNC(x) \ - int dba_delete_##x(dba_info *info, char *key, int keylen TSRMLS_DC) + int dba_delete_##x(dba_info *info, char *key, int keylen) #define DBA_FIRSTKEY_FUNC(x) \ - char *dba_firstkey_##x(dba_info *info, int *newlen TSRMLS_DC) + char *dba_firstkey_##x(dba_info *info, int *newlen) #define DBA_NEXTKEY_FUNC(x) \ - char *dba_nextkey_##x(dba_info *info, int *newlen TSRMLS_DC) + char *dba_nextkey_##x(dba_info *info, int *newlen) #define DBA_OPTIMIZE_FUNC(x) \ - int dba_optimize_##x(dba_info *info TSRMLS_DC) + int dba_optimize_##x(dba_info *info) #define DBA_SYNC_FUNC(x) \ - int dba_sync_##x(dba_info *info TSRMLS_DC) + int dba_sync_##x(dba_info *info) #define DBA_INFO_FUNC(x) \ - char *dba_info_##x(dba_handler *hnd, dba_info *info TSRMLS_DC) + char *dba_info_##x(dba_handler *hnd, dba_info *info) #define DBA_FUNCS(x) \ DBA_OPEN_FUNC(x); \ |