+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2004 The PHP Group |
+ | Copyright (c) 1997-2011 The PHP Group |
+----------------------------------------------------------------------+
- | This source file is subject to version 3.0 of the PHP license, |
+ | This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
- | http://www.php.net/license/3_0.txt. |
+ | http://www.php.net/license/3_01.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
#define MAX_ASSOC 200
-#define GET_PARM1(a) zend_parse_parameters(1 , "z", a)
-#define GET_PARM2(a,b) zend_parse_parameters(2, "zz", a, b)
-#define GET_PARM3(a,b,c) zend_parse_parameters(3, "zzz", a, b, c)
-#define GET_PARM4(a,b,c,d) zend_parse_parameters(4, "zzzz", a, b, c, d)
+#define GET_PARM1(a) zend_parse_parameters(1 TSRMLS_CC , "z", a)
+#define GET_PARM2(a,b) zend_parse_parameters(2 TSRMLS_CC, "zz", a, b)
+#define GET_PARM3(a,b,c) zend_parse_parameters(3 TSRMLS_CC, "zzz", a, b, c)
+#define GET_PARM4(a,b,c,d) zend_parse_parameters(4 TSRMLS_CC, "zzzz", a, b, c, d)
typedef struct Yaz_AssociationInfo *Yaz_Association;
#endif
-function_entry yaz_functions [] = {
+zend_function_entry yaz_functions [] = {
PHP_FE(yaz_connect, NULL)
PHP_FE(yaz_close, NULL)
PHP_FE(yaz_search, NULL)
{NULL, NULL, NULL}
};
-static void get_assoc(INTERNAL_FUNCTION_PARAMETERS, pval *id, Yaz_Association *assocp)
+static void get_assoc(INTERNAL_FUNCTION_PARAMETERS, zval *id, Yaz_Association *assocp)
{
Yaz_Association *as = 0;
static const char *array_lookup_string(HashTable *ht, const char *idx)
{
- pval **pvalue;
+ zval **pvalue;
if (ht && zend_hash_find(ht, (char *) idx, strlen(idx) + 1, (void **) &pvalue) == SUCCESS) {
SEPARATE_ZVAL(pvalue);
static long *array_lookup_long(HashTable *ht, const char *idx)
{
- pval **pvalue;
+ zval **pvalue;
if (ht && zend_hash_find(ht, (char *) idx, strlen(idx) + 1, (void **) &pvalue) == SUCCESS) {
SEPARATE_ZVAL(pvalue);
static long *array_lookup_bool(HashTable *ht, const char *idx)
{
- pval **pvalue;
+ zval **pvalue;
if (ht && zend_hash_find(ht, (char *) idx, strlen(idx) + 1, (void **) &pvalue) == SUCCESS) {
SEPARATE_ZVAL(pvalue);
const char *preferredMessageSize = 0;
int persistent = 1;
int piggyback = 1;
- pval *zurl, *user = 0;
+ zval *zurl, *user = 0;
Yaz_Association as;
int max_links = YAZSG(max_links);
PHP_FUNCTION(yaz_close)
{
Yaz_Association p;
- pval *id;
+ zval *id;
if (ZEND_NUM_ARGS() != 1) {
WRONG_PARAM_COUNT;
PHP_FUNCTION(yaz_search)
{
char *query_str, *type_str;
- pval *id, *type, *query;
+ zval *id, *type, *query;
Yaz_Association p;
if (ZEND_NUM_ARGS() == 3) {
Retrieve records */
PHP_FUNCTION(yaz_present)
{
- pval *id;
+ zval *id;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 1) {
WRONG_PARAM_COUNT;
}
- if (GET_PARM1(id) == FAILURE) {
+ if (GET_PARM1(&id) == FAILURE) {
WRONG_PARAM_COUNT;
}
Process events. */
PHP_FUNCTION(yaz_wait)
{
- pval *pval_options = 0;
+ zval *pval_options = 0;
int event_mode = 0;
int no = 0;
ZOOM_connection conn_ar[MAX_ASSOC];
Return last error number (>0 for bib-1 diagnostic, <0 for other error, 0 for no error */
PHP_FUNCTION(yaz_errno)
{
- pval *id;
+ zval *id;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 1 || GET_PARM1(&id) == FAILURE) {
Return last error message */
PHP_FUNCTION(yaz_error)
{
- pval *id;
+ zval *id;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 1 || GET_PARM1(&id) == FAILURE) {
Return additional info for last error (empty string if none) */
PHP_FUNCTION(yaz_addinfo)
{
- pval *id;
+ zval *id;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 1 || GET_PARM1(&id) == FAILURE) {
Return number of hits (result count) for last search */
PHP_FUNCTION(yaz_hits)
{
- pval *id, *searchresult = 0;
+ zval *id, *searchresult = 0;
Yaz_Association p;
if (ZEND_NUM_ARGS() == 1) {
array_init(zval_element);
if (e->tagType)
- add_assoc_long(zval_element, "tagType", *e->tagType);
+ add_assoc_long(zval_element, "tagType", (long) *e->tagType);
if (e->tagValue->which == Z_StringOrNumeric_string)
add_assoc_string(zval_element, "tag", e->tagValue->u.string, 1);
else if (e->tagValue->which == Z_StringOrNumeric_numeric)
- add_assoc_long(zval_element, "tag", *e->tagValue->u.numeric);
+ add_assoc_long(zval_element, "tag", (long) *e->tagValue->u.numeric);
switch (e->content->which) {
case Z_ElementData_string:
}
break;
case Z_ElementData_numeric:
- add_assoc_long(zval_element, "content",*e->content->u.numeric);
+ add_assoc_long(zval_element, "content", (long) *e->content->u.numeric);
break;
case Z_ElementData_trueOrFalse:
add_assoc_bool(zval_element, "content",*e->content->u.trueOrFalse);
}
*tag = '\0';
for (i = 0; i <= level; i++) {
- int tag_type = 3;
+ long tag_type = 3;
e = grs[i]->elements[eno[i]];
if (e->tagType) {
- tag_type = *e->tagType;
+ tag_type = (long) *e->tagType;
}
taglen = strlen(tag);
- sprintf(tag + taglen, "(%d,", tag_type);
+ sprintf(tag + taglen, "(%ld,", tag_type);
taglen = strlen(tag);
if (e->tagValue->which == Z_StringOrNumeric_string) {
}
break;
case Z_ElementData_numeric:
- add_next_index_long(my_zval, *e->content->u.numeric);
+ add_next_index_long(my_zval, (long) *e->content->u.numeric);
break;
case Z_ElementData_trueOrFalse:
add_next_index_long(my_zval, *e->content->u.trueOrFalse);
Return record information at given result set position */
PHP_FUNCTION(yaz_record)
{
- pval *pval_id, *pval_pos, *pval_type;
+ zval *pval_id, *pval_pos, *pval_type;
Yaz_Association p;
int pos;
char *type;
Set record syntax for retrieval */
PHP_FUNCTION(yaz_syntax)
{
- pval *pval_id, *pval_syntax;
+ zval *pval_id, *pval_syntax;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 2 ||
Set Element-Set-Name for retrieval */
PHP_FUNCTION(yaz_element)
{
- pval *pval_id, *pval_element;
+ zval *pval_id, *pval_element;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 2 ||
Set Schema for retrieval */
PHP_FUNCTION(yaz_schema)
{
- pval *pval_id, *pval_element;
+ zval *pval_id, *pval_element;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 2 ||
Set Option(s) for connection */
PHP_FUNCTION(yaz_set_option)
{
- pval *pval_ar, *pval_name, *pval_val, *pval_id;
+ zval *pval_ar, *pval_name, *pval_val, *pval_id;
Yaz_Association p;
if (ZEND_NUM_ARGS() == 2) {
Set Option(s) for connection */
PHP_FUNCTION(yaz_get_option)
{
- pval *pval_id, *pval_name;
+ zval *pval_id, *pval_name;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 2) {
Set result set start point and number of records to request */
PHP_FUNCTION(yaz_range)
{
- pval *pval_id, *pval_start, *pval_number;
+ zval *pval_id, *pval_start, *pval_number;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 3 ||
Set result set sorting criteria */
PHP_FUNCTION(yaz_sort)
{
- pval *pval_id, *pval_criteria;
+ zval *pval_id, *pval_criteria;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 2 ||
Sends Item Order request */
PHP_FUNCTION(yaz_itemorder)
{
- pval *pval_id, *pval_package;
+ zval *pval_id, *pval_package;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 2 ||
Sends Extended Services Request */
PHP_FUNCTION(yaz_es)
{
- pval *pval_id, *pval_type, *pval_package;
+ zval *pval_id, *pval_type, *pval_package;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 3 ||
Sends Scan Request */
PHP_FUNCTION(yaz_scan)
{
- pval *pval_id, *pval_type, *pval_query, *pval_flags = 0;
+ zval *pval_id, *pval_type, *pval_query, *pval_flags = 0;
HashTable *flags_ht = 0;
Yaz_Association p;
Inspects Extended Services Result */
PHP_FUNCTION(yaz_es_result)
{
- pval *pval_id;
+ zval *pval_id;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 1 || GET_PARM1(&pval_id) == FAILURE) {
Inspects Scan Result */
PHP_FUNCTION(yaz_scan_result)
{
- pval *pval_id, *pval_opt = 0;
+ zval *pval_id, *pval_opt = 0;
Yaz_Association p;
if (ZEND_NUM_ARGS() == 2) {
Configure CCL package */
PHP_FUNCTION(yaz_ccl_conf)
{
- pval *pval_id, *pval_package;
+ zval *pval_id, *pval_package;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 2 ||
Parse a CCL query */
PHP_FUNCTION(yaz_ccl_parse)
{
- pval *pval_id, *pval_query, *pval_res = 0;
+ zval *pval_id, *pval_query, *pval_res = 0;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 3 || GET_PARM3( &pval_id, &pval_query, &pval_res)
Specify the databases within a session */
PHP_FUNCTION(yaz_database)
{
- pval *pval_id, *pval_database;
+ zval *pval_id, *pval_database;
Yaz_Association p;
if (ZEND_NUM_ARGS() != 2 ||