/* module.h - definitions for the module1*2* Copyright (C) 2004-2010 Gerhard Häring <[email protected]>3*4* This file is part of pysqlite.5*6* This software is provided 'as-is', without any express or implied7* warranty. In no event will the authors be held liable for any damages8* arising from the use of this software.9*10* Permission is granted to anyone to use this software for any purpose,11* including commercial applications, and to alter it and redistribute it12* freely, subject to the following restrictions:13*14* 1. The origin of this software must not be misrepresented; you must not15* claim that you wrote the original software. If you use this software16* in a product, an acknowledgment in the product documentation would be17* appreciated but is not required.18* 2. Altered source versions must be plainly marked as such, and must not be19* misrepresented as being the original software.20* 3. This notice may not be removed or altered from any source distribution.21*/2223#ifndef PYSQLITE_MODULE_H24#define PYSQLITE_MODULE_H25#include "Python.h"2627#define LEGACY_TRANSACTION_CONTROL -12829#define PYSQLITE_VERSION "2.6.0"30#define MODULE_NAME "sqlite3"3132typedef struct {33PyObject *DataError;34PyObject *DatabaseError;35PyObject *Error;36PyObject *IntegrityError;37PyObject *InterfaceError;38PyObject *InternalError;39PyObject *NotSupportedError;40PyObject *OperationalError;41PyObject *ProgrammingError;42PyObject *Warning;434445/* A dictionary, mapping column types (INTEGER, VARCHAR, etc.) to converter46* functions, that convert the SQL value to the appropriate Python value.47* The key is uppercase.48*/49PyObject *converters;5051PyObject *lru_cache;52PyObject *psyco_adapters; // The adapters registry53int BaseTypeAdapted;54int enable_callback_tracebacks;5556PyTypeObject *BlobType;57PyTypeObject *ConnectionType;58PyTypeObject *CursorType;59PyTypeObject *PrepareProtocolType;60PyTypeObject *RowType;61PyTypeObject *StatementType;6263/* Pointers to interned strings */64PyObject *str___adapt__;65PyObject *str___conform__;66PyObject *str_executescript;67PyObject *str_finalize;68PyObject *str_inverse;69PyObject *str_step;70PyObject *str_upper;71PyObject *str_value;72} pysqlite_state;7374extern pysqlite_state pysqlite_global_state;7576static inline pysqlite_state *77pysqlite_get_state(PyObject *module)78{79pysqlite_state *state = (pysqlite_state *)PyModule_GetState(module);80assert(state != NULL);81return state;82}8384extern struct PyModuleDef _sqlite3module;85static inline pysqlite_state *86pysqlite_get_state_by_type(PyTypeObject *tp)87{88PyObject *module = PyType_GetModuleByDef(tp, &_sqlite3module);89assert(module != NULL);90return pysqlite_get_state(module);91}9293extern const char *pysqlite_error_name(int rc);9495#define PARSE_DECLTYPES 196#define PARSE_COLNAMES 297#endif9899100