diff options
author | Adam Dickmeiss <dickmeiss@php.net> | 2001-04-18 15:03:24 +0000 |
---|---|---|
committer | Adam Dickmeiss <dickmeiss@php.net> | 2001-04-18 15:03:24 +0000 |
commit | 1c62af36eba0d80923f13ffead2d2c4f7676efc8 (patch) | |
tree | 5b54401744440b11e333b5fae404057bddf16e99 /ext/yaz/php_yaz.c | |
parent | e2c8e80e2b72a9e7ef095ff74b240e6f7542e6c5 (diff) | |
download | php-git-1c62af36eba0d80923f13ffead2d2c4f7676efc8.tar.gz |
Function yaz_record returns database for record if type is "database".
Diffstat (limited to 'ext/yaz/php_yaz.c')
-rw-r--r-- | ext/yaz/php_yaz.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/yaz/php_yaz.c b/ext/yaz/php_yaz.c index 2696054194..b82097ec8a 100644 --- a/ext/yaz/php_yaz.c +++ b/ext/yaz/php_yaz.c @@ -244,6 +244,7 @@ static Yaz_Association get_assoc (pval **id) #ifdef ZTS tsrm_mutex_unlock (yaz_mutex); #endif + php_error(E_WARNING, "Invalid YAZ handle"); return 0; } return assoc; @@ -492,6 +493,7 @@ static void handle_apdu (Yaz_Association t, Z_APDU *apdu) } if (t->action) (*t->action) (t); + t->action = 0; } break; case Z_APDU_searchResponse: @@ -1193,7 +1195,6 @@ PHP_FUNCTION(yaz_present) p = get_assoc (id); if (!p) { - zend_error(E_WARNING, "get_assoc failed for present"); RETURN_FALSE; } p->action = 0; @@ -1219,7 +1220,8 @@ PHP_FUNCTION(yaz_wait) for (i = 0; i<MAX_ASSOC; i++) { Yaz_Association p = shared_associations[i]; - if (!p || p->order != order_associations || !p->action) + if (!p || p->order != order_associations || !p->action + || p->mask_select) continue; if (!p->cs) { @@ -1649,6 +1651,11 @@ PHP_FUNCTION(yaz_record) if (ent && ent->desc) RETVAL_STRING(ent->desc, 1); } + else if (!strcmp (type, "database")) + { + if (npr->databaseName) + RETVAL_STRING(npr->databaseName, 1); + } else if (!strcmp (type, "string")) { if (r->which == Z_External_sutrs && ent->value == VAL_SUTRS) @@ -2201,8 +2208,13 @@ PHP_FUNCTION(yaz_ccl_conf) zend_hash_move_forward_ex(ht, &pos)) { ulong idx; +#if PHP_API_VERSION > 20010101 int type = zend_hash_get_current_key_ex(ht, &key, 0, &idx, 0, &pos); +#else + int type = zend_hash_get_current_key_ex(ht, &key, 0, + &idx, &pos); +#endif if (type != HASH_KEY_IS_STRING || Z_TYPE_PP(ent) != IS_STRING) continue; ccl_qual_fitem(p->ccl_parser->bibset, (*ent)->value.str.val, key); |