cvs: php4 /ext/sybase php_sybase_db.c php_sybase_db.h

From: Date: Tue, 04 Sep 2001 07:41:18 +0000
Subject: cvs: php4 /ext/sybase php_sybase_db.c php_sybase_db.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-7194@lists.php.net to get a copy of this message
andi Tue Sep 4 03:41:18 2001 EDT Modified files: /php4/ext/sybase php_sybase_db.c php_sybase_db.h Log: - Fix namespace collisions. Index: php4/ext/sybase/php_sybase_db.c diff -u php4/ext/sybase/php_sybase_db.c:1.28 php4/ext/sybase/php_sybase_db.c:1.29 --- php4/ext/sybase/php_sybase_db.c:1.28 Sat Aug 11 08:02:15 2001 +++ php4/ext/sybase/php_sybase_db.c Tue Sep 4 03:41:18 2001 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_sybase_db.c,v 1.28 2001/08/11 12:02:15 thies Exp $ */ +/* $Id: php_sybase_db.c,v 1.29 2001/09/04 07:41:18 andi Exp $ */ #ifdef HAVE_CONFIG_H @@ -42,6 +42,43 @@ #if BROKEN_SYBASE_PCONNECTS #include "http_log.h" #endif + +/* Moved these structures/defines into the .c file (or into a *private* header), + because leaving them in php_sybase_db.h caused namespace pollution in + main/internal_functions.c. */ + +#define coltype(j) dbcoltype(sybase_ptr->link,j) +#define intcol(i) ((int) *(DBINT *) dbdata(sybase_ptr->link,i)) +#define smallintcol(i) ((int) *(DBSMALLINT *) dbdata(sybase_ptr->link,i)) +#define tinyintcol(i) ((int) *(DBTINYINT *) dbdata(sybase_ptr->link,i)) +#define anyintcol(j) (coltype(j)==SYBINT4?intcol(j):(coltype(j)==SYBINT2?smallintcol(j):tinyintcol(j))) +#define charcol(i) ((DBCHAR *) dbdata(sybase_ptr->link,i)) +#define floatcol(i) ((float) *(DBFLT8 *) dbdata(sybase_ptr->link,i)) + +typedef struct sybase_link_struct sybase_link; + +struct sybase_link_struct { + LOGINREC *login; + DBPROCESS *link; + int valid; +}; + +#define SYBASE_ROWS_BLOCK 128 + +typedef struct { + char *name,*column_source; + int max_length, numeric; + int type; +} sybase_field; + +typedef struct { + pval ***data; + sybase_field *fields; + sybase_link *sybase_ptr; + int cur_row,cur_field; + int num_rows,num_fields; +} sybase_result; + function_entry sybase_functions[] = { PHP_FE(sybase_connect, NULL) Index: php4/ext/sybase/php_sybase_db.h diff -u php4/ext/sybase/php_sybase_db.h:1.5 php4/ext/sybase/php_sybase_db.h:1.6 --- php4/ext/sybase/php_sybase_db.h:1.5 Thu Mar 15 20:21:31 2001 +++ php4/ext/sybase/php_sybase_db.h Tue Sep 4 03:41:18 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_sybase_db.h,v 1.5 2001/03/16 01:21:31 camber Exp $ */ +/* $Id: php_sybase_db.h,v 1.6 2001/09/04 07:41:18 andi Exp $ */ #ifndef PHP_SYBASE_DB_H #define PHP_SYBASE_DB_H @@ -63,21 +63,6 @@ PHP_FUNCTION(sybase_field_flags); - -#include <sybfront.h> -#include <sybdb.h> -#include <syberror.h> - -#define coltype(j) dbcoltype(sybase_ptr->link,j) -#define intcol(i) ((int) *(DBINT *) dbdata(sybase_ptr->link,i)) -#define smallintcol(i) ((int) *(DBSMALLINT *) dbdata(sybase_ptr->link,i)) -#define tinyintcol(i) ((int) *(DBTINYINT *) dbdata(sybase_ptr->link,i)) -#define anyintcol(j) (coltype(j)==SYBINT4?intcol(j):(coltype(j)==SYBINT2?smallintcol(j):tinyintcol(j))) -#define charcol(i) ((DBCHAR *) dbdata(sybase_ptr->link,i)) -#define floatcol(i) ((float) *(DBFLT8 *) dbdata(sybase_ptr->link,i)) - -typedef struct sybase_link_struct sybase_link; - typedef struct { long default_link; long num_links,num_persistent; @@ -90,29 +75,6 @@ long cfg_min_error_severity,cfg_min_message_severity; long compatability_mode; } sybase_module; - -struct sybase_link_struct { - LOGINREC *login; - DBPROCESS *link; - int valid; -}; - -#define SYBASE_ROWS_BLOCK 128 - -typedef struct { - char *name,*column_source; - int max_length, numeric; - int type; -} sybase_field; - -typedef struct { - pval ***data; - sybase_field *fields; - sybase_link *sybase_ptr; - int cur_row,cur_field; - int num_rows,num_fields; -} sybase_result; - extern sybase_module php_sybase_module;

« previous php.cvs (#7194) next »