Back to index

php5  5.3.10
php_sybase_ct.h
Go to the documentation of this file.
00001 /* 
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Authors: Zeev Suraski <zeev@zend.com>                                |
00016    |          Timm Friebe <php_sybase_ct@thekid.de>                       |
00017    +----------------------------------------------------------------------+
00018 */
00019 
00020 /* $Id: php_sybase_ct.h 321634 2012-01-01 13:15:04Z felipe $ */
00021 
00022 #ifndef PHP_SYBASE_CT_H
00023 #define PHP_SYBASE_CT_H
00024 
00025 #if HAVE_SYBASE_CT
00026 
00027 #define CTLIB_VERSION CS_VERSION_100
00028 
00029 extern zend_module_entry sybase_module_entry;
00030 #define sybase_module_ptr &sybase_module_entry
00031 
00032 PHP_MINIT_FUNCTION(sybase);
00033 PHP_MSHUTDOWN_FUNCTION(sybase);
00034 PHP_RINIT_FUNCTION(sybase);
00035 PHP_RSHUTDOWN_FUNCTION(sybase);
00036 PHP_MINFO_FUNCTION(sybase);
00037 
00038 PHP_FUNCTION(sybase_connect);
00039 PHP_FUNCTION(sybase_pconnect);
00040 PHP_FUNCTION(sybase_close);
00041 PHP_FUNCTION(sybase_select_db);
00042 PHP_FUNCTION(sybase_query);
00043 PHP_FUNCTION(sybase_unbuffered_query);
00044 PHP_FUNCTION(sybase_free_result);
00045 PHP_FUNCTION(sybase_get_last_message);
00046 PHP_FUNCTION(sybase_num_rows);
00047 PHP_FUNCTION(sybase_num_fields);
00048 PHP_FUNCTION(sybase_fetch_row);
00049 PHP_FUNCTION(sybase_fetch_array);
00050 PHP_FUNCTION(sybase_fetch_assoc);
00051 PHP_FUNCTION(sybase_fetch_object);
00052 PHP_FUNCTION(sybase_data_seek);
00053 PHP_FUNCTION(sybase_result);
00054 PHP_FUNCTION(sybase_affected_rows);
00055 PHP_FUNCTION(sybase_field_seek);
00056 PHP_FUNCTION(sybase_min_client_severity);
00057 PHP_FUNCTION(sybase_min_server_severity);
00058 PHP_FUNCTION(sybase_fetch_field);
00059 PHP_FUNCTION(sybase_set_message_handler);
00060 PHP_FUNCTION(sybase_deadlock_retry_count);
00061 
00062 #include <ctpublic.h>
00063 
00064 ZEND_BEGIN_MODULE_GLOBALS(sybase)
00065        long default_link;
00066        long num_links,num_persistent;
00067        long max_links,max_persistent;
00068        long login_timeout;
00069        long allow_persistent;
00070        char *appname;
00071        char *hostname;
00072        char *server_message;
00073        long min_server_severity, min_client_severity;
00074        long deadlock_retry_count;
00075        zval *callback_name;
00076        CS_CONTEXT *context;
00077 ZEND_END_MODULE_GLOBALS(sybase)
00078 
00079 typedef struct {
00080        CS_CONNECTION *connection;
00081        CS_COMMAND *cmd;
00082        int valid;
00083        int deadlock;
00084        int dead;
00085        int active_result_index;
00086        long affected_rows;
00087        zval *callback_name;
00088 } sybase_link;
00089 
00090 #define SYBASE_ROWS_BLOCK 128
00091 
00092 typedef struct {
00093        char *name,*column_source;
00094        int max_length, numeric;
00095        CS_INT type;
00096 } sybase_field;
00097 
00098 typedef struct {
00099        zval **data;
00100        sybase_field *fields;
00101        sybase_link *sybase_ptr;
00102        int cur_row,cur_field;
00103        int num_rows,num_fields;
00104        
00105        /* For unbuffered reads */
00106        CS_INT *lengths;
00107        CS_SMALLINT *indicators;
00108        char **tmp_buffer;
00109        unsigned char *numerics;
00110        CS_INT *types;
00111        CS_DATAFMT *datafmt;
00112        int blocks_initialized;
00113        CS_RETCODE last_retcode;
00114        int store;
00115 } sybase_result;
00116 
00117 #ifdef ZTS
00118 # define SybCtG(v) TSRMG(sybase_globals_id, zend_sybase_globals *, v)
00119 #else
00120 # define SybCtG(v) (sybase_globals.v)
00121 #endif
00122 
00123 #else
00124 
00125 #define sybase_module_ptr NULL
00126 
00127 #endif
00128 
00129 #define phpext_sybase_ct_ptr sybase_module_ptr
00130 
00131 #endif /* PHP_SYBASE_CT_H */