wiringpi2 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/ext/wiringpi/WiringPi/examples/blink.c +50 -0
  2. data/ext/wiringpi/WiringPi/examples/delayTest.c +107 -0
  3. data/ext/wiringpi/WiringPi/examples/ds1302.c +238 -0
  4. data/ext/wiringpi/WiringPi/examples/gertboard.c +94 -0
  5. data/ext/wiringpi/WiringPi/examples/header.h +23 -0
  6. data/ext/wiringpi/WiringPi/examples/isr-osc.c +118 -0
  7. data/ext/wiringpi/WiringPi/examples/isr.c +99 -0
  8. data/ext/wiringpi/WiringPi/examples/lcd.c +129 -0
  9. data/ext/wiringpi/WiringPi/examples/nes.c +67 -0
  10. data/ext/wiringpi/WiringPi/examples/okLed.c +83 -0
  11. data/ext/wiringpi/WiringPi/examples/piface.c +74 -0
  12. data/ext/wiringpi/WiringPi/examples/pwm.c +93 -0
  13. data/ext/wiringpi/WiringPi/examples/serialRead.c +48 -0
  14. data/ext/wiringpi/WiringPi/examples/serialTest.c +75 -0
  15. data/ext/wiringpi/WiringPi/examples/servo.c +57 -0
  16. data/ext/wiringpi/WiringPi/examples/speed.c +123 -0
  17. data/ext/wiringpi/WiringPi/examples/test1.c +111 -0
  18. data/ext/wiringpi/WiringPi/examples/test2.c +58 -0
  19. data/ext/wiringpi/WiringPi/examples/tone.c +59 -0
  20. data/ext/wiringpi/WiringPi/examples/wfi.c +161 -0
  21. data/ext/wiringpi/WiringPi/gpio/gpio.c +1371 -0
  22. data/ext/wiringpi/WiringPi/wiringPi/ds1302.c +239 -0
  23. data/ext/wiringpi/WiringPi/wiringPi/ds1302.h +44 -0
  24. data/ext/wiringpi/WiringPi/wiringPi/gertboard.c +166 -0
  25. data/ext/wiringpi/WiringPi/wiringPi/gertboard.h +40 -0
  26. data/ext/wiringpi/WiringPi/wiringPi/lcd.c +380 -0
  27. data/ext/wiringpi/WiringPi/wiringPi/lcd.h +46 -0
  28. data/ext/wiringpi/WiringPi/wiringPi/mcp23008.c +155 -0
  29. data/ext/wiringpi/WiringPi/wiringPi/mcp23008.h +33 -0
  30. data/ext/wiringpi/WiringPi/wiringPi/mcp23017.c +195 -0
  31. data/ext/wiringpi/WiringPi/wiringPi/mcp23017.h +33 -0
  32. data/ext/wiringpi/WiringPi/wiringPi/mcp23s08.c +195 -0
  33. data/ext/wiringpi/WiringPi/wiringPi/mcp23s08.h +33 -0
  34. data/ext/wiringpi/WiringPi/wiringPi/mcp23s17.c +236 -0
  35. data/ext/wiringpi/WiringPi/wiringPi/mcp23s17.h +33 -0
  36. data/ext/wiringpi/WiringPi/wiringPi/mcp23x08.h +73 -0
  37. data/ext/wiringpi/WiringPi/wiringPi/mcp23x0817.h +87 -0
  38. data/ext/wiringpi/WiringPi/wiringPi/piFace.c +179 -0
  39. data/ext/wiringpi/WiringPi/wiringPi/piFace.h +32 -0
  40. data/ext/wiringpi/WiringPi/wiringPi/piHiPri.c +50 -0
  41. data/ext/wiringpi/WiringPi/wiringPi/piNes.c +113 -0
  42. data/ext/wiringpi/WiringPi/wiringPi/piNes.h +45 -0
  43. data/ext/wiringpi/WiringPi/wiringPi/piThread.c +63 -0
  44. data/ext/wiringpi/WiringPi/wiringPi/softPwm.c +130 -0
  45. data/ext/wiringpi/WiringPi/wiringPi/softPwm.h +34 -0
  46. data/ext/wiringpi/WiringPi/wiringPi/softServo.c +211 -0
  47. data/ext/wiringpi/WiringPi/wiringPi/softServo.h +35 -0
  48. data/ext/wiringpi/WiringPi/wiringPi/softTone.c +121 -0
  49. data/ext/wiringpi/WiringPi/wiringPi/softTone.h +38 -0
  50. data/ext/wiringpi/WiringPi/wiringPi/sr595.c +108 -0
  51. data/ext/wiringpi/WiringPi/wiringPi/sr595.h +33 -0
  52. data/ext/wiringpi/WiringPi/wiringPi/wiringPi.c +1664 -0
  53. data/ext/wiringpi/WiringPi/wiringPi/wiringPi.h +168 -0
  54. data/ext/wiringpi/WiringPi/wiringPi/wiringPiI2C.c +227 -0
  55. data/ext/wiringpi/WiringPi/wiringPi/wiringPiI2C.h +42 -0
  56. data/ext/wiringpi/WiringPi/wiringPi/wiringPiSPI.c +119 -0
  57. data/ext/wiringpi/WiringPi/wiringPi/wiringPiSPI.h +35 -0
  58. data/ext/wiringpi/WiringPi/wiringPi/wiringSerial.c +213 -0
  59. data/ext/wiringpi/WiringPi/wiringPi/wiringSerial.h +38 -0
  60. data/ext/wiringpi/WiringPi/wiringPi/wiringShift.c +83 -0
  61. data/ext/wiringpi/WiringPi/wiringPi/wiringShift.h +41 -0
  62. data/ext/wiringpi/extconf.rb +8 -0
  63. data/ext/wiringpi/wiringpi_wrap.c +4378 -0
  64. data/lib/wiringpi/event.rb +21 -0
  65. data/lib/wiringpi/gpio.rb +131 -0
  66. data/lib/wiringpi/i2c.rb +26 -0
  67. data/lib/wiringpi/mcp23x17.rb +31 -0
  68. data/lib/wiringpi/serial.rb +49 -0
  69. data/lib/wiringpi/spi.rb +15 -0
  70. data/lib/wiringpi2.rb +42 -0
  71. metadata +122 -0
@@ -0,0 +1,35 @@
1
+ /*
2
+ * wiringPiSPI.h:
3
+ * Simplified SPI access routines
4
+ * Copyright (c) 2012 Gordon Henderson
5
+ ***********************************************************************
6
+ * This file is part of wiringPi:
7
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
8
+ *
9
+ * wiringPi is free software: you can redistribute it and/or modify
10
+ * it under the terms of the GNU Lesser General Public License as
11
+ * published by the Free Software Foundation, either version 3 of the
12
+ * License, or (at your option) any later version.
13
+ *
14
+ * wiringPi is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
+ * GNU Lesser General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Lesser General Public
20
+ * License along with wiringPi.
21
+ * If not, see <http://www.gnu.org/licenses/>.
22
+ ***********************************************************************
23
+ */
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ int wiringPiSPIGetFd (int channel) ;
30
+ int wiringPiSPIDataRW (int channel, unsigned char *data, int len) ;
31
+ int wiringPiSPISetup (int channel, int speed) ;
32
+
33
+ #ifdef __cplusplus
34
+ }
35
+ #endif
@@ -0,0 +1,213 @@
1
+ /*
2
+ * wiringSerial.c:
3
+ * Handle a serial port
4
+ ***********************************************************************
5
+ * This file is part of wiringPi:
6
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
7
+ *
8
+ * wiringPi is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * wiringPi is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
20
+ ***********************************************************************
21
+ */
22
+
23
+ #include <stdio.h>
24
+ #include <stdlib.h>
25
+ #include <stdint.h>
26
+ #include <stdarg.h>
27
+ #include <string.h>
28
+ #include <termios.h>
29
+ #include <unistd.h>
30
+ #include <fcntl.h>
31
+ #include <sys/ioctl.h>
32
+ #include <sys/types.h>
33
+ #include <sys/stat.h>
34
+
35
+ #include "wiringSerial.h"
36
+
37
+ /*
38
+ * serialOpen:
39
+ * Open and initialise the serial port, setting all the right
40
+ * port parameters - or as many as are required - hopefully!
41
+ *********************************************************************************
42
+ */
43
+
44
+ int serialOpen (char *device, int baud)
45
+ {
46
+ struct termios options ;
47
+ speed_t myBaud ;
48
+ int status, fd ;
49
+
50
+ switch (baud)
51
+ {
52
+ case 50: myBaud = B50 ; break ;
53
+ case 75: myBaud = B75 ; break ;
54
+ case 110: myBaud = B110 ; break ;
55
+ case 134: myBaud = B134 ; break ;
56
+ case 150: myBaud = B150 ; break ;
57
+ case 200: myBaud = B200 ; break ;
58
+ case 300: myBaud = B300 ; break ;
59
+ case 600: myBaud = B600 ; break ;
60
+ case 1200: myBaud = B1200 ; break ;
61
+ case 1800: myBaud = B1800 ; break ;
62
+ case 2400: myBaud = B2400 ; break ;
63
+ case 4800: myBaud = B4800 ; break ;
64
+ case 9600: myBaud = B9600 ; break ;
65
+ case 19200: myBaud = B19200 ; break ;
66
+ case 38400: myBaud = B38400 ; break ;
67
+ case 57600: myBaud = B57600 ; break ;
68
+ case 115200: myBaud = B115200 ; break ;
69
+ case 230400: myBaud = B230400 ; break ;
70
+
71
+ default:
72
+ return -2 ;
73
+ }
74
+
75
+ if ((fd = open (device, O_RDWR | O_NOCTTY | O_NDELAY | O_NONBLOCK)) == -1)
76
+ return -1 ;
77
+
78
+ fcntl (fd, F_SETFL, O_RDWR) ;
79
+
80
+ // Get and modify current options:
81
+
82
+ tcgetattr (fd, &options) ;
83
+
84
+ cfmakeraw (&options) ;
85
+ cfsetispeed (&options, myBaud) ;
86
+ cfsetospeed (&options, myBaud) ;
87
+
88
+ options.c_cflag |= (CLOCAL | CREAD) ;
89
+ options.c_cflag &= ~PARENB ;
90
+ options.c_cflag &= ~CSTOPB ;
91
+ options.c_cflag &= ~CSIZE ;
92
+ options.c_cflag |= CS8 ;
93
+ options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG) ;
94
+ options.c_oflag &= ~OPOST ;
95
+
96
+ options.c_cc [VMIN] = 0 ;
97
+ options.c_cc [VTIME] = 100 ; // Ten seconds (100 deciseconds)
98
+
99
+ tcsetattr (fd, TCSANOW | TCSAFLUSH, &options) ;
100
+
101
+ ioctl (fd, TIOCMGET, &status);
102
+
103
+ status |= TIOCM_DTR ;
104
+ status |= TIOCM_RTS ;
105
+
106
+ ioctl (fd, TIOCMSET, &status);
107
+
108
+ usleep (10000) ; // 10mS
109
+
110
+ return fd ;
111
+ }
112
+
113
+
114
+ /*
115
+ * serialFlush:
116
+ * Flush the serial buffers (both tx & rx)
117
+ *********************************************************************************
118
+ */
119
+
120
+ void serialFlush (int fd)
121
+ {
122
+ tcflush (fd, TCIOFLUSH) ;
123
+ }
124
+
125
+
126
+ /*
127
+ * serialClose:
128
+ * Release the serial port
129
+ *********************************************************************************
130
+ */
131
+
132
+ void serialClose (int fd)
133
+ {
134
+ close (fd) ;
135
+ }
136
+
137
+
138
+ /*
139
+ * serialPutchar:
140
+ * Send a single character to the serial port
141
+ *********************************************************************************
142
+ */
143
+
144
+ void serialPutchar (int fd, unsigned char c)
145
+ {
146
+ write (fd, &c, 1) ;
147
+ }
148
+
149
+
150
+ /*
151
+ * serialPuts:
152
+ * Send a string to the serial port
153
+ *********************************************************************************
154
+ */
155
+
156
+ void serialPuts (int fd, char *s)
157
+ {
158
+ write (fd, s, strlen (s)) ;
159
+ }
160
+
161
+ /*
162
+ * serialPrintf:
163
+ * Printf over Serial
164
+ *********************************************************************************
165
+ */
166
+
167
+ void serialPrintf (int fd, char *message, ...)
168
+ {
169
+ va_list argp ;
170
+ char buffer [1024] ;
171
+
172
+ va_start (argp, message) ;
173
+ vsnprintf (buffer, 1023, message, argp) ;
174
+ va_end (argp) ;
175
+
176
+ serialPuts (fd, buffer) ;
177
+ }
178
+
179
+
180
+ /*
181
+ * serialDataAvail:
182
+ * Return the number of bytes of data avalable to be read in the serial port
183
+ *********************************************************************************
184
+ */
185
+
186
+ int serialDataAvail (int fd)
187
+ {
188
+ int result ;
189
+
190
+ if (ioctl (fd, FIONREAD, &result) == -1)
191
+ return -1 ;
192
+
193
+ return result ;
194
+ }
195
+
196
+
197
+ /*
198
+ * serialGetchar:
199
+ * Get a single character from the serial device.
200
+ * Note: Zero is a valid character and this function will time-out after
201
+ * 10 seconds.
202
+ *********************************************************************************
203
+ */
204
+
205
+ int serialGetchar (int fd)
206
+ {
207
+ uint8_t x ;
208
+
209
+ if (read (fd, &x, 1) != 1)
210
+ return -1 ;
211
+
212
+ return ((int)x) & 0xFF ;
213
+ }
@@ -0,0 +1,38 @@
1
+ /*
2
+ * wiringSerial.h:
3
+ * Handle a serial port
4
+ ***********************************************************************
5
+ * This file is part of wiringPi:
6
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
7
+ *
8
+ * wiringPi is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU Lesser General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * wiringPi is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU Lesser General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU Lesser General Public License
19
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
20
+ ***********************************************************************
21
+ */
22
+
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif
26
+
27
+ extern int serialOpen (char *device, int baud) ;
28
+ extern void serialClose (int fd) ;
29
+ extern void serialFlush (int fd) ;
30
+ extern void serialPutchar (int fd, unsigned char c) ;
31
+ extern void serialPuts (int fd, char *s) ;
32
+ extern void serialPrintf (int fd, char *message, ...) ;
33
+ extern int serialDataAvail (int fd) ;
34
+ extern int serialGetchar (int fd) ;
35
+
36
+ #ifdef __cplusplus
37
+ }
38
+ #endif
@@ -0,0 +1,83 @@
1
+ /*
2
+ * wiringShift.c:
3
+ * Emulate some of the Arduino wiring functionality.
4
+ *
5
+ * Copyright (c) 2009-2012 Gordon Henderson.
6
+ ***********************************************************************
7
+ * This file is part of wiringPi:
8
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
9
+ *
10
+ * wiringPi 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 3 of the License, or
13
+ * (at your option) any later version.
14
+ *
15
+ * wiringPi 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 Lesser General Public License for more details.
19
+ *
20
+ * You should have received a copy of the GNU Lesser General Public License
21
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
22
+ ***********************************************************************
23
+ */
24
+
25
+ #include <stdint.h>
26
+
27
+ #include "wiringPi.h"
28
+ #include "wiringShift.h"
29
+
30
+ /*
31
+ * shiftIn:
32
+ * Shift data in from a clocked source
33
+ *********************************************************************************
34
+ */
35
+
36
+ uint8_t shiftIn (uint8_t dPin, uint8_t cPin, uint8_t order)
37
+ {
38
+ uint8_t value = 0 ;
39
+ int8_t i ;
40
+
41
+ if (order == MSBFIRST)
42
+ for (i = 7 ; i >= 0 ; --i)
43
+ {
44
+ digitalWrite (cPin, HIGH) ;
45
+ value |= digitalRead (dPin) << i ;
46
+ digitalWrite (cPin, LOW) ;
47
+ }
48
+ else
49
+ for (i = 0 ; i < 8 ; ++i)
50
+ {
51
+ digitalWrite (cPin, HIGH) ;
52
+ value |= digitalRead (dPin) << i ;
53
+ digitalWrite (cPin, LOW) ;
54
+ }
55
+
56
+ return value;
57
+ }
58
+
59
+ /*
60
+ * shiftOut:
61
+ * Shift data out to a clocked source
62
+ *********************************************************************************
63
+ */
64
+
65
+ void shiftOut (uint8_t dPin, uint8_t cPin, uint8_t order, uint8_t val)
66
+ {
67
+ int8_t i;
68
+
69
+ if (order == MSBFIRST)
70
+ for (i = 7 ; i >= 0 ; --i)
71
+ {
72
+ digitalWrite (dPin, val & (1 << i)) ;
73
+ digitalWrite (cPin, HIGH) ;
74
+ digitalWrite (cPin, LOW) ;
75
+ }
76
+ else
77
+ for (i = 0 ; i < 8 ; ++i)
78
+ {
79
+ digitalWrite (dPin, val & (1 << i)) ;
80
+ digitalWrite (cPin, HIGH) ;
81
+ digitalWrite (cPin, LOW) ;
82
+ }
83
+ }
@@ -0,0 +1,41 @@
1
+ /*
2
+ * wiringShift.h:
3
+ * Emulate some of the Arduino wiring functionality.
4
+ *
5
+ * Copyright (c) 2009-2012 Gordon Henderson.
6
+ ***********************************************************************
7
+ * This file is part of wiringPi:
8
+ * https://projects.drogon.net/raspberry-pi/wiringpi/
9
+ *
10
+ * wiringPi 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 3 of the License, or
13
+ * (at your option) any later version.
14
+ *
15
+ * wiringPi 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 Lesser General Public License for more details.
19
+ *
20
+ * You should have received a copy of the GNU Lesser General Public License
21
+ * along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
22
+ ***********************************************************************
23
+ */
24
+
25
+ #define LSBFIRST 0
26
+ #define MSBFIRST 1
27
+
28
+ #ifndef _STDINT_H
29
+ # include <stdint.h>
30
+ #endif
31
+
32
+ #ifdef __cplusplus
33
+ extern "C" {
34
+ #endif
35
+
36
+ extern uint8_t shiftIn (uint8_t dPin, uint8_t cPin, uint8_t order) ;
37
+ extern void shiftOut (uint8_t dPin, uint8_t cPin, uint8_t order, uint8_t val) ;
38
+
39
+ #ifdef __cplusplus
40
+ }
41
+ #endif
@@ -0,0 +1,8 @@
1
+ require 'mkmf'
2
+
3
+ $srcs = Dir.glob('WiringPi/wiringPi/*.c')
4
+ $objs = $srcs.map{ |file| file.sub('.c','.o') }
5
+ $srcs << 'wiringpi_wrap.c'
6
+ $objs << 'wiringpi_wrap.o'
7
+
8
+ create_makefile('wiringpi2/wiringpi2')
@@ -0,0 +1,4378 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 2.0.7
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
+ * coding conventions designed to improve portability and efficiency. Do not make
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
+ * ----------------------------------------------------------------------------- */
10
+
11
+ #define SWIGRUBY
12
+
13
+ /* -----------------------------------------------------------------------------
14
+ * This section contains generic SWIG labels for method/variable
15
+ * declarations/attributes, and other compiler dependent labels.
16
+ * ----------------------------------------------------------------------------- */
17
+
18
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
19
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
20
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21
+ # define SWIGTEMPLATEDISAMBIGUATOR template
22
+ # elif defined(__HP_aCC)
23
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
24
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
25
+ # define SWIGTEMPLATEDISAMBIGUATOR template
26
+ # else
27
+ # define SWIGTEMPLATEDISAMBIGUATOR
28
+ # endif
29
+ #endif
30
+
31
+ /* inline attribute */
32
+ #ifndef SWIGINLINE
33
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
34
+ # define SWIGINLINE inline
35
+ # else
36
+ # define SWIGINLINE
37
+ # endif
38
+ #endif
39
+
40
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
41
+ #ifndef SWIGUNUSED
42
+ # if defined(__GNUC__)
43
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44
+ # define SWIGUNUSED __attribute__ ((__unused__))
45
+ # else
46
+ # define SWIGUNUSED
47
+ # endif
48
+ # elif defined(__ICC)
49
+ # define SWIGUNUSED __attribute__ ((__unused__))
50
+ # else
51
+ # define SWIGUNUSED
52
+ # endif
53
+ #endif
54
+
55
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
56
+ # if defined(_MSC_VER)
57
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
58
+ # endif
59
+ #endif
60
+
61
+ #ifndef SWIGUNUSEDPARM
62
+ # ifdef __cplusplus
63
+ # define SWIGUNUSEDPARM(p)
64
+ # else
65
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
66
+ # endif
67
+ #endif
68
+
69
+ /* internal SWIG method */
70
+ #ifndef SWIGINTERN
71
+ # define SWIGINTERN static SWIGUNUSED
72
+ #endif
73
+
74
+ /* internal inline SWIG method */
75
+ #ifndef SWIGINTERNINLINE
76
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
77
+ #endif
78
+
79
+ /* exporting methods */
80
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
81
+ # ifndef GCC_HASCLASSVISIBILITY
82
+ # define GCC_HASCLASSVISIBILITY
83
+ # endif
84
+ #endif
85
+
86
+ #ifndef SWIGEXPORT
87
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
88
+ # if defined(STATIC_LINKED)
89
+ # define SWIGEXPORT
90
+ # else
91
+ # define SWIGEXPORT __declspec(dllexport)
92
+ # endif
93
+ # else
94
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
95
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
96
+ # else
97
+ # define SWIGEXPORT
98
+ # endif
99
+ # endif
100
+ #endif
101
+
102
+ /* calling conventions for Windows */
103
+ #ifndef SWIGSTDCALL
104
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
105
+ # define SWIGSTDCALL __stdcall
106
+ # else
107
+ # define SWIGSTDCALL
108
+ # endif
109
+ #endif
110
+
111
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
112
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
113
+ # define _CRT_SECURE_NO_DEPRECATE
114
+ #endif
115
+
116
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
117
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
118
+ # define _SCL_SECURE_NO_DEPRECATE
119
+ #endif
120
+
121
+
122
+ /* -----------------------------------------------------------------------------
123
+ * This section contains generic SWIG labels for method/variable
124
+ * declarations/attributes, and other compiler dependent labels.
125
+ * ----------------------------------------------------------------------------- */
126
+
127
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
128
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
129
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
130
+ # define SWIGTEMPLATEDISAMBIGUATOR template
131
+ # elif defined(__HP_aCC)
132
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
133
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
134
+ # define SWIGTEMPLATEDISAMBIGUATOR template
135
+ # else
136
+ # define SWIGTEMPLATEDISAMBIGUATOR
137
+ # endif
138
+ #endif
139
+
140
+ /* inline attribute */
141
+ #ifndef SWIGINLINE
142
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
143
+ # define SWIGINLINE inline
144
+ # else
145
+ # define SWIGINLINE
146
+ # endif
147
+ #endif
148
+
149
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
150
+ #ifndef SWIGUNUSED
151
+ # if defined(__GNUC__)
152
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
153
+ # define SWIGUNUSED __attribute__ ((__unused__))
154
+ # else
155
+ # define SWIGUNUSED
156
+ # endif
157
+ # elif defined(__ICC)
158
+ # define SWIGUNUSED __attribute__ ((__unused__))
159
+ # else
160
+ # define SWIGUNUSED
161
+ # endif
162
+ #endif
163
+
164
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
165
+ # if defined(_MSC_VER)
166
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
167
+ # endif
168
+ #endif
169
+
170
+ #ifndef SWIGUNUSEDPARM
171
+ # ifdef __cplusplus
172
+ # define SWIGUNUSEDPARM(p)
173
+ # else
174
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
175
+ # endif
176
+ #endif
177
+
178
+ /* internal SWIG method */
179
+ #ifndef SWIGINTERN
180
+ # define SWIGINTERN static SWIGUNUSED
181
+ #endif
182
+
183
+ /* internal inline SWIG method */
184
+ #ifndef SWIGINTERNINLINE
185
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
186
+ #endif
187
+
188
+ /* exporting methods */
189
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
190
+ # ifndef GCC_HASCLASSVISIBILITY
191
+ # define GCC_HASCLASSVISIBILITY
192
+ # endif
193
+ #endif
194
+
195
+ #ifndef SWIGEXPORT
196
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
197
+ # if defined(STATIC_LINKED)
198
+ # define SWIGEXPORT
199
+ # else
200
+ # define SWIGEXPORT __declspec(dllexport)
201
+ # endif
202
+ # else
203
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
204
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
205
+ # else
206
+ # define SWIGEXPORT
207
+ # endif
208
+ # endif
209
+ #endif
210
+
211
+ /* calling conventions for Windows */
212
+ #ifndef SWIGSTDCALL
213
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
214
+ # define SWIGSTDCALL __stdcall
215
+ # else
216
+ # define SWIGSTDCALL
217
+ # endif
218
+ #endif
219
+
220
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
221
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
222
+ # define _CRT_SECURE_NO_DEPRECATE
223
+ #endif
224
+
225
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
226
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
227
+ # define _SCL_SECURE_NO_DEPRECATE
228
+ #endif
229
+
230
+
231
+ /* -----------------------------------------------------------------------------
232
+ * swigrun.swg
233
+ *
234
+ * This file contains generic C API SWIG runtime support for pointer
235
+ * type checking.
236
+ * ----------------------------------------------------------------------------- */
237
+
238
+ /* This should only be incremented when either the layout of swig_type_info changes,
239
+ or for whatever reason, the runtime changes incompatibly */
240
+ #define SWIG_RUNTIME_VERSION "4"
241
+
242
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
243
+ #ifdef SWIG_TYPE_TABLE
244
+ # define SWIG_QUOTE_STRING(x) #x
245
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
246
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
247
+ #else
248
+ # define SWIG_TYPE_TABLE_NAME
249
+ #endif
250
+
251
+ /*
252
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
253
+ creating a static or dynamic library from the SWIG runtime code.
254
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
255
+
256
+ But only do this if strictly necessary, ie, if you have problems
257
+ with your compiler or suchlike.
258
+ */
259
+
260
+ #ifndef SWIGRUNTIME
261
+ # define SWIGRUNTIME SWIGINTERN
262
+ #endif
263
+
264
+ #ifndef SWIGRUNTIMEINLINE
265
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
266
+ #endif
267
+
268
+ /* Generic buffer size */
269
+ #ifndef SWIG_BUFFER_SIZE
270
+ # define SWIG_BUFFER_SIZE 1024
271
+ #endif
272
+
273
+ /* Flags for pointer conversions */
274
+ #define SWIG_POINTER_DISOWN 0x1
275
+ #define SWIG_CAST_NEW_MEMORY 0x2
276
+
277
+ /* Flags for new pointer objects */
278
+ #define SWIG_POINTER_OWN 0x1
279
+
280
+
281
+ /*
282
+ Flags/methods for returning states.
283
+
284
+ The SWIG conversion methods, as ConvertPtr, return an integer
285
+ that tells if the conversion was successful or not. And if not,
286
+ an error code can be returned (see swigerrors.swg for the codes).
287
+
288
+ Use the following macros/flags to set or process the returning
289
+ states.
290
+
291
+ In old versions of SWIG, code such as the following was usually written:
292
+
293
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
294
+ // success code
295
+ } else {
296
+ //fail code
297
+ }
298
+
299
+ Now you can be more explicit:
300
+
301
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
302
+ if (SWIG_IsOK(res)) {
303
+ // success code
304
+ } else {
305
+ // fail code
306
+ }
307
+
308
+ which is the same really, but now you can also do
309
+
310
+ Type *ptr;
311
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
312
+ if (SWIG_IsOK(res)) {
313
+ // success code
314
+ if (SWIG_IsNewObj(res) {
315
+ ...
316
+ delete *ptr;
317
+ } else {
318
+ ...
319
+ }
320
+ } else {
321
+ // fail code
322
+ }
323
+
324
+ I.e., now SWIG_ConvertPtr can return new objects and you can
325
+ identify the case and take care of the deallocation. Of course that
326
+ also requires SWIG_ConvertPtr to return new result values, such as
327
+
328
+ int SWIG_ConvertPtr(obj, ptr,...) {
329
+ if (<obj is ok>) {
330
+ if (<need new object>) {
331
+ *ptr = <ptr to new allocated object>;
332
+ return SWIG_NEWOBJ;
333
+ } else {
334
+ *ptr = <ptr to old object>;
335
+ return SWIG_OLDOBJ;
336
+ }
337
+ } else {
338
+ return SWIG_BADOBJ;
339
+ }
340
+ }
341
+
342
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
343
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
344
+ SWIG errors code.
345
+
346
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
347
+ allows to return the 'cast rank', for example, if you have this
348
+
349
+ int food(double)
350
+ int fooi(int);
351
+
352
+ and you call
353
+
354
+ food(1) // cast rank '1' (1 -> 1.0)
355
+ fooi(1) // cast rank '0'
356
+
357
+ just use the SWIG_AddCast()/SWIG_CheckState()
358
+ */
359
+
360
+ #define SWIG_OK (0)
361
+ #define SWIG_ERROR (-1)
362
+ #define SWIG_IsOK(r) (r >= 0)
363
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
364
+
365
+ /* The CastRankLimit says how many bits are used for the cast rank */
366
+ #define SWIG_CASTRANKLIMIT (1 << 8)
367
+ /* The NewMask denotes the object was created (using new/malloc) */
368
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
369
+ /* The TmpMask is for in/out typemaps that use temporal objects */
370
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
371
+ /* Simple returning values */
372
+ #define SWIG_BADOBJ (SWIG_ERROR)
373
+ #define SWIG_OLDOBJ (SWIG_OK)
374
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
375
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
376
+ /* Check, add and del mask methods */
377
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
378
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
379
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
380
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
381
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
382
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
383
+
384
+ /* Cast-Rank Mode */
385
+ #if defined(SWIG_CASTRANK_MODE)
386
+ # ifndef SWIG_TypeRank
387
+ # define SWIG_TypeRank unsigned long
388
+ # endif
389
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
390
+ # define SWIG_MAXCASTRANK (2)
391
+ # endif
392
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
393
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
394
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
395
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
396
+ }
397
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
398
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
399
+ }
400
+ #else /* no cast-rank mode */
401
+ # define SWIG_AddCast
402
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
403
+ #endif
404
+
405
+
406
+ #include <string.h>
407
+
408
+ #ifdef __cplusplus
409
+ extern "C" {
410
+ #endif
411
+
412
+ typedef void *(*swig_converter_func)(void *, int *);
413
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
414
+
415
+ /* Structure to store information on one type */
416
+ typedef struct swig_type_info {
417
+ const char *name; /* mangled name of this type */
418
+ const char *str; /* human readable name of this type */
419
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
420
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
421
+ void *clientdata; /* language specific type data */
422
+ int owndata; /* flag if the structure owns the clientdata */
423
+ } swig_type_info;
424
+
425
+ /* Structure to store a type and conversion function used for casting */
426
+ typedef struct swig_cast_info {
427
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
428
+ swig_converter_func converter; /* function to cast the void pointers */
429
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
430
+ struct swig_cast_info *prev; /* pointer to the previous cast */
431
+ } swig_cast_info;
432
+
433
+ /* Structure used to store module information
434
+ * Each module generates one structure like this, and the runtime collects
435
+ * all of these structures and stores them in a circularly linked list.*/
436
+ typedef struct swig_module_info {
437
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
438
+ size_t size; /* Number of types in this module */
439
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
440
+ swig_type_info **type_initial; /* Array of initially generated type structures */
441
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
442
+ void *clientdata; /* Language specific module data */
443
+ } swig_module_info;
444
+
445
+ /*
446
+ Compare two type names skipping the space characters, therefore
447
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
448
+
449
+ Return 0 when the two name types are equivalent, as in
450
+ strncmp, but skipping ' '.
451
+ */
452
+ SWIGRUNTIME int
453
+ SWIG_TypeNameComp(const char *f1, const char *l1,
454
+ const char *f2, const char *l2) {
455
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
456
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
457
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
458
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
459
+ }
460
+ return (int)((l1 - f1) - (l2 - f2));
461
+ }
462
+
463
+ /*
464
+ Check type equivalence in a name list like <name1>|<name2>|...
465
+ Return 0 if not equal, 1 if equal
466
+ */
467
+ SWIGRUNTIME int
468
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
469
+ int equiv = 0;
470
+ const char* te = tb + strlen(tb);
471
+ const char* ne = nb;
472
+ while (!equiv && *ne) {
473
+ for (nb = ne; *ne; ++ne) {
474
+ if (*ne == '|') break;
475
+ }
476
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
477
+ if (*ne) ++ne;
478
+ }
479
+ return equiv;
480
+ }
481
+
482
+ /*
483
+ Check type equivalence in a name list like <name1>|<name2>|...
484
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
485
+ */
486
+ SWIGRUNTIME int
487
+ SWIG_TypeCompare(const char *nb, const char *tb) {
488
+ int equiv = 0;
489
+ const char* te = tb + strlen(tb);
490
+ const char* ne = nb;
491
+ while (!equiv && *ne) {
492
+ for (nb = ne; *ne; ++ne) {
493
+ if (*ne == '|') break;
494
+ }
495
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
496
+ if (*ne) ++ne;
497
+ }
498
+ return equiv;
499
+ }
500
+
501
+
502
+ /*
503
+ Check the typename
504
+ */
505
+ SWIGRUNTIME swig_cast_info *
506
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
507
+ if (ty) {
508
+ swig_cast_info *iter = ty->cast;
509
+ while (iter) {
510
+ if (strcmp(iter->type->name, c) == 0) {
511
+ if (iter == ty->cast)
512
+ return iter;
513
+ /* Move iter to the top of the linked list */
514
+ iter->prev->next = iter->next;
515
+ if (iter->next)
516
+ iter->next->prev = iter->prev;
517
+ iter->next = ty->cast;
518
+ iter->prev = 0;
519
+ if (ty->cast) ty->cast->prev = iter;
520
+ ty->cast = iter;
521
+ return iter;
522
+ }
523
+ iter = iter->next;
524
+ }
525
+ }
526
+ return 0;
527
+ }
528
+
529
+ /*
530
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
531
+ */
532
+ SWIGRUNTIME swig_cast_info *
533
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
534
+ if (ty) {
535
+ swig_cast_info *iter = ty->cast;
536
+ while (iter) {
537
+ if (iter->type == from) {
538
+ if (iter == ty->cast)
539
+ return iter;
540
+ /* Move iter to the top of the linked list */
541
+ iter->prev->next = iter->next;
542
+ if (iter->next)
543
+ iter->next->prev = iter->prev;
544
+ iter->next = ty->cast;
545
+ iter->prev = 0;
546
+ if (ty->cast) ty->cast->prev = iter;
547
+ ty->cast = iter;
548
+ return iter;
549
+ }
550
+ iter = iter->next;
551
+ }
552
+ }
553
+ return 0;
554
+ }
555
+
556
+ /*
557
+ Cast a pointer up an inheritance hierarchy
558
+ */
559
+ SWIGRUNTIMEINLINE void *
560
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
561
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
562
+ }
563
+
564
+ /*
565
+ Dynamic pointer casting. Down an inheritance hierarchy
566
+ */
567
+ SWIGRUNTIME swig_type_info *
568
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
569
+ swig_type_info *lastty = ty;
570
+ if (!ty || !ty->dcast) return ty;
571
+ while (ty && (ty->dcast)) {
572
+ ty = (*ty->dcast)(ptr);
573
+ if (ty) lastty = ty;
574
+ }
575
+ return lastty;
576
+ }
577
+
578
+ /*
579
+ Return the name associated with this type
580
+ */
581
+ SWIGRUNTIMEINLINE const char *
582
+ SWIG_TypeName(const swig_type_info *ty) {
583
+ return ty->name;
584
+ }
585
+
586
+ /*
587
+ Return the pretty name associated with this type,
588
+ that is an unmangled type name in a form presentable to the user.
589
+ */
590
+ SWIGRUNTIME const char *
591
+ SWIG_TypePrettyName(const swig_type_info *type) {
592
+ /* The "str" field contains the equivalent pretty names of the
593
+ type, separated by vertical-bar characters. We choose
594
+ to print the last name, as it is often (?) the most
595
+ specific. */
596
+ if (!type) return NULL;
597
+ if (type->str != NULL) {
598
+ const char *last_name = type->str;
599
+ const char *s;
600
+ for (s = type->str; *s; s++)
601
+ if (*s == '|') last_name = s+1;
602
+ return last_name;
603
+ }
604
+ else
605
+ return type->name;
606
+ }
607
+
608
+ /*
609
+ Set the clientdata field for a type
610
+ */
611
+ SWIGRUNTIME void
612
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
613
+ swig_cast_info *cast = ti->cast;
614
+ /* if (ti->clientdata == clientdata) return; */
615
+ ti->clientdata = clientdata;
616
+
617
+ while (cast) {
618
+ if (!cast->converter) {
619
+ swig_type_info *tc = cast->type;
620
+ if (!tc->clientdata) {
621
+ SWIG_TypeClientData(tc, clientdata);
622
+ }
623
+ }
624
+ cast = cast->next;
625
+ }
626
+ }
627
+ SWIGRUNTIME void
628
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
629
+ SWIG_TypeClientData(ti, clientdata);
630
+ ti->owndata = 1;
631
+ }
632
+
633
+ /*
634
+ Search for a swig_type_info structure only by mangled name
635
+ Search is a O(log #types)
636
+
637
+ We start searching at module start, and finish searching when start == end.
638
+ Note: if start == end at the beginning of the function, we go all the way around
639
+ the circular list.
640
+ */
641
+ SWIGRUNTIME swig_type_info *
642
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
643
+ swig_module_info *end,
644
+ const char *name) {
645
+ swig_module_info *iter = start;
646
+ do {
647
+ if (iter->size) {
648
+ register size_t l = 0;
649
+ register size_t r = iter->size - 1;
650
+ do {
651
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
652
+ register size_t i = (l + r) >> 1;
653
+ const char *iname = iter->types[i]->name;
654
+ if (iname) {
655
+ register int compare = strcmp(name, iname);
656
+ if (compare == 0) {
657
+ return iter->types[i];
658
+ } else if (compare < 0) {
659
+ if (i) {
660
+ r = i - 1;
661
+ } else {
662
+ break;
663
+ }
664
+ } else if (compare > 0) {
665
+ l = i + 1;
666
+ }
667
+ } else {
668
+ break; /* should never happen */
669
+ }
670
+ } while (l <= r);
671
+ }
672
+ iter = iter->next;
673
+ } while (iter != end);
674
+ return 0;
675
+ }
676
+
677
+ /*
678
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
679
+ It first searches the mangled names of the types, which is a O(log #types)
680
+ If a type is not found it then searches the human readable names, which is O(#types).
681
+
682
+ We start searching at module start, and finish searching when start == end.
683
+ Note: if start == end at the beginning of the function, we go all the way around
684
+ the circular list.
685
+ */
686
+ SWIGRUNTIME swig_type_info *
687
+ SWIG_TypeQueryModule(swig_module_info *start,
688
+ swig_module_info *end,
689
+ const char *name) {
690
+ /* STEP 1: Search the name field using binary search */
691
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
692
+ if (ret) {
693
+ return ret;
694
+ } else {
695
+ /* STEP 2: If the type hasn't been found, do a complete search
696
+ of the str field (the human readable name) */
697
+ swig_module_info *iter = start;
698
+ do {
699
+ register size_t i = 0;
700
+ for (; i < iter->size; ++i) {
701
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
702
+ return iter->types[i];
703
+ }
704
+ iter = iter->next;
705
+ } while (iter != end);
706
+ }
707
+
708
+ /* neither found a match */
709
+ return 0;
710
+ }
711
+
712
+ /*
713
+ Pack binary data into a string
714
+ */
715
+ SWIGRUNTIME char *
716
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
717
+ static const char hex[17] = "0123456789abcdef";
718
+ register const unsigned char *u = (unsigned char *) ptr;
719
+ register const unsigned char *eu = u + sz;
720
+ for (; u != eu; ++u) {
721
+ register unsigned char uu = *u;
722
+ *(c++) = hex[(uu & 0xf0) >> 4];
723
+ *(c++) = hex[uu & 0xf];
724
+ }
725
+ return c;
726
+ }
727
+
728
+ /*
729
+ Unpack binary data from a string
730
+ */
731
+ SWIGRUNTIME const char *
732
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
733
+ register unsigned char *u = (unsigned char *) ptr;
734
+ register const unsigned char *eu = u + sz;
735
+ for (; u != eu; ++u) {
736
+ register char d = *(c++);
737
+ register unsigned char uu;
738
+ if ((d >= '0') && (d <= '9'))
739
+ uu = ((d - '0') << 4);
740
+ else if ((d >= 'a') && (d <= 'f'))
741
+ uu = ((d - ('a'-10)) << 4);
742
+ else
743
+ return (char *) 0;
744
+ d = *(c++);
745
+ if ((d >= '0') && (d <= '9'))
746
+ uu |= (d - '0');
747
+ else if ((d >= 'a') && (d <= 'f'))
748
+ uu |= (d - ('a'-10));
749
+ else
750
+ return (char *) 0;
751
+ *u = uu;
752
+ }
753
+ return c;
754
+ }
755
+
756
+ /*
757
+ Pack 'void *' into a string buffer.
758
+ */
759
+ SWIGRUNTIME char *
760
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
761
+ char *r = buff;
762
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
763
+ *(r++) = '_';
764
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
765
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
766
+ strcpy(r,name);
767
+ return buff;
768
+ }
769
+
770
+ SWIGRUNTIME const char *
771
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
772
+ if (*c != '_') {
773
+ if (strcmp(c,"NULL") == 0) {
774
+ *ptr = (void *) 0;
775
+ return name;
776
+ } else {
777
+ return 0;
778
+ }
779
+ }
780
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
781
+ }
782
+
783
+ SWIGRUNTIME char *
784
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
785
+ char *r = buff;
786
+ size_t lname = (name ? strlen(name) : 0);
787
+ if ((2*sz + 2 + lname) > bsz) return 0;
788
+ *(r++) = '_';
789
+ r = SWIG_PackData(r,ptr,sz);
790
+ if (lname) {
791
+ strncpy(r,name,lname+1);
792
+ } else {
793
+ *r = 0;
794
+ }
795
+ return buff;
796
+ }
797
+
798
+ SWIGRUNTIME const char *
799
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
800
+ if (*c != '_') {
801
+ if (strcmp(c,"NULL") == 0) {
802
+ memset(ptr,0,sz);
803
+ return name;
804
+ } else {
805
+ return 0;
806
+ }
807
+ }
808
+ return SWIG_UnpackData(++c,ptr,sz);
809
+ }
810
+
811
+ #ifdef __cplusplus
812
+ }
813
+ #endif
814
+
815
+ /* Errors in SWIG */
816
+ #define SWIG_UnknownError -1
817
+ #define SWIG_IOError -2
818
+ #define SWIG_RuntimeError -3
819
+ #define SWIG_IndexError -4
820
+ #define SWIG_TypeError -5
821
+ #define SWIG_DivisionByZero -6
822
+ #define SWIG_OverflowError -7
823
+ #define SWIG_SyntaxError -8
824
+ #define SWIG_ValueError -9
825
+ #define SWIG_SystemError -10
826
+ #define SWIG_AttributeError -11
827
+ #define SWIG_MemoryError -12
828
+ #define SWIG_NullReferenceError -13
829
+
830
+
831
+
832
+ #include <ruby.h>
833
+
834
+ /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
835
+ * breaks using rb_intern as an lvalue, as SWIG does. We work around this
836
+ * issue for now by disabling this.
837
+ * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
838
+ */
839
+ #ifdef rb_intern
840
+ # undef rb_intern
841
+ #endif
842
+
843
+ /* Remove global macros defined in Ruby's win32.h */
844
+ #ifdef write
845
+ # undef write
846
+ #endif
847
+ #ifdef read
848
+ # undef read
849
+ #endif
850
+ #ifdef bind
851
+ # undef bind
852
+ #endif
853
+ #ifdef close
854
+ # undef close
855
+ #endif
856
+ #ifdef connect
857
+ # undef connect
858
+ #endif
859
+
860
+
861
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
862
+ #ifndef NUM2LL
863
+ #define NUM2LL(x) NUM2LONG((x))
864
+ #endif
865
+ #ifndef LL2NUM
866
+ #define LL2NUM(x) INT2NUM((long) (x))
867
+ #endif
868
+ #ifndef ULL2NUM
869
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
870
+ #endif
871
+
872
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
873
+ #ifndef NUM2ULL
874
+ #ifdef HAVE_LONG_LONG
875
+ #define NUM2ULL(x) rb_num2ull((x))
876
+ #else
877
+ #define NUM2ULL(x) NUM2ULONG(x)
878
+ #endif
879
+ #endif
880
+
881
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
882
+ /* Define these for older versions so we can just write code the new way */
883
+ #ifndef RSTRING_LEN
884
+ # define RSTRING_LEN(x) RSTRING(x)->len
885
+ #endif
886
+ #ifndef RSTRING_PTR
887
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
888
+ #endif
889
+ #ifndef RSTRING_END
890
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
891
+ #endif
892
+ #ifndef RARRAY_LEN
893
+ # define RARRAY_LEN(x) RARRAY(x)->len
894
+ #endif
895
+ #ifndef RARRAY_PTR
896
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
897
+ #endif
898
+ #ifndef RFLOAT_VALUE
899
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
900
+ #endif
901
+ #ifndef DOUBLE2NUM
902
+ # define DOUBLE2NUM(x) rb_float_new(x)
903
+ #endif
904
+ #ifndef RHASH_TBL
905
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
906
+ #endif
907
+ #ifndef RHASH_ITER_LEV
908
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
909
+ #endif
910
+ #ifndef RHASH_IFNONE
911
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
912
+ #endif
913
+ #ifndef RHASH_SIZE
914
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
915
+ #endif
916
+ #ifndef RHASH_EMPTY_P
917
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
918
+ #endif
919
+ #ifndef RSTRUCT_LEN
920
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
921
+ #endif
922
+ #ifndef RSTRUCT_PTR
923
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
924
+ #endif
925
+
926
+
927
+
928
+ /*
929
+ * Need to be very careful about how these macros are defined, especially
930
+ * when compiling C++ code or C code with an ANSI C compiler.
931
+ *
932
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
933
+ * a Ruby method so that it can be passed as an argument to API functions
934
+ * like rb_define_method() and rb_define_singleton_method().
935
+ *
936
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
937
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
938
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
939
+ * and Data_Make_Struct().
940
+ */
941
+
942
+ #ifdef __cplusplus
943
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
944
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
945
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
946
+ # define VOIDFUNC(f) ((void (*)()) f)
947
+ # else
948
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
949
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
950
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
951
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
952
+ # else /* These definitions should work for Ruby 1.7+ */
953
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
954
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
955
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
956
+ # endif
957
+ # endif
958
+ #else
959
+ # define VALUEFUNC(f) (f)
960
+ # define VOIDFUNC(f) (f)
961
+ #endif
962
+
963
+ /* Don't use for expressions have side effect */
964
+ #ifndef RB_STRING_VALUE
965
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
966
+ #endif
967
+ #ifndef StringValue
968
+ #define StringValue(s) RB_STRING_VALUE(s)
969
+ #endif
970
+ #ifndef StringValuePtr
971
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
972
+ #endif
973
+ #ifndef StringValueLen
974
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
975
+ #endif
976
+ #ifndef SafeStringValue
977
+ #define SafeStringValue(v) do {\
978
+ StringValue(v);\
979
+ rb_check_safe_str(v);\
980
+ } while (0)
981
+ #endif
982
+
983
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
984
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
985
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
986
+ #endif
987
+
988
+ static VALUE _mSWIG = Qnil;
989
+
990
+ /* -----------------------------------------------------------------------------
991
+ * error manipulation
992
+ * ----------------------------------------------------------------------------- */
993
+
994
+
995
+ /* Define some additional error types */
996
+ #define SWIG_ObjectPreviouslyDeletedError -100
997
+
998
+
999
+ /* Define custom exceptions for errors that do not map to existing Ruby
1000
+ exceptions. Note this only works for C++ since a global cannot be
1001
+ initialized by a function in C. For C, fallback to rb_eRuntimeError.*/
1002
+
1003
+ SWIGINTERN VALUE
1004
+ getNullReferenceError(void) {
1005
+ static int init = 0;
1006
+ static VALUE rb_eNullReferenceError ;
1007
+ if (!init) {
1008
+ init = 1;
1009
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
1010
+ }
1011
+ return rb_eNullReferenceError;
1012
+ }
1013
+
1014
+ SWIGINTERN VALUE
1015
+ getObjectPreviouslyDeletedError(void) {
1016
+ static int init = 0;
1017
+ static VALUE rb_eObjectPreviouslyDeleted ;
1018
+ if (!init) {
1019
+ init = 1;
1020
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
1021
+ }
1022
+ return rb_eObjectPreviouslyDeleted;
1023
+ }
1024
+
1025
+
1026
+ SWIGINTERN VALUE
1027
+ SWIG_Ruby_ErrorType(int SWIG_code) {
1028
+ VALUE type;
1029
+ switch (SWIG_code) {
1030
+ case SWIG_MemoryError:
1031
+ type = rb_eNoMemError;
1032
+ break;
1033
+ case SWIG_IOError:
1034
+ type = rb_eIOError;
1035
+ break;
1036
+ case SWIG_RuntimeError:
1037
+ type = rb_eRuntimeError;
1038
+ break;
1039
+ case SWIG_IndexError:
1040
+ type = rb_eIndexError;
1041
+ break;
1042
+ case SWIG_TypeError:
1043
+ type = rb_eTypeError;
1044
+ break;
1045
+ case SWIG_DivisionByZero:
1046
+ type = rb_eZeroDivError;
1047
+ break;
1048
+ case SWIG_OverflowError:
1049
+ type = rb_eRangeError;
1050
+ break;
1051
+ case SWIG_SyntaxError:
1052
+ type = rb_eSyntaxError;
1053
+ break;
1054
+ case SWIG_ValueError:
1055
+ type = rb_eArgError;
1056
+ break;
1057
+ case SWIG_SystemError:
1058
+ type = rb_eFatal;
1059
+ break;
1060
+ case SWIG_AttributeError:
1061
+ type = rb_eRuntimeError;
1062
+ break;
1063
+ case SWIG_NullReferenceError:
1064
+ type = getNullReferenceError();
1065
+ break;
1066
+ case SWIG_ObjectPreviouslyDeletedError:
1067
+ type = getObjectPreviouslyDeletedError();
1068
+ break;
1069
+ case SWIG_UnknownError:
1070
+ type = rb_eRuntimeError;
1071
+ break;
1072
+ default:
1073
+ type = rb_eRuntimeError;
1074
+ }
1075
+ return type;
1076
+ }
1077
+
1078
+
1079
+ /* This function is called when a user inputs a wrong argument to
1080
+ a method.
1081
+ */
1082
+ SWIGINTERN
1083
+ const char* Ruby_Format_TypeError( const char* msg,
1084
+ const char* type,
1085
+ const char* name,
1086
+ const int argn,
1087
+ VALUE input )
1088
+ {
1089
+ char buf[128];
1090
+ VALUE str;
1091
+ VALUE asStr;
1092
+ if ( msg && *msg )
1093
+ {
1094
+ str = rb_str_new2(msg);
1095
+ }
1096
+ else
1097
+ {
1098
+ str = rb_str_new(NULL, 0);
1099
+ }
1100
+
1101
+ str = rb_str_cat2( str, "Expected argument " );
1102
+ sprintf( buf, "%d of type ", argn-1 );
1103
+ str = rb_str_cat2( str, buf );
1104
+ str = rb_str_cat2( str, type );
1105
+ str = rb_str_cat2( str, ", but got " );
1106
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1107
+ str = rb_str_cat2( str, " " );
1108
+ asStr = rb_inspect(input);
1109
+ if ( RSTRING_LEN(asStr) > 30 )
1110
+ {
1111
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1112
+ str = rb_str_cat2( str, "..." );
1113
+ }
1114
+ else
1115
+ {
1116
+ str = rb_str_append( str, asStr );
1117
+ }
1118
+
1119
+ if ( name )
1120
+ {
1121
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1122
+ str = rb_str_cat2( str, name );
1123
+ str = rb_str_cat2( str, "'" );
1124
+ }
1125
+
1126
+ return StringValuePtr( str );
1127
+ }
1128
+
1129
+ /* This function is called when an overloaded method fails */
1130
+ SWIGINTERN
1131
+ void Ruby_Format_OverloadedError(
1132
+ const int argc,
1133
+ const int maxargs,
1134
+ const char* method,
1135
+ const char* prototypes
1136
+ )
1137
+ {
1138
+ const char* msg = "Wrong # of arguments";
1139
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1140
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1141
+ "Possible C/C++ prototypes are:\n%s",
1142
+ msg, method, prototypes);
1143
+ }
1144
+
1145
+ /* -----------------------------------------------------------------------------
1146
+ * rubytracking.swg
1147
+ *
1148
+ * This file contains support for tracking mappings from
1149
+ * Ruby objects to C++ objects. This functionality is needed
1150
+ * to implement mark functions for Ruby's mark and sweep
1151
+ * garbage collector.
1152
+ * ----------------------------------------------------------------------------- */
1153
+
1154
+ #ifdef __cplusplus
1155
+ extern "C" {
1156
+ #endif
1157
+
1158
+ /* Ruby 1.8 actually assumes the first case. */
1159
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1160
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1161
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1162
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1163
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1164
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1165
+ #else
1166
+ # error sizeof(void*) is not the same as long or long long
1167
+ #endif
1168
+
1169
+
1170
+ /* Global Ruby hash table to store Trackings from C/C++
1171
+ structs to Ruby Objects.
1172
+ */
1173
+ static VALUE swig_ruby_trackings = Qnil;
1174
+
1175
+ /* Global variable that stores a reference to the ruby
1176
+ hash table delete function. */
1177
+ static ID swig_ruby_hash_delete;
1178
+
1179
+ /* Setup a Ruby hash table to store Trackings */
1180
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1181
+ /* Create a ruby hash table to store Trackings from C++
1182
+ objects to Ruby objects. */
1183
+
1184
+ /* Try to see if some other .so has already created a
1185
+ tracking hash table, which we keep hidden in an instance var
1186
+ in the SWIG module.
1187
+ This is done to allow multiple DSOs to share the same
1188
+ tracking table.
1189
+ */
1190
+ ID trackings_id = rb_intern( "@__trackings__" );
1191
+ VALUE verbose = rb_gv_get("VERBOSE");
1192
+ rb_gv_set("VERBOSE", Qfalse);
1193
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1194
+ rb_gv_set("VERBOSE", verbose);
1195
+
1196
+ /* No, it hasn't. Create one ourselves */
1197
+ if ( swig_ruby_trackings == Qnil )
1198
+ {
1199
+ swig_ruby_trackings = rb_hash_new();
1200
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1201
+ }
1202
+
1203
+ /* Now store a reference to the hash table delete function
1204
+ so that we only have to look it up once.*/
1205
+ swig_ruby_hash_delete = rb_intern("delete");
1206
+ }
1207
+
1208
+ /* Get a Ruby number to reference a pointer */
1209
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1210
+ /* We cast the pointer to an unsigned long
1211
+ and then store a reference to it using
1212
+ a Ruby number object. */
1213
+
1214
+ /* Convert the pointer to a Ruby number */
1215
+ return SWIG2NUM(ptr);
1216
+ }
1217
+
1218
+ /* Get a Ruby number to reference an object */
1219
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1220
+ /* We cast the object to an unsigned long
1221
+ and then store a reference to it using
1222
+ a Ruby number object. */
1223
+
1224
+ /* Convert the Object to a Ruby number */
1225
+ return SWIG2NUM(object);
1226
+ }
1227
+
1228
+ /* Get a Ruby object from a previously stored reference */
1229
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1230
+ /* The provided Ruby number object is a reference
1231
+ to the Ruby object we want.*/
1232
+
1233
+ /* Convert the Ruby number to a Ruby object */
1234
+ return NUM2SWIG(reference);
1235
+ }
1236
+
1237
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1238
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1239
+ /* In a Ruby hash table we store the pointer and
1240
+ the associated Ruby object. The trick here is
1241
+ that we cannot store the Ruby object directly - if
1242
+ we do then it cannot be garbage collected. So
1243
+ instead we typecast it as a unsigned long and
1244
+ convert it to a Ruby number object.*/
1245
+
1246
+ /* Get a reference to the pointer as a Ruby number */
1247
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1248
+
1249
+ /* Get a reference to the Ruby object as a Ruby number */
1250
+ VALUE value = SWIG_RubyObjectToReference(object);
1251
+
1252
+ /* Store the mapping to the global hash table. */
1253
+ rb_hash_aset(swig_ruby_trackings, key, value);
1254
+ }
1255
+
1256
+ /* Get the Ruby object that owns the specified C/C++ struct */
1257
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1258
+ /* Get a reference to the pointer as a Ruby number */
1259
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1260
+
1261
+ /* Now lookup the value stored in the global hash table */
1262
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1263
+
1264
+ if (value == Qnil) {
1265
+ /* No object exists - return nil. */
1266
+ return Qnil;
1267
+ }
1268
+ else {
1269
+ /* Convert this value to Ruby object */
1270
+ return SWIG_RubyReferenceToObject(value);
1271
+ }
1272
+ }
1273
+
1274
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1275
+ is very important to remove objects once they are destroyed
1276
+ since the same memory address may be reused later to create
1277
+ a new object. */
1278
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1279
+ /* Get a reference to the pointer as a Ruby number */
1280
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1281
+
1282
+ /* Delete the object from the hash table by calling Ruby's
1283
+ do this we need to call the Hash.delete method.*/
1284
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1285
+ }
1286
+
1287
+ /* This is a helper method that unlinks a Ruby object from its
1288
+ underlying C++ object. This is needed if the lifetime of the
1289
+ Ruby object is longer than the C++ object */
1290
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1291
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1292
+
1293
+ if (object != Qnil) {
1294
+ DATA_PTR(object) = 0;
1295
+ }
1296
+ }
1297
+
1298
+
1299
+ #ifdef __cplusplus
1300
+ }
1301
+ #endif
1302
+
1303
+ /* -----------------------------------------------------------------------------
1304
+ * Ruby API portion that goes into the runtime
1305
+ * ----------------------------------------------------------------------------- */
1306
+
1307
+ #ifdef __cplusplus
1308
+ extern "C" {
1309
+ #endif
1310
+
1311
+ SWIGINTERN VALUE
1312
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1313
+ if (NIL_P(target)) {
1314
+ target = o;
1315
+ } else {
1316
+ if (TYPE(target) != T_ARRAY) {
1317
+ VALUE o2 = target;
1318
+ target = rb_ary_new();
1319
+ rb_ary_push(target, o2);
1320
+ }
1321
+ rb_ary_push(target, o);
1322
+ }
1323
+ return target;
1324
+ }
1325
+
1326
+ /* For ruby1.8.4 and earlier. */
1327
+ #ifndef RUBY_INIT_STACK
1328
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1329
+ # define RUBY_INIT_STACK \
1330
+ VALUE variable_in_this_stack_frame; \
1331
+ Init_stack(&variable_in_this_stack_frame);
1332
+ #endif
1333
+
1334
+
1335
+ #ifdef __cplusplus
1336
+ }
1337
+ #endif
1338
+
1339
+
1340
+ /* -----------------------------------------------------------------------------
1341
+ * rubyrun.swg
1342
+ *
1343
+ * This file contains the runtime support for Ruby modules
1344
+ * and includes code for managing global variables and pointer
1345
+ * type checking.
1346
+ * ----------------------------------------------------------------------------- */
1347
+
1348
+ /* For backward compatibility only */
1349
+ #define SWIG_POINTER_EXCEPTION 0
1350
+
1351
+ /* for raw pointers */
1352
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1353
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1354
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1355
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1356
+ #define swig_owntype ruby_owntype
1357
+
1358
+ /* for raw packed data */
1359
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1360
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1361
+
1362
+ /* for class or struct pointers */
1363
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1364
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1365
+
1366
+ /* for C or C++ function pointers */
1367
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1368
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1369
+
1370
+ /* for C++ member pointers, ie, member methods */
1371
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1372
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1373
+
1374
+
1375
+ /* Runtime API */
1376
+
1377
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1378
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1379
+
1380
+
1381
+ /* Error manipulation */
1382
+
1383
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1384
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
1385
+ #define SWIG_fail goto fail
1386
+
1387
+
1388
+ /* Ruby-specific SWIG API */
1389
+
1390
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1391
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1392
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1393
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1394
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1395
+
1396
+ #include "assert.h"
1397
+
1398
+ /* -----------------------------------------------------------------------------
1399
+ * pointers/data manipulation
1400
+ * ----------------------------------------------------------------------------- */
1401
+
1402
+ #ifdef __cplusplus
1403
+ extern "C" {
1404
+ #endif
1405
+
1406
+ typedef struct {
1407
+ VALUE klass;
1408
+ VALUE mImpl;
1409
+ void (*mark)(void *);
1410
+ void (*destroy)(void *);
1411
+ int trackObjects;
1412
+ } swig_class;
1413
+
1414
+
1415
+ /* Global pointer used to keep some internal SWIG stuff */
1416
+ static VALUE _cSWIG_Pointer = Qnil;
1417
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1418
+
1419
+ /* Global IDs used to keep some internal SWIG stuff */
1420
+ static ID swig_arity_id = 0;
1421
+ static ID swig_call_id = 0;
1422
+
1423
+ /*
1424
+ If your swig extension is to be run within an embedded ruby and has
1425
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1426
+ This will reset ruby's stack frame on each entry point from the main
1427
+ program the first time a virtual director function is invoked (in a
1428
+ non-recursive way).
1429
+ If this is not done, you run the risk of Ruby trashing the stack.
1430
+ */
1431
+
1432
+ #ifdef RUBY_EMBEDDED
1433
+
1434
+ # define SWIG_INIT_STACK \
1435
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1436
+ ++swig_virtual_calls;
1437
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1438
+ # define Ruby_DirectorTypeMismatchException(x) \
1439
+ rb_raise( rb_eTypeError, "%s", x ); return c_result;
1440
+
1441
+ static unsigned int swig_virtual_calls = 0;
1442
+
1443
+ #else /* normal non-embedded extension */
1444
+
1445
+ # define SWIG_INIT_STACK
1446
+ # define SWIG_RELEASE_STACK
1447
+ # define Ruby_DirectorTypeMismatchException(x) \
1448
+ throw Swig::DirectorTypeMismatchException( x );
1449
+
1450
+ #endif /* RUBY_EMBEDDED */
1451
+
1452
+
1453
+ SWIGRUNTIME VALUE
1454
+ getExceptionClass(void) {
1455
+ static int init = 0;
1456
+ static VALUE rubyExceptionClass ;
1457
+ if (!init) {
1458
+ init = 1;
1459
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1460
+ }
1461
+ return rubyExceptionClass;
1462
+ }
1463
+
1464
+ /* This code checks to see if the Ruby object being raised as part
1465
+ of an exception inherits from the Ruby class Exception. If so,
1466
+ the object is simply returned. If not, then a new Ruby exception
1467
+ object is created and that will be returned to Ruby.*/
1468
+ SWIGRUNTIME VALUE
1469
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1470
+ VALUE exceptionClass = getExceptionClass();
1471
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1472
+ return obj;
1473
+ } else {
1474
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1475
+ }
1476
+ }
1477
+
1478
+ /* Initialize Ruby runtime support */
1479
+ SWIGRUNTIME void
1480
+ SWIG_Ruby_InitRuntime(void)
1481
+ {
1482
+ if (_mSWIG == Qnil) {
1483
+ _mSWIG = rb_define_module("SWIG");
1484
+ swig_call_id = rb_intern("call");
1485
+ swig_arity_id = rb_intern("arity");
1486
+ }
1487
+ }
1488
+
1489
+ /* Define Ruby class for C type */
1490
+ SWIGRUNTIME void
1491
+ SWIG_Ruby_define_class(swig_type_info *type)
1492
+ {
1493
+ VALUE klass;
1494
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1495
+ sprintf(klass_name, "TYPE%s", type->name);
1496
+ if (NIL_P(_cSWIG_Pointer)) {
1497
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1498
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1499
+ }
1500
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1501
+ free((void *) klass_name);
1502
+ }
1503
+
1504
+ /* Create a new pointer object */
1505
+ SWIGRUNTIME VALUE
1506
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1507
+ {
1508
+ int own = flags & SWIG_POINTER_OWN;
1509
+ int track;
1510
+ char *klass_name;
1511
+ swig_class *sklass;
1512
+ VALUE klass;
1513
+ VALUE obj;
1514
+
1515
+ if (!ptr)
1516
+ return Qnil;
1517
+
1518
+ if (type->clientdata) {
1519
+ sklass = (swig_class *) type->clientdata;
1520
+
1521
+ /* Are we tracking this class and have we already returned this Ruby object? */
1522
+ track = sklass->trackObjects;
1523
+ if (track) {
1524
+ obj = SWIG_RubyInstanceFor(ptr);
1525
+
1526
+ /* Check the object's type and make sure it has the correct type.
1527
+ It might not in cases where methods do things like
1528
+ downcast methods. */
1529
+ if (obj != Qnil) {
1530
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1531
+ const char* type_name = RSTRING_PTR(value);
1532
+
1533
+ if (strcmp(type->name, type_name) == 0) {
1534
+ return obj;
1535
+ }
1536
+ }
1537
+ }
1538
+
1539
+ /* Create a new Ruby object */
1540
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1541
+ ( own ? VOIDFUNC(sklass->destroy) :
1542
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1543
+ ), ptr);
1544
+
1545
+ /* If tracking is on for this class then track this object. */
1546
+ if (track) {
1547
+ SWIG_RubyAddTracking(ptr, obj);
1548
+ }
1549
+ } else {
1550
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1551
+ sprintf(klass_name, "TYPE%s", type->name);
1552
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1553
+ free((void *) klass_name);
1554
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1555
+ }
1556
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1557
+
1558
+ return obj;
1559
+ }
1560
+
1561
+ /* Create a new class instance (always owned) */
1562
+ SWIGRUNTIME VALUE
1563
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1564
+ {
1565
+ VALUE obj;
1566
+ swig_class *sklass = (swig_class *) type->clientdata;
1567
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1568
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1569
+ return obj;
1570
+ }
1571
+
1572
+ /* Get type mangle from class name */
1573
+ SWIGRUNTIMEINLINE char *
1574
+ SWIG_Ruby_MangleStr(VALUE obj)
1575
+ {
1576
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1577
+ return StringValuePtr(stype);
1578
+ }
1579
+
1580
+ /* Acquire a pointer value */
1581
+ typedef void (*ruby_owntype)(void*);
1582
+
1583
+ SWIGRUNTIME ruby_owntype
1584
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1585
+ if (obj) {
1586
+ ruby_owntype oldown = RDATA(obj)->dfree;
1587
+ RDATA(obj)->dfree = own;
1588
+ return oldown;
1589
+ } else {
1590
+ return 0;
1591
+ }
1592
+ }
1593
+
1594
+ /* Convert a pointer value */
1595
+ SWIGRUNTIME int
1596
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1597
+ {
1598
+ char *c;
1599
+ swig_cast_info *tc;
1600
+ void *vptr = 0;
1601
+
1602
+ /* Grab the pointer */
1603
+ if (NIL_P(obj)) {
1604
+ *ptr = 0;
1605
+ return SWIG_OK;
1606
+ } else {
1607
+ if (TYPE(obj) != T_DATA) {
1608
+ return SWIG_ERROR;
1609
+ }
1610
+ Data_Get_Struct(obj, void, vptr);
1611
+ }
1612
+
1613
+ if (own) *own = RDATA(obj)->dfree;
1614
+
1615
+ /* Check to see if the input object is giving up ownership
1616
+ of the underlying C struct or C++ object. If so then we
1617
+ need to reset the destructor since the Ruby object no
1618
+ longer owns the underlying C++ object.*/
1619
+ if (flags & SWIG_POINTER_DISOWN) {
1620
+ /* Is tracking on for this class? */
1621
+ int track = 0;
1622
+ if (ty && ty->clientdata) {
1623
+ swig_class *sklass = (swig_class *) ty->clientdata;
1624
+ track = sklass->trackObjects;
1625
+ }
1626
+
1627
+ if (track) {
1628
+ /* We are tracking objects for this class. Thus we change the destructor
1629
+ * to SWIG_RubyRemoveTracking. This allows us to
1630
+ * remove the mapping from the C++ to Ruby object
1631
+ * when the Ruby object is garbage collected. If we don't
1632
+ * do this, then it is possible we will return a reference
1633
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1634
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1635
+ } else {
1636
+ RDATA(obj)->dfree = 0;
1637
+ }
1638
+ }
1639
+
1640
+ /* Do type-checking if type info was provided */
1641
+ if (ty) {
1642
+ if (ty->clientdata) {
1643
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1644
+ if (vptr == 0) {
1645
+ /* The object has already been deleted */
1646
+ return SWIG_ObjectPreviouslyDeletedError;
1647
+ }
1648
+ *ptr = vptr;
1649
+ return SWIG_OK;
1650
+ }
1651
+ }
1652
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1653
+ return SWIG_ERROR;
1654
+ }
1655
+ tc = SWIG_TypeCheck(c, ty);
1656
+ if (!tc) {
1657
+ return SWIG_ERROR;
1658
+ } else {
1659
+ int newmemory = 0;
1660
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1661
+ assert(!newmemory); /* newmemory handling not yet implemented */
1662
+ }
1663
+ } else {
1664
+ *ptr = vptr;
1665
+ }
1666
+
1667
+ return SWIG_OK;
1668
+ }
1669
+
1670
+ /* Check convert */
1671
+ SWIGRUNTIMEINLINE int
1672
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1673
+ {
1674
+ char *c = SWIG_MangleStr(obj);
1675
+ if (!c) return 0;
1676
+ return SWIG_TypeCheck(c,ty) != 0;
1677
+ }
1678
+
1679
+ SWIGRUNTIME VALUE
1680
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1681
+ char result[1024];
1682
+ char *r = result;
1683
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1684
+ *(r++) = '_';
1685
+ r = SWIG_PackData(r, ptr, sz);
1686
+ strcpy(r, type->name);
1687
+ return rb_str_new2(result);
1688
+ }
1689
+
1690
+ /* Convert a packed value value */
1691
+ SWIGRUNTIME int
1692
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1693
+ swig_cast_info *tc;
1694
+ const char *c;
1695
+
1696
+ if (TYPE(obj) != T_STRING) goto type_error;
1697
+ c = StringValuePtr(obj);
1698
+ /* Pointer values must start with leading underscore */
1699
+ if (*c != '_') goto type_error;
1700
+ c++;
1701
+ c = SWIG_UnpackData(c, ptr, sz);
1702
+ if (ty) {
1703
+ tc = SWIG_TypeCheck(c, ty);
1704
+ if (!tc) goto type_error;
1705
+ }
1706
+ return SWIG_OK;
1707
+
1708
+ type_error:
1709
+ return SWIG_ERROR;
1710
+ }
1711
+
1712
+ SWIGRUNTIME swig_module_info *
1713
+ SWIG_Ruby_GetModule(void)
1714
+ {
1715
+ VALUE pointer;
1716
+ swig_module_info *ret = 0;
1717
+ VALUE verbose = rb_gv_get("VERBOSE");
1718
+
1719
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1720
+ rb_gv_set("VERBOSE", Qfalse);
1721
+
1722
+ /* first check if pointer already created */
1723
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1724
+ if (pointer != Qnil) {
1725
+ Data_Get_Struct(pointer, swig_module_info, ret);
1726
+ }
1727
+
1728
+ /* reinstate warnings */
1729
+ rb_gv_set("VERBOSE", verbose);
1730
+ return ret;
1731
+ }
1732
+
1733
+ SWIGRUNTIME void
1734
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1735
+ {
1736
+ /* register a new class */
1737
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1738
+ /* create and store the structure pointer to a global variable */
1739
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1740
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1741
+ }
1742
+
1743
+ /* This function can be used to check whether a proc or method or similarly
1744
+ callable function has been passed. Usually used in a %typecheck, like:
1745
+
1746
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1747
+ $result = SWIG_Ruby_isCallable( $input );
1748
+ }
1749
+ */
1750
+ SWIGINTERN
1751
+ int SWIG_Ruby_isCallable( VALUE proc )
1752
+ {
1753
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1754
+ return 1;
1755
+ return 0;
1756
+ }
1757
+
1758
+ /* This function can be used to check the arity (number of arguments)
1759
+ a proc or method can take. Usually used in a %typecheck.
1760
+ Valid arities will be that equal to minimal or those < 0
1761
+ which indicate a variable number of parameters at the end.
1762
+ */
1763
+ SWIGINTERN
1764
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1765
+ {
1766
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1767
+ {
1768
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1769
+ int arity = NUM2INT(num);
1770
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1771
+ if ( arity == minimal ) return 1;
1772
+ return 1;
1773
+ }
1774
+ return 0;
1775
+ }
1776
+
1777
+
1778
+ #ifdef __cplusplus
1779
+ }
1780
+ #endif
1781
+
1782
+
1783
+
1784
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1785
+
1786
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1787
+
1788
+
1789
+
1790
+ /* -------- TYPES TABLE (BEGIN) -------- */
1791
+
1792
+ #define SWIGTYPE_p_char swig_types[0]
1793
+ #define SWIGTYPE_p_f_int_int__int swig_types[1]
1794
+ #define SWIGTYPE_p_f_p_void__p_void swig_types[2]
1795
+ #define SWIGTYPE_p_f_void__void swig_types[3]
1796
+ #define SWIGTYPE_p_unsigned_char swig_types[4]
1797
+ static swig_type_info *swig_types[6];
1798
+ static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
1799
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1800
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1801
+
1802
+ /* -------- TYPES TABLE (END) -------- */
1803
+
1804
+ #define SWIG_init Init_wiringpi2
1805
+ #define SWIG_name "Wiringpi2"
1806
+
1807
+ static VALUE mWiringpi2;
1808
+
1809
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1810
+ #define SWIG_RUBY_THREAD_END_BLOCK
1811
+
1812
+
1813
+ #define SWIGVERSION 0x020007
1814
+ #define SWIG_VERSION SWIGVERSION
1815
+
1816
+
1817
+ #define SWIG_as_voidptr(a) (void *)((const void *)(a))
1818
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1819
+
1820
+
1821
+ #include "WiringPi/wiringPi/ds1302.h"
1822
+ #include "WiringPi/wiringPi/gertboard.h"
1823
+ #include "WiringPi/wiringPi/lcd.h"
1824
+ #include "WiringPi/wiringPi/mcp23008.h"
1825
+ #include "WiringPi/wiringPi/mcp23017.h"
1826
+ #include "WiringPi/wiringPi/mcp23s08.h"
1827
+ #include "WiringPi/wiringPi/mcp23s17.h"
1828
+ #include "WiringPi/wiringPi/mcp23x0817.h"
1829
+ #include "WiringPi/wiringPi/mcp23x08.h"
1830
+ #include "WiringPi/wiringPi/piFace.h"
1831
+ #include "WiringPi/wiringPi/piNes.h"
1832
+ #include "WiringPi/wiringPi/softPwm.h"
1833
+ #include "WiringPi/wiringPi/softServo.h"
1834
+ #include "WiringPi/wiringPi/softTone.h"
1835
+ #include "WiringPi/wiringPi/sr595.h"
1836
+ #include "WiringPi/wiringPi/wiringPi.h"
1837
+ #include "WiringPi/wiringPi/wiringPiI2C.h"
1838
+ #include "WiringPi/wiringPi/wiringPiSPI.h"
1839
+ #include "WiringPi/wiringPi/wiringSerial.h"
1840
+ #include "WiringPi/wiringPi/wiringShift.h"
1841
+
1842
+
1843
+ #include <limits.h>
1844
+ #if !defined(SWIG_NO_LLONG_MAX)
1845
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1846
+ # define LLONG_MAX __LONG_LONG_MAX__
1847
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1848
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1849
+ # endif
1850
+ #endif
1851
+
1852
+
1853
+ #define SWIG_From_long LONG2NUM
1854
+
1855
+
1856
+ SWIGINTERNINLINE VALUE
1857
+ SWIG_From_int (int value)
1858
+ {
1859
+ return SWIG_From_long (value);
1860
+ }
1861
+
1862
+
1863
+ SWIGINTERN VALUE
1864
+ SWIG_ruby_failed(void)
1865
+ {
1866
+ return Qnil;
1867
+ }
1868
+
1869
+
1870
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1871
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1872
+ {
1873
+ VALUE obj = args[0];
1874
+ VALUE type = TYPE(obj);
1875
+ long *res = (long *)(args[1]);
1876
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
1877
+ return obj;
1878
+ }
1879
+ /*@SWIG@*/
1880
+
1881
+ SWIGINTERN int
1882
+ SWIG_AsVal_long (VALUE obj, long* val)
1883
+ {
1884
+ VALUE type = TYPE(obj);
1885
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1886
+ long v;
1887
+ VALUE a[2];
1888
+ a[0] = obj;
1889
+ a[1] = (VALUE)(&v);
1890
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1891
+ if (val) *val = v;
1892
+ return SWIG_OK;
1893
+ }
1894
+ }
1895
+ return SWIG_TypeError;
1896
+ }
1897
+
1898
+
1899
+ SWIGINTERN int
1900
+ SWIG_AsVal_int (VALUE obj, int *val)
1901
+ {
1902
+ long v;
1903
+ int res = SWIG_AsVal_long (obj, &v);
1904
+ if (SWIG_IsOK(res)) {
1905
+ if ((v < INT_MIN || v > INT_MAX)) {
1906
+ return SWIG_OverflowError;
1907
+ } else {
1908
+ if (val) *val = (int)(v);
1909
+ }
1910
+ }
1911
+ return res;
1912
+ }
1913
+
1914
+
1915
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1916
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
1917
+ {
1918
+ VALUE obj = args[0];
1919
+ VALUE type = TYPE(obj);
1920
+ unsigned long *res = (unsigned long *)(args[1]);
1921
+ *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
1922
+ return obj;
1923
+ }
1924
+ /*@SWIG@*/
1925
+
1926
+ SWIGINTERN int
1927
+ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
1928
+ {
1929
+ VALUE type = TYPE(obj);
1930
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1931
+ unsigned long v;
1932
+ VALUE a[2];
1933
+ a[0] = obj;
1934
+ a[1] = (VALUE)(&v);
1935
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1936
+ if (val) *val = v;
1937
+ return SWIG_OK;
1938
+ }
1939
+ }
1940
+ return SWIG_TypeError;
1941
+ }
1942
+
1943
+
1944
+ SWIGINTERN int
1945
+ SWIG_AsVal_unsigned_SS_int (VALUE obj, unsigned int *val)
1946
+ {
1947
+ unsigned long v;
1948
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
1949
+ if (SWIG_IsOK(res)) {
1950
+ if ((v > UINT_MAX)) {
1951
+ return SWIG_OverflowError;
1952
+ } else {
1953
+ if (val) *val = (unsigned int)(v);
1954
+ }
1955
+ }
1956
+ return res;
1957
+ }
1958
+
1959
+
1960
+ SWIGINTERNINLINE VALUE
1961
+ SWIG_From_unsigned_SS_long (unsigned long value)
1962
+ {
1963
+ return ULONG2NUM(value);
1964
+ }
1965
+
1966
+
1967
+ SWIGINTERNINLINE VALUE
1968
+ SWIG_From_unsigned_SS_int (unsigned int value)
1969
+ {
1970
+ return SWIG_From_unsigned_SS_long (value);
1971
+ }
1972
+
1973
+
1974
+ SWIGINTERN swig_type_info*
1975
+ SWIG_pchar_descriptor(void)
1976
+ {
1977
+ static int init = 0;
1978
+ static swig_type_info* info = 0;
1979
+ if (!init) {
1980
+ info = SWIG_TypeQuery("_p_char");
1981
+ init = 1;
1982
+ }
1983
+ return info;
1984
+ }
1985
+
1986
+
1987
+ SWIGINTERN int
1988
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1989
+ {
1990
+ if (TYPE(obj) == T_STRING) {
1991
+ #if defined(StringValuePtr)
1992
+ char *cstr = StringValuePtr(obj);
1993
+ #else
1994
+ char *cstr = STR2CSTR(obj);
1995
+ #endif
1996
+ size_t size = RSTRING_LEN(obj) + 1;
1997
+ if (cptr) {
1998
+ if (alloc) {
1999
+ if (*alloc == SWIG_NEWOBJ) {
2000
+ *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
2001
+ } else {
2002
+ *cptr = cstr;
2003
+ *alloc = SWIG_OLDOBJ;
2004
+ }
2005
+ }
2006
+ }
2007
+ if (psize) *psize = size;
2008
+ return SWIG_OK;
2009
+ } else {
2010
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2011
+ if (pchar_descriptor) {
2012
+ void* vptr = 0;
2013
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
2014
+ if (cptr) *cptr = (char *)vptr;
2015
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
2016
+ if (alloc) *alloc = SWIG_OLDOBJ;
2017
+ return SWIG_OK;
2018
+ }
2019
+ }
2020
+ }
2021
+ return SWIG_TypeError;
2022
+ }
2023
+
2024
+
2025
+
2026
+
2027
+
2028
+ SWIGINTERN int
2029
+ SWIG_AsVal_unsigned_SS_char (VALUE obj, unsigned char *val)
2030
+ {
2031
+ unsigned long v;
2032
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
2033
+ if (SWIG_IsOK(res)) {
2034
+ if ((v > UCHAR_MAX)) {
2035
+ return SWIG_OverflowError;
2036
+ } else {
2037
+ if (val) *val = (unsigned char)(v);
2038
+ }
2039
+ }
2040
+ return res;
2041
+ }
2042
+
2043
+
2044
+ SWIGINTERNINLINE VALUE
2045
+ SWIG_From_unsigned_SS_char (unsigned char value)
2046
+ {
2047
+ return SWIG_From_unsigned_SS_long (value);
2048
+ }
2049
+
2050
+ SWIGINTERN VALUE
2051
+ _wrap_wiringPiSetup(int argc, VALUE *argv, VALUE self) {
2052
+ int result;
2053
+ VALUE vresult = Qnil;
2054
+
2055
+ if ((argc < 0) || (argc > 0)) {
2056
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2057
+ }
2058
+ result = (int)wiringPiSetup();
2059
+ vresult = SWIG_From_int((int)(result));
2060
+ return vresult;
2061
+ fail:
2062
+ return Qnil;
2063
+ }
2064
+
2065
+
2066
+ SWIGINTERN VALUE
2067
+ _wrap_wiringPiSetupSys(int argc, VALUE *argv, VALUE self) {
2068
+ int result;
2069
+ VALUE vresult = Qnil;
2070
+
2071
+ if ((argc < 0) || (argc > 0)) {
2072
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2073
+ }
2074
+ result = (int)wiringPiSetupSys();
2075
+ vresult = SWIG_From_int((int)(result));
2076
+ return vresult;
2077
+ fail:
2078
+ return Qnil;
2079
+ }
2080
+
2081
+
2082
+ SWIGINTERN VALUE
2083
+ _wrap_wiringPiSetupGpio(int argc, VALUE *argv, VALUE self) {
2084
+ int result;
2085
+ VALUE vresult = Qnil;
2086
+
2087
+ if ((argc < 0) || (argc > 0)) {
2088
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2089
+ }
2090
+ result = (int)wiringPiSetupGpio();
2091
+ vresult = SWIG_From_int((int)(result));
2092
+ return vresult;
2093
+ fail:
2094
+ return Qnil;
2095
+ }
2096
+
2097
+
2098
+ SWIGINTERN VALUE
2099
+ _wrap_wiringPiSetupPhys(int argc, VALUE *argv, VALUE self) {
2100
+ int result;
2101
+ VALUE vresult = Qnil;
2102
+
2103
+ if ((argc < 0) || (argc > 0)) {
2104
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2105
+ }
2106
+ result = (int)wiringPiSetupPhys();
2107
+ vresult = SWIG_From_int((int)(result));
2108
+ return vresult;
2109
+ fail:
2110
+ return Qnil;
2111
+ }
2112
+
2113
+
2114
+ SWIGINTERN VALUE
2115
+ _wrap_piFaceSetup(int argc, VALUE *argv, VALUE self) {
2116
+ int arg1 ;
2117
+ int val1 ;
2118
+ int ecode1 = 0 ;
2119
+ int result;
2120
+ VALUE vresult = Qnil;
2121
+
2122
+ if ((argc < 1) || (argc > 1)) {
2123
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2124
+ }
2125
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2126
+ if (!SWIG_IsOK(ecode1)) {
2127
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","piFaceSetup", 1, argv[0] ));
2128
+ }
2129
+ arg1 = (int)(val1);
2130
+ result = (int)piFaceSetup(arg1);
2131
+ vresult = SWIG_From_int((int)(result));
2132
+ return vresult;
2133
+ fail:
2134
+ return Qnil;
2135
+ }
2136
+
2137
+
2138
+ SWIGINTERN VALUE
2139
+ _wrap_pinMode(int argc, VALUE *argv, VALUE self) {
2140
+ int arg1 ;
2141
+ int arg2 ;
2142
+ int val1 ;
2143
+ int ecode1 = 0 ;
2144
+ int val2 ;
2145
+ int ecode2 = 0 ;
2146
+
2147
+ if ((argc < 2) || (argc > 2)) {
2148
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2149
+ }
2150
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2151
+ if (!SWIG_IsOK(ecode1)) {
2152
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","pinMode", 1, argv[0] ));
2153
+ }
2154
+ arg1 = (int)(val1);
2155
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2156
+ if (!SWIG_IsOK(ecode2)) {
2157
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","pinMode", 2, argv[1] ));
2158
+ }
2159
+ arg2 = (int)(val2);
2160
+ pinMode(arg1,arg2);
2161
+ return Qnil;
2162
+ fail:
2163
+ return Qnil;
2164
+ }
2165
+
2166
+
2167
+ SWIGINTERN VALUE
2168
+ _wrap_pullUpDnControl(int argc, VALUE *argv, VALUE self) {
2169
+ int arg1 ;
2170
+ int arg2 ;
2171
+ int val1 ;
2172
+ int ecode1 = 0 ;
2173
+ int val2 ;
2174
+ int ecode2 = 0 ;
2175
+
2176
+ if ((argc < 2) || (argc > 2)) {
2177
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2178
+ }
2179
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2180
+ if (!SWIG_IsOK(ecode1)) {
2181
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","pullUpDnControl", 1, argv[0] ));
2182
+ }
2183
+ arg1 = (int)(val1);
2184
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2185
+ if (!SWIG_IsOK(ecode2)) {
2186
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","pullUpDnControl", 2, argv[1] ));
2187
+ }
2188
+ arg2 = (int)(val2);
2189
+ pullUpDnControl(arg1,arg2);
2190
+ return Qnil;
2191
+ fail:
2192
+ return Qnil;
2193
+ }
2194
+
2195
+
2196
+ SWIGINTERN VALUE
2197
+ _wrap_digitalRead(int argc, VALUE *argv, VALUE self) {
2198
+ int arg1 ;
2199
+ int val1 ;
2200
+ int ecode1 = 0 ;
2201
+ int result;
2202
+ VALUE vresult = Qnil;
2203
+
2204
+ if ((argc < 1) || (argc > 1)) {
2205
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2206
+ }
2207
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2208
+ if (!SWIG_IsOK(ecode1)) {
2209
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","digitalRead", 1, argv[0] ));
2210
+ }
2211
+ arg1 = (int)(val1);
2212
+ result = (int)digitalRead(arg1);
2213
+ vresult = SWIG_From_int((int)(result));
2214
+ return vresult;
2215
+ fail:
2216
+ return Qnil;
2217
+ }
2218
+
2219
+
2220
+ SWIGINTERN VALUE
2221
+ _wrap_digitalWrite(int argc, VALUE *argv, VALUE self) {
2222
+ int arg1 ;
2223
+ int arg2 ;
2224
+ int val1 ;
2225
+ int ecode1 = 0 ;
2226
+ int val2 ;
2227
+ int ecode2 = 0 ;
2228
+
2229
+ if ((argc < 2) || (argc > 2)) {
2230
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2231
+ }
2232
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2233
+ if (!SWIG_IsOK(ecode1)) {
2234
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","digitalWrite", 1, argv[0] ));
2235
+ }
2236
+ arg1 = (int)(val1);
2237
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2238
+ if (!SWIG_IsOK(ecode2)) {
2239
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","digitalWrite", 2, argv[1] ));
2240
+ }
2241
+ arg2 = (int)(val2);
2242
+ digitalWrite(arg1,arg2);
2243
+ return Qnil;
2244
+ fail:
2245
+ return Qnil;
2246
+ }
2247
+
2248
+
2249
+ SWIGINTERN VALUE
2250
+ _wrap_pwmWrite(int argc, VALUE *argv, VALUE self) {
2251
+ int arg1 ;
2252
+ int arg2 ;
2253
+ int val1 ;
2254
+ int ecode1 = 0 ;
2255
+ int val2 ;
2256
+ int ecode2 = 0 ;
2257
+
2258
+ if ((argc < 2) || (argc > 2)) {
2259
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2260
+ }
2261
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2262
+ if (!SWIG_IsOK(ecode1)) {
2263
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","pwmWrite", 1, argv[0] ));
2264
+ }
2265
+ arg1 = (int)(val1);
2266
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2267
+ if (!SWIG_IsOK(ecode2)) {
2268
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","pwmWrite", 2, argv[1] ));
2269
+ }
2270
+ arg2 = (int)(val2);
2271
+ pwmWrite(arg1,arg2);
2272
+ return Qnil;
2273
+ fail:
2274
+ return Qnil;
2275
+ }
2276
+
2277
+
2278
+ SWIGINTERN VALUE
2279
+ _wrap_analogRead(int argc, VALUE *argv, VALUE self) {
2280
+ int arg1 ;
2281
+ int val1 ;
2282
+ int ecode1 = 0 ;
2283
+ int result;
2284
+ VALUE vresult = Qnil;
2285
+
2286
+ if ((argc < 1) || (argc > 1)) {
2287
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2288
+ }
2289
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2290
+ if (!SWIG_IsOK(ecode1)) {
2291
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","analogRead", 1, argv[0] ));
2292
+ }
2293
+ arg1 = (int)(val1);
2294
+ result = (int)analogRead(arg1);
2295
+ vresult = SWIG_From_int((int)(result));
2296
+ return vresult;
2297
+ fail:
2298
+ return Qnil;
2299
+ }
2300
+
2301
+
2302
+ SWIGINTERN VALUE
2303
+ _wrap_analogWrite(int argc, VALUE *argv, VALUE self) {
2304
+ int arg1 ;
2305
+ int arg2 ;
2306
+ int val1 ;
2307
+ int ecode1 = 0 ;
2308
+ int val2 ;
2309
+ int ecode2 = 0 ;
2310
+
2311
+ if ((argc < 2) || (argc > 2)) {
2312
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2313
+ }
2314
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2315
+ if (!SWIG_IsOK(ecode1)) {
2316
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","analogWrite", 1, argv[0] ));
2317
+ }
2318
+ arg1 = (int)(val1);
2319
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2320
+ if (!SWIG_IsOK(ecode2)) {
2321
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","analogWrite", 2, argv[1] ));
2322
+ }
2323
+ arg2 = (int)(val2);
2324
+ analogWrite(arg1,arg2);
2325
+ return Qnil;
2326
+ fail:
2327
+ return Qnil;
2328
+ }
2329
+
2330
+
2331
+ SWIGINTERN VALUE
2332
+ _wrap_piBoardRev(int argc, VALUE *argv, VALUE self) {
2333
+ int result;
2334
+ VALUE vresult = Qnil;
2335
+
2336
+ if ((argc < 0) || (argc > 0)) {
2337
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2338
+ }
2339
+ result = (int)piBoardRev();
2340
+ vresult = SWIG_From_int((int)(result));
2341
+ return vresult;
2342
+ fail:
2343
+ return Qnil;
2344
+ }
2345
+
2346
+
2347
+ SWIGINTERN VALUE
2348
+ _wrap_wpiPinToGpio(int argc, VALUE *argv, VALUE self) {
2349
+ int arg1 ;
2350
+ int val1 ;
2351
+ int ecode1 = 0 ;
2352
+ int result;
2353
+ VALUE vresult = Qnil;
2354
+
2355
+ if ((argc < 1) || (argc > 1)) {
2356
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2357
+ }
2358
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2359
+ if (!SWIG_IsOK(ecode1)) {
2360
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wpiPinToGpio", 1, argv[0] ));
2361
+ }
2362
+ arg1 = (int)(val1);
2363
+ result = (int)wpiPinToGpio(arg1);
2364
+ vresult = SWIG_From_int((int)(result));
2365
+ return vresult;
2366
+ fail:
2367
+ return Qnil;
2368
+ }
2369
+
2370
+
2371
+ SWIGINTERN VALUE
2372
+ _wrap_physPinToGpio(int argc, VALUE *argv, VALUE self) {
2373
+ int arg1 ;
2374
+ int val1 ;
2375
+ int ecode1 = 0 ;
2376
+ int result;
2377
+ VALUE vresult = Qnil;
2378
+
2379
+ if ((argc < 1) || (argc > 1)) {
2380
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2381
+ }
2382
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2383
+ if (!SWIG_IsOK(ecode1)) {
2384
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","physPinToGpio", 1, argv[0] ));
2385
+ }
2386
+ arg1 = (int)(val1);
2387
+ result = (int)physPinToGpio(arg1);
2388
+ vresult = SWIG_From_int((int)(result));
2389
+ return vresult;
2390
+ fail:
2391
+ return Qnil;
2392
+ }
2393
+
2394
+
2395
+ SWIGINTERN VALUE
2396
+ _wrap_waitForInterrupt_get(VALUE self) {
2397
+ VALUE _val;
2398
+
2399
+ _val = SWIG_NewFunctionPtrObj((void *)(waitForInterrupt), SWIGTYPE_p_f_int_int__int);
2400
+ return _val;
2401
+ }
2402
+
2403
+
2404
+ SWIGINTERN VALUE
2405
+ _wrap_waitForInterrupt_set(VALUE self, VALUE _val) {
2406
+ {
2407
+ int res = SWIG_ConvertFunctionPtr(_val, (void**)(&waitForInterrupt), SWIGTYPE_p_f_int_int__int);
2408
+ if (!SWIG_IsOK(res)) {
2409
+ SWIG_exception_fail(SWIG_ArgError(res), "in variable '""waitForInterrupt""' of type '""int (*)(int,int)""'");
2410
+ }
2411
+ }
2412
+ return _val;
2413
+ fail:
2414
+ return Qnil;
2415
+ }
2416
+
2417
+
2418
+ SWIGINTERN VALUE
2419
+ _wrap_wiringPiISR(int argc, VALUE *argv, VALUE self) {
2420
+ int arg1 ;
2421
+ int arg2 ;
2422
+ void (*arg3)(void) = (void (*)(void)) 0 ;
2423
+ int val1 ;
2424
+ int ecode1 = 0 ;
2425
+ int val2 ;
2426
+ int ecode2 = 0 ;
2427
+ int result;
2428
+ VALUE vresult = Qnil;
2429
+
2430
+ if ((argc < 3) || (argc > 3)) {
2431
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
2432
+ }
2433
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2434
+ if (!SWIG_IsOK(ecode1)) {
2435
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiISR", 1, argv[0] ));
2436
+ }
2437
+ arg1 = (int)(val1);
2438
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2439
+ if (!SWIG_IsOK(ecode2)) {
2440
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","wiringPiISR", 2, argv[1] ));
2441
+ }
2442
+ arg2 = (int)(val2);
2443
+ {
2444
+ int res = SWIG_ConvertFunctionPtr(argv[2], (void**)(&arg3), SWIGTYPE_p_f_void__void);
2445
+ if (!SWIG_IsOK(res)) {
2446
+ SWIG_exception_fail(SWIG_ArgError(res), Ruby_Format_TypeError( "", "void (*)(void)","wiringPiISR", 3, argv[2] ));
2447
+ }
2448
+ }
2449
+ result = (int)wiringPiISR(arg1,arg2,arg3);
2450
+ vresult = SWIG_From_int((int)(result));
2451
+ return vresult;
2452
+ fail:
2453
+ return Qnil;
2454
+ }
2455
+
2456
+
2457
+ SWIGINTERN VALUE
2458
+ _wrap_piThreadCreate(int argc, VALUE *argv, VALUE self) {
2459
+ void *(*arg1)(void *) = (void *(*)(void *)) 0 ;
2460
+ int result;
2461
+ VALUE vresult = Qnil;
2462
+
2463
+ if ((argc < 1) || (argc > 1)) {
2464
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2465
+ }
2466
+ {
2467
+ int res = SWIG_ConvertFunctionPtr(argv[0], (void**)(&arg1), SWIGTYPE_p_f_p_void__p_void);
2468
+ if (!SWIG_IsOK(res)) {
2469
+ SWIG_exception_fail(SWIG_ArgError(res), Ruby_Format_TypeError( "", "void *(*)(void *)","piThreadCreate", 1, argv[0] ));
2470
+ }
2471
+ }
2472
+ result = (int)piThreadCreate(arg1);
2473
+ vresult = SWIG_From_int((int)(result));
2474
+ return vresult;
2475
+ fail:
2476
+ return Qnil;
2477
+ }
2478
+
2479
+
2480
+ SWIGINTERN VALUE
2481
+ _wrap_piLock(int argc, VALUE *argv, VALUE self) {
2482
+ int arg1 ;
2483
+ int val1 ;
2484
+ int ecode1 = 0 ;
2485
+
2486
+ if ((argc < 1) || (argc > 1)) {
2487
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2488
+ }
2489
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2490
+ if (!SWIG_IsOK(ecode1)) {
2491
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","piLock", 1, argv[0] ));
2492
+ }
2493
+ arg1 = (int)(val1);
2494
+ piLock(arg1);
2495
+ return Qnil;
2496
+ fail:
2497
+ return Qnil;
2498
+ }
2499
+
2500
+
2501
+ SWIGINTERN VALUE
2502
+ _wrap_piUnlock(int argc, VALUE *argv, VALUE self) {
2503
+ int arg1 ;
2504
+ int val1 ;
2505
+ int ecode1 = 0 ;
2506
+
2507
+ if ((argc < 1) || (argc > 1)) {
2508
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2509
+ }
2510
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2511
+ if (!SWIG_IsOK(ecode1)) {
2512
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","piUnlock", 1, argv[0] ));
2513
+ }
2514
+ arg1 = (int)(val1);
2515
+ piUnlock(arg1);
2516
+ return Qnil;
2517
+ fail:
2518
+ return Qnil;
2519
+ }
2520
+
2521
+
2522
+ SWIGINTERN VALUE
2523
+ _wrap_piHiPri(int argc, VALUE *argv, VALUE self) {
2524
+ int arg1 ;
2525
+ int val1 ;
2526
+ int ecode1 = 0 ;
2527
+ int result;
2528
+ VALUE vresult = Qnil;
2529
+
2530
+ if ((argc < 1) || (argc > 1)) {
2531
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2532
+ }
2533
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2534
+ if (!SWIG_IsOK(ecode1)) {
2535
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","piHiPri", 1, argv[0] ));
2536
+ }
2537
+ arg1 = (int)(val1);
2538
+ result = (int)piHiPri(arg1);
2539
+ vresult = SWIG_From_int((int)(result));
2540
+ return vresult;
2541
+ fail:
2542
+ return Qnil;
2543
+ }
2544
+
2545
+
2546
+ SWIGINTERN VALUE
2547
+ _wrap_delay(int argc, VALUE *argv, VALUE self) {
2548
+ unsigned int arg1 ;
2549
+ unsigned int val1 ;
2550
+ int ecode1 = 0 ;
2551
+
2552
+ if ((argc < 1) || (argc > 1)) {
2553
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2554
+ }
2555
+ ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
2556
+ if (!SWIG_IsOK(ecode1)) {
2557
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "unsigned int","delay", 1, argv[0] ));
2558
+ }
2559
+ arg1 = (unsigned int)(val1);
2560
+ delay(arg1);
2561
+ return Qnil;
2562
+ fail:
2563
+ return Qnil;
2564
+ }
2565
+
2566
+
2567
+ SWIGINTERN VALUE
2568
+ _wrap_delayMicroseconds(int argc, VALUE *argv, VALUE self) {
2569
+ unsigned int arg1 ;
2570
+ unsigned int val1 ;
2571
+ int ecode1 = 0 ;
2572
+
2573
+ if ((argc < 1) || (argc > 1)) {
2574
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2575
+ }
2576
+ ecode1 = SWIG_AsVal_unsigned_SS_int(argv[0], &val1);
2577
+ if (!SWIG_IsOK(ecode1)) {
2578
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "unsigned int","delayMicroseconds", 1, argv[0] ));
2579
+ }
2580
+ arg1 = (unsigned int)(val1);
2581
+ delayMicroseconds(arg1);
2582
+ return Qnil;
2583
+ fail:
2584
+ return Qnil;
2585
+ }
2586
+
2587
+
2588
+ SWIGINTERN VALUE
2589
+ _wrap_millis(int argc, VALUE *argv, VALUE self) {
2590
+ unsigned int result;
2591
+ VALUE vresult = Qnil;
2592
+
2593
+ if ((argc < 0) || (argc > 0)) {
2594
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2595
+ }
2596
+ result = (unsigned int)millis();
2597
+ vresult = SWIG_From_unsigned_SS_int((unsigned int)(result));
2598
+ return vresult;
2599
+ fail:
2600
+ return Qnil;
2601
+ }
2602
+
2603
+
2604
+ SWIGINTERN VALUE
2605
+ _wrap_micros(int argc, VALUE *argv, VALUE self) {
2606
+ unsigned int result;
2607
+ VALUE vresult = Qnil;
2608
+
2609
+ if ((argc < 0) || (argc > 0)) {
2610
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2611
+ }
2612
+ result = (unsigned int)micros();
2613
+ vresult = SWIG_From_unsigned_SS_int((unsigned int)(result));
2614
+ return vresult;
2615
+ fail:
2616
+ return Qnil;
2617
+ }
2618
+
2619
+
2620
+ SWIGINTERN VALUE
2621
+ _wrap_serialOpen(int argc, VALUE *argv, VALUE self) {
2622
+ char *arg1 = (char *) 0 ;
2623
+ int arg2 ;
2624
+ int res1 ;
2625
+ char *buf1 = 0 ;
2626
+ int alloc1 = 0 ;
2627
+ int val2 ;
2628
+ int ecode2 = 0 ;
2629
+ int result;
2630
+ VALUE vresult = Qnil;
2631
+
2632
+ if ((argc < 2) || (argc > 2)) {
2633
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2634
+ }
2635
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2636
+ if (!SWIG_IsOK(res1)) {
2637
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char *","serialOpen", 1, argv[0] ));
2638
+ }
2639
+ arg1 = (char *)(buf1);
2640
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2641
+ if (!SWIG_IsOK(ecode2)) {
2642
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","serialOpen", 2, argv[1] ));
2643
+ }
2644
+ arg2 = (int)(val2);
2645
+ result = (int)serialOpen(arg1,arg2);
2646
+ vresult = SWIG_From_int((int)(result));
2647
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2648
+ return vresult;
2649
+ fail:
2650
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2651
+ return Qnil;
2652
+ }
2653
+
2654
+
2655
+ SWIGINTERN VALUE
2656
+ _wrap_serialClose(int argc, VALUE *argv, VALUE self) {
2657
+ int arg1 ;
2658
+ int val1 ;
2659
+ int ecode1 = 0 ;
2660
+
2661
+ if ((argc < 1) || (argc > 1)) {
2662
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2663
+ }
2664
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2665
+ if (!SWIG_IsOK(ecode1)) {
2666
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","serialClose", 1, argv[0] ));
2667
+ }
2668
+ arg1 = (int)(val1);
2669
+ serialClose(arg1);
2670
+ return Qnil;
2671
+ fail:
2672
+ return Qnil;
2673
+ }
2674
+
2675
+
2676
+ SWIGINTERN VALUE
2677
+ _wrap_serialFlush(int argc, VALUE *argv, VALUE self) {
2678
+ int arg1 ;
2679
+ int val1 ;
2680
+ int ecode1 = 0 ;
2681
+
2682
+ if ((argc < 1) || (argc > 1)) {
2683
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2684
+ }
2685
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2686
+ if (!SWIG_IsOK(ecode1)) {
2687
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","serialFlush", 1, argv[0] ));
2688
+ }
2689
+ arg1 = (int)(val1);
2690
+ serialFlush(arg1);
2691
+ return Qnil;
2692
+ fail:
2693
+ return Qnil;
2694
+ }
2695
+
2696
+
2697
+ SWIGINTERN VALUE
2698
+ _wrap_serialPutchar(int argc, VALUE *argv, VALUE self) {
2699
+ int arg1 ;
2700
+ unsigned char arg2 ;
2701
+ int val1 ;
2702
+ int ecode1 = 0 ;
2703
+ unsigned char val2 ;
2704
+ int ecode2 = 0 ;
2705
+
2706
+ if ((argc < 2) || (argc > 2)) {
2707
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2708
+ }
2709
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2710
+ if (!SWIG_IsOK(ecode1)) {
2711
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","serialPutchar", 1, argv[0] ));
2712
+ }
2713
+ arg1 = (int)(val1);
2714
+ ecode2 = SWIG_AsVal_unsigned_SS_char(argv[1], &val2);
2715
+ if (!SWIG_IsOK(ecode2)) {
2716
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "unsigned char","serialPutchar", 2, argv[1] ));
2717
+ }
2718
+ arg2 = (unsigned char)(val2);
2719
+ serialPutchar(arg1,arg2);
2720
+ return Qnil;
2721
+ fail:
2722
+ return Qnil;
2723
+ }
2724
+
2725
+
2726
+ SWIGINTERN VALUE
2727
+ _wrap_serialPuts(int argc, VALUE *argv, VALUE self) {
2728
+ int arg1 ;
2729
+ char *arg2 = (char *) 0 ;
2730
+ int val1 ;
2731
+ int ecode1 = 0 ;
2732
+ int res2 ;
2733
+ char *buf2 = 0 ;
2734
+ int alloc2 = 0 ;
2735
+
2736
+ if ((argc < 2) || (argc > 2)) {
2737
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2738
+ }
2739
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2740
+ if (!SWIG_IsOK(ecode1)) {
2741
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","serialPuts", 1, argv[0] ));
2742
+ }
2743
+ arg1 = (int)(val1);
2744
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
2745
+ if (!SWIG_IsOK(res2)) {
2746
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","serialPuts", 2, argv[1] ));
2747
+ }
2748
+ arg2 = (char *)(buf2);
2749
+ serialPuts(arg1,arg2);
2750
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2751
+ return Qnil;
2752
+ fail:
2753
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2754
+ return Qnil;
2755
+ }
2756
+
2757
+
2758
+ SWIGINTERN VALUE
2759
+ _wrap_serialPrintf(int argc, VALUE *argv, VALUE self) {
2760
+ int arg1 ;
2761
+ char *arg2 = (char *) 0 ;
2762
+ void *arg3 = 0 ;
2763
+ int val1 ;
2764
+ int ecode1 = 0 ;
2765
+ int res2 ;
2766
+ char *buf2 = 0 ;
2767
+ int alloc2 = 0 ;
2768
+
2769
+ if (argc < 2) {
2770
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2771
+ }
2772
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2773
+ if (!SWIG_IsOK(ecode1)) {
2774
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","serialPrintf", 1, argv[0] ));
2775
+ }
2776
+ arg1 = (int)(val1);
2777
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
2778
+ if (!SWIG_IsOK(res2)) {
2779
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","serialPrintf", 2, argv[1] ));
2780
+ }
2781
+ arg2 = (char *)(buf2);
2782
+ serialPrintf(arg1,arg2,arg3);
2783
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2784
+ return Qnil;
2785
+ fail:
2786
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2787
+ return Qnil;
2788
+ }
2789
+
2790
+
2791
+ SWIGINTERN VALUE
2792
+ _wrap_serialDataAvail(int argc, VALUE *argv, VALUE self) {
2793
+ int arg1 ;
2794
+ int val1 ;
2795
+ int ecode1 = 0 ;
2796
+ int result;
2797
+ VALUE vresult = Qnil;
2798
+
2799
+ if ((argc < 1) || (argc > 1)) {
2800
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2801
+ }
2802
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2803
+ if (!SWIG_IsOK(ecode1)) {
2804
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","serialDataAvail", 1, argv[0] ));
2805
+ }
2806
+ arg1 = (int)(val1);
2807
+ result = (int)serialDataAvail(arg1);
2808
+ vresult = SWIG_From_int((int)(result));
2809
+ return vresult;
2810
+ fail:
2811
+ return Qnil;
2812
+ }
2813
+
2814
+
2815
+ SWIGINTERN VALUE
2816
+ _wrap_serialGetchar(int argc, VALUE *argv, VALUE self) {
2817
+ int arg1 ;
2818
+ int val1 ;
2819
+ int ecode1 = 0 ;
2820
+ int result;
2821
+ VALUE vresult = Qnil;
2822
+
2823
+ if ((argc < 1) || (argc > 1)) {
2824
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2825
+ }
2826
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2827
+ if (!SWIG_IsOK(ecode1)) {
2828
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","serialGetchar", 1, argv[0] ));
2829
+ }
2830
+ arg1 = (int)(val1);
2831
+ result = (int)serialGetchar(arg1);
2832
+ vresult = SWIG_From_int((int)(result));
2833
+ return vresult;
2834
+ fail:
2835
+ return Qnil;
2836
+ }
2837
+
2838
+
2839
+ SWIGINTERN VALUE
2840
+ _wrap_shiftOut(int argc, VALUE *argv, VALUE self) {
2841
+ uint8_t arg1 ;
2842
+ uint8_t arg2 ;
2843
+ uint8_t arg3 ;
2844
+ uint8_t arg4 ;
2845
+ unsigned char val1 ;
2846
+ int ecode1 = 0 ;
2847
+ unsigned char val2 ;
2848
+ int ecode2 = 0 ;
2849
+ unsigned char val3 ;
2850
+ int ecode3 = 0 ;
2851
+ unsigned char val4 ;
2852
+ int ecode4 = 0 ;
2853
+
2854
+ if ((argc < 4) || (argc > 4)) {
2855
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
2856
+ }
2857
+ ecode1 = SWIG_AsVal_unsigned_SS_char(argv[0], &val1);
2858
+ if (!SWIG_IsOK(ecode1)) {
2859
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "uint8_t","shiftOut", 1, argv[0] ));
2860
+ }
2861
+ arg1 = (uint8_t)(val1);
2862
+ ecode2 = SWIG_AsVal_unsigned_SS_char(argv[1], &val2);
2863
+ if (!SWIG_IsOK(ecode2)) {
2864
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "uint8_t","shiftOut", 2, argv[1] ));
2865
+ }
2866
+ arg2 = (uint8_t)(val2);
2867
+ ecode3 = SWIG_AsVal_unsigned_SS_char(argv[2], &val3);
2868
+ if (!SWIG_IsOK(ecode3)) {
2869
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "uint8_t","shiftOut", 3, argv[2] ));
2870
+ }
2871
+ arg3 = (uint8_t)(val3);
2872
+ ecode4 = SWIG_AsVal_unsigned_SS_char(argv[3], &val4);
2873
+ if (!SWIG_IsOK(ecode4)) {
2874
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "uint8_t","shiftOut", 4, argv[3] ));
2875
+ }
2876
+ arg4 = (uint8_t)(val4);
2877
+ shiftOut(arg1,arg2,arg3,arg4);
2878
+ return Qnil;
2879
+ fail:
2880
+ return Qnil;
2881
+ }
2882
+
2883
+
2884
+ SWIGINTERN VALUE
2885
+ _wrap_shiftIn(int argc, VALUE *argv, VALUE self) {
2886
+ uint8_t arg1 ;
2887
+ uint8_t arg2 ;
2888
+ uint8_t arg3 ;
2889
+ unsigned char val1 ;
2890
+ int ecode1 = 0 ;
2891
+ unsigned char val2 ;
2892
+ int ecode2 = 0 ;
2893
+ unsigned char val3 ;
2894
+ int ecode3 = 0 ;
2895
+ uint8_t result;
2896
+ VALUE vresult = Qnil;
2897
+
2898
+ if ((argc < 3) || (argc > 3)) {
2899
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
2900
+ }
2901
+ ecode1 = SWIG_AsVal_unsigned_SS_char(argv[0], &val1);
2902
+ if (!SWIG_IsOK(ecode1)) {
2903
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "uint8_t","shiftIn", 1, argv[0] ));
2904
+ }
2905
+ arg1 = (uint8_t)(val1);
2906
+ ecode2 = SWIG_AsVal_unsigned_SS_char(argv[1], &val2);
2907
+ if (!SWIG_IsOK(ecode2)) {
2908
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "uint8_t","shiftIn", 2, argv[1] ));
2909
+ }
2910
+ arg2 = (uint8_t)(val2);
2911
+ ecode3 = SWIG_AsVal_unsigned_SS_char(argv[2], &val3);
2912
+ if (!SWIG_IsOK(ecode3)) {
2913
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "uint8_t","shiftIn", 3, argv[2] ));
2914
+ }
2915
+ arg3 = (uint8_t)(val3);
2916
+ result = shiftIn(arg1,arg2,arg3);
2917
+ vresult = SWIG_From_unsigned_SS_char((unsigned char)(result));
2918
+ return vresult;
2919
+ fail:
2920
+ return Qnil;
2921
+ }
2922
+
2923
+
2924
+ SWIGINTERN VALUE
2925
+ _wrap_wiringPiSPIGetFd(int argc, VALUE *argv, VALUE self) {
2926
+ int arg1 ;
2927
+ int val1 ;
2928
+ int ecode1 = 0 ;
2929
+ int result;
2930
+ VALUE vresult = Qnil;
2931
+
2932
+ if ((argc < 1) || (argc > 1)) {
2933
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2934
+ }
2935
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2936
+ if (!SWIG_IsOK(ecode1)) {
2937
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiSPIGetFd", 1, argv[0] ));
2938
+ }
2939
+ arg1 = (int)(val1);
2940
+ result = (int)wiringPiSPIGetFd(arg1);
2941
+ vresult = SWIG_From_int((int)(result));
2942
+ return vresult;
2943
+ fail:
2944
+ return Qnil;
2945
+ }
2946
+
2947
+
2948
+ SWIGINTERN VALUE
2949
+ _wrap_wiringPiSPIDataRW(int argc, VALUE *argv, VALUE self) {
2950
+ int arg1 ;
2951
+ unsigned char *arg2 = (unsigned char *) 0 ;
2952
+ int arg3 ;
2953
+ int val1 ;
2954
+ int ecode1 = 0 ;
2955
+ int result;
2956
+ VALUE vresult = Qnil;
2957
+
2958
+ if ((argc < 2) || (argc > 2)) {
2959
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2960
+ }
2961
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2962
+ if (!SWIG_IsOK(ecode1)) {
2963
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiSPIDataRW", 1, argv[0] ));
2964
+ }
2965
+ arg1 = (int)(val1);
2966
+ {
2967
+ arg2 = StringValuePtr(argv[1]);
2968
+ arg3 = strlen(arg2);
2969
+ }
2970
+ result = (int)wiringPiSPIDataRW(arg1,arg2,arg3);
2971
+ vresult = SWIG_From_int((int)(result));
2972
+ return vresult;
2973
+ fail:
2974
+ return Qnil;
2975
+ }
2976
+
2977
+
2978
+ SWIGINTERN VALUE
2979
+ _wrap_wiringPiSPISetup(int argc, VALUE *argv, VALUE self) {
2980
+ int arg1 ;
2981
+ int arg2 ;
2982
+ int val1 ;
2983
+ int ecode1 = 0 ;
2984
+ int val2 ;
2985
+ int ecode2 = 0 ;
2986
+ int result;
2987
+ VALUE vresult = Qnil;
2988
+
2989
+ if ((argc < 2) || (argc > 2)) {
2990
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2991
+ }
2992
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2993
+ if (!SWIG_IsOK(ecode1)) {
2994
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiSPISetup", 1, argv[0] ));
2995
+ }
2996
+ arg1 = (int)(val1);
2997
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2998
+ if (!SWIG_IsOK(ecode2)) {
2999
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","wiringPiSPISetup", 2, argv[1] ));
3000
+ }
3001
+ arg2 = (int)(val2);
3002
+ result = (int)wiringPiSPISetup(arg1,arg2);
3003
+ vresult = SWIG_From_int((int)(result));
3004
+ return vresult;
3005
+ fail:
3006
+ return Qnil;
3007
+ }
3008
+
3009
+
3010
+ SWIGINTERN VALUE
3011
+ _wrap_wiringPiI2CSetupInterface(int argc, VALUE *argv, VALUE self) {
3012
+ char *arg1 = (char *) 0 ;
3013
+ int arg2 ;
3014
+ int res1 ;
3015
+ char *buf1 = 0 ;
3016
+ int alloc1 = 0 ;
3017
+ int val2 ;
3018
+ int ecode2 = 0 ;
3019
+ int result;
3020
+ VALUE vresult = Qnil;
3021
+
3022
+ if ((argc < 2) || (argc > 2)) {
3023
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3024
+ }
3025
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
3026
+ if (!SWIG_IsOK(res1)) {
3027
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char *","wiringPiI2CSetupInterface", 1, argv[0] ));
3028
+ }
3029
+ arg1 = (char *)(buf1);
3030
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3031
+ if (!SWIG_IsOK(ecode2)) {
3032
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","wiringPiI2CSetupInterface", 2, argv[1] ));
3033
+ }
3034
+ arg2 = (int)(val2);
3035
+ result = (int)wiringPiI2CSetupInterface(arg1,arg2);
3036
+ vresult = SWIG_From_int((int)(result));
3037
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
3038
+ return vresult;
3039
+ fail:
3040
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
3041
+ return Qnil;
3042
+ }
3043
+
3044
+
3045
+ SWIGINTERN VALUE
3046
+ _wrap_wiringPiI2CSetup(int argc, VALUE *argv, VALUE self) {
3047
+ int arg1 ;
3048
+ int val1 ;
3049
+ int ecode1 = 0 ;
3050
+ int result;
3051
+ VALUE vresult = Qnil;
3052
+
3053
+ if ((argc < 1) || (argc > 1)) {
3054
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3055
+ }
3056
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3057
+ if (!SWIG_IsOK(ecode1)) {
3058
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiI2CSetup", 1, argv[0] ));
3059
+ }
3060
+ arg1 = (int)(val1);
3061
+ result = (int)wiringPiI2CSetup(arg1);
3062
+ vresult = SWIG_From_int((int)(result));
3063
+ return vresult;
3064
+ fail:
3065
+ return Qnil;
3066
+ }
3067
+
3068
+
3069
+ SWIGINTERN VALUE
3070
+ _wrap_wiringPiI2CRead(int argc, VALUE *argv, VALUE self) {
3071
+ int arg1 ;
3072
+ int val1 ;
3073
+ int ecode1 = 0 ;
3074
+ int result;
3075
+ VALUE vresult = Qnil;
3076
+
3077
+ if ((argc < 1) || (argc > 1)) {
3078
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3079
+ }
3080
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3081
+ if (!SWIG_IsOK(ecode1)) {
3082
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiI2CRead", 1, argv[0] ));
3083
+ }
3084
+ arg1 = (int)(val1);
3085
+ result = (int)wiringPiI2CRead(arg1);
3086
+ vresult = SWIG_From_int((int)(result));
3087
+ return vresult;
3088
+ fail:
3089
+ return Qnil;
3090
+ }
3091
+
3092
+
3093
+ SWIGINTERN VALUE
3094
+ _wrap_wiringPiI2CReadReg8(int argc, VALUE *argv, VALUE self) {
3095
+ int arg1 ;
3096
+ int arg2 ;
3097
+ int val1 ;
3098
+ int ecode1 = 0 ;
3099
+ int val2 ;
3100
+ int ecode2 = 0 ;
3101
+ int result;
3102
+ VALUE vresult = Qnil;
3103
+
3104
+ if ((argc < 2) || (argc > 2)) {
3105
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3106
+ }
3107
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3108
+ if (!SWIG_IsOK(ecode1)) {
3109
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiI2CReadReg8", 1, argv[0] ));
3110
+ }
3111
+ arg1 = (int)(val1);
3112
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3113
+ if (!SWIG_IsOK(ecode2)) {
3114
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","wiringPiI2CReadReg8", 2, argv[1] ));
3115
+ }
3116
+ arg2 = (int)(val2);
3117
+ result = (int)wiringPiI2CReadReg8(arg1,arg2);
3118
+ vresult = SWIG_From_int((int)(result));
3119
+ return vresult;
3120
+ fail:
3121
+ return Qnil;
3122
+ }
3123
+
3124
+
3125
+ SWIGINTERN VALUE
3126
+ _wrap_wiringPiI2CReadReg16(int argc, VALUE *argv, VALUE self) {
3127
+ int arg1 ;
3128
+ int arg2 ;
3129
+ int val1 ;
3130
+ int ecode1 = 0 ;
3131
+ int val2 ;
3132
+ int ecode2 = 0 ;
3133
+ int result;
3134
+ VALUE vresult = Qnil;
3135
+
3136
+ if ((argc < 2) || (argc > 2)) {
3137
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3138
+ }
3139
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3140
+ if (!SWIG_IsOK(ecode1)) {
3141
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiI2CReadReg16", 1, argv[0] ));
3142
+ }
3143
+ arg1 = (int)(val1);
3144
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3145
+ if (!SWIG_IsOK(ecode2)) {
3146
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","wiringPiI2CReadReg16", 2, argv[1] ));
3147
+ }
3148
+ arg2 = (int)(val2);
3149
+ result = (int)wiringPiI2CReadReg16(arg1,arg2);
3150
+ vresult = SWIG_From_int((int)(result));
3151
+ return vresult;
3152
+ fail:
3153
+ return Qnil;
3154
+ }
3155
+
3156
+
3157
+ SWIGINTERN VALUE
3158
+ _wrap_wiringPiI2CWrite(int argc, VALUE *argv, VALUE self) {
3159
+ int arg1 ;
3160
+ int arg2 ;
3161
+ int val1 ;
3162
+ int ecode1 = 0 ;
3163
+ int val2 ;
3164
+ int ecode2 = 0 ;
3165
+ int result;
3166
+ VALUE vresult = Qnil;
3167
+
3168
+ if ((argc < 2) || (argc > 2)) {
3169
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3170
+ }
3171
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3172
+ if (!SWIG_IsOK(ecode1)) {
3173
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiI2CWrite", 1, argv[0] ));
3174
+ }
3175
+ arg1 = (int)(val1);
3176
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3177
+ if (!SWIG_IsOK(ecode2)) {
3178
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","wiringPiI2CWrite", 2, argv[1] ));
3179
+ }
3180
+ arg2 = (int)(val2);
3181
+ result = (int)wiringPiI2CWrite(arg1,arg2);
3182
+ vresult = SWIG_From_int((int)(result));
3183
+ return vresult;
3184
+ fail:
3185
+ return Qnil;
3186
+ }
3187
+
3188
+
3189
+ SWIGINTERN VALUE
3190
+ _wrap_wiringPiI2CWriteReg8(int argc, VALUE *argv, VALUE self) {
3191
+ int arg1 ;
3192
+ int arg2 ;
3193
+ int arg3 ;
3194
+ int val1 ;
3195
+ int ecode1 = 0 ;
3196
+ int val2 ;
3197
+ int ecode2 = 0 ;
3198
+ int val3 ;
3199
+ int ecode3 = 0 ;
3200
+ int result;
3201
+ VALUE vresult = Qnil;
3202
+
3203
+ if ((argc < 3) || (argc > 3)) {
3204
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
3205
+ }
3206
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3207
+ if (!SWIG_IsOK(ecode1)) {
3208
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiI2CWriteReg8", 1, argv[0] ));
3209
+ }
3210
+ arg1 = (int)(val1);
3211
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3212
+ if (!SWIG_IsOK(ecode2)) {
3213
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","wiringPiI2CWriteReg8", 2, argv[1] ));
3214
+ }
3215
+ arg2 = (int)(val2);
3216
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
3217
+ if (!SWIG_IsOK(ecode3)) {
3218
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","wiringPiI2CWriteReg8", 3, argv[2] ));
3219
+ }
3220
+ arg3 = (int)(val3);
3221
+ result = (int)wiringPiI2CWriteReg8(arg1,arg2,arg3);
3222
+ vresult = SWIG_From_int((int)(result));
3223
+ return vresult;
3224
+ fail:
3225
+ return Qnil;
3226
+ }
3227
+
3228
+
3229
+ SWIGINTERN VALUE
3230
+ _wrap_wiringPiI2CWriteReg16(int argc, VALUE *argv, VALUE self) {
3231
+ int arg1 ;
3232
+ int arg2 ;
3233
+ int arg3 ;
3234
+ int val1 ;
3235
+ int ecode1 = 0 ;
3236
+ int val2 ;
3237
+ int ecode2 = 0 ;
3238
+ int val3 ;
3239
+ int ecode3 = 0 ;
3240
+ int result;
3241
+ VALUE vresult = Qnil;
3242
+
3243
+ if ((argc < 3) || (argc > 3)) {
3244
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
3245
+ }
3246
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3247
+ if (!SWIG_IsOK(ecode1)) {
3248
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","wiringPiI2CWriteReg16", 1, argv[0] ));
3249
+ }
3250
+ arg1 = (int)(val1);
3251
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3252
+ if (!SWIG_IsOK(ecode2)) {
3253
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","wiringPiI2CWriteReg16", 2, argv[1] ));
3254
+ }
3255
+ arg2 = (int)(val2);
3256
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
3257
+ if (!SWIG_IsOK(ecode3)) {
3258
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","wiringPiI2CWriteReg16", 3, argv[2] ));
3259
+ }
3260
+ arg3 = (int)(val3);
3261
+ result = (int)wiringPiI2CWriteReg16(arg1,arg2,arg3);
3262
+ vresult = SWIG_From_int((int)(result));
3263
+ return vresult;
3264
+ fail:
3265
+ return Qnil;
3266
+ }
3267
+
3268
+
3269
+ SWIGINTERN VALUE
3270
+ _wrap_softToneCreate(int argc, VALUE *argv, VALUE self) {
3271
+ int arg1 ;
3272
+ int val1 ;
3273
+ int ecode1 = 0 ;
3274
+ int result;
3275
+ VALUE vresult = Qnil;
3276
+
3277
+ if ((argc < 1) || (argc > 1)) {
3278
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3279
+ }
3280
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3281
+ if (!SWIG_IsOK(ecode1)) {
3282
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","softToneCreate", 1, argv[0] ));
3283
+ }
3284
+ arg1 = (int)(val1);
3285
+ result = (int)softToneCreate(arg1);
3286
+ vresult = SWIG_From_int((int)(result));
3287
+ return vresult;
3288
+ fail:
3289
+ return Qnil;
3290
+ }
3291
+
3292
+
3293
+ SWIGINTERN VALUE
3294
+ _wrap_softToneWrite(int argc, VALUE *argv, VALUE self) {
3295
+ int arg1 ;
3296
+ int arg2 ;
3297
+ int val1 ;
3298
+ int ecode1 = 0 ;
3299
+ int val2 ;
3300
+ int ecode2 = 0 ;
3301
+
3302
+ if ((argc < 2) || (argc > 2)) {
3303
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3304
+ }
3305
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3306
+ if (!SWIG_IsOK(ecode1)) {
3307
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","softToneWrite", 1, argv[0] ));
3308
+ }
3309
+ arg1 = (int)(val1);
3310
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3311
+ if (!SWIG_IsOK(ecode2)) {
3312
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","softToneWrite", 2, argv[1] ));
3313
+ }
3314
+ arg2 = (int)(val2);
3315
+ softToneWrite(arg1,arg2);
3316
+ return Qnil;
3317
+ fail:
3318
+ return Qnil;
3319
+ }
3320
+
3321
+
3322
+ SWIGINTERN VALUE
3323
+ _wrap_softServoWrite(int argc, VALUE *argv, VALUE self) {
3324
+ int arg1 ;
3325
+ int arg2 ;
3326
+ int val1 ;
3327
+ int ecode1 = 0 ;
3328
+ int val2 ;
3329
+ int ecode2 = 0 ;
3330
+
3331
+ if ((argc < 2) || (argc > 2)) {
3332
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3333
+ }
3334
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3335
+ if (!SWIG_IsOK(ecode1)) {
3336
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","softServoWrite", 1, argv[0] ));
3337
+ }
3338
+ arg1 = (int)(val1);
3339
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3340
+ if (!SWIG_IsOK(ecode2)) {
3341
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","softServoWrite", 2, argv[1] ));
3342
+ }
3343
+ arg2 = (int)(val2);
3344
+ softServoWrite(arg1,arg2);
3345
+ return Qnil;
3346
+ fail:
3347
+ return Qnil;
3348
+ }
3349
+
3350
+
3351
+ SWIGINTERN VALUE
3352
+ _wrap_softServoSetup(int argc, VALUE *argv, VALUE self) {
3353
+ int arg1 ;
3354
+ int arg2 ;
3355
+ int arg3 ;
3356
+ int arg4 ;
3357
+ int arg5 ;
3358
+ int arg6 ;
3359
+ int arg7 ;
3360
+ int arg8 ;
3361
+ int val1 ;
3362
+ int ecode1 = 0 ;
3363
+ int val2 ;
3364
+ int ecode2 = 0 ;
3365
+ int val3 ;
3366
+ int ecode3 = 0 ;
3367
+ int val4 ;
3368
+ int ecode4 = 0 ;
3369
+ int val5 ;
3370
+ int ecode5 = 0 ;
3371
+ int val6 ;
3372
+ int ecode6 = 0 ;
3373
+ int val7 ;
3374
+ int ecode7 = 0 ;
3375
+ int val8 ;
3376
+ int ecode8 = 0 ;
3377
+ int result;
3378
+ VALUE vresult = Qnil;
3379
+
3380
+ if ((argc < 8) || (argc > 8)) {
3381
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 8)",argc); SWIG_fail;
3382
+ }
3383
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3384
+ if (!SWIG_IsOK(ecode1)) {
3385
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","softServoSetup", 1, argv[0] ));
3386
+ }
3387
+ arg1 = (int)(val1);
3388
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3389
+ if (!SWIG_IsOK(ecode2)) {
3390
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","softServoSetup", 2, argv[1] ));
3391
+ }
3392
+ arg2 = (int)(val2);
3393
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
3394
+ if (!SWIG_IsOK(ecode3)) {
3395
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","softServoSetup", 3, argv[2] ));
3396
+ }
3397
+ arg3 = (int)(val3);
3398
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
3399
+ if (!SWIG_IsOK(ecode4)) {
3400
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","softServoSetup", 4, argv[3] ));
3401
+ }
3402
+ arg4 = (int)(val4);
3403
+ ecode5 = SWIG_AsVal_int(argv[4], &val5);
3404
+ if (!SWIG_IsOK(ecode5)) {
3405
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","softServoSetup", 5, argv[4] ));
3406
+ }
3407
+ arg5 = (int)(val5);
3408
+ ecode6 = SWIG_AsVal_int(argv[5], &val6);
3409
+ if (!SWIG_IsOK(ecode6)) {
3410
+ SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "int","softServoSetup", 6, argv[5] ));
3411
+ }
3412
+ arg6 = (int)(val6);
3413
+ ecode7 = SWIG_AsVal_int(argv[6], &val7);
3414
+ if (!SWIG_IsOK(ecode7)) {
3415
+ SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "int","softServoSetup", 7, argv[6] ));
3416
+ }
3417
+ arg7 = (int)(val7);
3418
+ ecode8 = SWIG_AsVal_int(argv[7], &val8);
3419
+ if (!SWIG_IsOK(ecode8)) {
3420
+ SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "int","softServoSetup", 8, argv[7] ));
3421
+ }
3422
+ arg8 = (int)(val8);
3423
+ result = (int)softServoSetup(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
3424
+ vresult = SWIG_From_int((int)(result));
3425
+ return vresult;
3426
+ fail:
3427
+ return Qnil;
3428
+ }
3429
+
3430
+
3431
+ SWIGINTERN VALUE
3432
+ _wrap_softPwmCreate(int argc, VALUE *argv, VALUE self) {
3433
+ int arg1 ;
3434
+ int arg2 ;
3435
+ int arg3 ;
3436
+ int val1 ;
3437
+ int ecode1 = 0 ;
3438
+ int val2 ;
3439
+ int ecode2 = 0 ;
3440
+ int val3 ;
3441
+ int ecode3 = 0 ;
3442
+ int result;
3443
+ VALUE vresult = Qnil;
3444
+
3445
+ if ((argc < 3) || (argc > 3)) {
3446
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
3447
+ }
3448
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3449
+ if (!SWIG_IsOK(ecode1)) {
3450
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","softPwmCreate", 1, argv[0] ));
3451
+ }
3452
+ arg1 = (int)(val1);
3453
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3454
+ if (!SWIG_IsOK(ecode2)) {
3455
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","softPwmCreate", 2, argv[1] ));
3456
+ }
3457
+ arg2 = (int)(val2);
3458
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
3459
+ if (!SWIG_IsOK(ecode3)) {
3460
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","softPwmCreate", 3, argv[2] ));
3461
+ }
3462
+ arg3 = (int)(val3);
3463
+ result = (int)softPwmCreate(arg1,arg2,arg3);
3464
+ vresult = SWIG_From_int((int)(result));
3465
+ return vresult;
3466
+ fail:
3467
+ return Qnil;
3468
+ }
3469
+
3470
+
3471
+ SWIGINTERN VALUE
3472
+ _wrap_softPwmWrite(int argc, VALUE *argv, VALUE self) {
3473
+ int arg1 ;
3474
+ int arg2 ;
3475
+ int val1 ;
3476
+ int ecode1 = 0 ;
3477
+ int val2 ;
3478
+ int ecode2 = 0 ;
3479
+
3480
+ if ((argc < 2) || (argc > 2)) {
3481
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3482
+ }
3483
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3484
+ if (!SWIG_IsOK(ecode1)) {
3485
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","softPwmWrite", 1, argv[0] ));
3486
+ }
3487
+ arg1 = (int)(val1);
3488
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3489
+ if (!SWIG_IsOK(ecode2)) {
3490
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","softPwmWrite", 2, argv[1] ));
3491
+ }
3492
+ arg2 = (int)(val2);
3493
+ softPwmWrite(arg1,arg2);
3494
+ return Qnil;
3495
+ fail:
3496
+ return Qnil;
3497
+ }
3498
+
3499
+
3500
+ SWIGINTERN VALUE
3501
+ _wrap_mcp23s17Setup(int argc, VALUE *argv, VALUE self) {
3502
+ int arg1 ;
3503
+ int arg2 ;
3504
+ int arg3 ;
3505
+ int val1 ;
3506
+ int ecode1 = 0 ;
3507
+ int val2 ;
3508
+ int ecode2 = 0 ;
3509
+ int val3 ;
3510
+ int ecode3 = 0 ;
3511
+ int result;
3512
+ VALUE vresult = Qnil;
3513
+
3514
+ if ((argc < 3) || (argc > 3)) {
3515
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
3516
+ }
3517
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3518
+ if (!SWIG_IsOK(ecode1)) {
3519
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","mcp23s17Setup", 1, argv[0] ));
3520
+ }
3521
+ arg1 = (int)(val1);
3522
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3523
+ if (!SWIG_IsOK(ecode2)) {
3524
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","mcp23s17Setup", 2, argv[1] ));
3525
+ }
3526
+ arg2 = (int)(val2);
3527
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
3528
+ if (!SWIG_IsOK(ecode3)) {
3529
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","mcp23s17Setup", 3, argv[2] ));
3530
+ }
3531
+ arg3 = (int)(val3);
3532
+ result = (int)mcp23s17Setup(arg1,arg2,arg3);
3533
+ vresult = SWIG_From_int((int)(result));
3534
+ return vresult;
3535
+ fail:
3536
+ return Qnil;
3537
+ }
3538
+
3539
+
3540
+ SWIGINTERN VALUE
3541
+ _wrap_mcp23017Setup(int argc, VALUE *argv, VALUE self) {
3542
+ int arg1 ;
3543
+ int arg2 ;
3544
+ int val1 ;
3545
+ int ecode1 = 0 ;
3546
+ int val2 ;
3547
+ int ecode2 = 0 ;
3548
+ int result;
3549
+ VALUE vresult = Qnil;
3550
+
3551
+ if ((argc < 2) || (argc > 2)) {
3552
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3553
+ }
3554
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3555
+ if (!SWIG_IsOK(ecode1)) {
3556
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","mcp23017Setup", 1, argv[0] ));
3557
+ }
3558
+ arg1 = (int)(val1);
3559
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3560
+ if (!SWIG_IsOK(ecode2)) {
3561
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","mcp23017Setup", 2, argv[1] ));
3562
+ }
3563
+ arg2 = (int)(val2);
3564
+ result = (int)mcp23017Setup(arg1,arg2);
3565
+ vresult = SWIG_From_int((int)(result));
3566
+ return vresult;
3567
+ fail:
3568
+ return Qnil;
3569
+ }
3570
+
3571
+
3572
+ SWIGINTERN VALUE
3573
+ _wrap_mcp23s08Setup(int argc, VALUE *argv, VALUE self) {
3574
+ int arg1 ;
3575
+ int arg2 ;
3576
+ int arg3 ;
3577
+ int val1 ;
3578
+ int ecode1 = 0 ;
3579
+ int val2 ;
3580
+ int ecode2 = 0 ;
3581
+ int val3 ;
3582
+ int ecode3 = 0 ;
3583
+ int result;
3584
+ VALUE vresult = Qnil;
3585
+
3586
+ if ((argc < 3) || (argc > 3)) {
3587
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
3588
+ }
3589
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3590
+ if (!SWIG_IsOK(ecode1)) {
3591
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","mcp23s08Setup", 1, argv[0] ));
3592
+ }
3593
+ arg1 = (int)(val1);
3594
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3595
+ if (!SWIG_IsOK(ecode2)) {
3596
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","mcp23s08Setup", 2, argv[1] ));
3597
+ }
3598
+ arg2 = (int)(val2);
3599
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
3600
+ if (!SWIG_IsOK(ecode3)) {
3601
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","mcp23s08Setup", 3, argv[2] ));
3602
+ }
3603
+ arg3 = (int)(val3);
3604
+ result = (int)mcp23s08Setup(arg1,arg2,arg3);
3605
+ vresult = SWIG_From_int((int)(result));
3606
+ return vresult;
3607
+ fail:
3608
+ return Qnil;
3609
+ }
3610
+
3611
+
3612
+ SWIGINTERN VALUE
3613
+ _wrap_mcp23008Setup(int argc, VALUE *argv, VALUE self) {
3614
+ int arg1 ;
3615
+ int arg2 ;
3616
+ int val1 ;
3617
+ int ecode1 = 0 ;
3618
+ int val2 ;
3619
+ int ecode2 = 0 ;
3620
+ int result;
3621
+ VALUE vresult = Qnil;
3622
+
3623
+ if ((argc < 2) || (argc > 2)) {
3624
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3625
+ }
3626
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3627
+ if (!SWIG_IsOK(ecode1)) {
3628
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","mcp23008Setup", 1, argv[0] ));
3629
+ }
3630
+ arg1 = (int)(val1);
3631
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3632
+ if (!SWIG_IsOK(ecode2)) {
3633
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","mcp23008Setup", 2, argv[1] ));
3634
+ }
3635
+ arg2 = (int)(val2);
3636
+ result = (int)mcp23008Setup(arg1,arg2);
3637
+ vresult = SWIG_From_int((int)(result));
3638
+ return vresult;
3639
+ fail:
3640
+ return Qnil;
3641
+ }
3642
+
3643
+
3644
+ SWIGINTERN VALUE
3645
+ _wrap_sr595Setup(int argc, VALUE *argv, VALUE self) {
3646
+ int arg1 ;
3647
+ int arg2 ;
3648
+ int arg3 ;
3649
+ int arg4 ;
3650
+ int arg5 ;
3651
+ int val1 ;
3652
+ int ecode1 = 0 ;
3653
+ int val2 ;
3654
+ int ecode2 = 0 ;
3655
+ int val3 ;
3656
+ int ecode3 = 0 ;
3657
+ int val4 ;
3658
+ int ecode4 = 0 ;
3659
+ int val5 ;
3660
+ int ecode5 = 0 ;
3661
+ int result;
3662
+ VALUE vresult = Qnil;
3663
+
3664
+ if ((argc < 5) || (argc > 5)) {
3665
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
3666
+ }
3667
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3668
+ if (!SWIG_IsOK(ecode1)) {
3669
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","sr595Setup", 1, argv[0] ));
3670
+ }
3671
+ arg1 = (int)(val1);
3672
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3673
+ if (!SWIG_IsOK(ecode2)) {
3674
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","sr595Setup", 2, argv[1] ));
3675
+ }
3676
+ arg2 = (int)(val2);
3677
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
3678
+ if (!SWIG_IsOK(ecode3)) {
3679
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","sr595Setup", 3, argv[2] ));
3680
+ }
3681
+ arg3 = (int)(val3);
3682
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
3683
+ if (!SWIG_IsOK(ecode4)) {
3684
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","sr595Setup", 4, argv[3] ));
3685
+ }
3686
+ arg4 = (int)(val4);
3687
+ ecode5 = SWIG_AsVal_int(argv[4], &val5);
3688
+ if (!SWIG_IsOK(ecode5)) {
3689
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","sr595Setup", 5, argv[4] ));
3690
+ }
3691
+ arg5 = (int)(val5);
3692
+ result = (int)sr595Setup(arg1,arg2,arg3,arg4,arg5);
3693
+ vresult = SWIG_From_int((int)(result));
3694
+ return vresult;
3695
+ fail:
3696
+ return Qnil;
3697
+ }
3698
+
3699
+
3700
+ SWIGINTERN VALUE
3701
+ _wrap_lcdHome(int argc, VALUE *argv, VALUE self) {
3702
+ int arg1 ;
3703
+ int val1 ;
3704
+ int ecode1 = 0 ;
3705
+
3706
+ if ((argc < 1) || (argc > 1)) {
3707
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3708
+ }
3709
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3710
+ if (!SWIG_IsOK(ecode1)) {
3711
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","lcdHome", 1, argv[0] ));
3712
+ }
3713
+ arg1 = (int)(val1);
3714
+ lcdHome(arg1);
3715
+ return Qnil;
3716
+ fail:
3717
+ return Qnil;
3718
+ }
3719
+
3720
+
3721
+ SWIGINTERN VALUE
3722
+ _wrap_lcdClear(int argc, VALUE *argv, VALUE self) {
3723
+ int arg1 ;
3724
+ int val1 ;
3725
+ int ecode1 = 0 ;
3726
+
3727
+ if ((argc < 1) || (argc > 1)) {
3728
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3729
+ }
3730
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3731
+ if (!SWIG_IsOK(ecode1)) {
3732
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","lcdClear", 1, argv[0] ));
3733
+ }
3734
+ arg1 = (int)(val1);
3735
+ lcdClear(arg1);
3736
+ return Qnil;
3737
+ fail:
3738
+ return Qnil;
3739
+ }
3740
+
3741
+
3742
+ SWIGINTERN VALUE
3743
+ _wrap_lcdSendCommand(int argc, VALUE *argv, VALUE self) {
3744
+ int arg1 ;
3745
+ uint8_t arg2 ;
3746
+ int val1 ;
3747
+ int ecode1 = 0 ;
3748
+ unsigned char val2 ;
3749
+ int ecode2 = 0 ;
3750
+
3751
+ if ((argc < 2) || (argc > 2)) {
3752
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3753
+ }
3754
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3755
+ if (!SWIG_IsOK(ecode1)) {
3756
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","lcdSendCommand", 1, argv[0] ));
3757
+ }
3758
+ arg1 = (int)(val1);
3759
+ ecode2 = SWIG_AsVal_unsigned_SS_char(argv[1], &val2);
3760
+ if (!SWIG_IsOK(ecode2)) {
3761
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "uint8_t","lcdSendCommand", 2, argv[1] ));
3762
+ }
3763
+ arg2 = (uint8_t)(val2);
3764
+ lcdSendCommand(arg1,arg2);
3765
+ return Qnil;
3766
+ fail:
3767
+ return Qnil;
3768
+ }
3769
+
3770
+
3771
+ SWIGINTERN VALUE
3772
+ _wrap_lcdPosition(int argc, VALUE *argv, VALUE self) {
3773
+ int arg1 ;
3774
+ int arg2 ;
3775
+ int arg3 ;
3776
+ int val1 ;
3777
+ int ecode1 = 0 ;
3778
+ int val2 ;
3779
+ int ecode2 = 0 ;
3780
+ int val3 ;
3781
+ int ecode3 = 0 ;
3782
+
3783
+ if ((argc < 3) || (argc > 3)) {
3784
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
3785
+ }
3786
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3787
+ if (!SWIG_IsOK(ecode1)) {
3788
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","lcdPosition", 1, argv[0] ));
3789
+ }
3790
+ arg1 = (int)(val1);
3791
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3792
+ if (!SWIG_IsOK(ecode2)) {
3793
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","lcdPosition", 2, argv[1] ));
3794
+ }
3795
+ arg2 = (int)(val2);
3796
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
3797
+ if (!SWIG_IsOK(ecode3)) {
3798
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","lcdPosition", 3, argv[2] ));
3799
+ }
3800
+ arg3 = (int)(val3);
3801
+ lcdPosition(arg1,arg2,arg3);
3802
+ return Qnil;
3803
+ fail:
3804
+ return Qnil;
3805
+ }
3806
+
3807
+
3808
+ SWIGINTERN VALUE
3809
+ _wrap_lcdPutchar(int argc, VALUE *argv, VALUE self) {
3810
+ int arg1 ;
3811
+ uint8_t arg2 ;
3812
+ int val1 ;
3813
+ int ecode1 = 0 ;
3814
+ unsigned char val2 ;
3815
+ int ecode2 = 0 ;
3816
+
3817
+ if ((argc < 2) || (argc > 2)) {
3818
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3819
+ }
3820
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3821
+ if (!SWIG_IsOK(ecode1)) {
3822
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","lcdPutchar", 1, argv[0] ));
3823
+ }
3824
+ arg1 = (int)(val1);
3825
+ ecode2 = SWIG_AsVal_unsigned_SS_char(argv[1], &val2);
3826
+ if (!SWIG_IsOK(ecode2)) {
3827
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "uint8_t","lcdPutchar", 2, argv[1] ));
3828
+ }
3829
+ arg2 = (uint8_t)(val2);
3830
+ lcdPutchar(arg1,arg2);
3831
+ return Qnil;
3832
+ fail:
3833
+ return Qnil;
3834
+ }
3835
+
3836
+
3837
+ SWIGINTERN VALUE
3838
+ _wrap_lcdPuts(int argc, VALUE *argv, VALUE self) {
3839
+ int arg1 ;
3840
+ char *arg2 = (char *) 0 ;
3841
+ int val1 ;
3842
+ int ecode1 = 0 ;
3843
+ int res2 ;
3844
+ char *buf2 = 0 ;
3845
+ int alloc2 = 0 ;
3846
+
3847
+ if ((argc < 2) || (argc > 2)) {
3848
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3849
+ }
3850
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3851
+ if (!SWIG_IsOK(ecode1)) {
3852
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","lcdPuts", 1, argv[0] ));
3853
+ }
3854
+ arg1 = (int)(val1);
3855
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
3856
+ if (!SWIG_IsOK(res2)) {
3857
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","lcdPuts", 2, argv[1] ));
3858
+ }
3859
+ arg2 = (char *)(buf2);
3860
+ lcdPuts(arg1,arg2);
3861
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3862
+ return Qnil;
3863
+ fail:
3864
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3865
+ return Qnil;
3866
+ }
3867
+
3868
+
3869
+ SWIGINTERN VALUE
3870
+ _wrap_lcdPrintf(int argc, VALUE *argv, VALUE self) {
3871
+ int arg1 ;
3872
+ char *arg2 = (char *) 0 ;
3873
+ void *arg3 = 0 ;
3874
+ int val1 ;
3875
+ int ecode1 = 0 ;
3876
+ int res2 ;
3877
+ char *buf2 = 0 ;
3878
+ int alloc2 = 0 ;
3879
+
3880
+ if (argc < 2) {
3881
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
3882
+ }
3883
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3884
+ if (!SWIG_IsOK(ecode1)) {
3885
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","lcdPrintf", 1, argv[0] ));
3886
+ }
3887
+ arg1 = (int)(val1);
3888
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
3889
+ if (!SWIG_IsOK(res2)) {
3890
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","lcdPrintf", 2, argv[1] ));
3891
+ }
3892
+ arg2 = (char *)(buf2);
3893
+ lcdPrintf(arg1,arg2,arg3);
3894
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3895
+ return Qnil;
3896
+ fail:
3897
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3898
+ return Qnil;
3899
+ }
3900
+
3901
+
3902
+ SWIGINTERN VALUE
3903
+ _wrap_lcdInit(int argc, VALUE *argv, VALUE self) {
3904
+ int arg1 ;
3905
+ int arg2 ;
3906
+ int arg3 ;
3907
+ int arg4 ;
3908
+ int arg5 ;
3909
+ int arg6 ;
3910
+ int arg7 ;
3911
+ int arg8 ;
3912
+ int arg9 ;
3913
+ int arg10 ;
3914
+ int arg11 ;
3915
+ int arg12 ;
3916
+ int arg13 ;
3917
+ int val1 ;
3918
+ int ecode1 = 0 ;
3919
+ int val2 ;
3920
+ int ecode2 = 0 ;
3921
+ int val3 ;
3922
+ int ecode3 = 0 ;
3923
+ int val4 ;
3924
+ int ecode4 = 0 ;
3925
+ int val5 ;
3926
+ int ecode5 = 0 ;
3927
+ int val6 ;
3928
+ int ecode6 = 0 ;
3929
+ int val7 ;
3930
+ int ecode7 = 0 ;
3931
+ int val8 ;
3932
+ int ecode8 = 0 ;
3933
+ int val9 ;
3934
+ int ecode9 = 0 ;
3935
+ int val10 ;
3936
+ int ecode10 = 0 ;
3937
+ int val11 ;
3938
+ int ecode11 = 0 ;
3939
+ int val12 ;
3940
+ int ecode12 = 0 ;
3941
+ int val13 ;
3942
+ int ecode13 = 0 ;
3943
+ int result;
3944
+ VALUE vresult = Qnil;
3945
+
3946
+ if ((argc < 13) || (argc > 13)) {
3947
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 13)",argc); SWIG_fail;
3948
+ }
3949
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3950
+ if (!SWIG_IsOK(ecode1)) {
3951
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","lcdInit", 1, argv[0] ));
3952
+ }
3953
+ arg1 = (int)(val1);
3954
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
3955
+ if (!SWIG_IsOK(ecode2)) {
3956
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","lcdInit", 2, argv[1] ));
3957
+ }
3958
+ arg2 = (int)(val2);
3959
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
3960
+ if (!SWIG_IsOK(ecode3)) {
3961
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","lcdInit", 3, argv[2] ));
3962
+ }
3963
+ arg3 = (int)(val3);
3964
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
3965
+ if (!SWIG_IsOK(ecode4)) {
3966
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","lcdInit", 4, argv[3] ));
3967
+ }
3968
+ arg4 = (int)(val4);
3969
+ ecode5 = SWIG_AsVal_int(argv[4], &val5);
3970
+ if (!SWIG_IsOK(ecode5)) {
3971
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","lcdInit", 5, argv[4] ));
3972
+ }
3973
+ arg5 = (int)(val5);
3974
+ ecode6 = SWIG_AsVal_int(argv[5], &val6);
3975
+ if (!SWIG_IsOK(ecode6)) {
3976
+ SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "int","lcdInit", 6, argv[5] ));
3977
+ }
3978
+ arg6 = (int)(val6);
3979
+ ecode7 = SWIG_AsVal_int(argv[6], &val7);
3980
+ if (!SWIG_IsOK(ecode7)) {
3981
+ SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "int","lcdInit", 7, argv[6] ));
3982
+ }
3983
+ arg7 = (int)(val7);
3984
+ ecode8 = SWIG_AsVal_int(argv[7], &val8);
3985
+ if (!SWIG_IsOK(ecode8)) {
3986
+ SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "int","lcdInit", 8, argv[7] ));
3987
+ }
3988
+ arg8 = (int)(val8);
3989
+ ecode9 = SWIG_AsVal_int(argv[8], &val9);
3990
+ if (!SWIG_IsOK(ecode9)) {
3991
+ SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "int","lcdInit", 9, argv[8] ));
3992
+ }
3993
+ arg9 = (int)(val9);
3994
+ ecode10 = SWIG_AsVal_int(argv[9], &val10);
3995
+ if (!SWIG_IsOK(ecode10)) {
3996
+ SWIG_exception_fail(SWIG_ArgError(ecode10), Ruby_Format_TypeError( "", "int","lcdInit", 10, argv[9] ));
3997
+ }
3998
+ arg10 = (int)(val10);
3999
+ ecode11 = SWIG_AsVal_int(argv[10], &val11);
4000
+ if (!SWIG_IsOK(ecode11)) {
4001
+ SWIG_exception_fail(SWIG_ArgError(ecode11), Ruby_Format_TypeError( "", "int","lcdInit", 11, argv[10] ));
4002
+ }
4003
+ arg11 = (int)(val11);
4004
+ ecode12 = SWIG_AsVal_int(argv[11], &val12);
4005
+ if (!SWIG_IsOK(ecode12)) {
4006
+ SWIG_exception_fail(SWIG_ArgError(ecode12), Ruby_Format_TypeError( "", "int","lcdInit", 12, argv[11] ));
4007
+ }
4008
+ arg12 = (int)(val12);
4009
+ ecode13 = SWIG_AsVal_int(argv[12], &val13);
4010
+ if (!SWIG_IsOK(ecode13)) {
4011
+ SWIG_exception_fail(SWIG_ArgError(ecode13), Ruby_Format_TypeError( "", "int","lcdInit", 13, argv[12] ));
4012
+ }
4013
+ arg13 = (int)(val13);
4014
+ result = (int)lcdInit(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13);
4015
+ vresult = SWIG_From_int((int)(result));
4016
+ return vresult;
4017
+ fail:
4018
+ return Qnil;
4019
+ }
4020
+
4021
+
4022
+
4023
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4024
+
4025
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4026
+ static swig_type_info _swigt__p_f_int_int__int = {"_p_f_int_int__int", "int (*)(int,int)", 0, 0, (void*)0, 0};
4027
+ static swig_type_info _swigt__p_f_p_void__p_void = {"_p_f_p_void__p_void", "void *(*)(void *)", 0, 0, (void*)0, 0};
4028
+ static swig_type_info _swigt__p_f_void__void = {"_p_f_void__void", "void (*)(void)", 0, 0, (void*)0, 0};
4029
+ static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0};
4030
+
4031
+ static swig_type_info *swig_type_initial[] = {
4032
+ &_swigt__p_char,
4033
+ &_swigt__p_f_int_int__int,
4034
+ &_swigt__p_f_p_void__p_void,
4035
+ &_swigt__p_f_void__void,
4036
+ &_swigt__p_unsigned_char,
4037
+ };
4038
+
4039
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4040
+ static swig_cast_info _swigc__p_f_int_int__int[] = { {&_swigt__p_f_int_int__int, 0, 0, 0},{0, 0, 0, 0}};
4041
+ static swig_cast_info _swigc__p_f_p_void__p_void[] = { {&_swigt__p_f_p_void__p_void, 0, 0, 0},{0, 0, 0, 0}};
4042
+ static swig_cast_info _swigc__p_f_void__void[] = { {&_swigt__p_f_void__void, 0, 0, 0},{0, 0, 0, 0}};
4043
+ static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
4044
+
4045
+ static swig_cast_info *swig_cast_initial[] = {
4046
+ _swigc__p_char,
4047
+ _swigc__p_f_int_int__int,
4048
+ _swigc__p_f_p_void__p_void,
4049
+ _swigc__p_f_void__void,
4050
+ _swigc__p_unsigned_char,
4051
+ };
4052
+
4053
+
4054
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4055
+
4056
+ /* -----------------------------------------------------------------------------
4057
+ * Type initialization:
4058
+ * This problem is tough by the requirement that no dynamic
4059
+ * memory is used. Also, since swig_type_info structures store pointers to
4060
+ * swig_cast_info structures and swig_cast_info structures store pointers back
4061
+ * to swig_type_info structures, we need some lookup code at initialization.
4062
+ * The idea is that swig generates all the structures that are needed.
4063
+ * The runtime then collects these partially filled structures.
4064
+ * The SWIG_InitializeModule function takes these initial arrays out of
4065
+ * swig_module, and does all the lookup, filling in the swig_module.types
4066
+ * array with the correct data and linking the correct swig_cast_info
4067
+ * structures together.
4068
+ *
4069
+ * The generated swig_type_info structures are assigned staticly to an initial
4070
+ * array. We just loop through that array, and handle each type individually.
4071
+ * First we lookup if this type has been already loaded, and if so, use the
4072
+ * loaded structure instead of the generated one. Then we have to fill in the
4073
+ * cast linked list. The cast data is initially stored in something like a
4074
+ * two-dimensional array. Each row corresponds to a type (there are the same
4075
+ * number of rows as there are in the swig_type_initial array). Each entry in
4076
+ * a column is one of the swig_cast_info structures for that type.
4077
+ * The cast_initial array is actually an array of arrays, because each row has
4078
+ * a variable number of columns. So to actually build the cast linked list,
4079
+ * we find the array of casts associated with the type, and loop through it
4080
+ * adding the casts to the list. The one last trick we need to do is making
4081
+ * sure the type pointer in the swig_cast_info struct is correct.
4082
+ *
4083
+ * First off, we lookup the cast->type name to see if it is already loaded.
4084
+ * There are three cases to handle:
4085
+ * 1) If the cast->type has already been loaded AND the type we are adding
4086
+ * casting info to has not been loaded (it is in this module), THEN we
4087
+ * replace the cast->type pointer with the type pointer that has already
4088
+ * been loaded.
4089
+ * 2) If BOTH types (the one we are adding casting info to, and the
4090
+ * cast->type) are loaded, THEN the cast info has already been loaded by
4091
+ * the previous module so we just ignore it.
4092
+ * 3) Finally, if cast->type has not already been loaded, then we add that
4093
+ * swig_cast_info to the linked list (because the cast->type) pointer will
4094
+ * be correct.
4095
+ * ----------------------------------------------------------------------------- */
4096
+
4097
+ #ifdef __cplusplus
4098
+ extern "C" {
4099
+ #if 0
4100
+ } /* c-mode */
4101
+ #endif
4102
+ #endif
4103
+
4104
+ #if 0
4105
+ #define SWIGRUNTIME_DEBUG
4106
+ #endif
4107
+
4108
+
4109
+ SWIGRUNTIME void
4110
+ SWIG_InitializeModule(void *clientdata) {
4111
+ size_t i;
4112
+ swig_module_info *module_head, *iter;
4113
+ int found, init;
4114
+
4115
+ clientdata = clientdata;
4116
+
4117
+ /* check to see if the circular list has been setup, if not, set it up */
4118
+ if (swig_module.next==0) {
4119
+ /* Initialize the swig_module */
4120
+ swig_module.type_initial = swig_type_initial;
4121
+ swig_module.cast_initial = swig_cast_initial;
4122
+ swig_module.next = &swig_module;
4123
+ init = 1;
4124
+ } else {
4125
+ init = 0;
4126
+ }
4127
+
4128
+ /* Try and load any already created modules */
4129
+ module_head = SWIG_GetModule(clientdata);
4130
+ if (!module_head) {
4131
+ /* This is the first module loaded for this interpreter */
4132
+ /* so set the swig module into the interpreter */
4133
+ SWIG_SetModule(clientdata, &swig_module);
4134
+ module_head = &swig_module;
4135
+ } else {
4136
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4137
+ found=0;
4138
+ iter=module_head;
4139
+ do {
4140
+ if (iter==&swig_module) {
4141
+ found=1;
4142
+ break;
4143
+ }
4144
+ iter=iter->next;
4145
+ } while (iter!= module_head);
4146
+
4147
+ /* if the is found in the list, then all is done and we may leave */
4148
+ if (found) return;
4149
+ /* otherwise we must add out module into the list */
4150
+ swig_module.next = module_head->next;
4151
+ module_head->next = &swig_module;
4152
+ }
4153
+
4154
+ /* When multiple interpeters are used, a module could have already been initialized in
4155
+ a different interpreter, but not yet have a pointer in this interpreter.
4156
+ In this case, we do not want to continue adding types... everything should be
4157
+ set up already */
4158
+ if (init == 0) return;
4159
+
4160
+ /* Now work on filling in swig_module.types */
4161
+ #ifdef SWIGRUNTIME_DEBUG
4162
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
4163
+ #endif
4164
+ for (i = 0; i < swig_module.size; ++i) {
4165
+ swig_type_info *type = 0;
4166
+ swig_type_info *ret;
4167
+ swig_cast_info *cast;
4168
+
4169
+ #ifdef SWIGRUNTIME_DEBUG
4170
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4171
+ #endif
4172
+
4173
+ /* if there is another module already loaded */
4174
+ if (swig_module.next != &swig_module) {
4175
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
4176
+ }
4177
+ if (type) {
4178
+ /* Overwrite clientdata field */
4179
+ #ifdef SWIGRUNTIME_DEBUG
4180
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
4181
+ #endif
4182
+ if (swig_module.type_initial[i]->clientdata) {
4183
+ type->clientdata = swig_module.type_initial[i]->clientdata;
4184
+ #ifdef SWIGRUNTIME_DEBUG
4185
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
4186
+ #endif
4187
+ }
4188
+ } else {
4189
+ type = swig_module.type_initial[i];
4190
+ }
4191
+
4192
+ /* Insert casting types */
4193
+ cast = swig_module.cast_initial[i];
4194
+ while (cast->type) {
4195
+
4196
+ /* Don't need to add information already in the list */
4197
+ ret = 0;
4198
+ #ifdef SWIGRUNTIME_DEBUG
4199
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
4200
+ #endif
4201
+ if (swig_module.next != &swig_module) {
4202
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
4203
+ #ifdef SWIGRUNTIME_DEBUG
4204
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
4205
+ #endif
4206
+ }
4207
+ if (ret) {
4208
+ if (type == swig_module.type_initial[i]) {
4209
+ #ifdef SWIGRUNTIME_DEBUG
4210
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
4211
+ #endif
4212
+ cast->type = ret;
4213
+ ret = 0;
4214
+ } else {
4215
+ /* Check for casting already in the list */
4216
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
4217
+ #ifdef SWIGRUNTIME_DEBUG
4218
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
4219
+ #endif
4220
+ if (!ocast) ret = 0;
4221
+ }
4222
+ }
4223
+
4224
+ if (!ret) {
4225
+ #ifdef SWIGRUNTIME_DEBUG
4226
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
4227
+ #endif
4228
+ if (type->cast) {
4229
+ type->cast->prev = cast;
4230
+ cast->next = type->cast;
4231
+ }
4232
+ type->cast = cast;
4233
+ }
4234
+ cast++;
4235
+ }
4236
+ /* Set entry in modules->types array equal to the type */
4237
+ swig_module.types[i] = type;
4238
+ }
4239
+ swig_module.types[i] = 0;
4240
+
4241
+ #ifdef SWIGRUNTIME_DEBUG
4242
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
4243
+ for (i = 0; i < swig_module.size; ++i) {
4244
+ int j = 0;
4245
+ swig_cast_info *cast = swig_module.cast_initial[i];
4246
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4247
+ while (cast->type) {
4248
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
4249
+ cast++;
4250
+ ++j;
4251
+ }
4252
+ printf("---- Total casts: %d\n",j);
4253
+ }
4254
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
4255
+ #endif
4256
+ }
4257
+
4258
+ /* This function will propagate the clientdata field of type to
4259
+ * any new swig_type_info structures that have been added into the list
4260
+ * of equivalent types. It is like calling
4261
+ * SWIG_TypeClientData(type, clientdata) a second time.
4262
+ */
4263
+ SWIGRUNTIME void
4264
+ SWIG_PropagateClientData(void) {
4265
+ size_t i;
4266
+ swig_cast_info *equiv;
4267
+ static int init_run = 0;
4268
+
4269
+ if (init_run) return;
4270
+ init_run = 1;
4271
+
4272
+ for (i = 0; i < swig_module.size; i++) {
4273
+ if (swig_module.types[i]->clientdata) {
4274
+ equiv = swig_module.types[i]->cast;
4275
+ while (equiv) {
4276
+ if (!equiv->converter) {
4277
+ if (equiv->type && !equiv->type->clientdata)
4278
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
4279
+ }
4280
+ equiv = equiv->next;
4281
+ }
4282
+ }
4283
+ }
4284
+ }
4285
+
4286
+ #ifdef __cplusplus
4287
+ #if 0
4288
+ { /* c-mode */
4289
+ #endif
4290
+ }
4291
+ #endif
4292
+
4293
+ /*
4294
+
4295
+ */
4296
+ #ifdef __cplusplus
4297
+ extern "C"
4298
+ #endif
4299
+ SWIGEXPORT void Init_wiringpi2(void) {
4300
+ size_t i;
4301
+
4302
+ SWIG_InitRuntime();
4303
+ mWiringpi2 = rb_define_module("Wiringpi2");
4304
+
4305
+ SWIG_InitializeModule(0);
4306
+ for (i = 0; i < swig_module.size; i++) {
4307
+ SWIG_define_class(swig_module.types[i]);
4308
+ }
4309
+
4310
+ SWIG_RubyInitializeTrackings();
4311
+ rb_define_module_function(mWiringpi2, "wiringPiSetup", _wrap_wiringPiSetup, -1);
4312
+ rb_define_module_function(mWiringpi2, "wiringPiSetupSys", _wrap_wiringPiSetupSys, -1);
4313
+ rb_define_module_function(mWiringpi2, "wiringPiSetupGpio", _wrap_wiringPiSetupGpio, -1);
4314
+ rb_define_module_function(mWiringpi2, "wiringPiSetupPhys", _wrap_wiringPiSetupPhys, -1);
4315
+ rb_define_module_function(mWiringpi2, "piFaceSetup", _wrap_piFaceSetup, -1);
4316
+ rb_define_module_function(mWiringpi2, "pinMode", _wrap_pinMode, -1);
4317
+ rb_define_module_function(mWiringpi2, "pullUpDnControl", _wrap_pullUpDnControl, -1);
4318
+ rb_define_module_function(mWiringpi2, "digitalRead", _wrap_digitalRead, -1);
4319
+ rb_define_module_function(mWiringpi2, "digitalWrite", _wrap_digitalWrite, -1);
4320
+ rb_define_module_function(mWiringpi2, "pwmWrite", _wrap_pwmWrite, -1);
4321
+ rb_define_module_function(mWiringpi2, "analogRead", _wrap_analogRead, -1);
4322
+ rb_define_module_function(mWiringpi2, "analogWrite", _wrap_analogWrite, -1);
4323
+ rb_define_module_function(mWiringpi2, "piBoardRev", _wrap_piBoardRev, -1);
4324
+ rb_define_module_function(mWiringpi2, "wpiPinToGpio", _wrap_wpiPinToGpio, -1);
4325
+ rb_define_module_function(mWiringpi2, "physPinToGpio", _wrap_physPinToGpio, -1);
4326
+ rb_define_singleton_method(mWiringpi2, "waitForInterrupt", _wrap_waitForInterrupt_get, 0);
4327
+ rb_define_singleton_method(mWiringpi2, "waitForInterrupt=", _wrap_waitForInterrupt_set, 1);
4328
+ rb_define_module_function(mWiringpi2, "wiringPiISR", _wrap_wiringPiISR, -1);
4329
+ rb_define_module_function(mWiringpi2, "piThreadCreate", _wrap_piThreadCreate, -1);
4330
+ rb_define_module_function(mWiringpi2, "piLock", _wrap_piLock, -1);
4331
+ rb_define_module_function(mWiringpi2, "piUnlock", _wrap_piUnlock, -1);
4332
+ rb_define_module_function(mWiringpi2, "piHiPri", _wrap_piHiPri, -1);
4333
+ rb_define_module_function(mWiringpi2, "delay", _wrap_delay, -1);
4334
+ rb_define_module_function(mWiringpi2, "delayMicroseconds", _wrap_delayMicroseconds, -1);
4335
+ rb_define_module_function(mWiringpi2, "millis", _wrap_millis, -1);
4336
+ rb_define_module_function(mWiringpi2, "micros", _wrap_micros, -1);
4337
+ rb_define_module_function(mWiringpi2, "serialOpen", _wrap_serialOpen, -1);
4338
+ rb_define_module_function(mWiringpi2, "serialClose", _wrap_serialClose, -1);
4339
+ rb_define_module_function(mWiringpi2, "serialFlush", _wrap_serialFlush, -1);
4340
+ rb_define_module_function(mWiringpi2, "serialPutchar", _wrap_serialPutchar, -1);
4341
+ rb_define_module_function(mWiringpi2, "serialPuts", _wrap_serialPuts, -1);
4342
+ rb_define_module_function(mWiringpi2, "serialPrintf", _wrap_serialPrintf, -1);
4343
+ rb_define_module_function(mWiringpi2, "serialDataAvail", _wrap_serialDataAvail, -1);
4344
+ rb_define_module_function(mWiringpi2, "serialGetchar", _wrap_serialGetchar, -1);
4345
+ rb_define_module_function(mWiringpi2, "shiftOut", _wrap_shiftOut, -1);
4346
+ rb_define_module_function(mWiringpi2, "shiftIn", _wrap_shiftIn, -1);
4347
+ rb_define_module_function(mWiringpi2, "wiringPiSPIGetFd", _wrap_wiringPiSPIGetFd, -1);
4348
+ rb_define_module_function(mWiringpi2, "wiringPiSPIDataRW", _wrap_wiringPiSPIDataRW, -1);
4349
+ rb_define_module_function(mWiringpi2, "wiringPiSPISetup", _wrap_wiringPiSPISetup, -1);
4350
+ rb_define_module_function(mWiringpi2, "wiringPiI2CSetupInterface", _wrap_wiringPiI2CSetupInterface, -1);
4351
+ rb_define_module_function(mWiringpi2, "wiringPiI2CSetup", _wrap_wiringPiI2CSetup, -1);
4352
+ rb_define_module_function(mWiringpi2, "wiringPiI2CRead", _wrap_wiringPiI2CRead, -1);
4353
+ rb_define_module_function(mWiringpi2, "wiringPiI2CReadReg8", _wrap_wiringPiI2CReadReg8, -1);
4354
+ rb_define_module_function(mWiringpi2, "wiringPiI2CReadReg16", _wrap_wiringPiI2CReadReg16, -1);
4355
+ rb_define_module_function(mWiringpi2, "wiringPiI2CWrite", _wrap_wiringPiI2CWrite, -1);
4356
+ rb_define_module_function(mWiringpi2, "wiringPiI2CWriteReg8", _wrap_wiringPiI2CWriteReg8, -1);
4357
+ rb_define_module_function(mWiringpi2, "wiringPiI2CWriteReg16", _wrap_wiringPiI2CWriteReg16, -1);
4358
+ rb_define_module_function(mWiringpi2, "softToneCreate", _wrap_softToneCreate, -1);
4359
+ rb_define_module_function(mWiringpi2, "softToneWrite", _wrap_softToneWrite, -1);
4360
+ rb_define_module_function(mWiringpi2, "softServoWrite", _wrap_softServoWrite, -1);
4361
+ rb_define_module_function(mWiringpi2, "softServoSetup", _wrap_softServoSetup, -1);
4362
+ rb_define_module_function(mWiringpi2, "softPwmCreate", _wrap_softPwmCreate, -1);
4363
+ rb_define_module_function(mWiringpi2, "softPwmWrite", _wrap_softPwmWrite, -1);
4364
+ rb_define_module_function(mWiringpi2, "mcp23s17Setup", _wrap_mcp23s17Setup, -1);
4365
+ rb_define_module_function(mWiringpi2, "mcp23017Setup", _wrap_mcp23017Setup, -1);
4366
+ rb_define_module_function(mWiringpi2, "mcp23s08Setup", _wrap_mcp23s08Setup, -1);
4367
+ rb_define_module_function(mWiringpi2, "mcp23008Setup", _wrap_mcp23008Setup, -1);
4368
+ rb_define_module_function(mWiringpi2, "sr595Setup", _wrap_sr595Setup, -1);
4369
+ rb_define_module_function(mWiringpi2, "lcdHome", _wrap_lcdHome, -1);
4370
+ rb_define_module_function(mWiringpi2, "lcdClear", _wrap_lcdClear, -1);
4371
+ rb_define_module_function(mWiringpi2, "lcdSendCommand", _wrap_lcdSendCommand, -1);
4372
+ rb_define_module_function(mWiringpi2, "lcdPosition", _wrap_lcdPosition, -1);
4373
+ rb_define_module_function(mWiringpi2, "lcdPutchar", _wrap_lcdPutchar, -1);
4374
+ rb_define_module_function(mWiringpi2, "lcdPuts", _wrap_lcdPuts, -1);
4375
+ rb_define_module_function(mWiringpi2, "lcdPrintf", _wrap_lcdPrintf, -1);
4376
+ rb_define_module_function(mWiringpi2, "lcdInit", _wrap_lcdInit, -1);
4377
+ }
4378
+