summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite/cache.h
diff options
context:
space:
mode:
authorGerhard Häring <gh@ghaering.de>2007-01-14 01:43:50 (GMT)
committerGerhard Häring <gh@ghaering.de>2007-01-14 01:43:50 (GMT)
commit0741a60ca7b332b755d8a6b3328da414f963f7b4 (patch)
tree470ec59548f5d0a1a875183c9edeedf8bd97454d /Modules/_sqlite/cache.h
parentb1a8ef629753ddfd23968a4418669ebbda83c835 (diff)
downloadcpython-0741a60ca7b332b755d8a6b3328da414f963f7b4.zip
cpython-0741a60ca7b332b755d8a6b3328da414f963f7b4.tar.gz
cpython-0741a60ca7b332b755d8a6b3328da414f963f7b4.tar.bz2
Merged changes from standalone version 2.3.3. This should probably all be
merged into the 2.5 maintenance branch: - self->statement was not checked while fetching data, which could lead to crashes if you used the pysqlite API in unusual ways. Closing the cursor and continuing to fetch data was enough. - Converters are stored in a converters dictionary. The converter name is uppercased first. The old upper-casing algorithm was wrong and was replaced by a simple call to the Python string's upper() method instead. -Applied patch by Glyph Lefkowitz that fixes the problem with subsequent SQLITE_SCHEMA errors. - Improvement to the row type: rows can now be iterated over and have a keys() method. This improves compatibility with both tuple and dict a lot. - A bugfix for the subsecond resolution in timestamps. - Corrected the way the flags PARSE_DECLTYPES and PARSE_COLNAMES are checked for. Now they work as documented. - gcc on Linux sucks. It exports all symbols by default in shared libraries, so if symbols are not unique it can lead to problems with symbol lookup. pysqlite used to crash under Apache when mod_cache was enabled because both modules had the symbol cache_init. I fixed this by applying the prefix pysqlite_ almost everywhere. Sigh.
Diffstat (limited to 'Modules/_sqlite/cache.h')
-rw-r--r--Modules/_sqlite/cache.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/Modules/_sqlite/cache.h b/Modules/_sqlite/cache.h
index 1f13907..158bf5a 100644
--- a/Modules/_sqlite/cache.h
+++ b/Modules/_sqlite/cache.h
@@ -29,15 +29,15 @@
* dictionary. The list items are of type 'Node' and the dictionary has the
* nodes as values. */
-typedef struct _Node
+typedef struct _pysqlite_Node
{
PyObject_HEAD
PyObject* key;
PyObject* data;
long count;
- struct _Node* prev;
- struct _Node* next;
-} Node;
+ struct _pysqlite_Node* prev;
+ struct _pysqlite_Node* next;
+} pysqlite_Node;
typedef struct
{
@@ -50,24 +50,24 @@ typedef struct
/* the factory callable */
PyObject* factory;
- Node* first;
- Node* last;
+ pysqlite_Node* first;
+ pysqlite_Node* last;
/* if set, decrement the factory function when the Cache is deallocated.
* this is almost always desirable, but not in the pysqlite context */
int decref_factory;
-} Cache;
+} pysqlite_Cache;
-extern PyTypeObject NodeType;
-extern PyTypeObject CacheType;
+extern PyTypeObject pysqlite_NodeType;
+extern PyTypeObject pysqlite_CacheType;
-int node_init(Node* self, PyObject* args, PyObject* kwargs);
-void node_dealloc(Node* self);
+int pysqlite_node_init(pysqlite_Node* self, PyObject* args, PyObject* kwargs);
+void pysqlite_node_dealloc(pysqlite_Node* self);
-int cache_init(Cache* self, PyObject* args, PyObject* kwargs);
-void cache_dealloc(Cache* self);
-PyObject* cache_get(Cache* self, PyObject* args);
+int pysqlite_cache_init(pysqlite_Cache* self, PyObject* args, PyObject* kwargs);
+void pysqlite_cache_dealloc(pysqlite_Cache* self);
+PyObject* pysqlite_cache_get(pysqlite_Cache* self, PyObject* args);
-int cache_setup_types(void);
+int pysqlite_cache_setup_types(void);
#endif