1 /* SWIG interface spec for eibclient
*/
3 /* has all eibclient interfaces in
*/
4 /* (Martin's code THAT clean
!) but
*/
5 /* you will realize
, some of them
*/
6 /* cannot be called from Python
*/
7 /* unless you SWIG code around them
*/
8 /* analogous to the eibgetbusmonitorpacket
*/
9 /* I already did. Not hard.
*/
14 Copyright
(C
) 2006 Tony Przygienda
, Z2 GmbH
16 This program is free software
; you can redistribute it and
/or modify
17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation
; either version
2 of the License
, or
19 (at your option
) any later version.
21 In addition to the permissions in the GNU General Public License
,
22 you may link the compiled version of this file into combinations
23 with other programs
, and distribute those combinations without any
24 restriction coming from the use of this file.
(The General Public
25 License restrictions do apply in other respects
; for example
, they
26 cover modification of the file
, and distribution when not linked into
27 a combine executable.
)
29 This program is distributed in the hope that it will be useful
,
30 but WITHOUT
ANY WARRANTY
; without even the implied warranty of
31 MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the
32 GNU General Public License for more details.
34 You should have received a copy of the GNU General Public License
35 along with this program
; if not
, write to the Free Software
36 Foundation
, Inc.
, 59 Temple Place
, Suite
330, Boston
, MA
02111-1307 USA
42 #include
"eibclient.h"
51 %typemap
(in
, numinputs
=0) (int maxlen
, uint8_t
*buf
) (unsigned char temp
[1024])
57 %typemap
(in
, numinputs
=0) (int max_len
, uint8_t
*buf
) (unsigned char temp
[1024])
63 %typemap
(in
, numinputs
=1) (int len
, uint8_t
* data
)
65 $
1 = PyString_Size
($input
);
66 $
2 = PyString_AsString
($input
);
69 %typemap
(argout
) (int maxlen
, uint8_t
*buf
)
71 if
(result
< 0) { /* Check for I
/O error
*/
72 PyErr_SetFromErrno
(PyExc_IOError
);
76 o
= PyString_FromStringAndSize
((char
*)$
2,result
);
77 if
((!$result
) ||
($result
== Py_None
)) {
81 if
(!PyList_Check
($result
)) {
82 PyObject
*o2
= $result
;
83 $result
= PyList_New
(0);
84 PyList_Append
($result
,o2
);
87 PyList_Append
($result
,o
);
93 %typemap
(argout
) (int max_len
, uint8_t
*buf
)
95 if
(result
< 0) { /* Check for I
/O error
*/
96 PyErr_SetFromErrno
(PyExc_IOError
);
100 o
= PyString_FromStringAndSize
((char
*)$
2,result
);
101 if
((!$result
) ||
($result
== Py_None
)) {
105 if
(!PyList_Check
($result
)) {
106 PyObject
*o2
= $result
;
107 $result
= PyList_New
(0);
108 PyList_Append
($result
,o2
);
111 PyList_Append
($result
,o
);
116 %typemap
(in
, numinputs
=0) (eibaddr_t
*OUTPUT) (eibaddr_t temp
)
121 %typemap
(argout
) (eibaddr_t
*OUTPUT) {
123 o
= PyInt_FromLong
((long
) *$
1);
124 if
((!$result
) ||
($result
== Py_None
)) {
128 if
(!PyList_Check
($result
)) {
129 PyObject
*o2
= $result
;
130 $result
= PyList_New
(0);
131 PyList_Append
($result
,o2
);
134 PyList_Append
($result
,o
);
139 %typemap
(in
) (eibaddr_t
INPUT) {
140 $
1 = ($type
) PyInt_AsLong
($input
);
143 %typemap
(in
) (uint16_t age
) {
144 $
1 = ($type
) PyInt_AsLong
($input
);
148 Py_BEGIN_ALLOW_THREADS
153 %apply eibaddr_t
*OUTPUT { eibaddr_t
*src
};
154 %apply eibaddr_t
*OUTPUT { eibaddr_t
*dest
};
155 %apply eibaddr_t
INPUT { eibaddr_t dest
};
157 %include
"eibtypes.h"
158 #define __BEGIN_DECLS
160 %include
"eibclient.h"
163 %module
(package
="eibclient") xrc