Mercurial > cpython-lru_cache-weakref
annotate Modules/_sqlite/cursor.h @ 80661:94de77bd0b4b 2.7
Issue #16194: document imp.load_dynamic problems
when read several extension modules from the same binary object file.
| author | Andrew Svetlov <andrew.svetlov@gmail.com> |
|---|---|
| date | Thu, 29 Nov 2012 19:51:28 +0200 |
| parents | 631e99961c5f |
| children |
| rev | line source |
|---|---|
|
37362
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
1 /* cursor.h - definitions for the cursor type |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
2 * |
|
59362
04d3ae52ff73
Merged code from pysqlite 2.6.0.
Gerhard Häring <gh@ghaering.de>
parents:
47559
diff
changeset
|
3 * Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de> |
|
37362
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
4 * |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
5 * This file is part of pysqlite. |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
6 * |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
7 * This software is provided 'as-is', without any express or implied |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
8 * warranty. In no event will the authors be held liable for any damages |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
9 * arising from the use of this software. |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
10 * |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
11 * Permission is granted to anyone to use this software for any purpose, |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
12 * including commercial applications, and to alter it and redistribute it |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
13 * freely, subject to the following restrictions: |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
14 * |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
15 * 1. The origin of this software must not be misrepresented; you must not |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
16 * claim that you wrote the original software. If you use this software |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
17 * in a product, an acknowledgment in the product documentation would be |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
18 * appreciated but is not required. |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
19 * 2. Altered source versions must be plainly marked as such, and must not be |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
20 * misrepresented as being the original software. |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
21 * 3. This notice may not be removed or altered from any source distribution. |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
22 */ |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
23 |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
24 #ifndef PYSQLITE_CURSOR_H |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
25 #define PYSQLITE_CURSOR_H |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
26 #include "Python.h" |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
27 |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
28 #include "statement.h" |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
29 #include "connection.h" |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
30 #include "module.h" |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
31 |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
32 typedef struct |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
33 { |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
34 PyObject_HEAD |
|
40625
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
35 pysqlite_Connection* connection; |
|
37362
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
36 PyObject* description; |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
37 PyObject* row_cast_map; |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
38 int arraysize; |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
39 PyObject* lastrowid; |
|
47559
2925b568aacc
Merged revisions 63562,63570,63728,63734,63784,63788,63802,63817,63827,63839,63887,63975,63998 via svnmerge from
Georg Brandl <georg@python.org>
parents:
45580
diff
changeset
|
40 long rowcount; |
|
37362
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
41 PyObject* row_factory; |
|
40625
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
42 pysqlite_Statement* statement; |
|
59362
04d3ae52ff73
Merged code from pysqlite 2.6.0.
Gerhard Häring <gh@ghaering.de>
parents:
47559
diff
changeset
|
43 int closed; |
|
04d3ae52ff73
Merged code from pysqlite 2.6.0.
Gerhard Häring <gh@ghaering.de>
parents:
47559
diff
changeset
|
44 int reset; |
|
74811
631e99961c5f
Issue #10811: Fix recursive usage of cursors. Instead of crashing, raise a ProgrammingError now.
Petri Lehtinen <petri@digip.org>
parents:
59362
diff
changeset
|
45 int locked; |
|
59362
04d3ae52ff73
Merged code from pysqlite 2.6.0.
Gerhard Häring <gh@ghaering.de>
parents:
47559
diff
changeset
|
46 int initialized; |
|
37362
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
47 |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
48 /* the next row to be returned, NULL if no next row available */ |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
49 PyObject* next_row; |
|
59362
04d3ae52ff73
Merged code from pysqlite 2.6.0.
Gerhard Häring <gh@ghaering.de>
parents:
47559
diff
changeset
|
50 |
|
04d3ae52ff73
Merged code from pysqlite 2.6.0.
Gerhard Häring <gh@ghaering.de>
parents:
47559
diff
changeset
|
51 PyObject* in_weakreflist; /* List of weak references */ |
|
40625
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
52 } pysqlite_Cursor; |
|
37362
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
53 |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
54 typedef enum { |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
55 STATEMENT_INVALID, STATEMENT_INSERT, STATEMENT_DELETE, |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
56 STATEMENT_UPDATE, STATEMENT_REPLACE, STATEMENT_SELECT, |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
57 STATEMENT_OTHER |
|
40625
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
58 } pysqlite_StatementKind; |
|
37362
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
59 |
|
40625
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
60 extern PyTypeObject pysqlite_CursorType; |
|
37362
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
61 |
|
40625
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
62 PyObject* pysqlite_cursor_execute(pysqlite_Cursor* self, PyObject* args); |
|
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
63 PyObject* pysqlite_cursor_executemany(pysqlite_Cursor* self, PyObject* args); |
|
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
64 PyObject* pysqlite_cursor_getiter(pysqlite_Cursor *self); |
|
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
65 PyObject* pysqlite_cursor_iternext(pysqlite_Cursor *self); |
|
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
66 PyObject* pysqlite_cursor_fetchone(pysqlite_Cursor* self, PyObject* args); |
|
45580
b7ee9074ca0e
Updated to pysqlite 2.4.1. Documentation additions will come later.
Gerhard Häring <gh@ghaering.de>
parents:
40625
diff
changeset
|
67 PyObject* pysqlite_cursor_fetchmany(pysqlite_Cursor* self, PyObject* args, PyObject* kwargs); |
|
40625
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
68 PyObject* pysqlite_cursor_fetchall(pysqlite_Cursor* self, PyObject* args); |
|
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
69 PyObject* pysqlite_noop(pysqlite_Connection* self, PyObject* args); |
|
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
70 PyObject* pysqlite_cursor_close(pysqlite_Cursor* self, PyObject* args); |
|
37362
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
71 |
|
40625
b9d4ced23506
Merged changes from standalone version 2.3.3. This should probably all be
Gerhard Häring <gh@ghaering.de>
parents:
37938
diff
changeset
|
72 int pysqlite_cursor_setup_types(void); |
|
37362
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
73 |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
74 #define UNKNOWN (-1) |
|
e546274d6503
merged the sqlite-integration branch.
Anthony Baxter <anthonybaxter@gmail.com>
parents:
diff
changeset
|
75 #endif |
