From 17765221dfb8282371dbbc7b05fc0bcf9a23b37e Mon Sep 17 00:00:00 2001 From: Andi Gutmans Date: Tue, 4 Sep 2001 07:41:20 +0000 Subject: - Fix namespace collisions. --- ext/sybase/php_sybase_db.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'ext/sybase/php_sybase_db.c') diff --git a/ext/sybase/php_sybase_db.c b/ext/sybase/php_sybase_db.c index db6adf7ceb..ef4c5c196b 100644 --- a/ext/sybase/php_sybase_db.c +++ b/ext/sybase/php_sybase_db.c @@ -43,6 +43,43 @@ #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) PHP_FE(sybase_pconnect, NULL) -- cgit v1.2.1