Lines Matching refs:entry

68 	browscap_entry *entry = Z_PTR_P(zvalue);  local
69 zend_string_release_ex(entry->pattern, 0);
70 if (entry->parent) {
71 zend_string_release_ex(entry->parent, 0);
73 efree(entry);
78 browscap_entry *entry = Z_PTR_P(zvalue); in browscap_entry_dtor_persistent() local
79 zend_string_release_ex(entry->pattern, 1); in browscap_entry_dtor_persistent()
80 if (entry->parent) { in browscap_entry_dtor_persistent()
81 zend_string_release_ex(entry->parent, 1); in browscap_entry_dtor_persistent()
83 pefree(entry, 1); in browscap_entry_dtor_persistent()
268 static void browscap_entry_add_kv_to_existing_array(browser_data *bdata, browscap_entry *entry, Has… in browscap_entry_add_kv_to_existing_array() argument
269 for (uint32_t i = entry->kv_start; i < entry->kv_end; i++) { in browscap_entry_add_kv_to_existing_array()
276 static HashTable *browscap_entry_to_array(browser_data *bdata, browscap_entry *entry) { in browscap_entry_to_array() argument
278 HashTable *ht = zend_new_array(2 + (entry->parent ? 1 : 0) + (entry->kv_end - entry->kv_start)); in browscap_entry_to_array()
280 ZVAL_STR(&tmp, browscap_convert_pattern(entry->pattern, 0)); in browscap_entry_to_array()
286 ZVAL_STR_COPY(&tmp, entry->pattern); in browscap_entry_to_array()
292 if (entry->parent) { in browscap_entry_to_array()
293 ZVAL_STR_COPY(&tmp, entry->parent); in browscap_entry_to_array()
300 browscap_entry_add_kv_to_existing_array(bdata, entry, ht); in browscap_entry_to_array()
361 browscap_entry *entry; in php_browscap_parser_cb() local
381 entry = ctx->current_entry in php_browscap_parser_cb()
383 zend_hash_update_ptr(bdata->htab, pattern, entry); in php_browscap_parser_cb()
390 entry->pattern = zend_string_copy(pattern); in php_browscap_parser_cb()
391 entry->kv_end = entry->kv_start = bdata->kv_used; in php_browscap_parser_cb()
392 entry->parent = NULL; in php_browscap_parser_cb()
394 pos = entry->prefix_len = browscap_compute_prefix_len(pattern); in php_browscap_parser_cb()
397 &entry->contains_start[i], &entry->contains_len[i]); in php_browscap_parser_cb()
541 static inline size_t browscap_get_minimum_length(const browscap_entry *entry) { in browscap_get_minimum_length() argument
542 size_t len = entry->prefix_len; in browscap_get_minimum_length()
545 len += entry->contains_len[i]; in browscap_get_minimum_length()
625 static int browser_reg_compare(browscap_entry *entry, const zend_string *agent_name, browscap_entry… in browser_reg_compare() argument
633 ZSTR_ALLOCA_ALLOC(pattern_lc, ZSTR_LEN(entry->pattern), use_heap); in browser_reg_compare()
634 zend_str_tolower_copy(ZSTR_VAL(pattern_lc), ZSTR_VAL(entry->pattern), ZSTR_LEN(entry->pattern)); in browser_reg_compare()
637 cur = ZSTR_VAL(agent_name) + entry->prefix_len; in browser_reg_compare()
639 if (entry->contains_len[i] != 0) { in browser_reg_compare()
641 ZSTR_VAL(pattern_lc) + entry->contains_start[i], in browser_reg_compare()
642 entry->contains_len[i], in browser_reg_compare()
648 cur += entry->contains_len[i]; in browser_reg_compare()
654 *found_entry_ptr = entry; in browser_reg_compare()
661 ZSTR_VAL(agent_name) + entry->prefix_len, in browser_reg_compare()
663 ZSTR_VAL(pattern_lc) + entry->prefix_len, in browser_reg_compare()
669 …size_t curr_len = entry->prefix_len; /* Start from the prefix because the prefix is free of wildca… in browser_reg_compare()
670 const zend_string *current_match = entry->pattern; in browser_reg_compare()
687 *found_entry_ptr = entry; in browser_reg_compare()
691 *found_entry_ptr = entry; in browser_reg_compare()
749 browscap_entry *entry; in PHP_FUNCTION() local
752 ZEND_HASH_MAP_FOREACH_PTR(bdata->htab, entry) { in PHP_FUNCTION()
758 if (ZSTR_LEN(lookup_browser_name) < browscap_get_minimum_length(entry)) { in PHP_FUNCTION()
764 for (size_t i = 0; i < entry->prefix_len; i++) { in PHP_FUNCTION()
765 if (ZSTR_VAL(lookup_browser_name)[i] != zend_tolower_ascii(ZSTR_VAL(entry->pattern)[i])) { in PHP_FUNCTION()
774 if (browser_reg_compare(entry, lookup_browser_name, &found_entry, &cached_prev_len)) { in PHP_FUNCTION()