Lines Matching refs:sybase_ptr
241 sybase_link *sybase_ptr = ((sybase_result *) le->ptr)->sybase_ptr; local
243 if (!sybase_ptr->valid) {
314 if (result->sybase_ptr && result->sybase_ptr->active_result_index) { in php_free_sybase_result()
315 if (result->sybase_ptr->cmd) { in php_free_sybase_result()
316 ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); in php_free_sybase_result()
326 sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr; in _close_sybase_link() local
329 sybase_ptr->valid = 0; in _close_sybase_link()
330 if (sybase_ptr->callback_name != NULL) { in _close_sybase_link()
331 zval_ptr_dtor(&sybase_ptr->callback_name); in _close_sybase_link()
332 sybase_ptr->callback_name= NULL; in _close_sybase_link()
340 if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS, in _close_sybase_link()
347 if ((con_status & CS_CONSTAT_DEAD) || ct_close(sybase_ptr->connection, CS_UNUSED)!=CS_SUCCEED) { in _close_sybase_link()
348 ct_close(sybase_ptr->connection, CS_FORCE_CLOSE); in _close_sybase_link()
352 ct_cmd_drop(sybase_ptr->cmd); in _close_sybase_link()
353 ct_con_drop(sybase_ptr->connection); in _close_sybase_link()
354 efree(sybase_ptr); in _close_sybase_link()
361 sybase_link *sybase_ptr = (sybase_link *)rsrc->ptr; in _close_sybase_plink() local
367 if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS, in _close_sybase_plink()
374 if ((con_status & CS_CONSTAT_DEAD) || ct_close(sybase_ptr->connection, CS_UNUSED)!=CS_SUCCEED) { in _close_sybase_plink()
375 ct_close(sybase_ptr->connection, CS_FORCE_CLOSE); in _close_sybase_plink()
379 ct_con_drop(sybase_ptr->connection); in _close_sybase_plink()
380 free(sybase_ptr); in _close_sybase_plink()
735 sybase_link *sybase_ptr; in php_sybase_do_connect() local
779 sybase_ptr = (sybase_link *) malloc(sizeof(sybase_link)); in php_sybase_do_connect()
780 if (!sybase_ptr) { in php_sybase_do_connect()
784 … if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) { in php_sybase_do_connect()
785 free(sybase_ptr); in php_sybase_do_connect()
792 new_le.ptr = sybase_ptr; in php_sybase_do_connect()
794 ct_close(sybase_ptr->connection, CS_UNUSED); in php_sybase_do_connect()
795 ct_con_drop(sybase_ptr->connection); in php_sybase_do_connect()
796 free(sybase_ptr); in php_sybase_do_connect()
810 sybase_ptr = (sybase_link *) le->ptr; in php_sybase_do_connect()
814 if (ct_con_props(sybase_ptr->connection, CS_GET, CS_CON_STATUS, in php_sybase_do_connect()
820 if (!(con_status & CS_CONSTAT_CONNECTED) || (con_status & CS_CONSTAT_DEAD) || sybase_ptr->dead) { in php_sybase_do_connect()
824 ct_close(sybase_ptr->connection, CS_FORCE_CLOSE); in php_sybase_do_connect()
837 memcpy(&sybase, sybase_ptr, sizeof(sybase_link)); in php_sybase_do_connect()
838 … if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) { in php_sybase_do_connect()
839 memcpy(sybase_ptr, &sybase, sizeof(sybase_link)); in php_sybase_do_connect()
846 ZEND_REGISTER_RESOURCE(return_value, sybase_ptr, le_plink); in php_sybase_do_connect()
881 sybase_ptr = (sybase_link *) emalloc(sizeof(sybase_link)); in php_sybase_do_connect()
882 if (!php_sybase_do_connect_internal(sybase_ptr, host, user, passwd, charset, appname TSRMLS_CC)) { in php_sybase_do_connect()
883 efree(sybase_ptr); in php_sybase_do_connect()
889 ZEND_REGISTER_RESOURCE(return_value, sybase_ptr, le_link); in php_sybase_do_connect()
895 ct_close(sybase_ptr->connection, CS_UNUSED); in php_sybase_do_connect()
896 ct_con_drop(sybase_ptr->connection); in php_sybase_do_connect()
897 efree(sybase_ptr); in php_sybase_do_connect()
955 sybase_link *sybase_ptr; in PHP_FUNCTION() local
967 …ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", le_link, le… in PHP_FUNCTION()
983 static int exec_cmd(sybase_link *sybase_ptr, char *cmdbuf) in exec_cmd() argument
991 if (sybase_ptr->dead) { in exec_cmd()
1000 if (ct_command(sybase_ptr->cmd, CS_LANG_CMD, cmdbuf, CS_NULLTERM, CS_UNUSED)!=CS_SUCCEED) { in exec_cmd()
1001 sybase_ptr->dead = 1; in exec_cmd()
1004 if (ct_send(sybase_ptr->cmd)!=CS_SUCCEED) { in exec_cmd()
1005 sybase_ptr->dead = 1; in exec_cmd()
1009 while ((retcode = ct_results(sybase_ptr->cmd, &restype))==CS_SUCCEED) { in exec_cmd()
1020 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT); in exec_cmd()
1028 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); in exec_cmd()
1045 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); in exec_cmd()
1049 sybase_ptr->dead = 1; in exec_cmd()
1065 sybase_link *sybase_ptr; in PHP_FUNCTION() local
1076 …ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", le_link, le… in PHP_FUNCTION()
1079 if (exec_cmd(sybase_ptr, cmdbuf) == FAILURE) { in PHP_FUNCTION()
1107 result->sybase_ptr->active_result_index= 0; in php_sybase_finish_results()
1117 while ((retcode = ct_results(result->sybase_ptr->cmd, &restype))==CS_SUCCEED) { in php_sybase_finish_results()
1125 ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); in php_sybase_finish_results()
1135 ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_CURRENT); in php_sybase_finish_results()
1140 ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_CURRENT); in php_sybase_finish_results()
1145 ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); in php_sybase_finish_results()
1166 ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); in php_sybase_finish_results()
1170 result->sybase_ptr->dead = 1; in php_sybase_finish_results()
1205 …while ((retcode=ct_fetch(result->sybase_ptr->cmd, CS_UNUSED, CS_UNUSED, CS_UNUSED, NULL))==CS_SUCC… in php_sybase_fetch_result_row()
1296 static sybase_result * php_sybase_fetch_result_set(sybase_link *sybase_ptr, int buffered, int store… in php_sybase_fetch_result_set() argument
1308 if (ct_res_info(sybase_ptr->cmd, CS_NUMDATA, &num_fields, CS_UNUSED, NULL)!=CS_SUCCEED) { in php_sybase_fetch_result_set()
1315 result->sybase_ptr = sybase_ptr; in php_sybase_fetch_result_set()
1329 ct_describe(sybase_ptr->cmd, i+1, &result->datafmt[i]); in php_sybase_fetch_result_set()
1387 …ct_bind(sybase_ptr->cmd, i+1, &result->datafmt[i], result->tmp_buffer[i], &result->lengths[i], &re… in php_sybase_fetch_result_set()
1430 sybase_link *sybase_ptr; in php_sybase_query() local
1454 …ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", le_link, le… in php_sybase_query()
1457 if (sybase_ptr->dead) { in php_sybase_query()
1462 if (sybase_ptr->active_result_index) { in php_sybase_query()
1466 if (sybase_ptr->cmd) { in php_sybase_query()
1467 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); in php_sybase_query()
1472 Z_LVAL_P(tmp)= sybase_ptr->active_result_index; in php_sybase_query()
1482 zend_list_delete(sybase_ptr->active_result_index); in php_sybase_query()
1483 sybase_ptr->active_result_index= 0; in php_sybase_query()
1490 sybase_ptr->deadlock = 0; in php_sybase_query()
1491 sybase_ptr->affected_rows = 0; in php_sybase_query()
1496 if (ct_command(sybase_ptr->cmd, CS_LANG_CMD, query, CS_NULLTERM, CS_UNUSED)!=CS_SUCCEED) { in php_sybase_query()
1503 sybase_ptr->dead = 1; in php_sybase_query()
1508 if (ct_send(sybase_ptr->cmd)!=CS_SUCCEED) { in php_sybase_query()
1509 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); in php_sybase_query()
1510 sybase_ptr->dead = 1; in php_sybase_query()
1521 if (ct_results(sybase_ptr->cmd, &restype)!=CS_SUCCEED) { in php_sybase_query()
1522 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); in php_sybase_query()
1523 sybase_ptr->dead = 1; in php_sybase_query()
1535 if (ct_res_info(sybase_ptr->cmd, CS_ROW_COUNT, &row_count, CS_UNUSED, NULL)==CS_SUCCEED) { in php_sybase_query()
1536 sybase_ptr->affected_rows = (long)row_count; in php_sybase_query()
1552 result = php_sybase_fetch_result_set(sybase_ptr, buffered, store TSRMLS_CC); in php_sybase_query()
1554 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); in php_sybase_query()
1563 while ((retcode = ct_results(sybase_ptr->cmd, &restype))==CS_SUCCEED) { in php_sybase_query()
1578 result = php_sybase_fetch_result_set(sybase_ptr, buffered, store TSRMLS_CC); in php_sybase_query()
1580 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); in php_sybase_query()
1581 sybase_ptr->dead = 1; in php_sybase_query()
1588 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT); in php_sybase_query()
1593 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_CURRENT); in php_sybase_query()
1601 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); in php_sybase_query()
1619 ct_cancel(NULL, sybase_ptr->cmd, CS_CANCEL_ALL); in php_sybase_query()
1623 sybase_ptr->dead = 1; in php_sybase_query()
1632 …if (sybase_ptr->deadlock && SybCtG(deadlock_retry_count) != -1 && ++deadlock_count > SybCtG(deadlo… in php_sybase_query()
1643 if (sybase_ptr->dead || sybase_ptr->deadlock == 0) { in php_sybase_query()
1667 sybase_ptr->active_result_index= buffered ? id : 0; in php_sybase_query()
1700 ct_cancel(NULL, result->sybase_ptr->cmd, CS_CANCEL_ALL); in PHP_FUNCTION()
2099 sybase_link *sybase_ptr; in PHP_FUNCTION() local
2111 …ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", le_link, le… in PHP_FUNCTION()
2113 Z_LVAL_P(return_value) = sybase_ptr->affected_rows; in PHP_FUNCTION()
2194 sybase_link *sybase_ptr; in PHP_FUNCTION() local
2209 …ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", le_link, le… in PHP_FUNCTION()
2210 callback= &sybase_ptr->callback_name; in PHP_FUNCTION()