~mordred/ndb-bindings/resultsets

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
/*  ndb-bindings: Bindings for the NDB API
Copyright (C) 2006 MySQL, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or 
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

%module ndb

%include "main-extended.i"




#if defined(SWIGPYTHON)
%feature("shadow") NdbOperation::setValue %{
#  %pythoncode %{
def setValue(self,name,value,length=None):
if isinstance(value,"".__class__):
value="%c%s" % (len(value),value)
if length is None:
return _ndb.NdbOperation_setValue(name,value)
return _ndb.NdbOperation_setValue(name,value,length)
%}
#endif

/*
Turns out we don't need these, but I'm leaving them here for reference.
#if defined(SWIGPYTHON)
%typemap(out) Uint32 {
$result = PyInt_FromUnsignedLong((long) $1);
}
%typemap(out) Int32 {
$result = PyInt_FromLong((long) $1);
}
%typemap(out) Uint64 {
$result = PyLong_FromUnsignedLongLong((long) $1);
}
%typemap(in) Int32 {
$1 = (Int32) PyLong_AsLong($input);
}
%typemap(in) Uint32 {
if ($input < 0) {
PyErr_SetString(PyExc_ValueError,"Expected a nonnegative value.");
return NULL;
}
$1 = (Uint32) PyLong_AsUnsignedLong($input);
}
%typemap(in) Uint64 {
if ($input < 0) {
PyErr_SetString(PyExc_ValueError,"Expected a nonnegative value.");
return NULL;
}
$1 = (Uint64) PyLong_AsUnsignedLong($input);

}
%typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) Uint32 {
$1 = PyInt_Check($input) ? 1 : 0;
}
%typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) Uint64 {
$1 = PyLong_Check($input) ? 1 : 0;
}
%typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) Int32 {
$1 = PyInt_Check($input) ? 1 : 0;
}
#endif

*/