You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
3.2 KiB

19 years ago
22 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2007 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: Ard Biesheuvel <abies@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #ifndef PHP_PDO_FIREBIRD_INT_H
  20. #define PHP_PDO_FIREBIRD_INT_H
  21. #include <ibase.h>
  22. #ifdef SQLDA_VERSION
  23. #define PDO_FB_SQLDA_VERSION SQLDA_VERSION
  24. #else
  25. #define PDO_FB_SQLDA_VERSION 1
  26. #endif
  27. #define PDO_FB_DIALECT 3
  28. #define SHORT_MAX (1 << (8*sizeof(short)-1))
  29. #if SIZEOF_LONG == 8
  30. # define LL_MASK "l"
  31. # define LL_LIT(lit) lit ## L
  32. #else
  33. # ifdef PHP_WIN32
  34. # define LL_MASK "I64"
  35. # define LL_LIT(lit) lit ## I64
  36. # else
  37. # define LL_MASK "ll"
  38. # define LL_LIT(lit) lit ## LL
  39. # endif
  40. #endif
  41. /* Firebird API has a couple of missing const decls in its API */
  42. #define const_cast(s) ((char*)(s))
  43. #ifdef PHP_WIN32
  44. typedef void (__stdcall *info_func_t)(char*);
  45. #else
  46. typedef void (*info_func_t)(char*);
  47. #endif
  48. #ifndef min
  49. #define min(a,b) ((a)<(b)?(a):(b))
  50. #endif
  51. typedef struct {
  52. /* the result of the last API call */
  53. ISC_STATUS isc_status[20];
  54. /* the connection handle */
  55. isc_db_handle db;
  56. /* the transaction handle */
  57. isc_tr_handle tr;
  58. /* the last error that didn't come from the API */
  59. char const *last_app_error;
  60. } pdo_firebird_db_handle;
  61. typedef struct {
  62. /* the link that owns this statement */
  63. pdo_firebird_db_handle *H;
  64. /* the statement handle */
  65. isc_stmt_handle stmt;
  66. /* the name of the cursor (if it has one) */
  67. char name[32];
  68. /* the type of statement that was issued */
  69. char statement_type:8;
  70. /* whether EOF was reached for this statement */
  71. unsigned exhausted:1;
  72. unsigned _reserved:23;
  73. /* the named params that were converted to ?'s by the driver */
  74. HashTable *named_params;
  75. /* allocated space to convert fields values to other types */
  76. char **fetch_buf;
  77. /* the input SQLDA */
  78. XSQLDA *in_sqlda;
  79. /* the output SQLDA */
  80. XSQLDA out_sqlda; /* last member */
  81. } pdo_firebird_stmt;
  82. extern pdo_driver_t pdo_firebird_driver;
  83. extern struct pdo_stmt_methods firebird_stmt_methods;
  84. void _firebird_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, char const *file, long line TSRMLS_DC);
  85. #endif /* PHP_PDO_FIREBIRD_INT_H */
  86. /*
  87. * Local variables:
  88. * tab-width: 4
  89. * c-basic-offset: 4
  90. * End:
  91. * vim600: noet sw=4 ts=4 fdm=marker
  92. * vim<600: noet sw=4 ts=4
  93. */