OLD | NEW |
1 /* | 1 /* |
2 ** 2009 November 10 | 2 ** 2009 November 10 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 ** longer needed. The application must not change the intarray values | 68 ** longer needed. The application must not change the intarray values |
69 ** while an intarray is in the middle of a query. | 69 ** while an intarray is in the middle of a query. |
70 ** | 70 ** |
71 ** The intarray object is automatically destroyed when its corresponding | 71 ** The intarray object is automatically destroyed when its corresponding |
72 ** virtual table is dropped. Since the virtual tables are created in the | 72 ** virtual table is dropped. Since the virtual tables are created in the |
73 ** TEMP database, they are automatically dropped when the database connection | 73 ** TEMP database, they are automatically dropped when the database connection |
74 ** closes so the application does not normally need to take any special | 74 ** closes so the application does not normally need to take any special |
75 ** action to free the intarray objects. | 75 ** action to free the intarray objects. |
76 */ | 76 */ |
77 #include "sqlite3.h" | 77 #include "sqlite3.h" |
| 78 #ifndef _INTARRAY_H_ |
| 79 #define _INTARRAY_H_ |
| 80 |
| 81 /* |
| 82 ** Make sure we can call this stuff from C++. |
| 83 */ |
| 84 #ifdef __cplusplus |
| 85 extern "C" { |
| 86 #endif |
78 | 87 |
79 /* | 88 /* |
80 ** An sqlite3_intarray is an abstract type to stores an instance of | 89 ** An sqlite3_intarray is an abstract type to stores an instance of |
81 ** an integer array. | 90 ** an integer array. |
82 */ | 91 */ |
83 typedef struct sqlite3_intarray sqlite3_intarray; | 92 typedef struct sqlite3_intarray sqlite3_intarray; |
84 | 93 |
85 /* | 94 /* |
86 ** Invoke this routine to create a specific instance of an intarray object. | 95 ** Invoke this routine to create a specific instance of an intarray object. |
87 ** The new intarray object is returned by the 3rd parameter. | 96 ** The new intarray object is returned by the 3rd parameter. |
88 ** | 97 ** |
89 ** Each intarray object corresponds to a virtual table in the TEMP table | 98 ** Each intarray object corresponds to a virtual table in the TEMP table |
90 ** with a name of zName. | 99 ** with a name of zName. |
91 ** | 100 ** |
92 ** Destroy the intarray object by dropping the virtual table. If not done | 101 ** Destroy the intarray object by dropping the virtual table. If not done |
93 ** explicitly by the application, the virtual table will be dropped implicitly | 102 ** explicitly by the application, the virtual table will be dropped implicitly |
94 ** by the system when the database connection is closed. | 103 ** by the system when the database connection is closed. |
95 */ | 104 */ |
96 int sqlite3_intarray_create( | 105 SQLITE_API int sqlite3_intarray_create( |
97 sqlite3 *db, | 106 sqlite3 *db, |
98 const char *zName, | 107 const char *zName, |
99 sqlite3_intarray **ppReturn | 108 sqlite3_intarray **ppReturn |
100 ); | 109 ); |
101 | 110 |
102 /* | 111 /* |
103 ** Bind a new array array of integers to a specific intarray object. | 112 ** Bind a new array array of integers to a specific intarray object. |
104 ** | 113 ** |
105 ** The array of integers bound must be unchanged for the duration of | 114 ** The array of integers bound must be unchanged for the duration of |
106 ** any query against the corresponding virtual table. If the integer | 115 ** any query against the corresponding virtual table. If the integer |
107 ** array does change or is deallocated undefined behavior will result. | 116 ** array does change or is deallocated undefined behavior will result. |
108 */ | 117 */ |
109 int sqlite3_intarray_bind( | 118 SQLITE_API int sqlite3_intarray_bind( |
110 sqlite3_intarray *pIntArray, /* The intarray object to bind to */ | 119 sqlite3_intarray *pIntArray, /* The intarray object to bind to */ |
111 int nElements, /* Number of elements in the intarray */ | 120 int nElements, /* Number of elements in the intarray */ |
112 sqlite3_int64 *aElements, /* Content of the intarray */ | 121 sqlite3_int64 *aElements, /* Content of the intarray */ |
113 void (*xFree)(void*) /* How to dispose of the intarray when done */ | 122 void (*xFree)(void*) /* How to dispose of the intarray when done */ |
114 ); | 123 ); |
| 124 |
| 125 #ifdef __cplusplus |
| 126 } /* End of the 'extern "C"' block */ |
| 127 #endif |
| 128 #endif /* _INTARRAY_H_ */ |
OLD | NEW |