CVS update: php3/functions
| From: | sas | Date: | Fri, 25 Jun 1999 22:48:30 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-7565@lists.php.net to get a copy of this message | ||
Date: Friday June 25, 1999 @ 18:48
Author: sas
Update of /repository/php3/functions
In directory php:/tmp/cvs-serv7720/functions
Modified Files:
dbase.c
Log Message:
one shouldn't apply the same patch twice
Index: php3/functions/dbase.c
diff -u php3/functions/dbase.c:1.74 php3/functions/dbase.c:1.75
--- php3/functions/dbase.c:1.74 Fri Jun 25 18:37:28 1999
+++ php3/functions/dbase.c Fri Jun 25 18:48:30 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dbase.c,v 1.74 1999/06/25 22:37:28 sas Exp $ */
+/* $Id: dbase.c,v 1.75 1999/06/25 22:48:30 sas Exp $ */
#if defined(COMPILE_DL)
#include "dl/phpdl.h"
#endif
@@ -384,74 +384,6 @@
}
/* }}} */
-/* {{{ proto bool dbase_replace_record(int identifier, array data, int recnum)
- Replaces a record to the database */
-void php3_dbase_replace_record(INTERNAL_FUNCTION_PARAMETERS) {
- pval *dbh_id, *fields, *field, *recnum;
- dbhead_t *dbh;
- int dbh_type;
-
- int num_fields;
- dbfield_t *dbf, *cur_f;
- char *cp, *t_cp;
- int i;
- DBase_TLS_VARS;
-
- if (ARG_COUNT(ht) != 3 || getParameters(ht,3,&dbh_id,&fields,&recnum)==FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_long(dbh_id);
- convert_to_long(recnum);
- if (fields->type != IS_ARRAY) {
- php3_error(E_WARNING, "Expected array as second parameter");
- RETURN_FALSE;
- }
-
- dbh = php3_list_find(dbh_id->value.lval, &dbh_type);
- if (!dbh || dbh_type != DBase_GLOBAL(le_dbhead)) {
- php3_error(E_WARNING, "Unable to find database for identifier %d",
dbh_id->value.lval);
- RETURN_FALSE;
- }
-
- num_fields = _php3_hash_num_elements(fields->value.ht);
-
- if (num_fields != dbh->db_nfields) {
- php3_error(E_WARNING, "Wrong number of fields specified");
- RETURN_FALSE;
- }
-
- cp = t_cp = (char *)emalloc(dbh->db_rlen + 1);
- if (!cp) {
- php3_error(E_WARNING, "unable to allocate memory");
- RETURN_FALSE;
- }
- *t_cp++ = VALID_RECORD;
-
- dbf = dbh->db_fields;
- for (i = 0, cur_f = dbf; cur_f < &dbf[num_fields]; i++, cur_f++) {
- if (_php3_hash_index_find(fields->value.ht, i, (void **)&field) == FAILURE) {
- php3_error(E_WARNING, "unexpected error");
- efree(cp);
- RETURN_FALSE;
- }
- convert_to_string(field);
- sprintf(t_cp, cur_f->db_format, field->value.str.val);
- t_cp += cur_f->db_flen;
- }
-
- if (put_dbf_record(dbh, recnum->value.lval, cp) < 0) {
- php3_error(E_WARNING, "unable to put record at %ld", dbh->db_records);
- efree(cp);
- RETURN_FALSE;
- }
-
- put_dbf_info(dbh);
- efree(cp);
-
- RETURN_TRUE;
-}
-/* }}} */
-
/* {{{ proto bool dbase_delete_record(int identifier, int record)
Marks a record to be deleted */
void php3_dbase_delete_record(INTERNAL_FUNCTION_PARAMETERS) {
@@ -799,7 +731,6 @@
{"dbase_numrecords", php3_dbase_numrecords, NULL},
{"dbase_numfields", php3_dbase_numfields, NULL},
{"dbase_add_record", php3_dbase_add_record, NULL},
- {"dbase_replace_record", php3_dbase_replace_record, NULL},
{"dbase_get_record", php3_dbase_get_record, NULL},
{"dbase_get_record_with_names", php3_dbase_get_record_with_names, NULL},
{"dbase_delete_record", php3_dbase_delete_record, NULL},