cvs: php4 /ext/dbplus php_dbplus.c

From: Date: Wed, 19 Sep 2001 17:14:14 +0000
Subject: cvs: php4 /ext/dbplus php_dbplus.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7482@lists.php.net to get a copy of this message
hholzgra Wed Sep 19 13:14:14 2001 EDT Modified files: /php4/ext/dbplus php_dbplus.c Log: argument count fix plus beginning local query support Index: php4/ext/dbplus/php_dbplus.c diff -u php4/ext/dbplus/php_dbplus.c:1.9 php4/ext/dbplus/php_dbplus.c:1.10 --- php4/ext/dbplus/php_dbplus.c:1.9 Tue Sep 18 16:42:37 2001 +++ php4/ext/dbplus/php_dbplus.c Wed Sep 19 13:14:14 2001 @@ -32,6 +32,8 @@ field * string_to_field(char *val, attribute *ap, int flags); void cdb_tcl(int,char *,char **, int *); relf * aql_exec(char *, char *); +tuple *rnext(relf *); + #define _STRING(x) ((*x)->value.str.val) #define _INT(x) ((*x)->value.lval) @@ -759,7 +761,7 @@ { zval **relation, **tname; relf *r; - tuple t; + tuple *t; int stat; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &relation, &tname) == FAILURE){ @@ -768,9 +770,15 @@ DBPLUS_FETCH_RESOURCE(r, relation); - stat = cdb_next(r, &t); + if(r->r_sid = 9999) { + t = rnext(r); + stat = Acc_error; + } else { + t = (tuple *) pmalloc(sizeof(tuple)); + stat = cdb_next(r, t); + } if(stat==ERR_NOERR) { - tuple2var(r, &t, tname); + tuple2var(r, t, tname); } RETURN_LONG(stat); @@ -1138,7 +1146,7 @@ { relf *r; zval **name, **dbpath; - int argc; + int argc = ZEND_NUM_ARGS(); if ((argc <1) || (argc>2) || (zend_get_parameters_ex(2, &name, &dbpath) == FAILURE)){ WRONG_PARAM_COUNT; @@ -1150,6 +1158,8 @@ /* TODO error handling */ RETURN_FALSE; } + + r->r_sid = 9999; ZEND_REGISTER_RESOURCE(return_value, r, le_dbplus_relation); }

« previous php.cvs (#7482) next »