mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
found type is unnecessary
This commit is contained in:
parent
50ae5b31b4
commit
e98caf27ea
10 changed files with 50 additions and 58 deletions
|
@ -98,19 +98,13 @@ ZEND_API zend_resource* zend_register_resource(void *rsrc_pointer, int rsrc_type
|
|||
return Z_RES_P(zv);
|
||||
}
|
||||
|
||||
ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int *found_type, int resource_type1, int resource_type2)
|
||||
ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resource_type1, int resource_type2)
|
||||
{
|
||||
if (resource_type1 == res->type) {
|
||||
if (found_type) {
|
||||
*found_type = resource_type1;
|
||||
}
|
||||
return res->ptr;
|
||||
}
|
||||
|
||||
if (resource_type2 == res->type) {
|
||||
if (found_type) {
|
||||
*found_type = resource_type2;
|
||||
}
|
||||
return res->ptr;
|
||||
}
|
||||
|
||||
|
@ -159,7 +153,7 @@ ZEND_API void *zend_fetch_resource_ex(zval *res, const char *resource_type_name,
|
|||
return zend_fetch_resource(Z_RES_P(res), resource_type_name, resource_type);
|
||||
}
|
||||
|
||||
ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int *found_type, int resource_type1, int resource_type2)
|
||||
ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int resource_type1, int resource_type2)
|
||||
{
|
||||
const char *space, *class_name;
|
||||
if (res == NULL) {
|
||||
|
@ -177,7 +171,7 @@ ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name
|
|||
return NULL;
|
||||
}
|
||||
|
||||
return zend_fetch_resource2(Z_RES_P(res), resource_type_name, found_type, resource_type1, resource_type2);
|
||||
return zend_fetch_resource2(Z_RES_P(res), resource_type_name, resource_type1, resource_type2);
|
||||
}
|
||||
|
||||
void list_entry_destructor(zval *zv)
|
||||
|
|
|
@ -61,9 +61,9 @@ ZEND_API int zend_list_close(zend_resource *res);
|
|||
|
||||
ZEND_API zend_resource *zend_register_resource(void *rsrc_pointer, int rsrc_type);
|
||||
ZEND_API void *zend_fetch_resource(zend_resource *res, const char *resource_type_name, int resource_type);
|
||||
ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int *found_type, int resource_type, int resource_type2);
|
||||
ZEND_API void *zend_fetch_resource2(zend_resource *res, const char *resource_type_name, int resource_type, int resource_type2);
|
||||
ZEND_API void *zend_fetch_resource_ex(zval *res, const char *resource_type_name, int resource_type);
|
||||
ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int *found_type, int resource_type, int resource_type2);
|
||||
ZEND_API void *zend_fetch_resource2_ex(zval *res, const char *resource_type_name, int resource_type, int resource_type2);
|
||||
|
||||
ZEND_API const char *zend_rsrc_list_get_rsrc_type(zend_resource *res);
|
||||
ZEND_API int zend_fetch_list_dtor_id(const char *type_name);
|
||||
|
|
|
@ -230,7 +230,7 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror) /* {{{ */
|
|||
}
|
||||
|
||||
if (!Z_ISUNDEF(ch->handlers->std_err)) {
|
||||
stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->std_err, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->std_err, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream == NULL) {
|
||||
if (reporterror) {
|
||||
php_error_docref(NULL, E_WARNING, "CURLOPT_STDERR resource has gone away, resetting to stderr");
|
||||
|
@ -242,7 +242,7 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror) /* {{{ */
|
|||
}
|
||||
}
|
||||
if (ch->handlers->read && !Z_ISUNDEF(ch->handlers->read->stream)) {
|
||||
stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->read->stream, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->read->stream, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream == NULL) {
|
||||
if (reporterror) {
|
||||
php_error_docref(NULL, E_WARNING, "CURLOPT_INFILE resource has gone away, resetting to default");
|
||||
|
@ -256,7 +256,7 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror) /* {{{ */
|
|||
}
|
||||
}
|
||||
if (ch->handlers->write_header && !Z_ISUNDEF(ch->handlers->write_header->stream)) {
|
||||
stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->write_header->stream, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->write_header->stream, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream == NULL) {
|
||||
if (reporterror) {
|
||||
php_error_docref(NULL, E_WARNING, "CURLOPT_WRITEHEADER resource has gone away, resetting to default");
|
||||
|
@ -270,7 +270,7 @@ void _php_curl_verify_handlers(php_curl *ch, int reporterror) /* {{{ */
|
|||
}
|
||||
}
|
||||
if (ch->handlers->write && !Z_ISUNDEF(ch->handlers->write->stream)) {
|
||||
stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->write->stream, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
stream = (php_stream *)zend_fetch_resource2_ex(&ch->handlers->write->stream, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream == NULL) {
|
||||
if (reporterror) {
|
||||
php_error_docref(NULL, E_WARNING, "CURLOPT_FILE resource has gone away, resetting to default");
|
||||
|
@ -2281,11 +2281,10 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
|
|||
case CURLOPT_STDERR:
|
||||
case CURLOPT_WRITEHEADER: {
|
||||
FILE *fp = NULL;
|
||||
int type;
|
||||
php_stream *what = NULL;
|
||||
|
||||
if (Z_TYPE_P(zvalue) != IS_NULL) {
|
||||
what = (php_stream *)zend_fetch_resource2_ex(zvalue, "File-Handle", &type, php_file_le_stream(), php_file_le_pstream());
|
||||
what = (php_stream *)zend_fetch_resource2_ex(zvalue, "File-Handle", php_file_le_stream(), php_file_le_pstream());
|
||||
if (!what) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
@ -2860,7 +2859,7 @@ PHP_FUNCTION(curl_exec)
|
|||
|
||||
if (!Z_ISUNDEF(ch->handlers->std_err)) {
|
||||
php_stream *stream;
|
||||
stream = (php_stream*)zend_fetch_resource2_ex(&ch->handlers->std_err, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
stream = (php_stream*)zend_fetch_resource2_ex(&ch->handlers->std_err, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream) {
|
||||
php_stream_flush(stream);
|
||||
}
|
||||
|
|
|
@ -543,7 +543,7 @@ static MYSQLND *mysql_convert_zv_to_mysqlnd(zval *zv)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(zv), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(zv), "MySQL-Link", le_link, le_plink))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1109,11 +1109,11 @@ PHP_FUNCTION(mysql_close)
|
|||
}
|
||||
|
||||
if (mysql_link) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(MySG(default_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(MySG(default_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1160,7 +1160,7 @@ PHP_FUNCTION(mysql_select_db)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1203,7 +1203,7 @@ PHP_FUNCTION(mysql_get_host_info)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1228,7 +1228,7 @@ PHP_FUNCTION(mysql_get_proto_info)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1253,7 +1253,7 @@ PHP_FUNCTION(mysql_get_server_info)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1279,7 +1279,7 @@ PHP_FUNCTION(mysql_info)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1308,7 +1308,7 @@ PHP_FUNCTION(mysql_thread_id)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1339,7 +1339,7 @@ PHP_FUNCTION(mysql_stat)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1374,7 +1374,7 @@ PHP_FUNCTION(mysql_client_encoding)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1403,7 +1403,7 @@ PHP_FUNCTION(mysql_set_charset)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1437,7 +1437,7 @@ PHP_FUNCTION(mysql_create_db)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1470,7 +1470,7 @@ PHP_FUNCTION(mysql_drop_db)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1593,7 +1593,7 @@ static void php_mysql_do_query(INTERNAL_FUNCTION_PARAMETERS, int use_store)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1636,7 +1636,7 @@ PHP_FUNCTION(mysql_db_query)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1664,7 +1664,7 @@ PHP_FUNCTION(mysql_list_dbs)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1702,7 +1702,7 @@ PHP_FUNCTION(mysql_list_tables)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1741,7 +1741,7 @@ PHP_FUNCTION(mysql_list_fields)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1778,7 +1778,7 @@ PHP_FUNCTION(mysql_list_processes)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1817,7 +1817,7 @@ PHP_FUNCTION(mysql_error)
|
|||
}
|
||||
mysql = (php_mysql_conn*)MySG(default_link)->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1848,7 +1848,7 @@ PHP_FUNCTION(mysql_errno)
|
|||
}
|
||||
mysql = (php_mysql_conn*)MySG(default_link)->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1874,7 +1874,7 @@ PHP_FUNCTION(mysql_affected_rows)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1927,7 +1927,7 @@ PHP_FUNCTION(mysql_real_escape_string)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1959,7 +1959,7 @@ PHP_FUNCTION(mysql_insert_id)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -2727,7 +2727,7 @@ PHP_FUNCTION(mysql_ping)
|
|||
CHECK_LINK(res);
|
||||
mysql = (php_mysql_conn*)res->ptr;
|
||||
} else {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", NULL, le_link, le_plink))) {
|
||||
if (!(mysql = (php_mysql_conn *)zend_fetch_resource2(Z_RES_P(mysql_link), "MySQL-Link", le_link, le_plink))) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3219,9 +3219,8 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
|
|||
|
||||
if (Z_TYPE_P(val) == IS_RESOURCE) {
|
||||
void * what;
|
||||
int type;
|
||||
|
||||
what = zend_fetch_resource2_ex(val, "OpenSSL X.509/key", &type, le_x509, le_key);
|
||||
what = zend_fetch_resource2_ex(val, "OpenSSL X.509/key", le_x509, le_key);
|
||||
if (!what) {
|
||||
TMP_CLEAN;
|
||||
}
|
||||
|
@ -3229,11 +3228,11 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval * val, int public_key, char * p
|
|||
*resourceval = Z_RES_P(val);
|
||||
Z_ADDREF_P(val);
|
||||
}
|
||||
if (type == le_x509) {
|
||||
if (Z_RES_P(val)->type == le_x509) {
|
||||
/* extract key from cert, depending on public_key param */
|
||||
cert = (X509*)what;
|
||||
free_cert = 0;
|
||||
} else if (type == le_key) {
|
||||
} else if (Z_RES_P(val)->type == le_key) {
|
||||
int is_priv;
|
||||
|
||||
is_priv = php_openssl_is_private_key((EVP_PKEY*)what);
|
||||
|
|
|
@ -1357,7 +1357,7 @@ static void from_zval_write_fd_array_aux(zval *elem, unsigned i, void **args, se
|
|||
return;
|
||||
}
|
||||
|
||||
stream = (php_stream *)zend_fetch_resource2_ex(elem, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
stream = (php_stream *)zend_fetch_resource2_ex(elem, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream == NULL) {
|
||||
do_from_zval_err(ctx, "resource is not a stream or a socket");
|
||||
return;
|
||||
|
|
|
@ -974,7 +974,7 @@ PHP_FUNCTION(socket_set_nonblock)
|
|||
if (!Z_ISUNDEF(php_sock->zstream)) {
|
||||
php_stream *stream;
|
||||
/* omit notice if resource doesn't exist anymore */
|
||||
stream = zend_fetch_resource2_ex(&php_sock->zstream, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
stream = zend_fetch_resource2_ex(&php_sock->zstream, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream != NULL) {
|
||||
if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, 0,
|
||||
NULL) != -1) {
|
||||
|
@ -1014,7 +1014,7 @@ PHP_FUNCTION(socket_set_block)
|
|||
* state */
|
||||
if (!Z_ISUNDEF(php_sock->zstream)) {
|
||||
php_stream *stream;
|
||||
stream = zend_fetch_resource2_ex(&php_sock->zstream, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
stream = zend_fetch_resource2_ex(&php_sock->zstream, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
if (stream != NULL) {
|
||||
if (php_stream_set_option(stream, PHP_STREAM_OPTION_BLOCKING, 1,
|
||||
NULL) != -1) {
|
||||
|
|
|
@ -1151,7 +1151,7 @@ PHPAPI PHP_FUNCTION(fgetss)
|
|||
Implements a mostly ANSI compatible fscanf() */
|
||||
PHP_FUNCTION(fscanf)
|
||||
{
|
||||
int result, type, argc = 0;
|
||||
int result, argc = 0;
|
||||
size_t format_len;
|
||||
zval *args = NULL;
|
||||
zval *file_handle;
|
||||
|
@ -1163,7 +1163,7 @@ PHP_FUNCTION(fscanf)
|
|||
return;
|
||||
}
|
||||
|
||||
what = zend_fetch_resource2(Z_RES_P(file_handle), "File-Handle", &type, php_file_le_stream(), php_file_le_pstream());
|
||||
what = zend_fetch_resource2(Z_RES_P(file_handle), "File-Handle", php_file_le_stream(), php_file_le_pstream());
|
||||
|
||||
/* we can't do a ZEND_VERIFY_RESOURCE(what), otherwise we end up
|
||||
* with a leak if we have an invalid filehandle. This needs changing
|
||||
|
|
|
@ -920,7 +920,7 @@ static php_stream_context *decode_context_param(zval *contextresource)
|
|||
if (context == NULL) {
|
||||
php_stream *stream;
|
||||
|
||||
stream = zend_fetch_resource2_ex(contextresource, NULL, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
stream = zend_fetch_resource2_ex(contextresource, NULL, php_file_le_stream(), php_file_le_pstream());
|
||||
|
||||
if (stream) {
|
||||
context = PHP_STREAM_CONTEXT(stream);
|
||||
|
|
|
@ -255,18 +255,18 @@ END_EXTERN_C()
|
|||
|
||||
#define php_stream_from_zval(xstr, pzval) do { \
|
||||
if (((xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), \
|
||||
"stream", NULL, php_file_le_stream(), php_file_le_pstream())) == NULL) { \
|
||||
"stream", php_file_le_stream(), php_file_le_pstream())) == NULL) { \
|
||||
RETURN_FALSE; \
|
||||
} \
|
||||
} while (0)
|
||||
#define php_stream_from_res(xstr, res) do { \
|
||||
if (((xstr) = (php_stream*)zend_fetch_resource2((res), \
|
||||
"stream", NULL, php_file_le_stream(), php_file_le_pstream())) == NULL) { \
|
||||
"stream", php_file_le_stream(), php_file_le_pstream())) == NULL) { \
|
||||
RETURN_FALSE; \
|
||||
} \
|
||||
} while (0)
|
||||
#define php_stream_from_res_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource((res), "stream", NULL, php_file_le_stream(), php_file_le_pstream())
|
||||
#define php_stream_from_zval_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), "stream", NULL, php_file_le_stream(), php_file_le_pstream())
|
||||
#define php_stream_from_res_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource((res), "stream", php_file_le_stream(), php_file_le_pstream())
|
||||
#define php_stream_from_zval_no_verify(xstr, pzval) (xstr) = (php_stream*)zend_fetch_resource2_ex((pzval), "stream", php_file_le_stream(), php_file_le_pstream())
|
||||
|
||||
BEGIN_EXTERN_C()
|
||||
PHPAPI php_stream *php_stream_encloses(php_stream *enclosing, php_stream *enclosed);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue