Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[3b03cb]: src / mysqlmod.h Maximize Restore History

Download this file

mysqlmod.h    93 lines (74 with data), 2.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef _MYSQL_PYTHON__MYSQL_H_
#define _MYSQL_PYTHON__MYSQL_H_
#include <Python.h>
#ifdef MS_WIN32
#include <windows.h>
#endif /* MS_WIN32 */
#include "structmember.h"
#include "mysql.h"
#include "my_config.h"
#include "mysqld_error.h"
#include "errmsg.h"
#define MyAlloc(s,t) (s *) t.tp_alloc(&t,0)
#define MyFree(ob) ob->ob_type->tp_free((PyObject *)ob)
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#endif
typedef struct {
PyObject_HEAD
MYSQL connection;
int open;
} _mysql_ConnectionObject;
#define check_connection(c) if (!(c->open)) return _mysql_Exception(c)
#define result_connection(r) ((_mysql_ConnectionObject *)r->conn)
#define check_result_connection(r) check_connection(result_connection(r))
extern PyTypeObject _mysql_ConnectionObject_Type;
typedef struct {
PyObject_HEAD
PyObject *conn;
MYSQL_RES *result;
int nfields;
int use;
PyObject *fields;
} _mysql_ResultObject;
extern PyTypeObject _mysql_ResultObject_Type;
typedef struct {
PyObject_HEAD
PyObject *result;
MYSQL_FIELD field;
unsigned int index;
} _mysql_FieldObject;
extern PyTypeObject _mysql_FieldObject_Type;
extern int _mysql_server_init_done;
#if MYSQL_VERSION_ID >= 40000
#define check_server_init(x) if (!_mysql_server_init_done) { if (mysql_server_init(0, NULL, NULL)) { _mysql_Exception(NULL); return x; } else { _mysql_server_init_done = 1;} }
#else
#define check_server_init(x) if (!_mysql_server_init_done) _mysql_server_init_done = 1
#endif
extern PyObject *_mysql_MySQLError;
extern PyObject *_mysql_Warning;
extern PyObject *_mysql_Error;
extern PyObject *_mysql_DatabaseError;
extern PyObject *_mysql_InterfaceError;
extern PyObject *_mysql_DataError;
extern PyObject *_mysql_OperationalError;
extern PyObject *_mysql_IntegrityError;
extern PyObject *_mysql_InternalError;
extern PyObject *_mysql_ProgrammingError;
extern PyObject *_mysql_NotSupportedError;
extern PyObject *_mysql_error_map;
extern PyObject *
_mysql_Exception(_mysql_ConnectionObject *c);
extern int
_mysql_ResultObject_Initialize(
_mysql_ResultObject *self,
PyObject *args,
PyObject *kwargs);
extern int
_mysql_FieldObject_Initialize(
_mysql_FieldObject *self,
PyObject *args,
PyObject *kwargs);
#endif