File: php3_sybase-ct.h

package info (click to toggle)
php3 1%3A3.0-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 6,512 kB
  • ctags: 6,320
  • sloc: ansic: 58,611; sh: 2,279; yacc: 1,090; php: 1,031; makefile: 911; cpp: 529; perl: 411; awk: 90; sql: 11
file content (129 lines) | stat: -rw-r--r-- 5,058 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* 
   +----------------------------------------------------------------------+
   | PHP HTML Embedded Scripting Language Version 3.0                     |
   +----------------------------------------------------------------------+
   | Copyright (c) 1997,1998 PHP Development Team (See Credits file)      |
   +----------------------------------------------------------------------+
   | This program is free software; you can redistribute it and/or modify |
   | it under the terms of one of the following licenses:                 |
   |                                                                      |
   |  A) the GNU General Public License as published by the Free Software |
   |     Foundation; either version 2 of the License, or (at your option) |
   |     any later version.                                               |
   |                                                                      |
   |  B) the PHP License as published by the PHP Development Team and     |
   |     included in the distribution in the file: LICENSE                |
   |                                                                      |
   | This program is distributed in the hope that it will be useful,      |
   | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
   | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
   | GNU General Public License for more details.                         |
   |                                                                      |
   | You should have received a copy of both licenses referred to here.   |
   | If you did not, or have any questions about PHP licensing, please    |
   | contact core@php.net.                                                |
   +----------------------------------------------------------------------+
   | Authors: Zeev Suraski <bourbon@netvision.net.il>                     |
   +----------------------------------------------------------------------+
 */


/* $Id: php3_sybase-ct.h,v 1.14 1998/05/16 11:53:44 zeev Exp $ */

#ifndef _PHP3_SYBASE_CT_H
#define _PHP3_SYBASE_CT_H

#if COMPILE_DL
#undef HAVE_SYBASE_CT
#define HAVE_SYBASE_CT 1
#endif

#if HAVE_SYBASE_CT

#define CTLIB_VERSION CS_VERSION_100

extern php3_module_entry sybct_module_entry;
#define sybct_module_ptr &sybct_module_entry

extern int php3_minit_sybct(INIT_FUNC_ARGS);
extern int php3_rinit_sybct(INIT_FUNC_ARGS);
extern int php3_mshutdown_sybct(void);
extern int php3_rshutdown_sybct(void);
extern void php3_info_sybct(void);
extern void php3_sybct_connect(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_pconnect(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_close(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_select_db(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_query(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_free_result(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_get_last_message(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_num_rows(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_num_fields(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_fetch_row(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_fetch_array(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_fetch_object(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_data_seek(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_result(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_field_seek(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_min_client_severity(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_min_server_severity(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_sybct_fetch_field(INTERNAL_FUNCTION_PARAMETERS);



#include <sybfront.h>
#include <sybdb.h>
#include <syberror.h>

#define coltype(j) dbcoltype(sybct_ptr->link,j)
#define intcol(i) ((int) *(DBINT *) dbdata(sybct_ptr->link,i))
#define smallintcol(i) ((int) *(DBSMALLINT *) dbdata(sybct_ptr->link,i))
#define tinyintcol(i) ((int) *(DBTINYINT *) dbdata(sybct_ptr->link,i))
#define anyintcol(j) (coltype(j)==SYBINT4?intcol(j):(coltype(j)==SYBINT2?smallintcol(j):tinyintcol(j)))
#define charcol(i) ((DBCHAR *) dbdata(sybct_ptr->link,i))
#define floatcol(i) ((float) *(DBFLT8 *) dbdata(sybct_ptr->link,i))

typedef struct {
	long default_link;
	long num_links,num_persistent;
	long max_links,max_persistent;
	long allow_persistent;
	char *appname;
	char *server_message;
	int le_link,le_plink,le_result;
	long min_server_severity, min_client_severity;
	long cfg_min_server_severity, cfg_min_client_severity;
} sybct_module;

typedef struct {
	CS_CONNECTION *connection;
	CS_COMMAND *cmd;
	int valid;
} sybct_link;

#define SYBASE_ROWS_BLOCK 128

typedef struct {
	char *name,*column_source;
	int max_length, numeric;
	CS_INT type;
} sybct_field;

typedef struct {
	pval **data;
	sybct_field *fields;
	sybct_link *sybct_ptr;
	int cur_row,cur_field;
	int num_rows,num_fields;
} sybct_result;


extern sybct_module php3_sybct_module;

#else

#define sybct_module_ptr NULL

#endif

#endif /* _PHP3_SYBASE_CT_H */