Back to index

python3.2  3.2.2
microprotocols.h
Go to the documentation of this file.
00001 /* microprotocols.c - definitions for minimalist and non-validating protocols
00002  *
00003  * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>
00004  *
00005  * This file is part of psycopg and was adapted for pysqlite. Federico Di
00006  * Gregorio gave the permission to use it within pysqlite under the following
00007  * license:
00008  *
00009  * This software is provided 'as-is', without any express or implied
00010  * warranty.  In no event will the authors be held liable for any damages
00011  * arising from the use of this software.
00012  *
00013  * Permission is granted to anyone to use this software for any purpose,
00014  * including commercial applications, and to alter it and redistribute it
00015  * freely, subject to the following restrictions:
00016  *
00017  * 1. The origin of this software must not be misrepresented; you must not
00018  *    claim that you wrote the original software. If you use this software
00019  *    in a product, an acknowledgment in the product documentation would be
00020  *    appreciated but is not required.
00021  * 2. Altered source versions must be plainly marked as such, and must not be
00022  *    misrepresented as being the original software.
00023  * 3. This notice may not be removed or altered from any source distribution.
00024  */
00025 
00026 #ifndef PSYCOPG_MICROPROTOCOLS_H
00027 #define PSYCOPG_MICROPROTOCOLS_H 1
00028 
00029 #include <Python.h>
00030 
00033 extern PyObject *psyco_adapters;
00034 
00037 #define MICROPROTOCOLS_GETQUOTED_NAME "getquoted"
00038 #define MICROPROTOCOLS_GETSTRING_NAME "getstring"
00039 #define MICROPROTOCOLS_GETBINARY_NAME "getbinary"
00040 
00043 /* used by module.c to init the microprotocols system */
00044 extern int pysqlite_microprotocols_init(PyObject *dict);
00045 extern int pysqlite_microprotocols_add(
00046     PyTypeObject *type, PyObject *proto, PyObject *cast);
00047 extern PyObject *pysqlite_microprotocols_adapt(
00048     PyObject *obj, PyObject *proto, PyObject *alt);
00049 
00050 extern PyObject *
00051     pysqlite_adapt(pysqlite_Cursor* self, PyObject *args);   
00052 #define pysqlite_adapt_doc \
00053     "adapt(obj, protocol, alternate) -> adapt obj to given protocol. Non-standard."
00054 
00055 #endif /* !defined(PSYCOPG_MICROPROTOCOLS_H) */