Browse Source

2nd phase in back-substitution those macro's

I've got pretty much everything now...
experimental/ZendEngine2
Jeroen van Wolffelaar 25 years ago
parent
commit
6cfba2a3ea
  1. 530
      ext/cpdf/cpdf.c
  2. 10
      ext/dba/dba.c
  3. 2
      ext/dba/dba_db2.c
  4. 2
      ext/dba/dba_db3.c
  5. 2
      ext/dba/dba_dbm.c
  6. 2
      ext/dba/dba_gdbm.c
  7. 2
      ext/dba/dba_ndbm.c
  8. 46
      ext/dbx/dbx.c
  9. 8
      ext/fbsql/php_fbsql.c
  10. 8
      ext/gd/gd.c
  11. 340
      ext/hyperwave/hw.c
  12. 102
      ext/informix/ifx.ec
  13. 34
      ext/interbase/interbase.c
  14. 2
      ext/java/java.c
  15. 2
      ext/ldap/ldap.c
  16. 8
      ext/mbstring/mbstring.c
  17. 14
      ext/mcrypt/mcrypt.c
  18. 4
      ext/ming/ming.c
  19. 4
      ext/mnogosearch/php_mnogo.c
  20. 2
      ext/msql/php_msql.c
  21. 2
      ext/mysql/php_mysql.c
  22. 10
      ext/oci8/oci8.c
  23. 4
      ext/oracle/oracle.c
  24. 74
      ext/ovrimos/ovrimos.c
  25. 32
      ext/pfpro/pfpro.c
  26. 2
      ext/rpc/java/java.c
  27. 8
      ext/rpc/xmlrpc/xmlrpc-epi-php.c
  28. 6
      ext/satellite/enum.c
  29. 4
      ext/satellite/object.c
  30. 4
      ext/satellite/struct.c
  31. 24
      ext/snmp/snmp.c
  32. 6
      ext/snmp/winsnmp.c
  33. 4
      ext/sockets/sockets.c
  34. 26
      ext/standard/datetime.c
  35. 4
      ext/standard/formatted_print.c
  36. 2
      ext/standard/info.c
  37. 12
      ext/standard/levenshtein.c
  38. 8
      ext/standard/mail.c
  39. 6
      ext/standard/quot_print.c
  40. 4
      ext/standard/string.c
  41. 32
      ext/xml/xml.c
  42. 8
      ext/xmlrpc/xmlrpc-epi-php.c
  43. 32
      ext/zlib/zlib.c

530
ext/cpdf/cpdf.c
File diff suppressed because it is too large
View File

10
ext/dba/dba.c

@ -310,15 +310,15 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
for(hptr = handler; hptr->name &&
strcasecmp(hptr->name, (*args[2])->value.str.val); hptr++);
strcasecmp(hptr->name, Z_STRVAL_PP(args[2])); hptr++);
if(!hptr->name) {
php_error(E_WARNING, "no such handler: %s", (*args[2])->value.str.val);
php_error(E_WARNING, "no such handler: %s", Z_STRVAL_PP(args[2]));
FREENOW;
RETURN_FALSE;
}
switch((*args[1])->value.str.val[0]) {
switch(Z_STRVAL_PP(args[1])[0]) {
case 'c':
modenr = DBA_CREAT;
break;
@ -332,14 +332,14 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
modenr = DBA_TRUNC;
break;
default:
php_error(E_WARNING, "illegal DBA mode: %s", (*args[1])->value.str.val);
php_error(E_WARNING, "illegal DBA mode: %s", Z_STRVAL_PP(args[1]));
FREENOW;
RETURN_FALSE;
}
info = malloc(sizeof(*info));
memset(info, 0, sizeof(info));
info->path = strdup((*args[0])->value.str.val);
info->path = strdup(Z_STRVAL_PP(args[0]));
info->mode = modenr;
info->argc = ac - 3;
info->argv = args + 3;

2
ext/dba/dba_db2.c

@ -62,7 +62,7 @@ DBA_OPEN_FUNC(db2)
if(info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
filemode = Z_LVAL_PP(info->argv[0]);
}
if(!db_open(info->path, type, gmode, filemode, NULL, NULL, &dbp)) {

2
ext/dba/dba_db3.c

@ -64,7 +64,7 @@ DBA_OPEN_FUNC(db3)
if (info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
filemode = Z_LVAL_PP(info->argv[0]);
}
if (db_create(&dbp, NULL, 0) == 0 &&

2
ext/dba/dba_dbm.c

@ -52,7 +52,7 @@ DBA_OPEN_FUNC(dbm)
if(info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
filemode = Z_LVAL_PP(info->argv[0]);
}
if(info->mode == DBA_TRUNC) {

2
ext/dba/dba_gdbm.c

@ -49,7 +49,7 @@ DBA_OPEN_FUNC(gdbm)
if(info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
filemode = Z_LVAL_PP(info->argv[0]);
}
dbf = gdbm_open(info->path, 0, gmode, filemode, NULL);

2
ext/dba/dba_ndbm.c

@ -56,7 +56,7 @@ DBA_OPEN_FUNC(ndbm)
if(info->argc > 0) {
convert_to_long_ex(info->argv[0]);
filemode = (*info->argv[0])->value.lval;
filemode = Z_LVAL_PP(info->argv[0]);
}
dbf = dbm_open(info->path, gmode, filemode);

46
ext/dbx/dbx.c

@ -237,24 +237,24 @@ ZEND_FUNCTION(dbx_connect)
}
if (ZEND_NUM_ARGS()==number_of_arguments+1) {
convert_to_long_ex(arguments[5]);
if ((*arguments[5])->value.lval!=0) persistent=1;
if (Z_LVAL_PP(arguments[5])!=0) persistent=1;
}
if ((*arguments[0])->type == IS_LONG) {
if (!module_identifier_exists((*arguments[0])->value.lval)) {
zend_error(E_WARNING, "dbx: module '%ld' not loaded or not supported.\n", (*arguments[0])->value.lval);
if (Z_TYPE_PP(arguments[0]) == IS_LONG) {
if (!module_identifier_exists(Z_LVAL_PP(arguments[0]))) {
zend_error(E_WARNING, "dbx: module '%ld' not loaded or not supported.\n", Z_LVAL_PP(arguments[0]));
return;
}
module_identifier = (*arguments[0])->value.lval;
module_identifier = Z_LVAL_PP(arguments[0]);
} else {
convert_to_string_ex(arguments[0]);
if (!module_exists((*arguments[0])->value.str.val)) {
zend_error(E_WARNING, "dbx: module '%s' not loaded.\n", (*arguments[0])->value.str.val);
if (!module_exists(Z_STRVAL_PP(arguments[0]))) {
zend_error(E_WARNING, "dbx: module '%s' not loaded.\n", Z_STRVAL_PP(arguments[0]));
return;
}
module_identifier=get_module_identifier((*arguments[0])->value.str.val);
module_identifier=get_module_identifier(Z_STRVAL_PP(arguments[0]));
if (!module_identifier) {
zend_error(E_WARNING, "dbx: unsupported module '%s'.\n", (*arguments[0])->value.str.val);
zend_error(E_WARNING, "dbx: unsupported module '%s'.\n", Z_STRVAL_PP(arguments[0]));
return;
}
}
@ -268,7 +268,7 @@ ZEND_FUNCTION(dbx_connect)
convert_to_string_ex(arguments[3]);
convert_to_string_ex(arguments[4]);
MAKE_STD_ZVAL(db_name);
ZVAL_STRING(db_name, (*arguments[2])->value.str.val, 1);
ZVAL_STRING(db_name, Z_STRVAL_PP(arguments[2]), 1);
if (persistent) {
result = switch_dbx_pconnect(&rv_dbx_handle, arguments[1], arguments[2], arguments[3], arguments[4], INTERNAL_FUNCTION_PARAM_PASSTHRU, &dbx_module);
} else {
@ -367,7 +367,7 @@ ZEND_FUNCTION(dbx_query)
/* parameter overrides */
if (ZEND_NUM_ARGS()>2) {
convert_to_long_ex(arguments[2]);
info_flags = (*arguments[2])->value.lval;
info_flags = Z_LVAL_PP(arguments[2]);
/* fieldnames are needed for association! */
if (info_flags & DBX_RESULT_ASSOC) {
info_flags |= DBX_RESULT_INFO;
@ -554,8 +554,8 @@ ZEND_FUNCTION(dbx_compare)
WRONG_PARAM_COUNT;
}
if ((*arguments[0])->type != IS_ARRAY
|| (*arguments[1])->type != IS_ARRAY) {
if (Z_TYPE_PP(arguments[0]) != IS_ARRAY
|| Z_TYPE_PP(arguments[1]) != IS_ARRAY) {
zend_error(E_WARNING, "Wrong argument type for compare");
RETURN_LONG(0);
}
@ -565,27 +565,27 @@ ZEND_FUNCTION(dbx_compare)
if (number_of_arguments>3) {
convert_to_long_ex(arguments[3]); /* comparison type and direction*/
/* direction */
if ((*arguments[3])->value.lval & DBX_CMP_DESC) {
if (Z_LVAL_PP(arguments[3]) & DBX_CMP_DESC) {
comparison_direction=DBX_CMP_DESC;
}
if ((*arguments[3])->value.lval & DBX_CMP_ASC) {
if (Z_LVAL_PP(arguments[3]) & DBX_CMP_ASC) {
comparison_direction=DBX_CMP_ASC;
}
/* type */
if ((*arguments[3])->value.lval & DBX_CMP_NUMBER) {
if (Z_LVAL_PP(arguments[3]) & DBX_CMP_NUMBER) {
comparison_type=DBX_CMP_NUMBER;
}
if ((*arguments[3])->value.lval & DBX_CMP_TEXT) {
if (Z_LVAL_PP(arguments[3]) & DBX_CMP_TEXT) {
comparison_type=DBX_CMP_TEXT;
}
if ((*arguments[3])->value.lval & DBX_CMP_NATIVE) {
if (Z_LVAL_PP(arguments[3]) & DBX_CMP_NATIVE) {
comparison_type=DBX_CMP_NATIVE;
}
}
if (zend_hash_find((*arguments[0])->value.ht, (*arguments[2])->value.str.val, (*arguments[2])->value.str.len+1, (void **) &zv_a)==FAILURE
|| zend_hash_find((*arguments[1])->value.ht, (*arguments[2])->value.str.val, (*arguments[2])->value.str.len+1, (void **) &zv_b)==FAILURE) {
zend_error(E_WARNING, "Field '%s' not available in result-object", (*arguments[2])->value.str.val);
if (zend_hash_find(Z_ARRVAL_PP(arguments[0]), Z_STRVAL_PP(arguments[2]), Z_STRLEN_PP(arguments[2])+1, (void **) &zv_a)==FAILURE
|| zend_hash_find(Z_ARRVAL_PP(arguments[1]), Z_STRVAL_PP(arguments[2]), Z_STRLEN_PP(arguments[2])+1, (void **) &zv_b)==FAILURE) {
zend_error(E_WARNING, "Field '%s' not available in result-object", Z_STRVAL_PP(arguments[2]));
RETURN_LONG(0);
}
@ -639,8 +639,8 @@ ZEND_FUNCTION(dbx_sort)
WRONG_PARAM_COUNT;
}
if ((*arguments[0])->type != IS_OBJECT
|| (*arguments[1])->type != IS_STRING) {
if (Z_TYPE_PP(arguments[0]) != IS_OBJECT
|| Z_TYPE_PP(arguments[1]) != IS_STRING) {
zend_error(E_WARNING, "Wrong argument type for sort");
RETURN_LONG(0);
}

8
ext/fbsql/php_fbsql.c

@ -463,17 +463,17 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistant)
if (argc >= 1)
{
convert_to_string_ex(argv[0]);
hostName = (*argv[0])->value.str.val;
hostName = Z_STRVAL_PP(argv[0]);
}
if (argc >= 2)
{
convert_to_string_ex(argv[1]);
userName = (*argv[1])->value.str.val;
userName = Z_STRVAL_PP(argv[1]);
}
if (argc == 3)
{
convert_to_string_ex(argv[2]);
userPassword = (*argv[2])->value.str.val;
userPassword = Z_STRVAL_PP(argv[2]);
}
if (hostName == NULL) hostName = FB_SQL_G(hostName);
@ -1896,7 +1896,7 @@ PHP_FUNCTION(fbsql_warnings)
if (argc >= 1)
{
convert_to_long_ex(argv[0]);
FB_SQL_G(generateWarnings) = (*argv[0])->value.lval != 0;
FB_SQL_G(generateWarnings) = Z_LVAL_PP(argv[0]) != 0;
}
RETURN_BOOL(FB_SQL_G(generateWarnings));
}

8
ext/gd/gd.c

@ -2124,12 +2124,12 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
npoints = Z_LVAL_PP(NPOINTS);
col = Z_LVAL_PP(COL);
if ((*POINTS)->type != IS_ARRAY) {
if (Z_TYPE_PP(POINTS) != IS_ARRAY) {
php_error(E_WARNING, "2nd argument to imagepolygon not an array");
RETURN_FALSE;
}
nelem = zend_hash_num_elements((*POINTS)->value.ht);
nelem = zend_hash_num_elements(Z_ARRVAL_PP(POINTS));
if (nelem < 6) {
php_error(E_WARNING, "you must have at least 3 points in your array");
RETURN_FALSE;
@ -2143,12 +2143,12 @@ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled)
points = (gdPointPtr) emalloc(npoints * sizeof(gdPoint));
for (i = 0; i < npoints; i++) {
if (zend_hash_index_find((*POINTS)->value.ht, (i * 2), (void **) &var) == SUCCESS) {
if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2), (void **) &var) == SUCCESS) {
SEPARATE_ZVAL((var));
convert_to_long(*var);
points[i].x = Z_LVAL_PP(var);
}
if (zend_hash_index_find((*POINTS)->value.ht, (i * 2) + 1, (void **) &var) == SUCCESS) {
if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2) + 1, (void **) &var) == SUCCESS) {
SEPARATE_ZVAL(var);
convert_to_long(*var);
points[i].y = Z_LVAL_PP(var);

340
ext/hyperwave/hw.c

@ -725,20 +725,20 @@ static void php_hw_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
/* Host: */
convert_to_string_ex(argv[0]);
host = (char *) estrndup((*argv[0])->value.str.val, (*argv[0])->value.str.len);
host = (char *) estrndup(Z_STRVAL_PP(argv[0]), Z_STRLEN_PP(argv[0]));
/* Port: */
convert_to_long_ex(argv[1]);
port = (*argv[1])->value.lval;
port = Z_LVAL_PP(argv[1]);
/* Username and Password */
if(argc > 2) {
/* Username */
convert_to_string_ex(argv[2]);
username = (char *) estrndup((*argv[2])->value.str.val, (*argv[2])->value.str.len);
username = (char *) estrndup(Z_STRVAL_PP(argv[2]), Z_STRLEN_PP(argv[2]));
/* Password */
convert_to_string_ex(argv[3]);
password = (char *) estrndup((*argv[3])->value.str.val, (*argv[3])->value.str.len);
password = (char *) estrndup(Z_STRVAL_PP(argv[3]), Z_STRLEN_PP(argv[3]));
}
/* Create identifier string for connection */
@ -981,7 +981,7 @@ PHP_FUNCTION(hw_close)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg1);
id=(*arg1)->value.lval;
id=Z_LVAL_PP(arg1);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -1005,7 +1005,7 @@ PHP_FUNCTION(hw_info)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg1);
id=(*arg1)->value.lval;
id=Z_LVAL_PP(arg1);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -1037,7 +1037,7 @@ PHP_FUNCTION(hw_error)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg1);
id=(*arg1)->value.lval;
id=Z_LVAL_PP(arg1);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -1060,7 +1060,7 @@ PHP_FUNCTION(hw_errormsg)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg1);
id=(*arg1)->value.lval;
id=Z_LVAL_PP(arg1);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -1351,7 +1351,7 @@ char *php_hw_command(INTERNAL_FUNCTION_PARAMETERS, int comm) {
return NULL;
}
convert_to_long_ex(arg1);
link=(*arg1)->value.lval;
link=Z_LVAL_PP(arg1);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -1516,9 +1516,9 @@ PHP_FUNCTION(hw_dummy)
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
convert_to_long_ex(arg3);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
msgid=(*arg3)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
msgid=Z_LVAL_PP(arg3);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -1555,7 +1555,7 @@ PHP_FUNCTION(hw_getobject)
WRONG_PARAM_COUNT;
convert_to_long_ex(argv[0]);
if((*argv[1])->type == IS_ARRAY) {
if(Z_TYPE_PP(argv[1]) == IS_ARRAY) {
multi = 1;
convert_to_array_ex(argv[1]);
} else {
@ -1565,11 +1565,11 @@ PHP_FUNCTION(hw_getobject)
if(argc == 3) {
convert_to_string_ex(argv[2]);
query = (*argv[2])->value.str.val;
query = Z_STRVAL_PP(argv[2]);
} else
query = NULL;
link=(*argv[0])->value.lval;
link=Z_LVAL_PP(argv[0]);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -1583,7 +1583,7 @@ PHP_FUNCTION(hw_getobject)
HashTable *lht;
zval **keydata;
lht = (*argv[1])->value.ht;
lht = Z_ARRVAL_PP(argv[1]);
if(0 == (count = zend_hash_num_elements(lht))) {
RETURN_FALSE;
}
@ -1619,7 +1619,7 @@ PHP_FUNCTION(hw_getobject)
} else {
char *object = NULL;
id=(*argv[1])->value.lval;
id=Z_LVAL_PP(argv[1]);
if (0 != (ptr->lasterror = send_getobject(ptr->socket, id, &object)))
RETURN_FALSE;
@ -1643,9 +1643,9 @@ PHP_FUNCTION(hw_insertobject)
convert_to_long(arg1);
convert_to_string(arg2);
convert_to_string(arg3);
link=arg1->value.lval;
objrec=arg2->value.str.val;
parms=arg3->value.str.val;
link=Z_LVAL_P(arg1);
objrec=Z_STRVAL_P(arg2);
parms=Z_STRVAL_P(arg3);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -1676,8 +1676,8 @@ PHP_FUNCTION(hw_getandlock)
}
convert_to_long(arg1);
convert_to_long(arg2);
link=arg1->value.lval;
id=arg2->value.lval;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -1708,8 +1708,8 @@ PHP_FUNCTION(hw_unlock)
}
convert_to_long(arg1);
convert_to_long(arg2);
link=arg1->value.lval;
id=arg2->value.lval;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -1737,8 +1737,8 @@ PHP_FUNCTION(hw_deleteobject)
}
convert_to_long(arg1);
convert_to_long(arg2);
link=arg1->value.lval;
id=arg2->value.lval;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -1769,9 +1769,9 @@ PHP_FUNCTION(hw_changeobject)
convert_to_long(arg1); /* Connection */
convert_to_long(arg2); /* object ID */
convert_to_array(arg3); /* Array with new attributes */
link=arg1->value.lval;
id=arg2->value.lval;
newobjarr=arg3->value.ht;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
newobjarr=Z_ARRVAL_P(arg3);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -1868,13 +1868,13 @@ PHP_FUNCTION(hw_modifyobject)
convert_to_array_ex(argv[3]); /* Array with attributes to add */
if(argc == 5) {
convert_to_long_ex(argv[4]);
mode = (*argv[4])->value.lval;
mode = Z_LVAL_PP(argv[4]);
} else
mode = 0;
link=(*argv[0])->value.lval;
id=(*argv[1])->value.lval;
remobjarr=(*argv[2])->value.ht;
addobjarr=(*argv[3])->value.ht;
link=Z_LVAL_PP(argv[0]);
id=Z_LVAL_PP(argv[1]);
remobjarr=Z_ARRVAL_PP(argv[2]);
addobjarr=Z_ARRVAL_PP(argv[3]);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -2093,16 +2093,16 @@ void php_hw_mvcp(INTERNAL_FUNCTION_PARAMETERS, int mvcp) {
convert_to_long(arg1);
convert_to_array(arg2);
convert_to_long(arg3);
link=arg1->value.lval;
src_arr=arg2->value.ht;
link=Z_LVAL_P(arg1);
src_arr=Z_ARRVAL_P(arg2);
switch(mvcp) {
case MOVE: /* Move also has fromID, which is arg3 --> arg4 becomes destID */
convert_to_long(arg4);
from=arg3->value.lval;
dest=arg4->value.lval;
from=Z_LVAL_P(arg3);
dest=Z_LVAL_P(arg4);
break;
case COPY: /* No fromID for Copy needed --> arg3 is destID */
dest=arg3->value.lval;
dest=Z_LVAL_P(arg3);
from = 0;
break;
}
@ -2204,20 +2204,20 @@ PHP_FUNCTION(hw_gettext)
mode = 0;
urlprefix = NULL;
if(argc == 3) {
switch(argv[2]->type) {
switch(Z_TYPE_P(argv[2])) {
case IS_LONG:
convert_to_long(argv[2]);
rootid = argv[2]->value.lval;
rootid = Z_LVAL_P(argv[2]);
mode = 1;
break;
case IS_STRING:
convert_to_string(argv[2]);
urlprefix = argv[2]->value.str.val;
urlprefix = Z_STRVAL_P(argv[2]);
break;
}
}
link=argv[0]->value.lval;
id=argv[1]->value.lval;
link=Z_LVAL_P(argv[0]);
id=Z_LVAL_P(argv[1]);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -2258,7 +2258,7 @@ PHP_FUNCTION(hw_edittext)
}
convert_to_long(arg1);
convert_to_long(arg2);
link=arg1->value.lval;
link=Z_LVAL_P(arg1);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
@ -2266,7 +2266,7 @@ PHP_FUNCTION(hw_edittext)
RETURN_FALSE;
}
doc=arg2->value.lval;
doc=Z_LVAL_P(arg2);
docptr = zend_list_find(doc, &type);
if(!docptr || (type!=le_document)) {
@ -2301,8 +2301,8 @@ PHP_FUNCTION(hw_getcgi)
}
convert_to_long(arg1);
convert_to_long(arg2);
link=arg1->value.lval;
id=arg2->value.lval;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -2363,8 +2363,8 @@ PHP_FUNCTION(hw_getremote)
}
convert_to_long(arg1);
convert_to_long(arg2);
link=arg1->value.lval;
id=arg2->value.lval;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -2404,8 +2404,8 @@ PHP_FUNCTION(hw_getremotechildren)
}
convert_to_long(arg1);
convert_to_string(arg2);
link=arg1->value.lval;
objrec=arg2->value.str.val;
link=Z_LVAL_P(arg1);
objrec=Z_STRVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -2508,8 +2508,8 @@ PHP_FUNCTION(hw_setlinkroot)
}
convert_to_long(arg1);
convert_to_long(arg2);
link = arg1->value.lval;
rootid = arg2->value.lval;
link = Z_LVAL_P(arg1);
rootid = Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -2554,8 +2554,8 @@ PHP_FUNCTION(hw_pipedocument)
convert_to_long(arg1);
convert_to_long(arg2);
link=arg1->value.lval;
id=arg2->value.lval;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -2565,7 +2565,7 @@ PHP_FUNCTION(hw_pipedocument)
/* check for the array with urlprefixes */
if(argc == 3) {
convert_to_array(arg3);
prefixarray =arg3->value.ht;
prefixarray =Z_ARRVAL_P(arg3);
if((prefixarray == NULL) || (zend_hash_num_elements(prefixarray) != 5)) {
php_error(E_WARNING, "You must provide 5 urlprefixes (you have provided %d)", zend_hash_num_elements(prefixarray));
RETURN_FALSE;
@ -2663,12 +2663,12 @@ PHP_FUNCTION(hw_oldpipedocument)
convert_to_long(argv[1]);
/* if(argc == 3) {
convert_to_long(argv[2]);
rootid = argv[2]->value.lval;
rootid = Z_LVAL_P(argv[2]);
if(rootid != 0)
mode = 1;
}
*/ link=argv[0]->value.lval;
id=argv[1]->value.lval;
*/ link=Z_LVAL_P(argv[0]);
id=Z_LVAL_P(argv[1]);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -2728,8 +2728,8 @@ PHP_FUNCTION(hw_pipecgi)
}
convert_to_long(arg1);
convert_to_long(arg2);
link=arg1->value.lval;
id=arg2->value.lval;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -2794,15 +2794,15 @@ PHP_FUNCTION(hw_insertdocument)
convert_to_long(arg1);
convert_to_long(arg2);
convert_to_long(arg3);
link=arg1->value.lval;
id=arg2->value.lval;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find connection identifier %d", link);
RETURN_FALSE;
}
doc=arg3->value.lval;
doc=Z_LVAL_P(arg3);
docptr = zend_list_find(doc, &type);
if(!docptr || (type!=le_document)) {
php_error(E_WARNING, "Unable to find document identifier %d", doc);
@ -2844,17 +2844,17 @@ PHP_FUNCTION(hw_new_document)
doc = malloc(sizeof(hw_document));
if(NULL == doc)
RETURN_FALSE;
doc->data = malloc(arg3->value.lval+1);
doc->data = malloc(Z_LVAL_P(arg3)+1);
if(NULL == doc->data) {
free(doc);
RETURN_FALSE;
}
memcpy(doc->data, arg2->value.str.val, arg3->value.lval);
memcpy(doc->data, Z_STRVAL_P(arg2), Z_LVAL_P(arg3));
ptr = doc->data;
ptr[arg3->value.lval] = '\0';
doc->attributes = strdup(arg1->value.str.val);
Z_LVAL_P(ptr[arg3)] = '\0';
doc->attributes = strdup(Z_STRVAL_P(arg1));
doc->bodytag = NULL;
doc->size = arg3->value.lval;
doc->size = Z_LVAL_P(arg3);
Z_LVAL_P(return_value) = zend_list_insert(doc, le_document);
Z_TYPE_P(return_value) = IS_LONG;
}
@ -2883,7 +2883,7 @@ PHP_FUNCTION(hw_new_document_from_file)
convert_to_string_ex(arg1);
convert_to_string_ex(arg2);
fp = php_fopen_wrapper((*arg2)->value.str.val, "r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
fp = php_fopen_wrapper(Z_STRVAL_PP(arg2), "r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL TSRMLS_CC);
if (!fp && !socketd){
if (issock != BAD_URL) {
char *tmp = estrndup(Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2));
@ -2955,7 +2955,7 @@ PHP_FUNCTION(hw_new_document_from_file)
doc->data = realloc(doc->data, bcount+1);
ptr = doc->data;
ptr[bcount] = '\0';
doc->attributes = strdup((*arg1)->value.str.val);
doc->attributes = strdup(Z_STRVAL_PP(arg1));
doc->bodytag = NULL;
doc->size = bcount;
Z_LVAL_P(return_value) = zend_list_insert(doc, le_document);
@ -2976,7 +2976,7 @@ PHP_FUNCTION(hw_free_document)
WRONG_PARAM_COUNT;
}
convert_to_long(arg1);
id=arg1->value.lval;
id=Z_LVAL_P(arg1);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_document)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3003,7 +3003,7 @@ PHP_FUNCTION(hw_output_document)
WRONG_PARAM_COUNT;
}
convert_to_long(arg1);
id=arg1->value.lval;
id=Z_LVAL_P(arg1);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_document)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3037,7 +3037,7 @@ PHP_FUNCTION(hw_document_bodytag)
RETURN_FALSE;
convert_to_long(argv[0]);
id=argv[0]->value.lval;
id=Z_LVAL_P(argv[0]);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_document)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3046,14 +3046,14 @@ PHP_FUNCTION(hw_document_bodytag)
if(argc == 2) {
convert_to_string(argv[1]);
str=argv[1]->value.str.val;
str=Z_STRVAL_P(argv[1]);
}
if(str != NULL) {
temp = emalloc(argv[1]->value.str.len + strlen(ptr->bodytag) + 2);
temp = emalloc(Z_STRLEN_P(argv[1]) + strlen(ptr->bodytag) + 2);
strcpy(temp, ptr->bodytag);
strcpy(temp+strlen(ptr->bodytag)-1, str);
strcpy(temp+strlen(ptr->bodytag)-1+argv[1]->value.str.len, ">\n");
strcpy(temp+strlen(ptr->bodytag)-1+Z_STRLEN_P(argv[1]), ">\n");
RETURN_STRING(temp, 0);
} else {
//fprintf(stderr, "hw_document_bodytag: %s (%s)\n", ptr->bodytag, ptr->attributes);
@ -3082,7 +3082,7 @@ PHP_FUNCTION(hw_document_content)
RETURN_FALSE;
convert_to_long(argv[0]);
id=argv[0]->value.lval;
id=Z_LVAL_P(argv[0]);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_document)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3111,7 +3111,7 @@ PHP_FUNCTION(hw_document_setcontent)
convert_to_long(argv[0]);
convert_to_string(argv[1]);
id=argv[0]->value.lval;
id=Z_LVAL_P(argv[0]);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_document)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3119,7 +3119,7 @@ PHP_FUNCTION(hw_document_setcontent)
}
str = ptr->data;
if(NULL != (ptr->data = strdup(argv[1]->value.str.val))) {
if(NULL != (ptr->data = strdup(Z_STRVAL_P(argv[1])))) {
ptr->size = strlen(ptr->data);
free(str);
RETURN_TRUE;
@ -3146,7 +3146,7 @@ PHP_FUNCTION(hw_document_size)
WRONG_PARAM_COUNT;
}
convert_to_long(arg1);
id=arg1->value.lval;
id=Z_LVAL_P(arg1);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_document)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3173,7 +3173,7 @@ PHP_FUNCTION(hw_document_attributes)
WRONG_PARAM_COUNT;
}
convert_to_long(arg1);
id=arg1->value.lval;
id=Z_LVAL_P(arg1);
ptr = zend_list_find(id, &type);
if(!ptr || (type!=le_document)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3200,8 +3200,8 @@ PHP_FUNCTION(hw_getparentsobj)
}
convert_to_long(arg1);
convert_to_long(arg2);
link=arg1->value.lval;
id=arg2->value.lval;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3235,8 +3235,8 @@ PHP_FUNCTION(hw_getparents)
}
convert_to_long(arg1);
convert_to_long(arg2);
link=arg1->value.lval;
id=arg2->value.lval;
link=Z_LVAL_P(arg1);
id=Z_LVAL_P(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3281,8 +3281,8 @@ PHP_FUNCTION(hw_children)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3328,8 +3328,8 @@ PHP_FUNCTION(hw_childrenobj)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3363,8 +3363,8 @@ PHP_FUNCTION(hw_getchildcoll)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3410,8 +3410,8 @@ PHP_FUNCTION(hw_getchildcollobj)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3444,8 +3444,8 @@ PHP_FUNCTION(hw_docbyanchor)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3476,8 +3476,8 @@ PHP_FUNCTION(hw_docbyanchorobj)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3516,9 +3516,9 @@ PHP_FUNCTION(hw_getobjectbyquery)
convert_to_long_ex(arg1);
convert_to_string_ex(arg2);
convert_to_long_ex(arg3);
link=(*arg1)->value.lval;
query=(*arg2)->value.str.val;
maxhits=(*arg3)->value.lval;
link=Z_LVAL_PP(arg1);
query=Z_STRVAL_PP(arg2);
maxhits=Z_LVAL_PP(arg3);
if (maxhits < 0) maxhits=0x7FFFFFFF;
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
@ -3560,9 +3560,9 @@ PHP_FUNCTION(hw_getobjectbyqueryobj)
convert_to_long_ex(arg1);
convert_to_string_ex(arg2);
convert_to_long_ex(arg3);
link=(*arg1)->value.lval;
query=(*arg2)->value.str.val;
maxhits=(*arg3)->value.lval;
link=Z_LVAL_PP(arg1);
query=Z_STRVAL_PP(arg2);
maxhits=Z_LVAL_PP(arg3);
if (maxhits < 0) maxhits=0x7FFFFFFF;
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
@ -3600,10 +3600,10 @@ PHP_FUNCTION(hw_getobjectbyquerycoll)
convert_to_long_ex(arg2);
convert_to_string_ex(arg3);
convert_to_long_ex(arg4);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
query=(*arg3)->value.str.val;
maxhits=(*arg4)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
query=Z_STRVAL_PP(arg3);
maxhits=Z_LVAL_PP(arg4);
if (maxhits < 0) maxhits=0x7FFFFFFF;
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
@ -3646,10 +3646,10 @@ PHP_FUNCTION(hw_getobjectbyquerycollobj)
convert_to_long_ex(arg2);
convert_to_string_ex(arg3);
convert_to_long_ex(arg4);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
query=(*arg3)->value.str.val;
maxhits=(*arg4)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
query=Z_STRVAL_PP(arg3);
maxhits=Z_LVAL_PP(arg4);
if (maxhits < 0) maxhits=0x7FFFFFFF;
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
@ -3687,9 +3687,9 @@ PHP_FUNCTION(hw_getobjectbyftquery)
convert_to_long_ex(arg1);
convert_to_string_ex(arg2);
convert_to_long_ex(arg3);
link=(*arg1)->value.lval;
query=(*arg2)->value.str.val;
maxhits=(*arg3)->value.lval;
link=Z_LVAL_PP(arg1);
query=Z_STRVAL_PP(arg2);
maxhits=Z_LVAL_PP(arg3);
if (maxhits < 0) maxhits=0x7FFFFFFF;
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
@ -3732,9 +3732,9 @@ PHP_FUNCTION(hw_getobjectbyftqueryobj)
convert_to_long_ex(arg1);
convert_to_string_ex(arg2);
convert_to_long_ex(arg3);
link=(*arg1)->value.lval;
query=(*arg2)->value.str.val;
maxhits=(*arg3)->value.lval;
link=Z_LVAL_PP(arg1);
query=Z_STRVAL_PP(arg2);
maxhits=Z_LVAL_PP(arg3);
if (maxhits < 0) maxhits=0x7FFFFFFF;
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
@ -3773,10 +3773,10 @@ PHP_FUNCTION(hw_getobjectbyftquerycoll)
convert_to_long_ex(arg2);
convert_to_string_ex(arg3);
convert_to_long_ex(arg4);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
query=(*arg3)->value.str.val;
maxhits=(*arg4)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
query=Z_STRVAL_PP(arg3);
maxhits=Z_LVAL_PP(arg4);
if (maxhits < 0) maxhits=0x7FFFFFFF;
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
@ -3820,10 +3820,10 @@ PHP_FUNCTION(hw_getobjectbyftquerycollobj)
convert_to_long_ex(arg2);
convert_to_string_ex(arg3);
convert_to_long_ex(arg4);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
query=(*arg3)->value.str.val;
maxhits=(*arg4)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
query=Z_STRVAL_PP(arg3);
maxhits=Z_LVAL_PP(arg4);
if (maxhits < 0) maxhits=0x7FFFFFFF;
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
@ -3858,8 +3858,8 @@ PHP_FUNCTION(hw_getchilddoccoll)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3898,8 +3898,8 @@ PHP_FUNCTION(hw_getchilddoccollobj)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3934,8 +3934,8 @@ PHP_FUNCTION(hw_getanchors)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -3974,8 +3974,8 @@ PHP_FUNCTION(hw_getanchorsobj)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = (hw_connection *) zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", id);
@ -4006,7 +4006,7 @@ PHP_FUNCTION(hw_getusername)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg1);
link = (*arg1)->value.lval;
link = Z_LVAL_PP(arg1);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -4034,9 +4034,9 @@ PHP_FUNCTION(hw_identify)
convert_to_long_ex(arg1);
convert_to_string_ex(arg2);
convert_to_string_ex(arg3);
link = (*arg1)->value.lval;
name=(*arg2)->value.str.val;
passwd=(*arg3)->value.str.val;
link = Z_LVAL_PP(arg1);
name=Z_STRVAL_PP(arg2);
passwd=Z_STRVAL_PP(arg3);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -4080,14 +4080,14 @@ PHP_FUNCTION(hw_objrec2array)
if(zend_get_parameters_ex(1, &arg1) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_string_ex(arg1);
make2_return_array_from_objrec(&return_value, (*arg1)->value.str.val, NULL);
make2_return_array_from_objrec(&return_value, Z_STRVAL_PP(arg1), NULL);
break;
case 2:
if(zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE)
WRONG_PARAM_COUNT;
convert_to_array_ex(arg2);
convert_to_string_ex(arg1);
make2_return_array_from_objrec(&return_value, (*arg1)->value.str.val, *arg2);
make2_return_array_from_objrec(&return_value, Z_STRVAL_PP(arg1), *arg2);
break;
default:
WRONG_PARAM_COUNT;
@ -4106,7 +4106,7 @@ PHP_FUNCTION(hw_array2objrec)
WRONG_PARAM_COUNT;
}
convert_to_array_ex(arg1);
objrec = make_objrec_from_array((*arg1)->value.ht);
objrec = make_objrec_from_array(Z_ARRVAL_PP(arg1));
if(objrec) {
retobj = estrdup(objrec);
free(objrec);
@ -4132,22 +4132,22 @@ PHP_FUNCTION(hw_incollections)
convert_to_array_ex(arg2);
convert_to_array_ex(arg3);
convert_to_long_ex(arg4);
link = (*arg1)->value.lval;
retcoll=(*arg4)->value.lval;
link = Z_LVAL_PP(arg1);
retcoll=Z_LVAL_PP(arg4);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
RETURN_FALSE;
}
cobjids = zend_hash_num_elements((*arg2)->value.ht);
if(NULL == (objectIDs = make_ints_from_array((*arg2)->value.ht))) {
cobjids = zend_hash_num_elements(Z_ARRVAL_PP(arg2));
if(NULL == (objectIDs = make_ints_from_array(Z_ARRVAL_PP(arg2)))) {
php_error(E_WARNING, "Could not create Int Array from Array\n");
RETURN_FALSE;
}
ccollids = zend_hash_num_elements((*arg3)->value.ht);
if(NULL == (collIDs = make_ints_from_array((*arg3)->value.ht))) {
ccollids = zend_hash_num_elements(Z_ARRVAL_PP(arg3));
if(NULL == (collIDs = make_ints_from_array(Z_ARRVAL_PP(arg3)))) {
php_error(E_WARNING, "Could not create Int Array from Array\n");
efree(objectIDs);
RETURN_FALSE;
@ -4193,15 +4193,15 @@ PHP_FUNCTION(hw_inscoll)
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
convert_to_array_ex(arg3);
link = (*arg1)->value.lval;
id=(*arg2)->value.lval;
link = Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
RETURN_FALSE;
}
if(NULL == (objrec = make_objrec_from_array((*arg3)->value.ht))) {
if(NULL == (objrec = make_objrec_from_array(Z_ARRVAL_PP(arg3)))) {
php_error(E_WARNING, "Could not create Object Record from Array\n");
RETURN_FALSE;
}
@ -4238,12 +4238,12 @@ PHP_FUNCTION(hw_insdoc)
convert_to_string_ex(argv[2]);
if(argc == 4) {
convert_to_string_ex(argv[3]);
text = (*argv[3])->value.str.val;
text = Z_STRVAL_PP(argv[3]);
} else {
text = NULL;
}
link = (*argv[0])->value.lval;
id = (*argv[1])->value.lval;
link = Z_LVAL_PP(argv[0]);
id = Z_LVAL_PP(argv[1]);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -4251,7 +4251,7 @@ PHP_FUNCTION(hw_insdoc)
}
set_swap(ptr->swap_on);
objrec = (*argv[2])->value.str.val;
objrec = Z_STRVAL_PP(argv[2]);
if (0 != (ptr->lasterror = send_insdoc(ptr->socket, id, objrec, text, &newid))) {
RETURN_FALSE;
}
@ -4275,8 +4275,8 @@ PHP_FUNCTION(hw_getsrcbydestobj)
}
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
link=(*arg1)->value.lval;
id=(*arg2)->value.lval;
link=Z_LVAL_PP(arg1);
id=Z_LVAL_PP(arg2);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -4309,9 +4309,9 @@ PHP_FUNCTION(hw_mapid)
convert_to_long_ex(arg1);
convert_to_long_ex(arg2);
convert_to_long_ex(arg3);
link=(*arg1)->value.lval;
servid=(*arg2)->value.lval;
id=(*arg3)->value.lval;
link=Z_LVAL_PP(arg1);
servid=Z_LVAL_PP(arg2);
id=Z_LVAL_PP(arg3);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -4344,10 +4344,10 @@ PHP_FUNCTION(hw_getrellink)
convert_to_long_ex(arg2);
convert_to_long_ex(arg3);
convert_to_long_ex(arg4);
link=(*arg1)->value.lval;
rootid=(*arg2)->value.lval;
sourceid=(*arg3)->value.lval;
destid=(*arg4)->value.lval;
link=Z_LVAL_PP(arg1);
rootid=Z_LVAL_PP(arg2);
sourceid=Z_LVAL_PP(arg3);
destid=Z_LVAL_PP(arg4);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);
@ -4397,7 +4397,7 @@ PHP_FUNCTION(hw_insertanchors)
convert_to_long_ex(arg1);
convert_to_array_ex(arg2);
convert_to_array_ex(arg3);
docid=(*arg1)->value.lval;
docid=Z_LVAL_PP(arg1);
hwdoc = zend_list_find(docid, &type);
if(!hwdoc || (type!=le_document)) {
php_error(E_WARNING, "Unable to find file identifier %d", docid);
@ -4408,7 +4408,7 @@ PHP_FUNCTION(hw_insertanchors)
if(argc == 4) {
int i;
convert_to_array_ex(arg4);
prefixarray =(*arg4)->value.ht;
prefixarray =Z_ARRVAL_PP(arg4);
if((prefixarray == NULL) || (zend_hash_num_elements(prefixarray) != 5)) {
php_error(E_WARNING, "You must provide 5 urlprefixes (you have provided %d)", zend_hash_num_elements(prefixarray));
RETURN_FALSE;
@ -4447,15 +4447,15 @@ PHP_FUNCTION(hw_insertanchors)
urlprefix = NULL;
}
if(zend_hash_num_elements((*arg2)->value.ht) != zend_hash_num_elements((*arg3)->value.ht)) {
if(zend_hash_num_elements(Z_ARRVAL_PP(arg2)) != zend_hash_num_elements(Z_ARRVAL_PP(arg3))) {
php_error(E_WARNING, "Unequal number of elments in arrays");
RETURN_FALSE;
}
/* Turn PHP-Array of strings into C-Array of strings */
arrht = (*arg2)->value.ht;
arrht = Z_ARRVAL_PP(arg2);
anchorrecs = make_strs_from_array(arrht);
arrht = (*arg3)->value.ht;
arrht = Z_ARRVAL_PP(arg3);
dest = make_strs_from_array(arrht);
if (0 != (error = send_insertanchors(&(hwdoc->data), &count, anchorrecs, dest, zend_hash_num_elements(arrht), urlprefix, &bodytag))) {
@ -4493,7 +4493,7 @@ PHP_FUNCTION(hw_connection_info)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg1);
link=(*arg1)->value.lval;
link=Z_LVAL_PP(arg1);
ptr = zend_list_find(link, &type);
if(!ptr || (type!=le_socketp && type!=le_psocketp)) {
php_error(E_WARNING, "Unable to find file identifier %d", link);

102
ext/informix/ifx.ec

@ -338,7 +338,7 @@ PHP_MINIT_FUNCTION(ifx)
le_idresult = zend_register_list_destructors_ex(NULL, NULL, "informix id result", module_number);
le_link = zend_register_list_destructors_ex(_close_ifx_link,NULL, "informix link", module_number);
le_plink = zend_register_list_destructors_ex(NULL,_close_ifx_plink,"informix persistent link", module_number);
ifx_module_entry.type = type;
Z_TYPE(ifx_module_entry) = type;
REGISTER_LONG_CONSTANT("IFX_SCROLL", IFX_SCROLL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("IFX_HOLD", IFX_HOLD, CONST_CS | CONST_PERSISTENT);
@ -513,7 +513,7 @@ EXEC SQL END DECLARE SECTION;
}
/* hash it up */
new_le.type = le_plink;
Z_TYPE(new_le) = le_plink;
new_le.ptr = ifx;
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE)
{
@ -524,7 +524,7 @@ EXEC SQL END DECLARE SECTION;
IFXG(num_persistent)++;
IFXG(num_links)++;
} else { /* we do */
if (le->type != le_plink) {
if (Z_TYPE_P(le) != le_plink) {
RETURN_FALSE;
}
/* ensure that the link did not die */
@ -558,7 +558,7 @@ EXEC SQL END DECLARE SECTION;
int type,link;
void *ptr;
if (index_ptr->type != le_index_ptr) {
if (Z_TYPE_P(index_ptr) != le_index_ptr) {
RETURN_FALSE;
}
link = (int) index_ptr->ptr;
@ -581,9 +581,9 @@ EXEC SQL END DECLARE SECTION;
}
}
zend_list_addref(link);
return_value->value.lval = link;
Z_LVAL_P(return_value) = link;
php_ifx_set_default_link(link TSRMLS_CC);
return_value->type = IS_RESOURCE;
Z_TYPE_P(return_value) = IS_RESOURCE;
efree(hashed_details);
return;
} else {
@ -614,8 +614,8 @@ EXEC SQL END DECLARE SECTION;
ZEND_REGISTER_RESOURCE(return_value, ifx, le_link);
/* add it to the hash */
new_index_ptr.ptr = (void *) return_value->value.lval;
new_index_ptr.type = le_index_ptr;
new_index_ptr.ptr = (void *) Z_LVAL_P(return_value);
Z_TYPE(new_index_ptr) = le_index_ptr;
if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length+1, (void *) &new_index_ptr, sizeof(list_entry), NULL) == FAILURE)
{
efree(hashed_details);
@ -624,7 +624,7 @@ EXEC SQL END DECLARE SECTION;
IFXG(num_links)++;
}
efree(hashed_details);
php_ifx_set_default_link(return_value->value.lval TSRMLS_CC);
php_ifx_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC);
}
/* {{{ proto int ifx_connect([string database [, string userid [, string password]]])
@ -865,25 +865,25 @@ EXEC SQL END DECLARE SECTION;
RETURN_FALSE;
}
zend_hash_internal_pointer_reset((*pblobidarr)->value.ht);
zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pblobidarr));
i=1;
while (zend_hash_get_current_data((*pblobidarr)->value.ht, (void **) &tmp) == SUCCESS) {
while (zend_hash_get_current_data(Z_ARRVAL_PP(pblobidarr), (void **) &tmp) == SUCCESS) {
convert_to_long(*tmp);
if ((query_type == SQ_UPDATE) || (query_type == SQ_UPDALL)) {
EXEC SQL SET DESCRIPTOR :descrpid COUNT = :i;
}
ifx_type=php_intifx_getType((int)(*tmp)->value.lval,&EG(regular_list) TSRMLS_CC);
ifx_type=php_intifx_getType((int)Z_LVAL_PP(tmp),&EG(regular_list) TSRMLS_CC);
switch(ifx_type) {
case TYPE_BLTEXT:
case TYPE_BLBYTE:
locator=php_intifx_get_blobloc((int)((*tmp)->value.lval),&EG(regular_list) TSRMLS_CC);
locator=php_intifx_get_blobloc((int)(Z_LVAL_PP(tmp)),&EG(regular_list) TSRMLS_CC);
if(locator==NULL) {
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
efree(Ifx_Result);
php_error(E_WARNING,"%d is not a Informix blob-result index", (int)((*tmp)->value.lval));
php_error(E_WARNING,"%d is not a Informix blob-result index", (int)(Z_LVAL_PP(tmp)));
RETURN_FALSE;
}
if(locator->loc_loctype==LOCFNAME) {
@ -893,7 +893,7 @@ EXEC SQL END DECLARE SECTION;
break;
case TYPE_CHAR:
len=php_intifx_get_char((int)((*tmp)->value.lval),&EG(regular_list),&char_tmp TSRMLS_CC);
len=php_intifx_get_char((int)(Z_LVAL_PP(tmp)),&EG(regular_list),&char_tmp TSRMLS_CC);
indicator=0;
if(char_tmp==NULL || len<0) {
indicator=-1;
@ -908,7 +908,7 @@ EXEC SQL END DECLARE SECTION;
break;
}
i++;
zend_hash_move_forward((*pblobidarr)->value.ht);
zend_hash_move_forward(Z_ARRVAL_PP(pblobidarr));
}
Ifx_Result->paramquery=1;
EXEC SQL EXECUTE :statemid USING SQL DESCRIPTOR :descrpid;
@ -1209,7 +1209,7 @@ EXEC SQL END DECLARE SECTION;
RETURN_FALSE;
}
if((*pblobidarr)->type != IS_ARRAY) {
if(Z_TYPE_PP(pblobidarr) != IS_ARRAY) {
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
@ -1218,25 +1218,25 @@ EXEC SQL END DECLARE SECTION;
RETURN_FALSE;
}
zend_hash_internal_pointer_reset((*pblobidarr)->value.ht);
zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pblobidarr));
i=1;
while (zend_hash_get_current_data((*pblobidarr)->value.ht, (void **) &tmp) == SUCCESS) {
while (zend_hash_get_current_data(Z_ARRVAL_PP(pblobidarr), (void **) &tmp) == SUCCESS) {
convert_to_long(*tmp);
if ((query_type == SQ_UPDATE) || (query_type == SQ_UPDALL)) {
EXEC SQL SET DESCRIPTOR :descrpid COUNT = :i;
}
ifx_type=php_intifx_getType((int)(*tmp)->value.lval,&EG(regular_list) TSRMLS_CC);
ifx_type=php_intifx_getType((int)Z_LVAL_PP(tmp),&EG(regular_list) TSRMLS_CC);
switch(ifx_type) {
case TYPE_BLTEXT:
case TYPE_BLBYTE:
locator=php_intifx_get_blobloc((int)((*tmp)->value.lval),&EG(regular_list) TSRMLS_CC);
locator=php_intifx_get_blobloc((int)(Z_LVAL_PP(tmp)),&EG(regular_list) TSRMLS_CC);
if(locator==NULL) {
IFXG(sv_sqlcode) = SQLCODE;
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
efree(Ifx_Result);
php_error(E_WARNING,"%d is not a Informix blob-result index", (int)((*tmp)->value.lval));
php_error(E_WARNING,"%d is not a Informix blob-result index", (int)(Z_LVAL_PP(tmp)));
RETURN_FALSE;
}
if(locator->loc_loctype==LOCFNAME) {
@ -1245,7 +1245,7 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA= :*locator, TYPE=:loc_t_type;
break;
case TYPE_CHAR:
len=php_intifx_get_char((int)((*tmp)->value.lval),&EG(regular_list),&char_tmp TSRMLS_CC);
len=php_intifx_get_char((int)(Z_LVAL_PP(tmp)),&EG(regular_list),&char_tmp TSRMLS_CC);
indicator=0;
if(char_tmp==NULL || len < 0) {
@ -1261,7 +1261,7 @@ EXEC SQL END DECLARE SECTION;
break;
}
i++;
zend_hash_move_forward((*pblobidarr)->value.ht);
zend_hash_move_forward(Z_ARRVAL_PP(pblobidarr));
}
}
@ -2032,7 +2032,7 @@ EXEC SQL END DECLARE SECTION;
if (zend_get_parameters_ex(2, &result, &arg2)==FAILURE) {
RETURN_FALSE;
}
table_options = (*arg2)->value.str.val;
table_options = Z_STRVAL_PP(arg2);
break;
default:
WRONG_PARAM_COUNT;
@ -2796,7 +2796,7 @@ static long php_intifx_getType(long id, HashTable *list TSRMLS_DC)
php_error(E_WARNING,"%d is not a Informix id-result index", id);
return -1;
}
return Ifx_res->type;
return IZ_TYPE_P(fx_res);
}
/* ----------------------------------------------------------------------
@ -2873,9 +2873,9 @@ static long php_intifx_create_blob(long type, long mode, char* param, long len,
memset(Ifx_blob, 0, sizeof(IFX_IDRES));
if(type==0 ) {
Ifx_blob->type=TYPE_BLBYTE;
IZ_TYPE_P(fx_blob)=TYPE_BLBYTE;
} else {
Ifx_blob->type=TYPE_BLTEXT;
IZ_TYPE_P(fx_blob)=TYPE_BLTEXT;
}
Ifx_blob->BLOB.mode=(int)mode;
@ -2965,7 +2965,7 @@ static long php_intifx_copy_blob(long bid, HashTable *list TSRMLS_DC)
int type;
Ifx_blob_orig = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult || !(Ifx_blob_orig->type==TYPE_BLBYTE || Ifx_blob_orig->type==TYPE_BLTEXT)) {
if (type!=le_idresult || !(IZ_TYPE_P(fx_blob_orig)==TYPE_BLBYTE || IZ_TYPE_P(fx_blob_orig)==TYPE_BLTEXT)) {
php_error(E_WARNING,"%d is not a Informix blob-result index", bid);
return -1;
}
@ -2978,7 +2978,7 @@ static long php_intifx_copy_blob(long bid, HashTable *list TSRMLS_DC)
memset(Ifx_blob, 0, sizeof(IFX_IDRES));
Ifx_blob->type=Ifx_blob_orig->type;
IZ_TYPE_P(fx_blob)=IZ_TYPE_P(fx_blob_orig);
Ifx_blob->BLOB.mode=Ifx_blob_orig->BLOB.mode;
locator=&(Ifx_blob->BLOB.blob_data);
@ -3041,7 +3041,7 @@ PHP_FUNCTION(ifx_free_blob)
}
convert_to_long(pid);
ret=php_intifx_free_blob(pid->value.lval,&EG(regular_list) TSRMLS_CC);
ret=php_intifx_free_blob(Z_LVAL_P(pid),&EG(regular_list) TSRMLS_CC);
if(ret<0) {
RETURN_FALSE;
}
@ -3067,7 +3067,7 @@ static long php_intifx_free_blob(long bid, HashTable *list TSRMLS_DC)
int type;
Ifx_blob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult && !(Ifx_blob->type==TYPE_BLTEXT || Ifx_blob->type==TYPE_BLBYTE)) {
if (type!=le_idresult && !(IZ_TYPE_P(fx_blob)==TYPE_BLTEXT || IZ_TYPE_P(fx_blob)==TYPE_BLBYTE)) {
php_error(E_WARNING,"%d is not a Informix blob-result index", bid);
return -1;
}
@ -3105,7 +3105,7 @@ static long php_intifx2_free_blob(long bid, HashTable *list TSRMLS_DC)
int type;
Ifx_blob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult && !(Ifx_blob->type==TYPE_BLTEXT || Ifx_blob->type==TYPE_BLBYTE)) {
if (type!=le_idresult && !(IZ_TYPE_P(fx_blob)==TYPE_BLTEXT || IZ_TYPE_P(fx_blob)==TYPE_BLBYTE)) {
php_error(E_WARNING,"%d is not a Informix blob-result index", bid);
return -1;
}
@ -3152,7 +3152,7 @@ PHP_FUNCTION(ifx_get_blob)
}
convert_to_long(pbid);
len=php_intifx_get_blob(pbid->value.lval,&EG(regular_list),&content TSRMLS_CC);
len=php_intifx_get_blob(Z_LVAL_P(pbid),&EG(regular_list),&content TSRMLS_CC);
if(content==NULL || len<0) {
RETURN_STRING(php_intifx_null(TSRMLS_C),1);
}
@ -3178,7 +3178,7 @@ static long php_intifx_get_blob(long bid, HashTable *list, char** content TSRMLS
int type;
Ifx_blob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult && !(Ifx_blob->type==TYPE_BLTEXT || Ifx_blob->type==TYPE_BLBYTE)) {
if (type!=le_idresult && !(IZ_TYPE_P(fx_blob)==TYPE_BLTEXT || IZ_TYPE_P(fx_blob)==TYPE_BLBYTE)) {
php_error(E_WARNING,"%d is not a Informix blob-result index", bid);
return -1;
}
@ -3207,7 +3207,7 @@ static loc_t *php_intifx_get_blobloc(long bid, HashTable *list TSRMLS_DC)
int type;
Ifx_blob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult && !(Ifx_blob->type==TYPE_BLTEXT || Ifx_blob->type==TYPE_BLBYTE)) {
if (type!=le_idresult && !(IZ_TYPE_P(fx_blob)==TYPE_BLTEXT || IZ_TYPE_P(fx_blob)==TYPE_BLBYTE)) {
php_error(E_WARNING,"%d is not a Informix blob-result index", bid);
return NULL;
}
@ -3263,7 +3263,7 @@ static long php_intifx_update_blob(long bid, char* param, long len, HashTable *l
int type;
Ifx_blob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult && !(Ifx_blob->type==TYPE_BLTEXT || Ifx_blob->type==TYPE_BLBYTE)) {
if (type!=le_idresult && !(IZ_TYPE_P(fx_blob)==TYPE_BLTEXT || IZ_TYPE_P(fx_blob)==TYPE_BLBYTE)) {
php_error(E_WARNING,"%d is not a Informix blob-result index", bid);
return -1;
}
@ -3511,7 +3511,7 @@ static long php_intifx_create_char(char* param, long len, HashTable *list)
return -1;
}
Ifx_char->type=TYPE_CHAR;
IZ_TYPE_P(fx_char)=TYPE_CHAR;
if(param==NULL || len<0) {
Ifx_char->CHAR.char_data=NULL;
@ -3578,7 +3578,7 @@ static long php_intifx_get_char(long bid, HashTable *list, char** content TSRMLS
int type;
Ifx_char = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult && !(Ifx_char->type==TYPE_CHAR)) {
if (type!=le_idresult && !(IZ_TYPE_P(fx_char)==TYPE_CHAR)) {
php_error(E_WARNING,"%d is not a Informix char-result index", bid);
return -1;
}
@ -3631,7 +3631,7 @@ static long php_intifx_free_char(long bid, HashTable *list TSRMLS_DC)
int type;
Ifx_char = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult && !(Ifx_char->type==TYPE_CHAR)) {
if (type!=le_idresult && !(IZ_TYPE_P(fx_char)==TYPE_CHAR)) {
php_error(E_WARNING,"%d is not a Informix char-result index", bid);
return -1;
}
@ -3691,7 +3691,7 @@ static long php_intifx_update_char(long bid, char* param, long len, HashTable *l
int type;
Ifx_char = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult && !(Ifx_char->type==TYPE_CHAR)) {
if (type!=le_idresult && !(IZ_TYPE_P(fx_char)==TYPE_CHAR)) {
php_error(E_WARNING,"%d is not a Informix char-result index", bid);
return -1;
}
@ -3793,7 +3793,7 @@ static long php_intifxus_create_slob(long create_mode, HashTable *list)
return -1;
}
Ifx_slob->type=TYPE_SLOB;
IZ_TYPE_P(fx_slob)=TYPE_SLOB;
Ifx_slob->SLOB.lofd=ifx_lo_create(Ifx_slob->SLOB.createspec,create_mode,&(Ifx_slob->SLOB.slob_data),&errcode);
if(errcode<0 || Ifx_slob->SLOB.lofd<0) {
php_error(E_WARNING,"can't create slob-resource: %d", errcode);
@ -3846,7 +3846,7 @@ static long php_intifxus_free_slob(long bid, HashTable *list TSRMLS_DC)
int type;
Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) {
if (type!=le_idresult || IZ_TYPE_P(fx_slob)!=TYPE_SLOB) {
php_error(E_WARNING,"%d is not a Informix slob-result index", bid);
return -1;
}
@ -3907,7 +3907,7 @@ static long php_intifxus_close_slob(long bid, HashTable *list TSRMLS_DC)
int type;
Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) {
if (type!=le_idresult || IZ_TYPE_P(fx_slob)!=TYPE_SLOB) {
php_error(E_WARNING,"%d is not a Informix slob-result index", bid);
return -1;
}
@ -3985,7 +3985,7 @@ static long php_intifxus_open_slob(long bid, long create_mode, HashTable *list T
int type;
Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) {
if (type!=le_idresult || IZ_TYPE_P(fx_slob)!=TYPE_SLOB) {
php_error(E_WARNING,"%d is not a Informix slob-result index", bid);
return -1;
}
@ -4022,7 +4022,7 @@ static long php_intifxus_new_slob(HashTable *list)
return -1;
}
Ifx_slob->type=TYPE_SLOB;
IZ_TYPE_P(fx_slob)=TYPE_SLOB;
Ifx_slob->SLOB.lofd=-1;
Ifx_slob->SLOB.createspec=NULL;
return zend_list_insert(Ifx_slob,le_idresult);
@ -4043,7 +4043,7 @@ static ifx_lo_t *php_intifxus_get_slobloc(long bid, HashTable *list TSRMLS_DC)
int type;
Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) {
if (type!=le_idresult || IZ_TYPE_P(fx_slob)!=TYPE_SLOB) {
php_error(E_WARNING,"%d is not a Informix slob-result index", bid);
return NULL;
}
@ -4077,7 +4077,7 @@ PHP_FUNCTION(ifxus_tell_slob)
bid=Z_LVAL_P(pbid);
Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) {
if (type!=le_idresult || IZ_TYPE_P(fx_slob)!=TYPE_SLOB) {
php_error(E_WARNING,"%d is not a Informix slob-result index", bid);
RETURN_FALSE;
}
@ -4125,7 +4125,7 @@ PHP_FUNCTION(ifxus_seek_slob)
bid=Z_LVAL_P(pbid);
Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) {
if (type!=le_idresult || IZ_TYPE_P(fx_slob)!=TYPE_SLOB) {
php_error(E_WARNING,"%d is not a Informix slob-result index", bid);
RETURN_FALSE;
}
@ -4180,7 +4180,7 @@ PHP_FUNCTION(ifxus_read_slob)
bid=Z_LVAL_P(pbid);
Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) {
if (type!=le_idresult || IZ_TYPE_P(fx_slob)!=TYPE_SLOB) {
php_error(E_WARNING,"%d is not a Informix slob-result index", bid);
RETURN_FALSE;
}
@ -4224,7 +4224,7 @@ PHP_FUNCTION(ifxus_write_slob)
bid=Z_LVAL_P(pbid);
Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type);
if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) {
if (type!=le_idresult || IZ_TYPE_P(fx_slob)!=TYPE_SLOB) {
php_error(E_WARNING,"%d is not a Informix slob-result index", bid);
RETURN_FALSE;
}

34
ext/interbase/interbase.c

@ -709,38 +709,38 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
switch(ZEND_NUM_ARGS()) {
case 7:
convert_to_string_ex(args[6]);
ib_role = (*args[6])->value.str.val;
hashed_details_length += (*args[6])->value.str.len;
ib_role = Z_STRVAL_PP(args[6]);
hashed_details_length += Z_STRLEN_PP(args[6]);
/* fallout */
case 6:
convert_to_string_ex(args[5]);
ib_dialect = (*args[5])->value.str.val;
hashed_details_length += (*args[5])->value.str.len;
ib_dialect = Z_STRVAL_PP(args[5]);
hashed_details_length += Z_STRLEN_PP(args[5]);
/* fallout */
case 5:
convert_to_string_ex(args[4]);
ib_buffers = (*args[4])->value.str.val;
hashed_details_length += (*args[4])->value.str.len;
ib_buffers = Z_STRVAL_PP(args[4]);
hashed_details_length += Z_STRLEN_PP(args[4]);
/* fallout */
case 4:
convert_to_string_ex(args[3]);
ib_charset = (*args[3])->value.str.val;
hashed_details_length += (*args[3])->value.str.len;
ib_charset = Z_STRVAL_PP(args[3]);
hashed_details_length += Z_STRLEN_PP(args[3]);
/* fallout */
case 3:
convert_to_string_ex(args[2]);
ib_passwd = (*args[2])->value.str.val;
hashed_details_length += (*args[2])->value.str.len;
ib_passwd = Z_STRVAL_PP(args[2]);
hashed_details_length += Z_STRLEN_PP(args[2]);
/* fallout */
case 2:
convert_to_string_ex(args[1]);
ib_uname = (*args[1])->value.str.val;
hashed_details_length += (*args[1])->value.str.len;
ib_uname = Z_STRVAL_PP(args[1]);
hashed_details_length += Z_STRLEN_PP(args[1]);
/* fallout */
case 1:
convert_to_string_ex(args[0]);
ib_server = (*args[0])->value.str.val;
hashed_details_length += (*args[0])->value.str.len;
ib_server = Z_STRVAL_PP(args[0]);
hashed_details_length += Z_STRLEN_PP(args[0]);
} /* case */
efree(args);
@ -1497,7 +1497,7 @@ PHP_FUNCTION(ibase_trans)
/* First argument is transaction parameters */
convert_to_long_ex(args[0]);
trans_argl = (*args[0])->value.lval;
trans_argl = Z_LVAL_PP(args[0]);
efree(args);
}
@ -2299,10 +2299,10 @@ PHP_FUNCTION(ibase_timefmt)
switch (ZEND_NUM_ARGS()) {
case 2:
convert_to_long_ex(args[1]);
type = (*args[1])->value.lval;
type = Z_LVAL_PP(args[1]);
case 1:
convert_to_string_ex(args[0]);
fmt = (*args[0])->value.str.val;
fmt = Z_STRVAL_PP(args[0]);
}
switch (type) {

2
ext/java/java.c

@ -438,7 +438,7 @@ void java_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_refe
return;
}
className=(*jenv)->NewStringUTF(jenv, arguments[0]->value.str.val);
className=(*jenv)->NewStringUTF(jenv, Z_STRVAL_P(arguments[0]));
(*jenv)->CallVoidMethod(jenv, JG(php_reflect), co,
className, _java_makeArray(arg_count-1, arguments+1 TSRMLS_CC), result);

2
ext/ldap/ldap.c

@ -934,7 +934,7 @@ PHP_FUNCTION(ldap_get_entries)
ldap_value_free(ldap_value);
attr_len = strlen(attribute);
zend_hash_update(tmp1->value.ht, php_strtolower(attribute, attr_len), attr_len+1, (void *) &tmp2, sizeof(pval *), NULL);
zend_hash_update(Z_ARRVAL_P(tmp1), php_strtolower(attribute, attr_len), attr_len+1, (void *) &tmp2, sizeof(pval *), NULL);
add_index_string(tmp1, num_attrib, attribute, 1);
num_attrib++;

8
ext/mbstring/mbstring.c

@ -1637,7 +1637,7 @@ PHP_FUNCTION(mb_strcut)
* of the string
*/
if (from < 0) {
from = (*arg1)->value.str.len + from;
from = Z_STRLEN_PP(arg1) + from;
if (from < 0) {
from = 0;
}
@ -1647,7 +1647,7 @@ PHP_FUNCTION(mb_strcut)
* needed to stop that many chars from the end of the string
*/
if (len < 0) {
len = ((*arg1)->value.str.len - from) + len;
len = (Z_STRLEN_PP(arg1) - from) + len;
if (len < 0) {
len = 0;
}
@ -2422,7 +2422,7 @@ php_mbstr_numericentity_exec(INTERNAL_FUNCTION_PARAMETERS, int type)
/* conversion map */
convmap = NULL;
if (Z_TYPE_PP(arg2) == IS_ARRAY){
target_hash = (*arg2)->value.ht;
target_hash = Z_ARRVAL_PP(arg2);
zend_hash_internal_pointer_reset(target_hash);
i = zend_hash_num_elements(target_hash);
if (i > 0) {
@ -2602,7 +2602,7 @@ PHP_FUNCTION(mb_send_mail)
if (argc == 5) { /* extra options that get passed to the mailer */
convert_to_string_ex(argv[4]);
extra_cmd = (*argv[4])->value.str.val;
extra_cmd = Z_STRVAL_PP(argv[4]);
}
if (!err && php_mail(to, subject, message, headers, extra_cmd)){

14
ext/mcrypt/mcrypt.c

@ -824,7 +824,7 @@ PHP_FUNCTION(mcrypt_module_self_test)
MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir);
if (mcrypt_module_self_test ((*arg1)->value.str.val, lib_dir_s) == 0) {
if (mcrypt_module_self_test (Z_STRVAL_PP(arg1), lib_dir_s) == 0) {
RETURN_TRUE;
}
else {
@ -846,7 +846,7 @@ PHP_FUNCTION(mcrypt_module_is_block_algorithm_mode)
MCRYPT_GET_MODE_DIR_ARGS(modes_dir)
if (mcrypt_module_is_block_algorithm_mode ((*arg1)->value.str.val, lib_dir_s) == 0) {
if (mcrypt_module_is_block_algorithm_mode (Z_STRVAL_PP(arg1), lib_dir_s) == 0) {
RETURN_TRUE;
}
else {
@ -868,7 +868,7 @@ PHP_FUNCTION(mcrypt_module_is_block_algorithm)
MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir)
if (mcrypt_module_is_block_algorithm ((*arg1)->value.str.val, lib_dir_s) == 0) {
if (mcrypt_module_is_block_algorithm (Z_STRVAL_PP(arg1), lib_dir_s) == 0) {
RETURN_TRUE;
}
else {
@ -890,7 +890,7 @@ PHP_FUNCTION(mcrypt_module_is_block_mode)
MCRYPT_GET_MODE_DIR_ARGS(modes_dir)
if (mcrypt_module_is_block_mode ((*arg1)->value.str.val, lib_dir_s) == 0) {
if (mcrypt_module_is_block_mode (Z_STRVAL_PP(arg1), lib_dir_s) == 0) {
RETURN_TRUE;
}
else {
@ -912,7 +912,7 @@ PHP_FUNCTION(mcrypt_module_get_algo_block_size)
MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir)
RETURN_LONG(mcrypt_module_get_algo_block_size ((*arg1)->value.str.val, lib_dir_s))
RETURN_LONG(mcrypt_module_get_algo_block_size (Z_STRVAL_PP(arg1), lib_dir_s))
}
/* }}} */
@ -929,7 +929,7 @@ PHP_FUNCTION(mcrypt_module_get_algo_key_size)
MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir);
RETURN_LONG(mcrypt_module_get_algo_key_size ((*arg1)->value.str.val, lib_dir_s))
RETURN_LONG(mcrypt_module_get_algo_key_size (Z_STRVAL_PP(arg1), lib_dir_s))
}
/* }}} */
@ -947,7 +947,7 @@ PHP_FUNCTION(mcrypt_module_get_supported_key_sizes)
MCRYPT_GET_MODE_DIR_ARGS(algorithms_dir)
key_sizes = mcrypt_module_get_algo_supported_key_sizes ((*arg1)->value.str.val, lib_dir_s, &count);
key_sizes = mcrypt_module_get_algo_supported_key_sizes (Z_STRVAL_PP(arg1), lib_dir_s, &count);
if (array_init(return_value) == FAILURE) {
php_error(E_ERROR, "Unable to initialize array");

4
ext/ming/ming.c

@ -1870,7 +1870,7 @@ PHP_FUNCTION(swfshape_addfill)
convert_to_object_ex(arg1);
if((*arg1)->value.obj.ce == &gradient_class_entry)
if(Z_OBJCE_PP(arg1) == &gradient_class_entry)
{
if(flags == 0)
flags = SWFFILL_LINEAR_GRADIENT;
@ -1878,7 +1878,7 @@ PHP_FUNCTION(swfshape_addfill)
fill = SWFShape_addGradientFill(getShape(getThis() TSRMLS_CC), getGradient(*arg1 TSRMLS_CC),
flags);
}
else if((*arg1)->value.obj.ce == &bitmap_class_entry)
else if(Z_OBJCE_PP(arg1) == &bitmap_class_entry)
{
if(flags == 0)
flags = SWFFILL_TILED_BITMAP;

4
ext/mnogosearch/php_mnogo.c

@ -646,8 +646,8 @@ DLEXPORT PHP_FUNCTION(udm_load_ispell_data)
ZEND_FETCH_RESOURCE(Agent, UDM_AGENT *, yyagent, -1, "mnoGoSearch-agent", le_link);
var = Z_LVAL_PP(yyvar);
flag = Z_LVAL_PP(yyflag);
val1 = (*yyval1)->value.str.val;
val2 = (*yyval2)->value.str.val;
val1 = Z_STRVAL_PP(yyval1);
val2 = Z_STRVAL_PP(yyval2);
break;

2
ext/msql/php_msql.c

@ -916,7 +916,7 @@ static void php_msql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
RETURN_FALSE;
}
convert_to_long(arg2);
result_type = arg2->value.lval;
result_type = Z_LVAL_P(arg2);
break;
default:
WRONG_PARAM_COUNT;

2
ext/mysql/php_mysql.c

@ -1541,7 +1541,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type,
RETURN_FALSE;
}
convert_to_long_ex(arg2);
result_type = (*arg2)->value.lval;
result_type = Z_LVAL_PP(arg2);
break;
default:
WRONG_PARAM_COUNT;

10
ext/oci8/oci8.c

@ -2518,15 +2518,15 @@ static void oci_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent,int exclu
convert_to_string_ex(passParam);
convert_to_string_ex(dbParam);
username = (*userParam)->value.str.val;
password = (*passParam)->value.str.val;
dbname = (*dbParam)->value.str.val;
username = Z_STRVAL_PP(userParam);
password = Z_STRVAL_PP(passParam);
dbname = Z_STRVAL_PP(dbParam);
} else if (zend_get_parameters_ex(2, &userParam, &passParam) == SUCCESS) {
convert_to_string_ex(userParam);
convert_to_string_ex(passParam);
username = (*userParam)->value.str.val;
password = (*passParam)->value.str.val;
username = Z_STRVAL_PP(userParam);
password = Z_STRVAL_PP(passParam);
dbname = "";
} else {
WRONG_PARAM_COUNT;

4
ext/oracle/oracle.c

@ -430,8 +430,8 @@ void ora_do_logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)
convert_to_string_ex(arg1);
convert_to_string_ex(arg2);
user = (*arg1)->value.str.val;
passwd = (*arg2)->value.str.val;
user = Z_STRVAL_PP(arg1);
passwd = Z_STRVAL_PP(arg2);
hashed_details_length = sizeof("oracle__")-1+strlen(user)+strlen(passwd);
hashed_details = (char *) emalloc(hashed_details_length+1);

74
ext/ovrimos/ovrimos.c

@ -96,8 +96,8 @@ PHP_FUNCTION(ovrimos_connect)
convert_to_string(arg4);
if (!sqlConnect
(arg1->value.str.val, arg2->value.str.val, arg3->value.str.val,
arg4->value.str.val, &conn, 0)) {
(Z_STRVAL_P(arg1), Z_STRVAL_P(arg2), Z_STRVAL_P(arg3),
Z_STRVAL_P(arg4), &conn, 0)) {
RETURN_LONG(0);
}
@ -122,11 +122,11 @@ PHP_FUNCTION(ovrimos_close)
PCON_STATE state;
if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &arg1) == FAILURE
|| arg1->type != IS_LONG) {
|| Z_TYPE_P(arg1) != IS_LONG) {
WRONG_PARAM_COUNT;
}
state = (PCON_STATE) arg1->value.lval;
state = (PCON_STATE) Z_LVAL_P(arg1);
/* free all the statements associated with
* the connection. (called results in php)
@ -165,9 +165,9 @@ PHP_FUNCTION(ovrimos_longreadlen)
convert_to_long(arg1);
convert_to_long(arg2);
stmt = (PSTATEMENT) arg1->value.lval;
stmt = (PSTATEMENT) Z_LVAL_P(arg1);
stmt->longreadlen = arg2->value.lval;
stmt->longreadlen = Z_LVAL_P(arg2);
RETURN_TRUE;
}
@ -250,10 +250,10 @@ PHP_FUNCTION(ovrimos_prepare)
convert_to_long(arg1);
convert_to_string(arg2);
state = (PCON_STATE) arg1->value.lval;
state = (PCON_STATE) Z_LVAL_P(arg1);
conn = (SQLH) state->connection;
query = arg2->value.str.val;
query = Z_STRVAL_P(arg2);
if (!local_sqlAllocStmt( state, conn, &stmt, &pstmt)) {
RETURN_FALSE;
@ -299,7 +299,7 @@ PHP_FUNCTION(ovrimos_execute)
}
convert_to_long(arg1);
pstmt = (PSTATEMENT) arg1->value.lval;
pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
stmt = pstmt->statement;
colnb = sqlGetParamNb(stmt);
@ -308,12 +308,12 @@ PHP_FUNCTION(ovrimos_execute)
pval **tmp;
int arr_elem;
if (arg2->type != IS_ARRAY) {
if (Z_TYPE_P(arg2) != IS_ARRAY) {
php_error(E_WARNING,
"Not an array in call to ovrimos_execute()");
RETURN_FALSE;
}
arr_elem = zend_hash_num_elements(arg2->value.ht);
arr_elem = zend_hash_num_elements(Z_ARRVAL_P(arg2));
if (arr_elem < colnb) {
php_error(E_WARNING,
"Not enough parameters in call to ovrimos_execute(): %d instead of %d",
@ -321,7 +321,7 @@ PHP_FUNCTION(ovrimos_execute)
RETURN_FALSE;
}
zend_hash_internal_pointer_reset(arg2->value.ht);
zend_hash_internal_pointer_reset(Z_ARRVAL_P(arg2));
for (icol = 0; icol < colnb; icol++) {
int len;
@ -333,7 +333,7 @@ PHP_FUNCTION(ovrimos_execute)
sql_type from_type;
if (zend_hash_get_current_data
(arg2->value.ht, (void **) &tmp) == FAILURE) {
(Z_ARRVAL_P(arg2), (void **) &tmp) == FAILURE) {
php_error(E_WARNING,
"Error getting parameter %d in call to ovrimos_execute()",
icol);
@ -420,7 +420,7 @@ PHP_FUNCTION(ovrimos_cursor)
}
convert_to_long(arg1);
pstmt = (PSTATEMENT) arg1->value.lval;
pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
stmt = pstmt->statement;
if (!sqlGetCursorName(stmt, cname)) {
@ -456,9 +456,9 @@ PHP_FUNCTION(ovrimos_exec)
convert_to_long(arg1);
convert_to_string(arg2);
state = (PCON_STATE) arg1->value.lval;
state = (PCON_STATE) Z_LVAL_P(arg1);
conn = state->connection;
query = arg2->value.str.val;
query = Z_STRVAL_P(arg2);
if (!local_sqlAllocStmt( state, conn, &stmt, &pstmt)) {
RETURN_FALSE;
@ -925,7 +925,7 @@ PHP_FUNCTION(ovrimos_result_all)
}
convert_to_long(arg1);
pstmt = (PSTATEMENT) arg1->value.lval;
pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
stmt = (SQLS) pstmt->statement;
colnb = sqlGetOutputColNb(stmt);
@ -935,7 +935,7 @@ PHP_FUNCTION(ovrimos_result_all)
php_printf("<table><tr>");
} else {
convert_to_string(arg2);
php_printf("<table %s ><tr>", arg2->value.str.val);
php_printf("<table %s ><tr>", Z_STRVAL_P(arg2));
}
for (icol = 0; icol < colnb; icol++) {
@ -974,7 +974,7 @@ PHP_FUNCTION(ovrimos_free_result)
WRONG_PARAM_COUNT;
}
convert_to_long(arg1);
pstmt = (PSTATEMENT) arg1->value.lval;
pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
stmt = (SQLS) pstmt->statement;
sqlCloseCursor( stmt);
@ -998,7 +998,7 @@ PHP_FUNCTION(ovrimos_num_rows)
}
convert_to_long(arg1);
pstmt = (PSTATEMENT) arg1->value.lval;
pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
stmt = (SQLS) pstmt->statement;
@ -1021,7 +1021,7 @@ PHP_FUNCTION(ovrimos_num_fields)
}
convert_to_long(arg1);
pstmt = (PSTATEMENT) arg1->value.lval;
pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
stmt = (SQLS) pstmt->statement;
@ -1045,18 +1045,18 @@ PHP_FUNCTION(ovrimos_field_name)
convert_to_long(arg1);
convert_to_long(arg2);
pstmt = (PSTATEMENT) arg1->value.lval;
pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
stmt = (SQLS) pstmt->statement;
if (arg2->value.lval < 1) {
if (Z_LVAL_P(arg2) < 1) {
php_error(E_WARNING,
"Field numbering starts at 1! in call to ovrimos_field_name()");
RETURN_FALSE;
}
field = arg2->value.lval - 1;
field = Z_LVAL_P(arg2) - 1;
if (field >= sqlGetOutputColNb(stmt)) {
php_error(E_WARNING,
@ -1085,17 +1085,17 @@ PHP_FUNCTION(ovrimos_field_type)
convert_to_long(arg1);
convert_to_long(arg2);
pstmt = (PSTATEMENT) arg1->value.lval;
pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
stmt = (SQLS) pstmt->statement;
if (arg2->value.lval < 1) {
if (Z_LVAL_P(arg2) < 1) {
php_error(E_WARNING,
"Field numbering starts at 1! in call to ovrimos_field_type()");
RETURN_FALSE;
}
field = arg2->value.lval - 1;
field = Z_LVAL_P(arg2) - 1;
if (field >= sqlGetOutputColNb(stmt)) {
php_error(E_WARNING,
@ -1125,19 +1125,19 @@ PHP_FUNCTION(ovrimos_field_len)
convert_to_long(arg1);
convert_to_long(arg2);
pstmt = (PSTATEMENT) arg1->value.lval;
pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
longreadlen = pstmt->longreadlen;
stmt = (SQLS) pstmt->statement;
if (arg2->value.lval < 1) {
if (Z_LVAL_P(arg2) < 1) {
php_error(E_WARNING,
"Field numbering starts at 1! in call to ovrimos_field_len()");
RETURN_FALSE;
}
field = arg2->value.lval - 1;
field = Z_LVAL_P(arg2) - 1;
if (field >= sqlGetOutputColNb(stmt)) {
php_error(E_WARNING,
@ -1167,17 +1167,17 @@ PHP_FUNCTION(ovrimos_field_num)
PSTATEMENT pstmt;
if (getParameters(ht, 2, &arg1, &arg2) == FAILURE
|| arg2->type != IS_STRING) {
|| Z_TYPE_P(arg2) != IS_STRING) {
WRONG_PARAM_COUNT;
}
convert_to_long(arg1);
pstmt = (PSTATEMENT) arg1->value.lval;
pstmt = (PSTATEMENT) Z_LVAL_P(arg1);
stmt = (SQLS) pstmt->statement;
n = sqlGetOutputColNb(stmt);
for (i = 0; i < n; i++) {
if (!strcmp
(arg2->value.str.val, sqlGetOutputColName(stmt, i))) {
(Z_STRVAL_P(arg2), sqlGetOutputColName(stmt, i))) {
RETURN_LONG(i + 1);
}
}
@ -1207,12 +1207,12 @@ PHP_FUNCTION(ovrimos_commit)
PCON_STATE state;
if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &arg1) == FAILURE
|| arg1->type != IS_LONG) {
|| Z_TYPE_P(arg1) != IS_LONG) {
WRONG_PARAM_COUNT;
}
convert_to_long( arg1);
state = (PCON_STATE) arg1->value.lval;
state = (PCON_STATE) Z_LVAL_P(arg1);
for (i=0;i<state->nstatements;i++) {
stmt = state->statements[ i].statement;
@ -1238,12 +1238,12 @@ PHP_FUNCTION(ovrimos_rollback)
PCON_STATE state;
if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &arg1) == FAILURE
|| arg1->type != IS_LONG) {
|| Z_TYPE_P(arg1) != IS_LONG) {
WRONG_PARAM_COUNT;
}
convert_to_long( arg1);
state = (PCON_STATE) arg1->value.lval;
state = (PCON_STATE) Z_LVAL_P(arg1);
for (i=0;i<state->nstatements;i++) {
stmt = (SQLS) state->statements[ i].statement;

32
ext/pfpro/pfpro.c

@ -216,41 +216,41 @@ PHP_FUNCTION(pfpro_process_raw)
switch (ZEND_NUM_ARGS()) {
case 8:
convert_to_string_ex(args[7]);
proxyPassword = (*args[7])->value.str.val;
proxyPassword = Z_STRVAL_PP(args[7]);
/* fall through */
case 7:
convert_to_string_ex(args[6]);
proxyLogon = (*args[6])->value.str.val;
proxyLogon = Z_STRVAL_PP(args[6]);
/* fall through */
case 6:
convert_to_long_ex(args[5]);
proxyPort = (*args[5])->value.lval;
proxyPort = Z_LVAL_PP(args[5]);
/* fall through */
case 5:
convert_to_string_ex(args[4]);
proxyAddress = (*args[4])->value.str.val;
proxyAddress = Z_STRVAL_PP(args[4]);
/* fall through */
case 4:
convert_to_long_ex(args[3]);
timeout = (*args[3])->value.lval;
timeout = Z_LVAL_PP(args[3]);
/* fall through */
case 3:
convert_to_long_ex(args[2]);
port = (*args[2])->value.lval;
port = Z_LVAL_PP(args[2]);
/* fall through */
case 2:
convert_to_string_ex(args[1]);
address = (*args[1])->value.str.val;
address = Z_STRVAL_PP(args[1]);
}
convert_to_string_ex(args[0]);
parmlist = (*args[0])->value.str.val;
parmlist = Z_STRVAL_PP(args[0]);
efree(args);
@ -341,7 +341,7 @@ PHP_FUNCTION(pfpro_process)
RETURN_FALSE;
}
if ((*args[0])->type != IS_ARRAY) {
if (Z_TYPE_PP(args[0]) != IS_ARRAY) {
php_error(E_ERROR, "First parameter to pfpro_process() must be an array");
efree(args);
RETURN_FALSE;
@ -350,37 +350,37 @@ PHP_FUNCTION(pfpro_process)
switch (ZEND_NUM_ARGS()) {
case 8:
convert_to_string_ex(args[7]);
proxyPassword = (*args[7])->value.str.val;
proxyPassword = Z_STRVAL_PP(args[7]);
/* fall through */
case 7:
convert_to_string_ex(args[6]);
proxyLogon = (*args[6])->value.str.val;
proxyLogon = Z_STRVAL_PP(args[6]);
/* fall through */
case 6:
convert_to_long_ex(args[5]);
proxyPort = (*args[5])->value.lval;
proxyPort = Z_LVAL_PP(args[5]);
/* fall through */
case 5:
convert_to_string_ex(args[4]);
proxyAddress = (*args[4])->value.str.val;
proxyAddress = Z_STRVAL_PP(args[4]);
/* fall through */
case 4:
convert_to_long_ex(args[3]);
timeout = (*args[3])->value.lval;
timeout = Z_LVAL_PP(args[3]);
/* fall through */
case 3:
convert_to_long_ex(args[2]);
port = (*args[2])->value.lval;
port = Z_LVAL_PP(args[2]);
/* fall through */
case 2:
convert_to_string_ex(args[1]);
address = (*args[1])->value.str.val;
address = Z_STRVAL_PP(args[1]);
}
/* Concatenate the passed array as specified by Verisign.

2
ext/rpc/java/java.c

@ -438,7 +438,7 @@ void java_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_refe
return;
}
className=(*jenv)->NewStringUTF(jenv, arguments[0]->value.str.val);
className=(*jenv)->NewStringUTF(jenv, Z_STRVAL_P(arguments[0]));
(*jenv)->CallVoidMethod(jenv, JG(php_reflect), co,
className, _java_makeArray(arg_count-1, arguments+1 TSRMLS_CC), result);

8
ext/rpc/xmlrpc/xmlrpc-epi-php.c

@ -815,13 +815,13 @@ PHP_FUNCTION(xmlrpc_server_destroy) {
WRONG_PARAM_COUNT; /* prints/logs a warning and returns */
}
if(arg1->type == IS_RESOURCE) {
if(Z_TYPE_P(arg1) == IS_RESOURCE) {
int type;
xmlrpc_server_data *server = zend_list_find(arg1->value.lval, &type);
xmlrpc_server_data *server = zend_list_find(Z_LVAL_P(arg1), &type);
if(server && type == XMLRPCG(le_xmlrpc_server)) {
bSuccess = zend_list_delete(arg1->value.lval);
bSuccess = zend_list_delete(Z_LVAL_P(arg1));
/* called by hashtable destructor
* destroy_server_data(server);
@ -1163,7 +1163,7 @@ PHP_FUNCTION(xmlrpc_parse_method_descriptions)
if(return_value_used) {
STRUCT_XMLRPC_ERROR err = {0};
XMLRPC_VALUE xVal = XMLRPC_IntrospectionCreateDescription(arg1->value.str.val, &err);
XMLRPC_VALUE xVal = XMLRPC_IntrospectionCreateDescription(Z_STRVAL_P(arg1), &err);
if(xVal) {
retval = XMLRPC_to_PHP(xVal);

6
ext/satellite/enum.c

@ -96,14 +96,14 @@ zend_bool OrbitEnum_Constructor(OrbitEnum ** ppEnum, int parameterCount,
}
/* validate parameter types */
if (ppParameters[0]->type != IS_STRING)
if (ppPZ_TYPE_P(arameters[0]) != IS_STRING)
goto error;
/* find type information */
p_enum->mpEnumType = TypeManager_FindEnum(ppParameters[0]->value.str.val);
p_enum->mpEnumType = TypeManager_FindEnum(ppPZ_STRVAL_P(arameters[0]));
if (p_enum->mpEnumType == NULL)
{
zend_error(E_WARNING, "(Satellite) unknown enum '%s'", ppParameters[0]->value.str.val);
zend_error(E_WARNING, "(Satellite) unknown enum '%s'", ppPZ_STRVAL_P(arameters[0]));
goto error;
}

4
ext/satellite/object.c

@ -277,7 +277,7 @@ zend_bool OrbitObject_Constructor(OrbitObject ** ppObject,
}
/* validate parameter types */
if (ppParameters[0]->type != IS_STRING)
if (ppPZ_TYPE_P(arameters[0]) != IS_STRING)
{
zend_error(E_WARNING, "(Satellite) IOR is not a string");
goto error;
@ -286,7 +286,7 @@ zend_bool OrbitObject_Constructor(OrbitObject ** ppObject,
/* initialize data object */
if ( !OrbitObject_InitializeData(
p_object,
ppParameters[0]->value.str.val) )
ppPZ_STRVAL_P(arameters[0])) )
{
goto error;
}

4
ext/satellite/struct.c

@ -240,11 +240,11 @@ zend_bool OrbitStruct_Constructor(OrbitStruct ** ppStruct,
}
/* validate parameter types */
if (ppParameters[0]->type != IS_STRING)
if (ppPZ_TYPE_P(arameters[0]) != IS_STRING)
goto error;
/* initialize struct */
if (!OrbitStruct_Initialize(ppParameters[0]->value.str.val, p_struct))
if (!OrbitStruct_Initialize(ppPZ_STRVAL_P(arameters[0]), p_struct))
goto error;
*ppStruct = p_struct;

24
ext/snmp/snmp.c

@ -187,29 +187,29 @@ void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
if(myargc > 5) {
convert_to_long_ex(a6);
timeout = (*a6)->value.lval;
timeout = Z_LVAL_PP(a6);
}
if(myargc > 6) {
convert_to_long_ex(a7);
retries = (*a7)->value.lval;
retries = Z_LVAL_PP(a7);
}
type = (*a4)->value.str.val[0];
value = (*a5)->value.str.val;
type = Z_STRVAL_PP(a4)[0];
value = Z_STRVAL_PP(a5);
} else {
if(myargc > 3) {
convert_to_long_ex(a4);
timeout = (*a4)->value.lval;
timeout = Z_LVAL_PP(a4);
}
if(myargc > 4) {
convert_to_long_ex(a5);
retries = (*a5)->value.lval;
retries = Z_LVAL_PP(a5);
}
}
objid = (*a3)->value.str.val;
objid = Z_STRVAL_PP(a3);
if (st >= 2) { /* walk */
rootlen = MAX_NAME_LEN;
@ -229,7 +229,7 @@ void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
memset(&session, 0, sizeof(struct snmp_session));
strcpy (hostname, (*a1)->value.str.val);
strcpy (hostname, Z_STRVAL_PP(a1));
if ((pptr = strchr (hostname, ':'))) {
remote_port = strtol (pptr + 1, NULL, 0);
*pptr = 0;
@ -245,11 +245,11 @@ void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
* memory it did not allocate
*/
#ifdef UCD_SNMP_HACK
session.community = (u_char *)strdup((*a2)->value.str.val); /* memory freed by SNMP library, strdup NOT estrdup */
session.community = (u_char *)strdup(Z_STRVAL_PP(a2)); /* memory freed by SNMP library, strdup NOT estrdup */
#else
session.community = (u_char *)(*a2)->value.str.val;
session.community = (u_char *)Z_STRVAL_PP(a2);
#endif
session.community_len = (*a2)->value.str.len;
session.community_len = Z_STRLEN_PP(a2);
session.retries = retries;
session.timeout = timeout;
@ -360,7 +360,7 @@ retry:
}
}
} else if (status == STAT_TIMEOUT) {
php_error(E_WARNING,"No Response from %s\n", (*a1)->value.str.val);
php_error(E_WARNING,"No Response from %s\n", Z_STRVAL_PP(a1));
RETURN_FALSE;
} else { /* status == STAT_ERROR */
php_error(E_WARNING,"An error occurred, Quitting...\n");

6
ext/snmp/winsnmp.c

@ -74,10 +74,10 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
convert_to_string(a2);
convert_to_string(a3);
agent=a1->value.str.val;
community=a2->value.str.val;
agent=Z_STRVAL_P(a1);
community=Z_STRVAL_P(a2);
operation=st;
SnmpMgrStrToOid(a3->value.str.val, &oid);
SnmpMgrStrToOid(Z_STRVAL_P(a3), &oid);
/*
I've limited this to only one oid, but we can create a

4
ext/sockets/sockets.c

@ -1976,8 +1976,8 @@ PHP_FUNCTION(socket_create_pair)
php_sock[0]->bsd_socket = fds_array[0];
php_sock[1]->bsd_socket = fds_array[1];
php_sock[0]->type = Z_LVAL_PP(arg1);
php_sock[1]->type = Z_LVAL_PP(arg1);
Z_TYPE_P(php_sock[0]) = Z_LVAL_PP(arg1);
Z_TYPE_P(php_sock[1]) = Z_LVAL_PP(arg1);
ZEND_REGISTER_RESOURCE(retval[0], php_sock[0], le_socket);
ZEND_REGISTER_RESOURCE(retval[1], php_sock[1], le_socket);

26
ext/standard/datetime.c

@ -119,16 +119,16 @@ void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm)
*/
switch(arg_count) {
case 7:
ta->tm_isdst = is_dst = (*arguments[6])->value.lval;
ta->tm_isdst = is_dst = Z_LVAL_PP(arguments[6]);
/* fall-through */
case 6:
/* special case:
a zero in year, month and day is considered illegal
as it would be interpreted as 30.11.1999 otherwise
*/
if ( ( (*arguments[5])->value.lval==0)
&&((*arguments[4])->value.lval==0)
&&((*arguments[3])->value.lval==0)
if ( ( Z_LVAL_PP(arguments[5])==0)
&&(Z_LVAL_PP(arguments[4])==0)
&&(Z_LVAL_PP(arguments[3])==0)
) {
RETURN_LONG(-1);
}
@ -143,26 +143,26 @@ void php_mktime(INTERNAL_FUNCTION_PARAMETERS, int gm)
** But it cannot represent ancestral dates prior to year 1001.
** Additionally, input parameters of 0..70 are mapped to 100..170
*/
if ((*arguments[5])->value.lval < 70)
ta->tm_year = (*arguments[5])->value.lval + 100;
if (Z_LVAL_PP(arguments[5]) < 70)
ta->tm_year = Z_LVAL_PP(arguments[5]) + 100;
else
ta->tm_year = (*arguments[5])->value.lval
- (((*arguments[5])->value.lval > 1000) ? 1900 : 0);
ta->tm_year = Z_LVAL_PP(arguments[5])
- ((Z_LVAL_PP(arguments[5]) > 1000) ? 1900 : 0);
/* fall-through */
case 5:
ta->tm_mday = (*arguments[4])->value.lval;
ta->tm_mday = Z_LVAL_PP(arguments[4]);
/* fall-through */
case 4:
ta->tm_mon = (*arguments[3])->value.lval - 1;
ta->tm_mon = Z_LVAL_PP(arguments[3]) - 1;
/* fall-through */
case 3:
ta->tm_sec = (*arguments[2])->value.lval;
ta->tm_sec = Z_LVAL_PP(arguments[2]);
/* fall-through */
case 2:
ta->tm_min = (*arguments[1])->value.lval;
ta->tm_min = Z_LVAL_PP(arguments[1]);
/* fall-through */
case 1:
ta->tm_hour = (*arguments[0])->value.lval;
ta->tm_hour = Z_LVAL_PP(arguments[0]);
/* fall-through */
case 0:
break;

4
ext/standard/formatted_print.c

@ -444,12 +444,12 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC)
}
}
convert_to_string_ex(args[0]);
format = (*args[0])->value.str.val;
format = Z_STRVAL_PP(args[0]);
result = emalloc(size);
currarg = 1;
while (inpos<(*args[0])->value.str.len) {
while (inpos<Z_STRLEN_PP(args[0])) {
int expprec = 0;
PRINTF_DEBUG(("sprintf: format[%d]='%c'\n", inpos, format[inpos]));

2
ext/standard/info.c

@ -89,7 +89,7 @@ static void php_print_gpcse_array(char *name, uint name_length TSRMLS_DC)
tmp2 = **tmp;
zval_copy_ctor(&tmp2);
convert_to_string(&tmp2);
zend_html_puts(tmp2.value.str.val, tmp2.value.str.len);
zend_html_puts(Z_STRVAL(tmp2), Z_STRLEN(tmp2));
zval_dtor(&tmp2);
} else {
zend_html_puts(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));

12
ext/standard/levenshtein.c

@ -101,8 +101,8 @@ PHP_FUNCTION(levenshtein)
convert_to_string_ex(str1);
convert_to_string_ex(str2);
distance = reference_levdist((*str1)->value.str.val, (*str1)->value.str.len,
(*str2)->value.str.val, (*str2)->value.str.len,
distance = reference_levdist(Z_STRVAL_PP(str1), Z_STRLEN_PP(str1),
Z_STRVAL_PP(str2), Z_STRLEN_PP(str2),
1, 1, 1);
break;
@ -117,8 +117,8 @@ PHP_FUNCTION(levenshtein)
convert_to_long_ex(cost_rep);
convert_to_long_ex(cost_del);
distance = reference_levdist((*str1)->value.str.val, (*str1)->value.str.len,
(*str2)->value.str.val, (*str2)->value.str.len,
distance = reference_levdist(Z_STRVAL_PP(str1), Z_STRLEN_PP(str1),
Z_STRVAL_PP(str2), Z_STRLEN_PP(str2),
Z_LVAL_PP(cost_ins),
Z_LVAL_PP(cost_rep),
Z_LVAL_PP(cost_del)
@ -134,8 +134,8 @@ PHP_FUNCTION(levenshtein)
convert_to_string_ex(str2);
convert_to_string_ex(callback_name);
distance = custom_levdist((*str1)->value.str.val
, (*str2)->value.str.val
distance = custom_levdist(Z_STRVAL_PP(str1)
, Z_STRVAL_PP(str2)
, Z_STRVAL_PP(callback_name)
);
break;

8
ext/standard/mail.c

@ -88,8 +88,8 @@ PHP_FUNCTION(mail)
}
/* To: */
convert_to_string_ex(argv[0]);
if ((*argv[0])->value.str.val) {
to = (*argv[0])->value.str.val;
if (Z_STRVAL_PP(argv[0])) {
to = Z_STRVAL_PP(argv[0]);
} else {
php_error(E_WARNING, "No to field in mail command");
RETURN_FALSE;
@ -97,7 +97,7 @@ PHP_FUNCTION(mail)
/* Subject: */
convert_to_string_ex(argv[1]);
if ((*argv[1])->value.str.val) {
if (Z_STRVAL_PP(argv[1])) {
subject = Z_STRVAL_PP(argv[1]);
} else {
php_error(E_WARNING, "No subject field in mail command");
@ -106,7 +106,7 @@ PHP_FUNCTION(mail)
/* message body */
convert_to_string_ex(argv[2]);
if ((*argv[2])->value.str.val) {
if (Z_STRVAL_PP(argv[2])) {
message = Z_STRVAL_PP(argv[2]);
} else {
/* this is not really an error, so it is allowed. */

6
ext/standard/quot_print.c

@ -69,13 +69,13 @@ PHP_FUNCTION(quoted_printable_decode)
}
convert_to_string_ex(arg1);
if((*arg1)->value.str.len == 0) {
if(Z_STRLEN_PP(arg1) == 0) {
/* shortcut */
RETURN_EMPTY_STRING();
}
str_in = (*arg1)->value.str.val;
str_out = emalloc((*arg1)->value.str.len+1);
str_in = Z_STRVAL_PP(arg1);
str_out = emalloc(Z_STRLEN_PP(arg1)+1);
while ( str_in[i] )
{
switch (str_in[i])

4
ext/standard/string.c

@ -3501,8 +3501,8 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
convert_to_string_ex(s1);
convert_to_string_ex(s2);
RETURN_LONG(strnatcmp_ex((*s1)->value.str.val, (*s1)->value.str.len,
(*s2)->value.str.val, (*s2)->value.str.len,
RETURN_LONG(strnatcmp_ex(Z_STRVAL_PP(s1), Z_STRLEN_PP(s1),
Z_STRVAL_PP(s2), Z_STRLEN_PP(s2),
fold_case));
}
/* }}} */

32
ext/xml/xml.c

@ -800,7 +800,7 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len)
zval **myval;
/* check if the current tag already has a value - if yes append to that! */
if (zend_hash_find((*parser->ctag)->value.ht,"value",sizeof("value"),(void **) &myval) == SUCCESS) {
if (zend_hash_find(Z_ARRVAL_PP(parser->ctag),"value",sizeof("value"),(void **) &myval) == SUCCESS) {
int newlen = Z_STRLEN_PP(myval) + decoded_len;
Z_STRVAL_PP(myval) = erealloc(Z_STRVAL_PP(myval),newlen+1);
strcpy(Z_STRVAL_PP(myval) + Z_STRLEN_PP(myval),decoded_value);
@ -1014,18 +1014,18 @@ PHP_FUNCTION(xml_parser_create)
/* The supported encoding types are hardcoded here because
* we are limited to the encodings supported by expat/xmltok.
*/
if (strncasecmp((*encodingArg)->value.str.val, "ISO-8859-1",
(*encodingArg)->value.str.len) == 0) {
if (strncasecmp(Z_STRVAL_PP(encodingArg), "ISO-8859-1",
Z_STRLEN_PP(encodingArg)) == 0) {
encoding = "ISO-8859-1";
} else if (strncasecmp((*encodingArg)->value.str.val, "UTF-8",
(*encodingArg)->value.str.len) == 0) {
} else if (strncasecmp(Z_STRVAL_PP(encodingArg), "UTF-8",
Z_STRLEN_PP(encodingArg)) == 0) {
encoding = "UTF-8";
} else if (strncasecmp((*encodingArg)->value.str.val, "US-ASCII",
(*encodingArg)->value.str.len) == 0) {
} else if (strncasecmp(Z_STRVAL_PP(encodingArg), "US-ASCII",
Z_STRLEN_PP(encodingArg)) == 0) {
encoding = "US-ASCII";
} else { /* UTF-16 not supported */
php_error(E_WARNING, "%s: unsupported source encoding \"%s\"",
thisfunc, (*encodingArg)->value.str.val);
thisfunc, Z_STRVAL_PP(encodingArg));
RETURN_FALSE;
}
} else {
@ -1065,18 +1065,18 @@ PHP_FUNCTION(xml_parser_create_ns)
/* The supported encoding types are hardcoded here because
* we are limited to the encodings supported by expat/xmltok.
*/
if (strncasecmp((*encodingArg)->value.str.val, "ISO-8859-1",
(*encodingArg)->value.str.len) == 0) {
if (strncasecmp(Z_STRVAL_PP(encodingArg), "ISO-8859-1",
Z_STRLEN_PP(encodingArg)) == 0) {
encoding = "ISO-8859-1";
} else if (strncasecmp((*encodingArg)->value.str.val, "UTF-8",
(*encodingArg)->value.str.len) == 0) {
} else if (strncasecmp(Z_STRVAL_PP(encodingArg), "UTF-8",
Z_STRLEN_PP(encodingArg)) == 0) {
encoding = "UTF-8";
} else if (strncasecmp((*encodingArg)->value.str.val, "US-ASCII",
(*encodingArg)->value.str.len) == 0) {
} else if (strncasecmp(Z_STRVAL_PP(encodingArg), "US-ASCII",
Z_STRLEN_PP(encodingArg)) == 0) {
encoding = "US-ASCII";
} else { /* UTF-16 not supported */
php_error(E_WARNING, "%s: unsupported source encoding \"%s\"",
thisfunc, (*encodingArg)->value.str.val);
thisfunc, Z_STRVAL_PP(encodingArg));
RETURN_FALSE;
}
} else {
@ -1085,7 +1085,7 @@ PHP_FUNCTION(xml_parser_create_ns)
if (argc == 2){
convert_to_string_ex(sepArg);
sep = (*sepArg)->value.str.val;
sep = Z_STRVAL_PP(sepArg);
} else {
sep = ":";
}

8
ext/xmlrpc/xmlrpc-epi-php.c

@ -815,13 +815,13 @@ PHP_FUNCTION(xmlrpc_server_destroy) {
WRONG_PARAM_COUNT; /* prints/logs a warning and returns */
}
if(arg1->type == IS_RESOURCE) {
if(Z_TYPE_P(arg1) == IS_RESOURCE) {
int type;
xmlrpc_server_data *server = zend_list_find(arg1->value.lval, &type);
xmlrpc_server_data *server = zend_list_find(Z_LVAL_P(arg1), &type);
if(server && type == XMLRPCG(le_xmlrpc_server)) {
bSuccess = zend_list_delete(arg1->value.lval);
bSuccess = zend_list_delete(Z_LVAL_P(arg1));
/* called by hashtable destructor
* destroy_server_data(server);
@ -1163,7 +1163,7 @@ PHP_FUNCTION(xmlrpc_parse_method_descriptions)
if(return_value_used) {
STRUCT_XMLRPC_ERROR err = {0};
XMLRPC_VALUE xVal = XMLRPC_IntrospectionCreateDescription(arg1->value.str.val, &err);
XMLRPC_VALUE xVal = XMLRPC_IntrospectionCreateDescription(Z_STRVAL_P(arg1), &err);
if(xVal) {
retval = XMLRPC_to_PHP(xVal);

32
ext/zlib/zlib.c

@ -267,7 +267,7 @@ PHP_FUNCTION(gzfile)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg2);
use_include_path = (*arg2)->value.lval?USE_PATH:0;
use_include_path = Z_LVAL_PP(arg2)?USE_PATH:0;
break;
default:
WRONG_PARAM_COUNT;
@ -321,23 +321,23 @@ PHP_FUNCTION(gzopen)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg3);
use_include_path = (*arg3)->value.lval?USE_PATH:0;
use_include_path = Z_LVAL_PP(arg3)?USE_PATH:0;
break;
default:
WRONG_PARAM_COUNT;
}
convert_to_string_ex(arg1);
convert_to_string_ex(arg2);
p = estrndup((*arg2)->value.str.val,(*arg2)->value.str.len);
p = estrndup(Z_STRVAL_PP(arg2),Z_STRLEN_PP(arg2));
/*
* We need a better way of returning error messages from
* php_gzopen_wrapper().
*/
zp = php_gzopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE TSRMLS_CC);
zp = php_gzopen_wrapper(Z_STRVAL_PP(arg1), p, use_include_path|ENFORCE_SAFE_MODE TSRMLS_CC);
if (!zp) {
php_error(E_WARNING,"gzopen(\"%s\",\"%s\") - %s",
(*arg1)->value.str.val, p, strerror(errno));
Z_STRVAL_PP(arg1), p, strerror(errno));
efree(p);
RETURN_FALSE;
}
@ -358,7 +358,7 @@ PHP_FUNCTION(gzclose)
WRONG_PARAM_COUNT;
}
ZEND_FETCH_RESOURCE(zp, gzFile *, arg1, -1, "Zlib file", le_zp);
zend_list_delete((*arg1)->value.lval);
zend_list_delete(Z_LVAL_PP(arg1));
RETURN_TRUE;
}
/* }}} */
@ -396,7 +396,7 @@ PHP_FUNCTION(gzgets)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg2);
len = (*arg2)->value.lval;
len = Z_LVAL_PP(arg2);
ZEND_FETCH_RESOURCE(zp, gzFile *, arg1, -1, "Zlib file", le_zp);
@ -517,7 +517,7 @@ PHP_FUNCTION(gzwrite)
RETURN_FALSE;
}
convert_to_string_ex(arg2);
num_bytes = (*arg2)->value.str.len;
num_bytes = Z_STRLEN_PP(arg2);
break;
case 3:
if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3)==FAILURE) {
@ -525,7 +525,7 @@ PHP_FUNCTION(gzwrite)
}
convert_to_string_ex(arg2);
convert_to_long_ex(arg3);
num_bytes = MIN((*arg3)->value.lval, (*arg2)->value.str.len);
num_bytes = MIN(Z_LVAL_PP(arg3), Z_STRLEN_PP(arg2));
break;
default:
WRONG_PARAM_COUNT;
@ -539,7 +539,7 @@ PHP_FUNCTION(gzwrite)
php_stripslashes(Z_STRVAL_PP(arg2), &num_bytes TSRMLS_CC);
}
ret = gzwrite(zp, (*arg2)->value.str.val,num_bytes);
ret = gzwrite(zp, Z_STRVAL_PP(arg2),num_bytes);
RETURN_LONG(ret);
}
/* }}} */
@ -600,7 +600,7 @@ PHP_FUNCTION(gzseek)
ZEND_FETCH_RESOURCE(zp, gzFile *, arg1, -1, "Zlib file", le_zp);
ret = gzseek(zp, (*arg2)->value.lval, SEEK_SET);
ret = gzseek(zp, Z_LVAL_PP(arg2), SEEK_SET);
RETURN_LONG(ret);
}
/* }}} */
@ -631,7 +631,7 @@ PHP_FUNCTION(readgzfile)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg2);
use_include_path = (*arg2)->value.lval?USE_PATH:0;
use_include_path = Z_LVAL_PP(arg2)?USE_PATH:0;
break;
default:
WRONG_PARAM_COUNT;
@ -642,9 +642,9 @@ PHP_FUNCTION(readgzfile)
* We need a better way of returning error messages from
* php_gzopen_wrapper().
*/
zp = php_gzopen_wrapper((*arg1)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE TSRMLS_CC);
zp = php_gzopen_wrapper(Z_STRVAL_PP(arg1),"r", use_include_path|ENFORCE_SAFE_MODE TSRMLS_CC);
if (!zp){
php_error(E_WARNING,"ReadGzFile(\"%s\") - %s",(*arg1)->value.str.val,strerror(errno));
php_error(E_WARNING,"ReadGzFile(\"%s\") - %s",Z_STRVAL_PP(arg1),strerror(errno));
RETURN_FALSE;
}
size= 0;
@ -681,7 +681,7 @@ PHP_FUNCTION(gzpassthru)
size += b ;
}
/* gzclose(zp); */
zend_list_delete((*arg1)->value.lval);
zend_list_delete(Z_LVAL_PP(arg1));
RETURN_LONG(size);
}
/* }}} */
@ -698,7 +698,7 @@ PHP_FUNCTION(gzread)
WRONG_PARAM_COUNT;
}
convert_to_long_ex(arg2);
len = (*arg2)->value.lval;
len = Z_LVAL_PP(arg2);
ZEND_FETCH_RESOURCE(zp, gzFile *, arg1, -1, "Zlib file", le_zp);

Loading…
Cancel
Save