xref: /PHP-5.6/ext/mysql/php_mysql_structs.h (revision 49493a2d)
1 /*
2    +----------------------------------------------------------------------+
3    | PHP Version 5                                                        |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 1997-2016 The PHP Group                                |
6    +----------------------------------------------------------------------+
7    | This source file is subject to version 3.01 of the PHP license,      |
8    | that is bundled with this package in the file LICENSE, and is        |
9    | available through the world-wide-web at the following url:           |
10    | http://www.php.net/license/3_01.txt                                  |
11    | If you did not receive a copy of the PHP license and are unable to   |
12    | obtain it through the world-wide-web, please send a note to          |
13    | license@php.net so we can mail you a copy immediately.               |
14    +----------------------------------------------------------------------+
15    | Author: Zeev Suraski <zeev@zend.com>                                 |
16    |         Andrey Hristov <andrey@php.net>                              |
17    +----------------------------------------------------------------------+
18 */
19 
20 
21 /* $Id$ */
22 
23 #ifndef PHP_MYSQL_STRUCTS_H
24 #define PHP_MYSQL_STRUCTS_H
25 
26 #ifdef ZTS
27 #include "TSRM.h"
28 #endif
29 
30 #ifndef TRUE
31 #define TRUE 1
32 #endif
33 
34 #ifndef FALSE
35 #define FALSE 0
36 #endif
37 
38 #if defined(MYSQL_USE_MYSQLND)
39 #include "ext/mysqlnd/mysqlnd.h"
40 #include "mysql_mysqlnd.h"
41 #else
42 #include <mysql.h>
43 #endif
44 
45 #ifdef PHP_MYSQL_UNIX_SOCK_ADDR
46 #ifdef MYSQL_UNIX_ADDR
47 #undef MYSQL_UNIX_ADDR
48 #endif
49 #define MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR
50 #endif
51 
52 #if (MYSQL_VERSION_ID >= 40113 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID >= 50007 || defined(MYSQL_USE_MYSQLND)
53 #define MYSQL_HAS_SET_CHARSET
54 #endif
55 
56 PHP_MINIT_FUNCTION(mysql);
57 PHP_RINIT_FUNCTION(mysql);
58 PHP_MSHUTDOWN_FUNCTION(mysql);
59 PHP_RSHUTDOWN_FUNCTION(mysql);
60 PHP_MINFO_FUNCTION(mysql);
61 
62 PHP_FUNCTION(mysql_connect);
63 PHP_FUNCTION(mysql_pconnect);
64 PHP_FUNCTION(mysql_close);
65 PHP_FUNCTION(mysql_select_db);
66 #if MYSQL_VERSION_ID < 40000
67 PHP_FUNCTION(mysql_create_db);
68 PHP_FUNCTION(mysql_drop_db);
69 #endif
70 PHP_FUNCTION(mysql_query);
71 PHP_FUNCTION(mysql_unbuffered_query);
72 PHP_FUNCTION(mysql_db_query);
73 PHP_FUNCTION(mysql_list_dbs);
74 PHP_FUNCTION(mysql_list_tables);
75 PHP_FUNCTION(mysql_list_fields);
76 PHP_FUNCTION(mysql_list_processes);
77 PHP_FUNCTION(mysql_error);
78 PHP_FUNCTION(mysql_errno);
79 PHP_FUNCTION(mysql_affected_rows);
80 PHP_FUNCTION(mysql_insert_id);
81 PHP_FUNCTION(mysql_result);
82 PHP_FUNCTION(mysql_num_rows);
83 PHP_FUNCTION(mysql_num_fields);
84 PHP_FUNCTION(mysql_fetch_row);
85 PHP_FUNCTION(mysql_fetch_array);
86 PHP_FUNCTION(mysql_fetch_assoc);
87 PHP_FUNCTION(mysql_fetch_object);
88 PHP_FUNCTION(mysql_data_seek);
89 PHP_FUNCTION(mysql_fetch_lengths);
90 PHP_FUNCTION(mysql_fetch_field);
91 PHP_FUNCTION(mysql_field_seek);
92 PHP_FUNCTION(mysql_free_result);
93 PHP_FUNCTION(mysql_field_name);
94 PHP_FUNCTION(mysql_field_table);
95 PHP_FUNCTION(mysql_field_len);
96 PHP_FUNCTION(mysql_field_type);
97 PHP_FUNCTION(mysql_field_flags);
98 PHP_FUNCTION(mysql_escape_string);
99 PHP_FUNCTION(mysql_real_escape_string);
100 PHP_FUNCTION(mysql_get_client_info);
101 PHP_FUNCTION(mysql_get_host_info);
102 PHP_FUNCTION(mysql_get_proto_info);
103 PHP_FUNCTION(mysql_get_server_info);
104 PHP_FUNCTION(mysql_info);
105 PHP_FUNCTION(mysql_stat);
106 PHP_FUNCTION(mysql_thread_id);
107 PHP_FUNCTION(mysql_client_encoding);
108 PHP_FUNCTION(mysql_ping);
109 #ifdef MYSQL_HAS_SET_CHARSET
110 PHP_FUNCTION(mysql_set_charset);
111 #endif
112 
113 ZEND_BEGIN_MODULE_GLOBALS(mysql)
114 	long default_link;
115 	long num_links,num_persistent;
116 	long max_links,max_persistent;
117 	long allow_persistent;
118 	long default_port;
119 	char *default_host, *default_user, *default_password;
120 	char *default_socket;
121 	char *connect_error;
122 	long connect_errno;
123 	long connect_timeout;
124 	long result_allocated;
125 	long trace_mode;
126 	long allow_local_infile;
127 ZEND_END_MODULE_GLOBALS(mysql)
128 
129 #ifdef ZTS
130 # define MySG(v) TSRMG(mysql_globals_id, zend_mysql_globals *, v)
131 #else
132 # define MySG(v) (mysql_globals.v)
133 #endif
134 
135 
136 #endif /* PHP_MYSQL_STRUCTS_H */
137