Lines Matching refs:bdata

217 	browser_data *bdata;  member
264 browser_data *bdata, zend_string *key, zend_string *value, zend_bool persistent) { in browscap_add_kv() argument
265 if (bdata->kv_used == bdata->kv_size) { in browscap_add_kv()
266 bdata->kv_size *= 2; in browscap_add_kv()
267 bdata->kv = safe_perealloc(bdata->kv, sizeof(browscap_kv), bdata->kv_size, 0, persistent); in browscap_add_kv()
270 bdata->kv[bdata->kv_used].key = key; in browscap_add_kv()
271 bdata->kv[bdata->kv_used].value = value; in browscap_add_kv()
272 bdata->kv_used++; in browscap_add_kv()
275 static HashTable *browscap_entry_to_array(browser_data *bdata, browscap_entry *entry) { in browscap_entry_to_array() argument
293 ZVAL_STR_COPY(&tmp, bdata->kv[i].value); in browscap_entry_to_array()
294 zend_hash_add(ht, bdata->kv[i].key, &tmp); in browscap_entry_to_array()
303 browser_data *bdata = ctx->bdata; in php_browscap_parser_cb() local
304 int persistent = GC_FLAGS(bdata->htab) & IS_ARRAY_PERSISTENT; in php_browscap_parser_cb()
350 browscap_add_kv(bdata, new_key, new_value, persistent); in php_browscap_parser_cb()
351 ctx->current_entry->kv_end = bdata->kv_used; in php_browscap_parser_cb()
379 zend_hash_update_ptr(bdata->htab, pattern, entry); in php_browscap_parser_cb()
387 entry->kv_end = entry->kv_start = bdata->kv_used; in php_browscap_parser_cb()
429 ctx.bdata = browdata; in browscap_read_file()
457 static void browscap_bdata_dtor(browser_data *bdata, int persistent) /* {{{ */ in browscap_bdata_dtor() argument
459 if (bdata->htab != NULL) { in browscap_bdata_dtor()
462 zend_hash_destroy(bdata->htab); in browscap_bdata_dtor()
463 pefree(bdata->htab, persistent); in browscap_bdata_dtor()
464 bdata->htab = NULL; in browscap_bdata_dtor()
466 for (i = 0; i < bdata->kv_used; i++) { in browscap_bdata_dtor()
467 zend_string_release(bdata->kv[i].key); in browscap_bdata_dtor()
468 zend_string_release(bdata->kv[i].value); in browscap_bdata_dtor()
470 pefree(bdata->kv, persistent); in browscap_bdata_dtor()
471 bdata->kv = NULL; in browscap_bdata_dtor()
473 bdata->filename[0] = '\0'; in browscap_bdata_dtor()
484 browser_data *bdata = &BROWSCAP_G(activation_bdata); in PHP_INI_MH() local
485 if (bdata->filename[0] != '\0') { in PHP_INI_MH()
486 browscap_bdata_dtor(bdata, 0); in PHP_INI_MH()
488 if (VCWD_REALPATH(ZSTR_VAL(new_value), bdata->filename) == NULL) { in PHP_INI_MH()
519 browser_data *bdata = &BROWSCAP_G(activation_bdata); in PHP_RSHUTDOWN_FUNCTION() local
520 if (bdata->filename[0] != '\0') { in PHP_RSHUTDOWN_FUNCTION()
521 browscap_bdata_dtor(bdata, 0); in PHP_RSHUTDOWN_FUNCTION()
683 browser_data *bdata; in PHP_FUNCTION() local
694 bdata = &BROWSCAP_G(activation_bdata); in PHP_FUNCTION()
695 if (bdata->htab == NULL) { /* not initialized yet */ in PHP_FUNCTION()
696 if (browscap_read_file(bdata->filename, bdata, 0) == FAILURE) { in PHP_FUNCTION()
705 bdata = &global_bdata; in PHP_FUNCTION()
724 found_entry = zend_hash_find_ptr(bdata->htab, lookup_browser_name); in PHP_FUNCTION()
728 ZEND_HASH_FOREACH_PTR(bdata->htab, entry) { in PHP_FUNCTION()
735 found_entry = zend_hash_str_find_ptr(bdata->htab, in PHP_FUNCTION()
744 agent_ht = browscap_entry_to_array(bdata, found_entry); in PHP_FUNCTION()
753 found_entry = zend_hash_find_ptr(bdata->htab, found_entry->parent); in PHP_FUNCTION()
758 agent_ht = browscap_entry_to_array(bdata, found_entry); in PHP_FUNCTION()