CVS update: php3/functions
| From: | sas | Date: | Sun, 09 May 1999 17:35:46 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-5443@lists.php.net to get a copy of this message | ||
Date: Sunday May 9, 1999 @ 13:35
Author: sas
Update of /repository/php3/functions
In directory php:/tmp/cvs-serv25955/functions
Modified Files:
dba.c dba_db2.c file.c
Log Message:
- better autoconf checking for db2
- db2 compile fix
- correcter cast in file.c
- dba_sync fix
Index: php3/functions/dba.c
diff -u php3/functions/dba.c:1.10 php3/functions/dba.c:1.11
--- php3/functions/dba.c:1.10 Sun May 9 12:54:34 1999
+++ php3/functions/dba.c Sun May 9 13:35:46 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba.c,v 1.10 1999/05/09 16:54:34 sas Exp $ */
+/* $Id: dba.c,v 1.11 1999/05/09 17:35:46 sas Exp $ */
#include "php.h"
@@ -123,7 +123,7 @@
{\
#x, dba_open_##x, dba_close_##x, dba_fetch_##x, dba_update_##x, \
dba_exists_##x, dba_delete_##x, dba_firstkey_##x, dba_nextkey_##x, \
- dba_optimize_##x \
+ dba_optimize_##x, dba_sync_##x \
},
#define GLOBAL(a) a
@@ -190,7 +190,7 @@
{
dba_handler *hptr;
- PUTS("V1 ($Id: dba.c,v 1.10 1999/05/09 16:54:34 sas Exp $)");
+ PUTS("V1 ($Id: dba.c,v 1.11 1999/05/09 17:35:46 sas Exp $)");
for(hptr = handler; hptr->name; hptr++) {
PUTS(" ");
PUTS(hptr->name);
Index: php3/functions/dba_db2.c
diff -u php3/functions/dba_db2.c:1.1 php3/functions/dba_db2.c:1.2
--- php3/functions/dba_db2.c:1.1 Sun May 9 12:54:35 1999
+++ php3/functions/dba_db2.c Sun May 9 13:35:46 1999
@@ -27,7 +27,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dba_db2.c,v 1.1 1999/05/09 16:54:35 sas Exp $ */
+/* $Id: dba_db2.c,v 1.2 1999/05/09 17:35:46 sas Exp $ */
#include "php.h"
@@ -35,7 +35,15 @@
#include "php3_db2.h"
#include <string.h>
+#if DB2_DB2_DB_H
+#include <db2/db.h>
+#elif DB2_DB_DB2_H
+#include <db/db2.h>
+#elif DB2_DB2_H
+#include <db2.h>
+#elif DB2_DB_H
#include <db.h>
+#endif
#define DB2_DATA dba_db2_data *dba = info->dbf
#define DB2_GKEY \
@@ -53,16 +61,8 @@
DB *dbp;
int gmode = 0;
- switch(info->mode) {
- case DBA_READER:
- gmode = DB_RDONLY;
- break;
- case DBA_WRITER;
- gmode = DB_CREATE;
- break;
- default:
- break;
- }
+ gmode = info->mode == DBA_READER ? DB_RDONLY :
+ info->mode == DBA_WRITER ? DB_CREATE : 0;
if(!db_open(info->path, DB_BTREE, gmode, 0644, NULL, NULL, &dbp)) {
info->dbf = malloc(sizeof(dba_db2_data));
@@ -111,12 +111,9 @@
if(!dba->dbp->put(dba->dbp, NULL, &gkey, &gval,
mode == 1 ? DB_NOOVERWRITE : 0)) {
return 1;
+ }
return 0;
}
-
-/*
- * is not there any better method??
- */
DBA_EXISTS_FUNC(db2)
{
Index: php3/functions/file.c
diff -u php3/functions/file.c:1.206 php3/functions/file.c:1.207
--- php3/functions/file.c:1.206 Mon May 3 16:21:15 1999
+++ php3/functions/file.c Sun May 9 13:35:46 1999
@@ -26,7 +26,7 @@
| Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.206 1999/05/03 20:21:15 sas Exp $ */
+/* $Id: file.c,v 1.207 1999/05/09 17:35:46 sas Exp $ */
#ifdef THREAD_SAFE
#include "tls.h"
#endif
@@ -1526,7 +1526,7 @@
buf = emalloc(sizeof(char) * (len + 1));
/*needed because recv doesnt set null char at end*/
memset(buf,0,len+1);
- if (!(issock?SOCK_FGETS(buf,len,socketd):(int)fgets(buf, len, fp))) {
+ if (!(issock?SOCK_FGETS(buf,len,socketd):(long)fgets(buf, len, fp))) {
efree(buf);
RETURN_FALSE;
}
--
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