CVS update: php3/functions

From: Date: Mon, 04 Jan 1999 01:13:01 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-3227@lists.php.net to get a copy of this message
Date: Sunday January 3, 1999 @ 20:13 Author: jah Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv24643/functions Modified Files: db.c filepro.c Log Message: Added prototypes. Added a few convert_to_long()s to db.c in the very unlikely case that someone changed the type of dbm_identifier to something else than int. Index: php3/functions/db.c diff -c php3/functions/db.c:1.80 php3/functions/db.c:1.81 *** php3/functions/db.c:1.80 Fri Jan 1 12:59:08 1999 --- php3/functions/db.c Sun Jan 3 20:12:59 1999 *************** *** 28,34 **** +----------------------------------------------------------------------+ */ ! /* $Id: db.c,v 1.80 1999/01/01 17:59:08 zeev Exp $ */ #define IS_EXT_MODULE #if COMPILE_DL #ifdef PHP_31 --- 28,34 ---- +----------------------------------------------------------------------+ */ ! /* $Id: db.c,v 1.81 1999/01/04 01:12:59 jah Exp $ */ #define IS_EXT_MODULE #if COMPILE_DL #ifdef PHP_31 *************** *** 261,273 **** php3_printf(php3_get_info_db()); } void php3_dblist(INTERNAL_FUNCTION_PARAMETERS) { char *str = php3_get_info_db(); RETURN_STRING(str,1); } ! void php3_dbmopen(INTERNAL_FUNCTION_PARAMETERS) { pval *filename, *mode; dbm_info *info=NULL; --- 261,277 ---- php3_printf(php3_get_info_db()); } + /* {{{ proto string dblist(void) + */ void php3_dblist(INTERNAL_FUNCTION_PARAMETERS) { char *str = php3_get_info_db(); RETURN_STRING(str,1); } ! /* }}} */ + /* {{{ proto int dbmopen(string filename, string mode) + */ void php3_dbmopen(INTERNAL_FUNCTION_PARAMETERS) { pval *filename, *mode; dbm_info *info=NULL; *************** *** 289,294 **** --- 293,299 ---- RETURN_FALSE; } } + /* }}} */ dbm_info *_php3_dbmopen(char *filename, char *mode) { dbm_info *info; *************** *** 434,439 **** --- 439,446 ---- return NULL; } + /* {{{ proto bool dbmclose(int dbm_identifier) + */ void php3_dbmclose(INTERNAL_FUNCTION_PARAMETERS) { pval *id; *************** *** 448,453 **** --- 455,461 ---- RETURN_FALSE; } } + /* }}} */ int _php3_dbmclose(dbm_info *info) { int ret = 0; *************** *** 488,493 **** --- 496,503 ---- * ret = 0 success * ret = 1 key already exists - nothing done */ + /* {{{ proto int dbminsert(int dbm_identifier, string key, string value) + */ void php3_dbminsert(INTERNAL_FUNCTION_PARAMETERS) { pval *id, *key, *value; *************** *** 497,502 **** --- 507,513 ---- if (ARG_COUNT(ht)!=3||getParameters(ht,3,&id,&key,&value) == FAILURE) { WRONG_PARAM_COUNT; } + convert_to_long(id); convert_to_string(key); convert_to_string(value); *************** *** 509,514 **** --- 520,526 ---- ret = _php3_dbminsert(info, key->value.str.val, value->value.str.val); RETURN_LONG(ret); } + /* }}} */ int _php3_dbminsert(dbm_info *info, char *key, char *value) { datum key_datum, value_datum; *************** *** 541,546 **** --- 553,560 ---- return(ret); } + /* {{{ proto int dbmreplace(int dbm_identifier, string key, string value) + */ void php3_dbmreplace(INTERNAL_FUNCTION_PARAMETERS) { pval *id, *key, *value; *************** *** 550,555 **** --- 564,570 ---- if (ARG_COUNT(ht)!=3||getParameters(ht,3,&id,&key,&value) == FAILURE) { WRONG_PARAM_COUNT; } + convert_to_long(id); convert_to_string(key); convert_to_string(value); *************** *** 562,567 **** --- 577,583 ---- ret = _php3_dbmreplace(info, key->value.str.val, value->value.str.val); RETURN_LONG(ret); } + /* }}} */ int _php3_dbmreplace(dbm_info *info, char *key, char *value) { DBM_TYPE dbf; *************** *** 598,603 **** --- 614,621 ---- return(ret); } + /* {{{ proto string dbmfetch(int dbm_identifier, string key) + */ void php3_dbmfetch(INTERNAL_FUNCTION_PARAMETERS) { pval *id, *key; *************** *** 606,611 **** --- 624,630 ---- if (ARG_COUNT(ht)!=2||getParameters(ht,2,&id,&key)==FAILURE) { WRONG_PARAM_COUNT; } + convert_to_long(id); convert_to_string(key); info = _php3_finddbm(id,list); *************** *** 622,627 **** --- 641,647 ---- RETURN_FALSE; } } + /* }}} */ char *_php3_dbmfetch(dbm_info *info, char *key) { datum key_datum, value_datum; *************** *** 670,675 **** --- 690,697 ---- } + /* {{{ proto int dbmexists(int dbm_identifier, string key) + */ void php3_dbmexists(INTERNAL_FUNCTION_PARAMETERS) { pval *id, *key; *************** *** 679,684 **** --- 701,707 ---- if (ARG_COUNT(ht)!=2||getParameters(ht,2,&id,&key)==FAILURE) { WRONG_PARAM_COUNT; } + convert_to_long(id); convert_to_string(key); info = _php3_finddbm(id,list); *************** *** 712,718 **** --- 735,744 ---- return(ret); } + /* }}} */ + /* {{{ proto int dbmdelete(int dbm_identifier, string key) + */ void php3_dbmdelete(INTERNAL_FUNCTION_PARAMETERS) { pval *id, *key; *************** *** 722,727 **** --- 748,754 ---- if (ARG_COUNT(ht)!=2||getParameters(ht,2,&id,&key)==FAILURE) { WRONG_PARAM_COUNT; } + convert_to_long(id); convert_to_string(key); info = _php3_finddbm(id,list); *************** *** 733,738 **** --- 760,766 ---- ret = _php3_dbmdelete(info, key->value.str.val); RETURN_LONG(ret); } + /* }}} */ int _php3_dbmdelete(dbm_info *info, char *key) { datum key_datum; *************** *** 755,760 **** --- 783,790 ---- return(ret); } + /* {{{ proto string dbmfirstkey(int dm_identifier) + */ void php3_dbmfirstkey(INTERNAL_FUNCTION_PARAMETERS) { pval *id; *************** *** 764,769 **** --- 794,800 ---- if (ARG_COUNT(ht)!=1||getParameters(ht,1,&id)==FAILURE) { WRONG_PARAM_COUNT; } + convert_to_long(id); info = _php3_finddbm(id,list); if (!info) { *************** *** 780,785 **** --- 811,817 ---- return_value->type = IS_STRING; } } + /* }}} */ char *_php3_dbmfirstkey(dbm_info *info) { datum ret_datum; *************** *** 812,817 **** --- 844,851 ---- return (ret); } + /* {{{ proto string dbmnextkey(int dbm_identifier, string key) + */ void php3_dbmnextkey(INTERNAL_FUNCTION_PARAMETERS) { pval *id, *key; *************** *** 821,826 **** --- 855,861 ---- if (ARG_COUNT(ht)!=2||getParameters(ht,2,&id,&key)==FAILURE) { WRONG_PARAM_COUNT; } + convert_to_long(id); convert_to_string(key); info = _php3_finddbm(id,list); *************** *** 838,843 **** --- 873,879 ---- return_value->type = IS_STRING; } } + /* }}} */ char *_php3_dbmnextkey(dbm_info *info, char *key) { datum key_datum, ret_datum; Index: php3/functions/filepro.c diff -c php3/functions/filepro.c:1.36 php3/functions/filepro.c:1.37 *** php3/functions/filepro.c:1.36 Fri Jan 1 12:59:09 1999 --- php3/functions/filepro.c Sun Jan 3 20:12:59 1999 *************** *** 34,40 **** */ ! /* $Id: filepro.c,v 1.36 1999/01/01 17:59:09 zeev Exp $ */ #ifdef THREAD_SAFE #include "tls.h" --- 34,40 ---- */ ! /* $Id: filepro.c,v 1.37 1999/01/04 01:12:59 jah Exp $ */ #ifdef THREAD_SAFE #include "tls.h" *************** *** 191,197 **** * a user is using it! We cannot lock anything since Web connections don't * provide the ability to later unlock what we locked. Be smart, be safe. */ ! void php3_filepro(INTERNAL_FUNCTION_PARAMETERS) { pval *dir; FILE *fp; --- 191,199 ---- * a user is using it! We cannot lock anything since Web connections don't * provide the ability to later unlock what we locked. Be smart, be safe. */ ! /* {{{ proto bool filepro(string directory) ! */ ! Void php3_filepro(INTERNAL_FUNCTION_PARAMETERS) { pval *dir; FILE *fp; *************** *** 276,281 **** --- 278,284 ---- RETVAL_TRUE; } + /* }}} */ /* *************** *** 287,292 **** --- 290,297 ---- * * Errors return false, success returns the row count. */ + /* {{{ proto int filepro_rowcount(void) + */ void php3_filepro_rowcount(INTERNAL_FUNCTION_PARAMETERS) { FILE *fp; *************** *** 334,339 **** --- 339,345 ---- RETVAL_LONG(records); } + /* }}} */ /* *************** *** 341,346 **** --- 347,354 ---- * * Errors return false, success returns the name of the field. */ + /* {{{ proto string filepro_fieldname(int fieldnumber) + */ void php3_filepro_fieldname(INTERNAL_FUNCTION_PARAMETERS) { pval *fno; *************** *** 372,377 **** --- 380,386 ---- RETVAL_FALSE; } + /* }}} */ /* *************** *** 379,384 **** --- 388,395 ---- * * Errors return false, success returns the type (edit) of the field */ + /* {{{ proto string filepro_fieldtype(int field_number) + */ void php3_filepro_fieldtype(INTERNAL_FUNCTION_PARAMETERS) { pval *fno; *************** *** 408,420 **** fno->value.lval); RETVAL_FALSE; } /* ! * STRING filePro_fieldwidth(int field_number) * * Errors return false, success returns the character width of the field. */ void php3_filepro_fieldwidth(INTERNAL_FUNCTION_PARAMETERS) { pval *fno; --- 419,434 ---- fno->value.lval); RETVAL_FALSE; } + /* }}} */ /* ! * LONG filePro_fieldwidth(int field_number) * * Errors return false, success returns the character width of the field. */ + /* {{{ proto int filepro_fieldwidth(int field_number) + */ void php3_filepro_fieldwidth(INTERNAL_FUNCTION_PARAMETERS) { pval *fno; *************** *** 444,449 **** --- 458,464 ---- fno->value.lval); RETVAL_FALSE; } + /* }}} */ /* *************** *** 451,456 **** --- 466,473 ---- * * Errors return false, success returns the field count. */ + /* {{{ proto int filepro_fieldcount(void) + */ void php3_filepro_fieldcount(INTERNAL_FUNCTION_PARAMETERS) { FP_TLS_VARS; *************** *** 468,473 **** --- 485,491 ---- /* Read in the first line from the map file */ RETVAL_LONG(FP_GLOBAL(fp_fcount)); } + /* }}} */ /* *************** *** 475,480 **** --- 493,500 ---- * * Errors return false, success returns the datum. */ + /* {{{ proto string filepro_retrieve(int row_number, int field_number) + */ void php3_filepro_retrieve(INTERNAL_FUNCTION_PARAMETERS) { pval *rno, *fno; *************** *** 544,549 **** --- 564,570 ---- fclose(fp); RETURN_STRING(readbuf,1); } + /* }}} */ #endif -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#3227) next »