php_mysql_structs.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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. /* $Id$ */
  20. #ifndef PHP_MYSQL_STRUCTS_H
  21. #define PHP_MYSQL_STRUCTS_H
  22. #ifdef ZTS
  23. #include "TSRM.h"
  24. #endif
  25. #ifndef TRUE
  26. #define TRUE 1
  27. #endif
  28. #ifndef FALSE
  29. #define FALSE 0
  30. #endif
  31. #if defined(MYSQL_USE_MYSQLND)
  32. #include "ext/mysqlnd/mysqlnd.h"
  33. #include "mysql_mysqlnd.h"
  34. #else
  35. #include <mysql.h>
  36. #endif
  37. #ifdef PHP_MYSQL_UNIX_SOCK_ADDR
  38. #ifdef MYSQL_UNIX_ADDR
  39. #undef MYSQL_UNIX_ADDR
  40. #endif
  41. #define MYSQL_UNIX_ADDR PHP_MYSQL_UNIX_SOCK_ADDR
  42. #endif
  43. #if (MYSQL_VERSION_ID >= 40113 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID >= 50007 || defined(MYSQL_USE_MYSQLND)
  44. #define MYSQL_HAS_SET_CHARSET
  45. #endif
  46. PHP_MINIT_FUNCTION(mysql);
  47. PHP_RINIT_FUNCTION(mysql);
  48. PHP_MSHUTDOWN_FUNCTION(mysql);
  49. PHP_RSHUTDOWN_FUNCTION(mysql);
  50. PHP_MINFO_FUNCTION(mysql);
  51. PHP_FUNCTION(mysql_connect);
  52. PHP_FUNCTION(mysql_pconnect);
  53. PHP_FUNCTION(mysql_close);
  54. PHP_FUNCTION(mysql_select_db);
  55. #if MYSQL_VERSION_ID < 40000
  56. PHP_FUNCTION(mysql_create_db);
  57. PHP_FUNCTION(mysql_drop_db);
  58. #endif
  59. PHP_FUNCTION(mysql_query);
  60. PHP_FUNCTION(mysql_unbuffered_query);
  61. PHP_FUNCTION(mysql_db_query);
  62. PHP_FUNCTION(mysql_list_dbs);
  63. PHP_FUNCTION(mysql_list_tables);
  64. PHP_FUNCTION(mysql_list_fields);
  65. PHP_FUNCTION(mysql_list_processes);
  66. PHP_FUNCTION(mysql_error);
  67. PHP_FUNCTION(mysql_errno);
  68. PHP_FUNCTION(mysql_affected_rows);
  69. PHP_FUNCTION(mysql_insert_id);
  70. PHP_FUNCTION(mysql_result);
  71. PHP_FUNCTION(mysql_num_rows);
  72. PHP_FUNCTION(mysql_num_fields);
  73. PHP_FUNCTION(mysql_fetch_row);
  74. PHP_FUNCTION(mysql_fetch_array);
  75. PHP_FUNCTION(mysql_fetch_assoc);
  76. PHP_FUNCTION(mysql_fetch_object);
  77. PHP_FUNCTION(mysql_data_seek);
  78. PHP_FUNCTION(mysql_fetch_lengths);
  79. PHP_FUNCTION(mysql_fetch_field);
  80. PHP_FUNCTION(mysql_field_seek);
  81. PHP_FUNCTION(mysql_free_result);
  82. PHP_FUNCTION(mysql_field_name);
  83. PHP_FUNCTION(mysql_field_table);
  84. PHP_FUNCTION(mysql_field_len);
  85. PHP_FUNCTION(mysql_field_type);
  86. PHP_FUNCTION(mysql_field_flags);
  87. PHP_FUNCTION(mysql_escape_string);
  88. PHP_FUNCTION(mysql_real_escape_string);
  89. PHP_FUNCTION(mysql_get_client_info);
  90. PHP_FUNCTION(mysql_get_host_info);
  91. PHP_FUNCTION(mysql_get_proto_info);
  92. PHP_FUNCTION(mysql_get_server_info);
  93. PHP_FUNCTION(mysql_info);
  94. PHP_FUNCTION(mysql_stat);
  95. PHP_FUNCTION(mysql_thread_id);
  96. PHP_FUNCTION(mysql_client_encoding);
  97. PHP_FUNCTION(mysql_ping);
  98. #ifdef MYSQL_HAS_SET_CHARSET
  99. PHP_FUNCTION(mysql_set_charset);
  100. #endif
  101. ZEND_BEGIN_MODULE_GLOBALS(mysql)
  102. long default_link;
  103. long num_links,num_persistent;
  104. long max_links,max_persistent;
  105. long allow_persistent;
  106. long default_port;
  107. char *default_host, *default_user, *default_password;
  108. char *default_socket;
  109. char *connect_error;
  110. long connect_errno;
  111. long connect_timeout;
  112. long result_allocated;
  113. long trace_mode;
  114. long allow_local_infile;
  115. ZEND_END_MODULE_GLOBALS(mysql)
  116. #ifdef ZTS
  117. # define MySG(v) TSRMG(mysql_globals_id, zend_mysql_globals *, v)
  118. #else
  119. # define MySG(v) (mysql_globals.v)
  120. #endif
  121. #endif /* PHP_MYSQL_STRUCTS_H */