driverwriting.xml: COMEDI_CB_OVERFLOW is also used to report underflows.
[comedilib.git] / swig / comedi.i
1 /***********************************************************
2            Interface file for wrapping Comedilib
3
4     Copyright (C) 2003 Bryan Cole  <bryan.cole@teraview.co.uk>
5     Copyright (C) 1998-2002 David A. Schleef <ds@schleef.org>
6     Copyright (C) 2003,2004 Frank Mori Hess <fmhess@users.sourceforge.net>
7     Copyright (C) 2003 Steven Jenkins <steven.jenkins@ieee.org>
8     Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
9
10     This program is free software; you can redistribute it and/or modify
11     it under the terms of the GNU Lesser General Public License as published by
12     the Free Software Foundation; either version 2 of the License, or
13     (at your option) any later version.
14
15     This program is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18     GNU General Public License for more details.
19
20     You should have received a copy of the GNU General Public License
21     along with this program; if not, write to the Free Software
22     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
24 ***********************************************************
25 *
26 *     This file was created with Python wrappers in mind but wil
27 *  probably work for other swig-supported script languages
28 *
29 *    to regenerate the wrappers run:
30 *    swig -python comedi.i
31 *
32 ***********************************************************/
33 %module comedi
34 #define SWIG_USE_OLD_TYPEMAPS
35 %{
36 #include "comedilib.h"
37 %}
38 %include "carrays.i"
39 %include "typemaps.i"
40
41 %inline %{
42 static unsigned int cr_pack(unsigned int chan, unsigned int rng, unsigned int aref){
43         return CR_PACK(chan,rng,aref);
44 }
45 static unsigned int cr_pack_flags(unsigned int chan, unsigned int rng, unsigned int aref, unsigned int flags){
46         return CR_PACK_FLAGS(chan,rng,aref, flags);
47 }
48 static unsigned int cr_chan(unsigned int a){
49         return CR_CHAN(a);
50 }
51 static unsigned int cr_range(unsigned int a){
52         return CR_RANGE(a);
53 }
54 static unsigned int cr_aref(unsigned int a){
55         return CR_AREF(a);
56 }
57 %}
58
59 #ifdef SWIGRUBY
60 %typemap(argout) comedi_cmd *INOUT(VALUE info) {
61     $result = output_helper($result, $arg);
62 };
63 #endif
64
65 %include "comedi.h"
66 %include "comedilib.h"
67
68 %array_class(unsigned int, chanlist);
69 %array_class(sampl_t, sampl_array);
70 %array_class(lsampl_t, lsampl_array);
71 %array_class(comedi_insn, insn_array);