]>
Commit | Line | Data |
---|---|---|
4710c53d | 1 | /* microprotocols.c - definitions for minimalist and non-validating protocols\r |
2 | *\r | |
3 | * Copyright (C) 2003-2004 Federico Di Gregorio <fog@debian.org>\r | |
4 | *\r | |
5 | * This file is part of psycopg and was adapted for pysqlite. Federico Di\r | |
6 | * Gregorio gave the permission to use it within pysqlite under the following\r | |
7 | * license:\r | |
8 | *\r | |
9 | * This software is provided 'as-is', without any express or implied\r | |
10 | * warranty. In no event will the authors be held liable for any damages\r | |
11 | * arising from the use of this software.\r | |
12 | *\r | |
13 | * Permission is granted to anyone to use this software for any purpose,\r | |
14 | * including commercial applications, and to alter it and redistribute it\r | |
15 | * freely, subject to the following restrictions:\r | |
16 | *\r | |
17 | * 1. The origin of this software must not be misrepresented; you must not\r | |
18 | * claim that you wrote the original software. If you use this software\r | |
19 | * in a product, an acknowledgment in the product documentation would be\r | |
20 | * appreciated but is not required.\r | |
21 | * 2. Altered source versions must be plainly marked as such, and must not be\r | |
22 | * misrepresented as being the original software.\r | |
23 | * 3. This notice may not be removed or altered from any source distribution.\r | |
24 | */\r | |
25 | \r | |
26 | #ifndef PSYCOPG_MICROPROTOCOLS_H\r | |
27 | #define PSYCOPG_MICROPROTOCOLS_H 1\r | |
28 | \r | |
29 | #include <Python.h>\r | |
30 | \r | |
31 | /** adapters registry **/\r | |
32 | \r | |
33 | extern PyObject *psyco_adapters;\r | |
34 | \r | |
35 | /** the names of the three mandatory methods **/\r | |
36 | \r | |
37 | #define MICROPROTOCOLS_GETQUOTED_NAME "getquoted"\r | |
38 | #define MICROPROTOCOLS_GETSTRING_NAME "getstring"\r | |
39 | #define MICROPROTOCOLS_GETBINARY_NAME "getbinary"\r | |
40 | \r | |
41 | /** exported functions **/\r | |
42 | \r | |
43 | /* used by module.c to init the microprotocols system */\r | |
44 | extern int pysqlite_microprotocols_init(PyObject *dict);\r | |
45 | extern int pysqlite_microprotocols_add(\r | |
46 | PyTypeObject *type, PyObject *proto, PyObject *cast);\r | |
47 | extern PyObject *pysqlite_microprotocols_adapt(\r | |
48 | PyObject *obj, PyObject *proto, PyObject *alt);\r | |
49 | \r | |
50 | extern PyObject *\r | |
51 | pysqlite_adapt(pysqlite_Cursor* self, PyObject *args); \r | |
52 | #define pysqlite_adapt_doc \\r | |
53 | "adapt(obj, protocol, alternate) -> adapt obj to given protocol. Non-standard."\r | |
54 | \r | |
55 | #endif /* !defined(PSYCOPG_MICROPROTOCOLS_H) */\r |