diff options
| author | Andi Gutmans <andi@php.net> | 2001-09-04 07:41:20 +0000 | 
|---|---|---|
| committer | Andi Gutmans <andi@php.net> | 2001-09-04 07:41:20 +0000 | 
| commit | 17765221dfb8282371dbbc7b05fc0bcf9a23b37e (patch) | |
| tree | e987b3e540a00866fb4007f63c8ea98f4aa2c3e8 | |
| parent | 0935217091cc4df7eaa3cc976e22232f2380a156 (diff) | |
| download | php-git-17765221dfb8282371dbbc7b05fc0bcf9a23b37e.tar.gz | |
- Fix namespace collisions.
| -rw-r--r-- | ext/sybase/php_sybase_db.c | 37 | ||||
| -rw-r--r-- | ext/sybase/php_sybase_db.h | 38 | 
2 files changed, 37 insertions, 38 deletions
| 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) diff --git a/ext/sybase/php_sybase_db.h b/ext/sybase/php_sybase_db.h index a622e1222a..265ec09f59 100644 --- a/ext/sybase/php_sybase_db.h +++ b/ext/sybase/php_sybase_db.h @@ -63,21 +63,6 @@ PHP_FUNCTION(sybase_field_type);  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; @@ -91,29 +76,6 @@ typedef struct {  	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;  #else | 
