Skip to content

Commit a3af52c

Browse files
author
foobar
committed
MFH: list_entry -> zend_rsrc_list_entry
1 parent d0a54af commit a3af52c

File tree

13 files changed

+65
-65
lines changed

13 files changed

+65
-65
lines changed

ext/fbsql/php_fbsql.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ PHP_MINFO_FUNCTION(fbsql)
502502
static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
503503
{
504504
PHPFBLink* phpLink;
505-
list_entry *lep;
505+
zend_rsrc_list_entry *lep;
506506
char name[1024];
507507
char *hostName = NULL, *userName = NULL, *userPassword = NULL;
508508
int argc = ZEND_NUM_ARGS(), create_new = 0;
@@ -543,7 +543,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
543543
phpLink = (PHPFBLink*)lep->ptr;
544544
}
545545
else {
546-
list_entry le;
546+
zend_rsrc_list_entry le;
547547

548548
if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks)))
549549
{
@@ -592,7 +592,7 @@ static void php_fbsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
592592
}
593593
else
594594
{
595-
list_entry le;
595+
zend_rsrc_list_entry le;
596596

597597
if ((FB_SQL_G(maxLinks) != -1 && FB_SQL_G(linkCount) == FB_SQL_G(maxLinks)))
598598
{

ext/informix/ifx.ec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,11 @@ EXEC SQL END DECLARE SECTION;
527527
}
528528

529529
if (persistent) {
530-
list_entry *le;
530+
zend_rsrc_list_entry *le;
531531

532532
/* try to find if we already have this link in our persistent list */
533533
if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void **) &le) == FAILURE) { /* we don't */
534-
list_entry new_le;
534+
zend_rsrc_list_entry new_le;
535535

536536
if (IFXG(max_links) != -1 && IFXG(num_links) >= IFXG(max_links)) {
537537
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", IFXG(num_links));
@@ -564,7 +564,7 @@ EXEC SQL END DECLARE SECTION;
564564
/* hash it up */
565565
new_le.type = le_plink;
566566
new_le.ptr = ifx;
567-
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void *) &new_le, sizeof(list_entry), NULL) == FAILURE) {
567+
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void *) &new_le, sizeof(zend_rsrc_list_entry), NULL) == FAILURE) {
568568
free(ifx);
569569
efree(hashed_details);
570570
RETURN_FALSE;
@@ -596,7 +596,7 @@ EXEC SQL END DECLARE SECTION;
596596
}
597597
ZEND_REGISTER_RESOURCE(return_value, ifx, le_plink);
598598
} else { /* non persistent */
599-
list_entry *index_ptr,new_index_ptr;
599+
zend_rsrc_list_entry *index_ptr,new_index_ptr;
600600

601601
/* first we check the hash for the hashed_details key. if it exists,
602602
* it should point us to the right offset where the actual ifx link sits.
@@ -670,7 +670,7 @@ EXEC SQL END DECLARE SECTION;
670670
/* add it to the hash */
671671
new_index_ptr.ptr = (void *) return_value->value.lval;
672672
new_index_ptr.type = le_index_ptr;
673-
if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length + 1, (void *) &new_index_ptr, sizeof(list_entry), NULL) == FAILURE) {
673+
if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length + 1, (void *) &new_index_ptr, sizeof(zend_rsrc_list_entry), NULL) == FAILURE) {
674674
efree(hashed_details);
675675
RETURN_FALSE;
676676
}

ext/interbase/interbase.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
616616
int i, len[] = { 0, 0, 0, 0, 0 };
617617
long largs[] = { 0, 0, 0 };
618618
PHP_MD5_CTX hash_context;
619-
list_entry new_index_ptr, *le;
619+
zend_rsrc_list_entry new_index_ptr, *le;
620620
isc_db_handle db_handle = NULL;
621621
ibase_db_link *ib_link;
622622

@@ -715,15 +715,15 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
715715
ib_link = (ibase_db_link *) emalloc(sizeof(ibase_db_link));
716716
ZEND_REGISTER_RESOURCE(return_value, ib_link, le_link);
717717
} else {
718-
list_entry new_le;
718+
zend_rsrc_list_entry new_le;
719719

720720
ib_link = (ibase_db_link *) malloc(sizeof(ibase_db_link));
721721

722722
/* hash it up */
723723
Z_TYPE(new_le) = le_plink;
724724
new_le.ptr = ib_link;
725725
if (FAILURE == zend_hash_update(&EG(persistent_list), hash, sizeof(hash),
726-
(void *) &new_le, sizeof(list_entry), NULL)) {
726+
(void *) &new_le, sizeof(zend_rsrc_list_entry), NULL)) {
727727
free(ib_link);
728728
RETURN_FALSE;
729729
}
@@ -742,7 +742,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
742742
new_index_ptr.ptr = (void *) Z_LVAL_P(return_value);
743743
Z_TYPE(new_index_ptr) = le_index_ptr;
744744
if (FAILURE == zend_hash_update(&EG(regular_list), hash, sizeof(hash),
745-
(void *) &new_index_ptr, sizeof(list_entry), NULL)) {
745+
(void *) &new_index_ptr, sizeof(zend_rsrc_list_entry), NULL)) {
746746
RETURN_FALSE;
747747
}
748748
zend_list_addref(IBG(default_link) = Z_LVAL_P(return_value));

ext/msql/php_msql.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static void php_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
264264
persistent=0;
265265
}
266266
if (persistent) {
267-
list_entry *le;
267+
zend_rsrc_list_entry *le;
268268

269269
if (msql_globals.max_links!=-1 && msql_globals.num_links>=msql_globals.max_links) {
270270
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", msql_globals.num_links);
@@ -279,7 +279,7 @@ static void php_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
279279

280280
/* try to find if we already have this link in our persistent list */
281281
if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */
282-
list_entry new_le;
282+
zend_rsrc_list_entry new_le;
283283

284284
/* create the link */
285285
if ((msql=msqlConnect(host))==-1) {
@@ -290,7 +290,7 @@ static void php_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
290290
/* hash it up */
291291
Z_TYPE(new_le) = msql_globals.le_plink;
292292
new_le.ptr = (void *) msql;
293-
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) {
293+
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(zend_rsrc_list_entry), NULL)==FAILURE) {
294294
efree(hashed_details);
295295
RETURN_FALSE;
296296
}
@@ -317,7 +317,7 @@ static void php_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
317317
}
318318
ZEND_REGISTER_RESOURCE(return_value, (void *) msql, msql_globals.le_plink);
319319
} else {
320-
list_entry *index_ptr,new_index_ptr;
320+
zend_rsrc_list_entry *index_ptr,new_index_ptr;
321321

322322
/* first we check the hash for the hashed_details key. if it exists,
323323
* it should point us to the right offset where the actual msql link sits.
@@ -358,7 +358,7 @@ static void php_msql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
358358
/* add it to the hash */
359359
new_index_ptr.ptr = (void *) Z_LVAL_P(return_value);
360360
Z_TYPE(new_index_ptr) = le_index_ptr;
361-
if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) {
361+
if (zend_hash_update(&EG(regular_list),hashed_details,hashed_details_length+1,(void *) &new_index_ptr, sizeof(zend_rsrc_list_entry), NULL)==FAILURE) {
362362
efree(hashed_details);
363363
RETURN_FALSE;
364364
}

ext/mssql/php_mssql.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate
170170
return 0;
171171
}
172172

173-
static int _clean_invalid_results(list_entry *le TSRMLS_DC)
173+
static int _clean_invalid_results(zend_rsrc_list_entry *le TSRMLS_DC)
174174
{
175175
if (Z_TYPE_P(le) == le_result) {
176176
mssql_link *mssql_ptr = ((mssql_result *) le->ptr)->mssql_ptr;
@@ -510,11 +510,11 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
510510
persistent=0;
511511
}
512512
if (persistent) {
513-
list_entry *le;
513+
zend_rsrc_list_entry *le;
514514

515515
/* try to find if we already have this link in our persistent list */
516516
if (new_link || zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void **) &le)==FAILURE) { /* we don't */
517-
list_entry new_le;
517+
zend_rsrc_list_entry new_le;
518518

519519
if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) {
520520
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links));
@@ -566,7 +566,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
566566
memcpy(mssql_ptr, &mssql, sizeof(mssql_link));
567567
Z_TYPE(new_le) = le_plink;
568568
new_le.ptr = mssql_ptr;
569-
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length + 1, &new_le, sizeof(list_entry), NULL)==FAILURE) {
569+
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length + 1, &new_le, sizeof(zend_rsrc_list_entry), NULL)==FAILURE) {
570570
free(mssql_ptr);
571571
efree(hashed_details);
572572
dbfreelogin(mssql.login);
@@ -619,7 +619,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
619619
}
620620
ZEND_REGISTER_RESOURCE(return_value, mssql_ptr, le_plink);
621621
} else { /* non persistent */
622-
list_entry *index_ptr, new_index_ptr;
622+
zend_rsrc_list_entry *index_ptr, new_index_ptr;
623623

624624
/* first we check the hash for the hashed_details key. if it exists,
625625
* it should point us to the right offset where the actual mssql link sits.
@@ -696,7 +696,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
696696
/* add it to the hash */
697697
new_index_ptr.ptr = (void *) Z_LVAL_P(return_value);
698698
Z_TYPE(new_index_ptr) = le_index_ptr;
699-
if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length + 1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) {
699+
if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length + 1,(void *) &new_index_ptr, sizeof(zend_rsrc_list_entry),NULL)==FAILURE) {
700700
efree(hashed_details);
701701
RETURN_FALSE;
702702
}

ext/mysql/php_mysql.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -661,11 +661,11 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
661661
persistent=0;
662662
}
663663
if (persistent) {
664-
list_entry *le;
664+
zend_rsrc_list_entry *le;
665665

666666
/* try to find if we already have this link in our persistent list */
667667
if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { /* we don't */
668-
list_entry new_le;
668+
zend_rsrc_list_entry new_le;
669669

670670
if (MySG(max_links)!=-1 && MySG(num_links)>=MySG(max_links)) {
671671
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MySG(num_links));
@@ -705,7 +705,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
705705
/* hash it up */
706706
Z_TYPE(new_le) = le_plink;
707707
new_le.ptr = mysql;
708-
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) {
708+
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(zend_rsrc_list_entry), NULL)==FAILURE) {
709709
free(mysql);
710710
efree(hashed_details);
711711
MYSQL_DO_CONNECT_RETURN_FALSE();
@@ -748,7 +748,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
748748
}
749749
ZEND_REGISTER_RESOURCE(return_value, mysql, le_plink);
750750
} else { /* non persistent */
751-
list_entry *index_ptr, new_index_ptr;
751+
zend_rsrc_list_entry *index_ptr, new_index_ptr;
752752

753753
/* first we check the hash for the hashed_details key. if it exists,
754754
* it should point us to the right offset where the actual mysql link sits.
@@ -813,7 +813,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
813813
/* add it to the hash */
814814
new_index_ptr.ptr = (void *) Z_LVAL_P(return_value);
815815
Z_TYPE(new_index_ptr) = le_index_ptr;
816-
if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length+1,(void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) {
816+
if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length+1,(void *) &new_index_ptr, sizeof(zend_rsrc_list_entry), NULL)==FAILURE) {
817817
efree(hashed_details);
818818
MYSQL_DO_CONNECT_RETURN_FALSE();
819819
}

ext/oci8/oci8.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static void php_oci_statement_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
8787
static void php_oci_descriptor_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
8888
static void php_oci_collection_list_dtor (zend_rsrc_list_entry * TSRMLS_DC);
8989

90-
static int php_oci_persistent_helper(list_entry *le TSRMLS_DC);
90+
static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC);
9191
static int php_oci_connection_ping(php_oci_connection * TSRMLS_DC);
9292
static int php_oci_connection_status(php_oci_connection * TSRMLS_DC);
9393
static int php_oci_connection_close(php_oci_connection * TSRMLS_DC);
@@ -925,8 +925,8 @@ void php_oci_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent, int exclus
925925
* The real connect function. Allocates all the resources needed, establishes the connection and returns the result handle (or NULL) */
926926
php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char *password, int password_len, char *new_password, int new_password_len, char *dbname, int dbname_len, char *charset, long session_mode, int persistent, int exclusive TSRMLS_DC)
927927
{
928-
list_entry *le;
929-
list_entry new_le;
928+
zend_rsrc_list_entry *le;
929+
zend_rsrc_list_entry new_le;
930930
php_oci_connection *connection = NULL;
931931
smart_str hashed_details = {0};
932932
time_t timestamp;
@@ -1300,14 +1300,14 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
13001300
new_le.type = le_pconnection;
13011301
connection->used_this_request = 1;
13021302
connection->rsrc_id = zend_list_insert(connection, le_pconnection);
1303-
zend_hash_update(&EG(persistent_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(list_entry), NULL);
1303+
zend_hash_update(&EG(persistent_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL);
13041304
OCI_G(num_persistent)++;
13051305
}
13061306
else if (!exclusive) {
13071307
connection->rsrc_id = zend_list_insert(connection, le_connection);
13081308
new_le.ptr = (void *)connection->rsrc_id;
13091309
new_le.type = le_index_ptr;
1310-
zend_hash_update(&EG(regular_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(list_entry), NULL);
1310+
zend_hash_update(&EG(regular_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL);
13111311
OCI_G(num_links)++;
13121312
}
13131313
else {
@@ -1672,7 +1672,7 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg
16721672

16731673
/* {{{ php_oci_persistent_helper()
16741674
Helper function to close/rollback persistent connections at the end of request */
1675-
static int php_oci_persistent_helper(list_entry *le TSRMLS_DC)
1675+
static int php_oci_persistent_helper(zend_rsrc_list_entry *le TSRMLS_DC)
16761676
{
16771677
time_t timestamp;
16781678
php_oci_connection *connection;

ext/odbc/php_odbc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type)
716716
/* }}} */
717717

718718
/* {{{ _close_pconn_with_id */
719-
static int _close_pconn_with_id(list_entry *le, int *id TSRMLS_DC)
719+
static int _close_pconn_with_id(zend_rsrc_list_entry *le, int *id TSRMLS_DC)
720720
{
721721
if(Z_TYPE_P(le) == le_pconn && (((odbc_connection *)(le->ptr))->id == *id)){
722722
return 1;
@@ -2274,11 +2274,11 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
22742274
try_and_get_another_connection:
22752275

22762276
if (persistent) {
2277-
list_entry *le;
2277+
zend_rsrc_list_entry *le;
22782278

22792279
if (zend_hash_find(&EG(persistent_list), hashed_details, hashed_len + 1, (void **) &le)
22802280
== FAILURE) { /* the link is not in the persistent list */
2281-
list_entry new_le;
2281+
zend_rsrc_list_entry new_le;
22822282

22832283
if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) {
22842284
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", ODBCG(num_links));
@@ -2299,7 +2299,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
22992299
Z_TYPE(new_le) = le_pconn;
23002300
new_le.ptr = db_conn;
23012301
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_len + 1, &new_le,
2302-
sizeof(list_entry), NULL) == FAILURE) {
2302+
sizeof(zend_rsrc_list_entry), NULL) == FAILURE) {
23032303
free(db_conn);
23042304
efree(hashed_details);
23052305
RETURN_FALSE;
@@ -2343,7 +2343,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
23432343
}
23442344
db_conn->id = ZEND_REGISTER_RESOURCE(return_value, db_conn, le_pconn);
23452345
} else { /* non persistent */
2346-
list_entry *index_ptr, new_index_ptr;
2346+
zend_rsrc_list_entry *index_ptr, new_index_ptr;
23472347

23482348
if (zend_hash_find(&EG(regular_list), hashed_details, hashed_len + 1,
23492349
(void **) &index_ptr) == SUCCESS) {
@@ -2378,7 +2378,7 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
23782378
new_index_ptr.ptr = (void *) Z_LVAL_P(return_value);
23792379
Z_TYPE(new_index_ptr) = le_index_ptr;
23802380
if (zend_hash_update(&EG(regular_list), hashed_details, hashed_len + 1, (void *) &new_index_ptr,
2381-
sizeof(list_entry), NULL) == FAILURE) {
2381+
sizeof(zend_rsrc_list_entry), NULL) == FAILURE) {
23822382
efree(hashed_details);
23832383
RETURN_FALSE;
23842384
/* XXX Free Connection */

0 commit comments

Comments
 (0)