1
0
mirror of https://github.com/php/php-src.git synced 2026-03-28 18:22:42 +01:00

Inline DBA_ID_GET2(_3) Macro

This commit is contained in:
George Peter Banyard
2021-10-23 10:13:57 +01:00
parent 864a7953fa
commit b8327cff0b

View File

@@ -187,9 +187,6 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free)
RETURN_THROWS(); \
}
#define DBA_ID_GET2 DBA_ID_PARS; DBA_GET2; DBA_FETCH_RESOURCE_WITH_ID(info, id)
#define DBA_ID_GET2_3 DBA_ID_PARS; DBA_GET2_3; DBA_FETCH_RESOURCE_WITH_ID(info, id)
#define DBA_ID_DONE \
if (key_free) efree(key_free)
/* a DBA handler must have specific routines */
@@ -941,7 +938,9 @@ PHP_FUNCTION(dba_close)
/* {{{ Checks, if the specified key exists */
PHP_FUNCTION(dba_exists)
{
DBA_ID_GET2;
DBA_ID_PARS;
DBA_GET2;
DBA_FETCH_RESOURCE_WITH_ID(info, id);
if(info->hnd->exists(info, key_str, key_len) == SUCCESS) {
DBA_ID_DONE;
@@ -957,7 +956,9 @@ PHP_FUNCTION(dba_fetch)
{
char *val;
size_t len = 0;
DBA_ID_GET2_3;
DBA_ID_PARS;
DBA_GET2_3;
DBA_FETCH_RESOURCE_WITH_ID(info, id);
if (ac==3) {
if (!strcmp(info->hnd->name, "cdb")) {
@@ -1079,7 +1080,9 @@ PHP_FUNCTION(dba_nextkey)
If inifile: remove all other key lines */
PHP_FUNCTION(dba_delete)
{
DBA_ID_GET2;
DBA_ID_PARS;
DBA_GET2;
DBA_FETCH_RESOURCE_WITH_ID(info, id);
DBA_WRITE_CHECK_WITH_ID;