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.

116 lines
3.0 KiB

18 years ago
18 years ago
18 years ago
18 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2008 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_llist free_list;
  59. } php_sqlite3_db_object;
  60. typedef struct _php_sqlite3_stmt_object php_sqlite3_stmt;
  61. typedef struct _php_sqlite3_result_object php_sqlite3_result;
  62. /* sqlite3 objects to be destroyed */
  63. typedef struct _php_sqlite3_free_list {
  64. zval *stmt_obj_zval;
  65. php_sqlite3_stmt *stmt_obj;
  66. } php_sqlite3_free_list;
  67. /* Structure for SQLite Result object. */
  68. struct _php_sqlite3_result_object {
  69. zend_object zo;
  70. php_sqlite3_db_object *db_obj;
  71. php_sqlite3_stmt *stmt_obj;
  72. zval *stmt_obj_zval;
  73. int is_prepared_statement;
  74. int complete;
  75. };
  76. /* Structure for SQLite Statement object. */
  77. struct _php_sqlite3_stmt_object {
  78. zend_object zo;
  79. sqlite3_stmt *stmt;
  80. php_sqlite3_db_object *db_obj;
  81. zval *db_obj_zval;
  82. int initialised;
  83. /* Keep track of the zvals for bound parameters */
  84. HashTable *bound_params;
  85. };
  86. #endif
  87. /*
  88. * Local variables:
  89. * tab-width: 4
  90. * c-basic-offset: 4
  91. * indent-tabs-mode: t
  92. * End:
  93. */