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.

124 lines
3.2 KiB

18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
18 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2009 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: Scott MacVicar <scottmac@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #ifndef PHP_SQLITE_STRUCTS_H
  20. #define PHP_SQLITE_STRUCTS_H
  21. #include <sqlite3.h>
  22. /* for backwards compatability reasons */
  23. #ifndef SQLITE_OPEN_READONLY
  24. #define SQLITE_OPEN_READONLY 0x00000001
  25. #endif
  26. #ifndef SQLITE_OPEN_READWRITE
  27. #define SQLITE_OPEN_READWRITE 0x00000002
  28. #endif
  29. #ifndef SQLITE_OPEN_CREATE
  30. #define SQLITE_OPEN_CREATE 0x00000004
  31. #endif
  32. /* Structure for SQLite Statement Parameter. */
  33. struct php_sqlite3_bound_param {
  34. long param_number;
  35. char *name;
  36. int name_len;
  37. long type;
  38. zval *parameter;
  39. };
  40. struct php_sqlite3_fci {
  41. zend_fcall_info fci;
  42. zend_fcall_info_cache fcc;
  43. };
  44. /* Structure for SQLite function. */
  45. typedef struct _php_sqlite3_func {
  46. struct _php_sqlite3_func *next;
  47. const char *func_name;
  48. int argc;
  49. zval *func, *step, *fini;
  50. struct php_sqlite3_fci afunc, astep, afini;
  51. } php_sqlite3_func;
  52. /* Structure for SQLite Database object. */
  53. typedef struct _php_sqlite3_db_object {
  54. zend_object zo;
  55. int initialised;
  56. sqlite3 *db;
  57. php_sqlite3_func *funcs;
  58. zend_bool exception;
  59. zend_llist free_list;
  60. } php_sqlite3_db_object;
  61. /* Structure for SQLite Database object. */
  62. typedef struct _php_sqlite3_agg_context {
  63. zval *zval_context;
  64. long row_count;
  65. } php_sqlite3_agg_context;
  66. typedef struct _php_sqlite3_stmt_object php_sqlite3_stmt;
  67. typedef struct _php_sqlite3_result_object php_sqlite3_result;
  68. /* sqlite3 objects to be destroyed */
  69. typedef struct _php_sqlite3_free_list {
  70. zval *stmt_obj_zval;
  71. php_sqlite3_stmt *stmt_obj;
  72. } php_sqlite3_free_list;
  73. /* Structure for SQLite Result object. */
  74. struct _php_sqlite3_result_object {
  75. zend_object zo;
  76. php_sqlite3_db_object *db_obj;
  77. php_sqlite3_stmt *stmt_obj;
  78. zval *stmt_obj_zval;
  79. int is_prepared_statement;
  80. int complete;
  81. };
  82. /* Structure for SQLite Statement object. */
  83. struct _php_sqlite3_stmt_object {
  84. zend_object zo;
  85. sqlite3_stmt *stmt;
  86. php_sqlite3_db_object *db_obj;
  87. zval *db_obj_zval;
  88. int initialised;
  89. /* Keep track of the zvals for bound parameters */
  90. HashTable *bound_params;
  91. };
  92. #endif
  93. /*
  94. * Local variables:
  95. * tab-width: 4
  96. * c-basic-offset: 4
  97. * indent-tabs-mode: t
  98. * End:
  99. */