php_sybase_ct.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. | Authors: Zeev Suraski <zeev@zend.com> |
  16. | Timm Friebe <php_sybase_ct@thekid.de> |
  17. +----------------------------------------------------------------------+
  18. */
  19. /* $Id$ */
  20. #ifndef PHP_SYBASE_CT_H
  21. #define PHP_SYBASE_CT_H
  22. #if HAVE_SYBASE_CT
  23. #define CTLIB_VERSION CS_VERSION_100
  24. extern zend_module_entry sybase_module_entry;
  25. #define sybase_module_ptr &sybase_module_entry
  26. PHP_MINIT_FUNCTION(sybase);
  27. PHP_MSHUTDOWN_FUNCTION(sybase);
  28. PHP_RINIT_FUNCTION(sybase);
  29. PHP_RSHUTDOWN_FUNCTION(sybase);
  30. PHP_MINFO_FUNCTION(sybase);
  31. PHP_FUNCTION(sybase_connect);
  32. PHP_FUNCTION(sybase_pconnect);
  33. PHP_FUNCTION(sybase_close);
  34. PHP_FUNCTION(sybase_select_db);
  35. PHP_FUNCTION(sybase_query);
  36. PHP_FUNCTION(sybase_unbuffered_query);
  37. PHP_FUNCTION(sybase_free_result);
  38. PHP_FUNCTION(sybase_get_last_message);
  39. PHP_FUNCTION(sybase_num_rows);
  40. PHP_FUNCTION(sybase_num_fields);
  41. PHP_FUNCTION(sybase_fetch_row);
  42. PHP_FUNCTION(sybase_fetch_array);
  43. PHP_FUNCTION(sybase_fetch_assoc);
  44. PHP_FUNCTION(sybase_fetch_object);
  45. PHP_FUNCTION(sybase_data_seek);
  46. PHP_FUNCTION(sybase_result);
  47. PHP_FUNCTION(sybase_affected_rows);
  48. PHP_FUNCTION(sybase_field_seek);
  49. PHP_FUNCTION(sybase_min_client_severity);
  50. PHP_FUNCTION(sybase_min_server_severity);
  51. PHP_FUNCTION(sybase_fetch_field);
  52. PHP_FUNCTION(sybase_set_message_handler);
  53. PHP_FUNCTION(sybase_deadlock_retry_count);
  54. #include <ctpublic.h>
  55. ZEND_BEGIN_MODULE_GLOBALS(sybase)
  56. long default_link;
  57. long num_links,num_persistent;
  58. long max_links,max_persistent;
  59. long login_timeout;
  60. long allow_persistent;
  61. char *appname;
  62. char *hostname;
  63. char *server_message;
  64. long min_server_severity, min_client_severity;
  65. long deadlock_retry_count;
  66. zval *callback_name;
  67. CS_CONTEXT *context;
  68. ZEND_END_MODULE_GLOBALS(sybase)
  69. typedef struct {
  70. CS_CONNECTION *connection;
  71. CS_COMMAND *cmd;
  72. int valid;
  73. int deadlock;
  74. int dead;
  75. int active_result_index;
  76. long affected_rows;
  77. zval *callback_name;
  78. } sybase_link;
  79. #define SYBASE_ROWS_BLOCK 128
  80. typedef struct {
  81. char *name,*column_source;
  82. int max_length, numeric;
  83. CS_INT type;
  84. } sybase_field;
  85. typedef struct {
  86. zval **data;
  87. sybase_field *fields;
  88. sybase_link *sybase_ptr;
  89. int cur_row,cur_field;
  90. int num_rows,num_fields;
  91. /* For unbuffered reads */
  92. CS_INT *lengths;
  93. CS_SMALLINT *indicators;
  94. char **tmp_buffer;
  95. unsigned char *numerics;
  96. CS_INT *types;
  97. CS_DATAFMT *datafmt;
  98. int blocks_initialized;
  99. CS_RETCODE last_retcode;
  100. int store;
  101. } sybase_result;
  102. #ifdef ZTS
  103. # define SybCtG(v) TSRMG(sybase_globals_id, zend_sybase_globals *, v)
  104. #else
  105. # define SybCtG(v) (sybase_globals.v)
  106. #endif
  107. #else
  108. #define sybase_module_ptr NULL
  109. #endif
  110. #define phpext_sybase_ct_ptr sybase_module_ptr
  111. #endif /* PHP_SYBASE_CT_H */