gbarcode 0.98.16-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +3 -0
- data/COPYING +0 -0
- data/README +199 -0
- data/Rakefile +109 -0
- data/ext/barcode.h +119 -0
- data/ext/barcode_wrap.c +3192 -0
- data/ext/codabar.c +182 -0
- data/ext/code128.c +607 -0
- data/ext/code39.c +173 -0
- data/ext/code93.c +213 -0
- data/ext/ean.c +774 -0
- data/ext/extconf.rb +6 -0
- data/ext/i25.c +164 -0
- data/ext/library.c +244 -0
- data/ext/msi.c +155 -0
- data/ext/pcl.c +200 -0
- data/ext/plessey.c +164 -0
- data/ext/ps.c +272 -0
- data/ext/svg.c +174 -0
- data/extras/mingw-rbconfig.rb +176 -0
- data/lib/gbarcode.so +0 -0
- data/test/assets/gb-code128b.eps +44 -0
- data/test/gbarcode_test.rb +48 -0
- data/test/test_helper.rb +2 -0
- metadata +77 -0
data/CHANGELOG
ADDED
data/COPYING
ADDED
File without changes
|
data/README
ADDED
@@ -0,0 +1,199 @@
|
|
1
|
+
=Gbarcode
|
2
|
+
|
3
|
+
This project is a C extension that wraps the GNU Barcode project using SWIG.
|
4
|
+
The Gbarcode version coincides with the GNU Barcode version, the source of which is distributed
|
5
|
+
along with the gem, as barcode is not usually installed as a dynamically loaded library on
|
6
|
+
most systems. You should not need SWIG to be installed to use this gem, only if you wish to muck around with the
|
7
|
+
SWIG interface file. See README_SWIG.txt for more information.
|
8
|
+
|
9
|
+
This library is distributed under the GPL, see LICENSE.txt.
|
10
|
+
|
11
|
+
For recent changes, see CHANGELOG.txt
|
12
|
+
|
13
|
+
==USAGE
|
14
|
+
|
15
|
+
The Gbarcode class, being a straight wrap of the GNU Barcode C library, is not very Ruby centric.
|
16
|
+
The example of the usage will illustrate this point.
|
17
|
+
|
18
|
+
require 'rubygems'
|
19
|
+
require 'gbarcode'
|
20
|
+
|
21
|
+
# include the module so I type less ;-)
|
22
|
+
include Gbarcode
|
23
|
+
|
24
|
+
# There are three stages to creating a barcode
|
25
|
+
# 1) allocating the space with a string
|
26
|
+
# 2) encoding the string as some barcode
|
27
|
+
# 3) printing out the barcode to Postscript
|
28
|
+
|
29
|
+
# allocate the barcode for text "TEST1234"
|
30
|
+
bc = barcode_create("TEST1234")
|
31
|
+
|
32
|
+
# encode the barcode using code 39,since code 39 does not use a checksum, we can pass in this additional flag.
|
33
|
+
barcode_encode(bc, BARCODE_NO_CHECKSUM | BARCODE_39)
|
34
|
+
|
35
|
+
#print out the barcode to a Postscript file, using the default width and height and page placement
|
36
|
+
barcode_print(bc, File.new("testout.ps", "w"), 0,0,0,0,0)
|
37
|
+
|
38
|
+
#print out the barcode to a Postscript EPS file, using the default width and height and page placement
|
39
|
+
barcode_print(bc, File.new("testout.eps", "w"), 0,0,0,0,BARCODE_OUT_EPS)
|
40
|
+
|
41
|
+
# you can even read the output to a stream like so
|
42
|
+
rd, wr = IO.pipe
|
43
|
+
barcode_print(bc, wr, 0,0,0,0,BARCODE_OUT_EPS)
|
44
|
+
wr.close() # must close this to use the read pipe
|
45
|
+
myEpsBarcodeAsString = rd.readlines().join("\n")
|
46
|
+
rd.close() # it is good practice to also close this pipe
|
47
|
+
|
48
|
+
It is good practice to close any IO pipes, or else you may get over-run by zombie processes when
|
49
|
+
using with long-running applications (e.g. Rails)
|
50
|
+
|
51
|
+
|
52
|
+
==BARCODE FORMATS
|
53
|
+
|
54
|
+
Gbarcode and Rbarcode, being a wrap of GNU Barcode, supports those formats that GNU barcode supports. From the GNU barcode documentation:
|
55
|
+
|
56
|
+
The encodings flags are supplied as constants from Gbarcode. Notice the use of the bitwise OR operation on the flag in the USAGE section.
|
57
|
+
Here are a listing of the flags, taken from the GNU barcode docs:
|
58
|
+
BARCODE_EAN
|
59
|
+
BARCODE_UPC
|
60
|
+
BARCODE_ISBN
|
61
|
+
BARCODE_128B
|
62
|
+
BARCODE_128C
|
63
|
+
BARCODE_128
|
64
|
+
BARCODE_128RAW
|
65
|
+
BARCODE_39
|
66
|
+
BARCODE_I25
|
67
|
+
BARCODE_CBR
|
68
|
+
BARCODE_MSI
|
69
|
+
BARCODE_PLS
|
70
|
+
BARCODE_93
|
71
|
+
The currently supported encoding types: EAN (13 digits, 8 digits,
|
72
|
+
13 + 2 add-on and 13 + 5 add-on), UPC (UPC-A, UPC-E, UPC-A with 2
|
73
|
+
or 5 digit add-on), ISBN (with or without the 5-digit add-on),
|
74
|
+
CODE128-B (the whole set of printable ASCII characters), CODE128-C
|
75
|
+
(two digits encoded by each barcode symbol), CODE128 (all ASCII
|
76
|
+
values), a "raw-input" pseudo-code that generates CODE128 output,
|
77
|
+
CODE39 (alphanumeric), "interleaved 2 of 5" (numeric), Codabar
|
78
|
+
(numeric plus a few symbols), MSI (numeric) and Plessey (hex
|
79
|
+
digits). *Note Supported Encodings::.
|
80
|
+
|
81
|
+
BARCODE_ANY
|
82
|
+
This special encoding type (represented by a value of zero, so it
|
83
|
+
will be the default) tells the encoding procedure to look for the
|
84
|
+
first encoding type that can deal with a textual string.
|
85
|
+
Therefore, a 11-digit code will be printed as UPC (as well as
|
86
|
+
6-digit, 11+2 and 11+5), a 12-digit (or 7-digit, or 12+2 or 12+5)
|
87
|
+
as EAN13, an ISBN code (with or without hyphens, with or without
|
88
|
+
add-5) will be encoded in its EAN13 representation, an even number
|
89
|
+
of digits is encoded using CODE128C and a generic string is
|
90
|
+
encoded using CODE128B. Since code-39 offers a much larger
|
91
|
+
representation for the same text string, code128-b is preferred
|
92
|
+
over code39 for alphanumeric strings.
|
93
|
+
|
94
|
+
BARCODE_NO_CHECKSUM
|
95
|
+
Instructs the engine not to add the checksum character to the
|
96
|
+
output. Not all the encoding types can drop the checksum; those
|
97
|
+
where the checksum is mandatory (like EAN and UPC) just ignore the
|
98
|
+
flag.
|
99
|
+
|
100
|
+
|
101
|
+
Here are some flags that can be given to the barcode_print method:
|
102
|
+
|
103
|
+
`BARCODE_OUT_PS'
|
104
|
+
`BARCODE_OUT_EPS'
|
105
|
+
`BARCODE_OUT_PCL'
|
106
|
+
`BARCODE_OUT_PCL_III'
|
107
|
+
The currently supported encoding types: full-page postscript and
|
108
|
+
encapsulated postscript; PCL (print command language, for HP
|
109
|
+
printers) and PCL-III (same as PCL, but uses a font not available
|
110
|
+
on older printers).
|
111
|
+
|
112
|
+
`BARCODE_NO_ASCII'
|
113
|
+
Instructs the engine not to print the ascii string on output. By
|
114
|
+
default the bar code is accompanied with an ascii version of the
|
115
|
+
text it encodes.
|
116
|
+
|
117
|
+
`BARCODE_OUT_NOHEADERS'
|
118
|
+
The flag instructs the printing engine not to print the header and
|
119
|
+
footer part of the file. This makes sense for the postscript
|
120
|
+
engine but might not make sense for other engines; such other
|
121
|
+
engines will silently ignore the flag just like the PCL back-end
|
122
|
+
does
|
123
|
+
|
124
|
+
Multiple flags are given by bitwise OR-ing them together (e.g. "BARCODE_NO_CHECKSUM | BARCODE_39" ) For more details on GNU barcode itself, see the GNU Barcode site at http://www.gnu.org/software/barcode/barcode.html .
|
125
|
+
|
126
|
+
==FUNCTION REFERENCE
|
127
|
+
|
128
|
+
Since RDoc for some reason was not picking up my comments from the C code, here is a reference for the functions exported by the library:
|
129
|
+
|
130
|
+
|
131
|
+
Gbarcode::BarcodeItem = Gbarcode.barcode_create( _text_ )
|
132
|
+
Class method for creating a BarcodeItem for the given string
|
133
|
+
[text] The barcode text to encode
|
134
|
+
+returns+ Gbarcode::BarcodeItem
|
135
|
+
|
136
|
+
int = Gbarcode.barcode_delete( Gbarcode::BarcodeItem )
|
137
|
+
Class method for destroying the BarcodeItem. Return 0 if successful
|
138
|
+
|
139
|
+
int = Gbarcode.barcode_encode( Gbarcode::BarcodeItem, <ENCODING FLAGS> )
|
140
|
+
Encodes the BarcodeItem to one of the flags above. Returns 0 if successful.
|
141
|
+
|
142
|
+
int = Gbarcode.barcode_print( Gbarcode::BarcodeItem, File, <OUTPUT FLAGS>)'
|
143
|
+
Print the bar code described by bc to the specified file. Valid
|
144
|
+
flags are the output type, BARCODE_NO_ASCII and
|
145
|
+
BARCODE_OUT_NOHEADERS, other flags are ignored. If any of these
|
146
|
+
flags is zero, it will be inherited from bc->flags which therefore
|
147
|
+
takes precedence. The function returns 0 on success and -1 in case
|
148
|
+
of error (with bc->error set accordingly). In case of success, the
|
149
|
+
bar code is printed to the specified file, which won't be closed
|
150
|
+
after use.
|
151
|
+
|
152
|
+
int = Gbarcode.barcode_position( Gbarcode::BarcodeItem, int width, int height, int xoff, int yoff, double scalef);'
|
153
|
+
The function is a shortcut to assign values to the BarcodeItem object. Sets the dimensions, page offsets and scaling factors all in one go. See below for more complete documentation of BarcodeItem.
|
154
|
+
|
155
|
+
int = Gbarcode.barcode_encode_and_print(char *text, FILE *f, int wid, int hei, int xoff, int yoff, int flags);'
|
156
|
+
The function deals with the whole life of the barcode object by
|
157
|
+
calling the other functions; it uses all the specified flags.
|
158
|
+
|
159
|
+
Gbarcode::BarcodeItem.ascii
|
160
|
+
Returns the ASCII text that is being encoded
|
161
|
+
|
162
|
+
Gbarcode::BarcodeItem.ascii=
|
163
|
+
Sets the ASCII text to be encoded. Please note that if the barcode was already encoded, you will
|
164
|
+
need to re-encode it once this method has been called, or else you will be printing out the wrong barcode!
|
165
|
+
|
166
|
+
Gbarcode::BarcodeItem.encoding
|
167
|
+
Gets the encoding scheme as a human readable string
|
168
|
+
|
169
|
+
Gbarcode::BarcodeItem.partial
|
170
|
+
Gets a representation of the barcode as a sequence of integers representing the width of a span.
|
171
|
+
The integers alternate between specifying white space and a black bar, starting with white space.
|
172
|
+
|
173
|
+
Gbarcode::BarcodeItem.textinfo
|
174
|
+
Gets the Postscript representation of the ASCII text that will be printed to the barcode file.
|
175
|
+
|
176
|
+
Gbarcode::BarcodeItem.width=
|
177
|
+
Gbarcode::BarcodeItem.width
|
178
|
+
Set/get the width in points, which are 1/72 of an inch, or about 1 pixel on most monitors
|
179
|
+
|
180
|
+
Gbarcode::BarcodeItem.width=
|
181
|
+
Gbarcode::BarcodeItem.width
|
182
|
+
Set/get the height in points
|
183
|
+
|
184
|
+
Gbarcode::BarcodeItem.xoff=
|
185
|
+
Gbarcode::BarcodeItem.xoff
|
186
|
+
Set/get the page X coordinate offset
|
187
|
+
|
188
|
+
Gbarcode::BarcodeItem.yoff=
|
189
|
+
Gbarcode::BarcodeItem.yoff
|
190
|
+
Set/get the page Y coordinate offset
|
191
|
+
|
192
|
+
Gbarcode::BarcodeItem.margin=
|
193
|
+
Gbarcode::BarcodeItem.margin
|
194
|
+
Set/get the margin around the barcode in points
|
195
|
+
|
196
|
+
Gbarcode::BarcodeItem.scalef=
|
197
|
+
Gbarcode::BarcodeItem.scalef
|
198
|
+
Set/get the scaling factor of the barcode
|
199
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/testtask'
|
5
|
+
require 'rake/packagetask'
|
6
|
+
require 'rake/gempackagetask'
|
7
|
+
require 'rake/rdoctask'
|
8
|
+
|
9
|
+
AUTH = "Angel Pizarro" # can also be an array of Authors
|
10
|
+
AUTH_EMAIL = "angel@delagoya.com"
|
11
|
+
DESC_SHORT = "A barcode library that wraps GNU Barcode using SWIG."
|
12
|
+
DESC_LONG = DESC_SHORT + " " + "Most popular encoding schemes are supported (Code 39, UPC, ISBN, etc.). See the README for a full listing." +
|
13
|
+
" For more Ruby-ish syntax, you should use the Rbarcode gem."
|
14
|
+
|
15
|
+
GEM_NAME = "gbarcode" # what ppl will type to install your gem
|
16
|
+
RUBYFORGE_PROJECT = "gbarcode" # The unix name for your project
|
17
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
18
|
+
REV = nil # UNCOMMENT IF REQUIRED: File.read(".svn/entries")[/committed-rev="(d+)"/, 1] rescue nil
|
19
|
+
GEM_VERSION = "0.98"
|
20
|
+
RDOC_OPTS = ["--exclude", "\.c$"]
|
21
|
+
|
22
|
+
gem_spec = Gem::Specification.new do |s|
|
23
|
+
s.name = GEM_NAME
|
24
|
+
s.version = GEM_VERSION
|
25
|
+
s.summary = DESC_SHORT
|
26
|
+
s.description = DESC_LONG
|
27
|
+
s.author = AUTH
|
28
|
+
s.test_files = FileList['test/**/*']
|
29
|
+
s.files = FileList['*.txt', 'doc/**/*.*', 'ext/**/*.c', 'ext/**/*.h', 'ext/**/*.rb']
|
30
|
+
s.require_paths = [".","ext"]
|
31
|
+
s.autorequire = "Gbarcode"
|
32
|
+
s.extensions = ["ext/extconf.rb"]
|
33
|
+
s.extra_rdoc_files = FileList['*.txt']
|
34
|
+
s.has_rdoc = true
|
35
|
+
s.rdoc_options = RDOC_OPTS
|
36
|
+
s.platform = Gem::Platform::RUBY
|
37
|
+
s.required_ruby_version = ">= 1.8.4"
|
38
|
+
s.rubyforge_project = RUBYFORGE_PROJECT
|
39
|
+
end
|
40
|
+
|
41
|
+
desc "package the gem"
|
42
|
+
Rake::GemPackageTask.new(gem_spec) do |pkg|
|
43
|
+
pkg.need_zip = true
|
44
|
+
pkg.need_tar = true
|
45
|
+
# rm_f FileList['pkg/**/*.*']
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "Run test code"
|
49
|
+
Rake::TestTask.new(:test) do |t|
|
50
|
+
t.libs << ["ext", "lib", "test"]
|
51
|
+
t.pattern = 'test/**/*_test.rb'
|
52
|
+
t.verbose = true
|
53
|
+
end
|
54
|
+
|
55
|
+
desc "Create documentation"
|
56
|
+
Rake::RDocTask.new(:docs) do |rd|
|
57
|
+
rd.main = "README.txt"
|
58
|
+
rd.rdoc_files.include("./*.txt")
|
59
|
+
rd.options = RDOC_OPTS
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "Makes the Makefile"
|
63
|
+
task :extconf do
|
64
|
+
system 'cd ext/; ruby extconf.rb'
|
65
|
+
end
|
66
|
+
|
67
|
+
desc "Compiles extensions"
|
68
|
+
task :compile => [:extconf] do
|
69
|
+
system 'cd ext/; make'
|
70
|
+
end
|
71
|
+
|
72
|
+
### Win32 Packages ###
|
73
|
+
|
74
|
+
Win32Spec = SPEC.dup
|
75
|
+
Win32Spec.platform = Gem::Platform::WIN32
|
76
|
+
Win32Spec.files = PKG_FILES + ['lib/hpricot_scan.so']
|
77
|
+
Win32Spec.extensions = []
|
78
|
+
|
79
|
+
WIN32_PKG_DIR = "#{PKG}-mswin32"
|
80
|
+
|
81
|
+
desc "Package up the Win32 distribution."
|
82
|
+
file WIN32_PKG_DIR => [:package] do
|
83
|
+
sh "tar zxf pkg/#{PKG}.tgz"
|
84
|
+
mv PKG, WIN32_PKG_DIR
|
85
|
+
end
|
86
|
+
|
87
|
+
desc "Cross-compile the hpricot_scan extension for win32"
|
88
|
+
file "hpricot_scan_win32" => [WIN32_PKG_DIR] do
|
89
|
+
cp "extras/mingw-rbconfig.rb", "#{WIN32_PKG_DIR}/ext/hpricot_scan/rbconfig.rb"
|
90
|
+
sh "cd #{WIN32_PKG_DIR}/ext/hpricot_scan/ && ruby -I. extconf.rb && make"
|
91
|
+
mv "#{WIN32_PKG_DIR}/ext/hpricot_scan/hpricot_scan.so", "#{WIN32_PKG_DIR}/lib"
|
92
|
+
end
|
93
|
+
|
94
|
+
desc "Build the binary RubyGems package for win32"
|
95
|
+
task :package_win32 => ["hpricot_scan_win32"] do
|
96
|
+
Dir.chdir("#{WIN32_PKG_DIR}") do
|
97
|
+
Gem::Builder.new(Win32Spec).build
|
98
|
+
verbose(true) {
|
99
|
+
mv Dir["*.gem"].first, "../pkg/#{WIN32_PKG_DIR}.gem"
|
100
|
+
}
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
CLEAN.include WIN32_PKG_DIR
|
105
|
+
|
106
|
+
### end WIN32 ###
|
107
|
+
|
108
|
+
# add compiled files to clean list
|
109
|
+
CLOBBER << FileList["ext/**/*.o", "ext/Makefile"]
|
data/ext/barcode.h
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
/*
|
2
|
+
* barcode.h -- definitions for libbarcode
|
3
|
+
*
|
4
|
+
* Copyright (c) 1999 Alessandro Rubini (rubini@gnu.org)
|
5
|
+
* Copyright (c) 1999 Prosa Srl. (prosa@prosa.it)
|
6
|
+
*
|
7
|
+
* This program is free software; you can redistribute it and/or modify
|
8
|
+
* it under the terms of the GNU General Public License as published by
|
9
|
+
* the Free Software Foundation; either version 2 of the License, or
|
10
|
+
* (at your option) any later version.
|
11
|
+
*
|
12
|
+
* This program is distributed in the hope that it will be useful,
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
* GNU General Public License for more details.
|
16
|
+
*
|
17
|
+
* You should have received a copy of the GNU General Public License
|
18
|
+
* along with this program; if not, write to the Free Software
|
19
|
+
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
20
|
+
*/
|
21
|
+
|
22
|
+
#ifndef _BARCODE_H_
|
23
|
+
#define _BARCODE_H_
|
24
|
+
|
25
|
+
#include <stdio.h>
|
26
|
+
|
27
|
+
#define BARCODE_VERSION "0.98"
|
28
|
+
#define BARCODE_VERSION_INT 9800
|
29
|
+
|
30
|
+
/*
|
31
|
+
* The object
|
32
|
+
*/
|
33
|
+
struct Barcode_Item {
|
34
|
+
int flags; /* type of encoding and decoding */
|
35
|
+
char *ascii; /* malloced */
|
36
|
+
char *partial; /* malloced too */
|
37
|
+
char *textinfo; /* information about text positioning */
|
38
|
+
char *encoding; /* code name, filled by encoding engine */
|
39
|
+
int width, height; /* output units */
|
40
|
+
int xoff, yoff; /* output units */
|
41
|
+
int margin; /* output units */
|
42
|
+
double scalef; /* requested scaling for barcode */
|
43
|
+
int error; /* an errno-like value, in case of failure */
|
44
|
+
};
|
45
|
+
|
46
|
+
/*
|
47
|
+
* The flags field
|
48
|
+
*/
|
49
|
+
#define BARCODE_DEFAULT_FLAGS 0x00000000
|
50
|
+
|
51
|
+
#define BARCODE_ENCODING_MASK 0x000000ff /* 256 possibilites... */
|
52
|
+
#define BARCODE_NO_ASCII 0x00000100 /* avoid text in output */
|
53
|
+
#define BARCODE_NO_CHECKSUM 0x00000200 /* avoid checksum in output */
|
54
|
+
|
55
|
+
#define BARCODE_OUTPUT_MASK 0x000ff000 /* 256 output types */
|
56
|
+
#define BARCODE_OUT_EPS 0x00001000
|
57
|
+
#define BARCODE_OUT_PS 0x00002000
|
58
|
+
#define BARCODE_OUT_PCL 0x00004000 /* by Andrea Scopece */
|
59
|
+
/* PCL_III 0x00008000 */
|
60
|
+
#define BARCODE_OUT_PCL_III 0x0000C000
|
61
|
+
#define BARCODE_OUT_NOHEADERS 0x00100000 /* no header nor footer */
|
62
|
+
|
63
|
+
enum {
|
64
|
+
BARCODE_ANY = 0, /* choose best-fit */
|
65
|
+
BARCODE_EAN,
|
66
|
+
BARCODE_UPC, /* upc == 12-digit ean */
|
67
|
+
BARCODE_ISBN, /* isbn numbers (still EAN13) */
|
68
|
+
BARCODE_39, /* code 39 */
|
69
|
+
BARCODE_128, /* code 128 (a,b,c: autoselection) */
|
70
|
+
BARCODE_128C, /* code 128 (compact form for digits) */
|
71
|
+
BARCODE_128B, /* code 128, full printable ascii */
|
72
|
+
BARCODE_I25, /* interleaved 2 of 5 (only digits) */
|
73
|
+
BARCODE_128RAW, /* Raw code 128 (by Leonid A. Broukhis) */
|
74
|
+
BARCODE_CBR, /* Codabar (by Leonid A. Broukhis) */
|
75
|
+
BARCODE_MSI, /* MSI (by Leonid A. Broukhis) */
|
76
|
+
BARCODE_PLS, /* Plessey (by Leonid A. Broukhis) */
|
77
|
+
BARCODE_93 /* code 93 (by Nathan D. Holmes) */
|
78
|
+
};
|
79
|
+
|
80
|
+
#define BARCODE_DEFAULT_MARGIN 10
|
81
|
+
|
82
|
+
#ifdef __cplusplus
|
83
|
+
extern "C" {
|
84
|
+
#endif
|
85
|
+
/*
|
86
|
+
* Create and destroy barcode structures
|
87
|
+
*/
|
88
|
+
extern struct Barcode_Item *Barcode_Create(char *text);
|
89
|
+
extern int Barcode_Delete(struct Barcode_Item *bc);
|
90
|
+
|
91
|
+
/*
|
92
|
+
* Encode and print
|
93
|
+
*/
|
94
|
+
extern int Barcode_Encode(struct Barcode_Item *bc, int flags);
|
95
|
+
extern int Barcode_Print(struct Barcode_Item *bc, FILE *f, int flags);
|
96
|
+
|
97
|
+
/*
|
98
|
+
* Choose the position
|
99
|
+
*/
|
100
|
+
extern int Barcode_Position(struct Barcode_Item *bc, int wid, int hei,
|
101
|
+
int xoff, int yoff, double scalef);
|
102
|
+
|
103
|
+
/*
|
104
|
+
* Do it all in one step
|
105
|
+
*/
|
106
|
+
extern int Barcode_Encode_and_Print(char *text, FILE *f, int wid, int hei,
|
107
|
+
int xoff, int yoff, int flags);
|
108
|
+
|
109
|
+
|
110
|
+
/*
|
111
|
+
* Return current version (integer and string)
|
112
|
+
*/
|
113
|
+
extern int Barcode_Version(char *versionname);
|
114
|
+
|
115
|
+
#ifdef __cplusplus
|
116
|
+
}
|
117
|
+
#endif
|
118
|
+
|
119
|
+
#endif /* _BARCODE_H_ */
|
data/ext/barcode_wrap.c
ADDED
@@ -0,0 +1,3192 @@
|
|
1
|
+
/* ----------------------------------------------------------------------------
|
2
|
+
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
+
* Version 1.3.31
|
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
|
+
* This section contains generic SWIG labels for method/variable
|
14
|
+
* declarations/attributes, and other compiler dependent labels.
|
15
|
+
* ----------------------------------------------------------------------------- */
|
16
|
+
|
17
|
+
/* template workaround for compilers that cannot correctly implement the C++ standard */
|
18
|
+
#ifndef SWIGTEMPLATEDISAMBIGUATOR
|
19
|
+
# if defined(__SUNPRO_CC)
|
20
|
+
# if (__SUNPRO_CC <= 0x560)
|
21
|
+
# define SWIGTEMPLATEDISAMBIGUATOR template
|
22
|
+
# else
|
23
|
+
# define SWIGTEMPLATEDISAMBIGUATOR
|
24
|
+
# endif
|
25
|
+
# else
|
26
|
+
# define SWIGTEMPLATEDISAMBIGUATOR
|
27
|
+
# endif
|
28
|
+
#endif
|
29
|
+
|
30
|
+
/* inline attribute */
|
31
|
+
#ifndef SWIGINLINE
|
32
|
+
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
|
33
|
+
# define SWIGINLINE inline
|
34
|
+
# else
|
35
|
+
# define SWIGINLINE
|
36
|
+
# endif
|
37
|
+
#endif
|
38
|
+
|
39
|
+
/* attribute recognised by some compilers to avoid 'unused' warnings */
|
40
|
+
#ifndef SWIGUNUSED
|
41
|
+
# if defined(__GNUC__)
|
42
|
+
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
43
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
44
|
+
# else
|
45
|
+
# define SWIGUNUSED
|
46
|
+
# endif
|
47
|
+
# elif defined(__ICC)
|
48
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
49
|
+
# else
|
50
|
+
# define SWIGUNUSED
|
51
|
+
# endif
|
52
|
+
#endif
|
53
|
+
|
54
|
+
#ifndef SWIGUNUSEDPARM
|
55
|
+
# ifdef __cplusplus
|
56
|
+
# define SWIGUNUSEDPARM(p)
|
57
|
+
# else
|
58
|
+
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
59
|
+
# endif
|
60
|
+
#endif
|
61
|
+
|
62
|
+
/* internal SWIG method */
|
63
|
+
#ifndef SWIGINTERN
|
64
|
+
# define SWIGINTERN static SWIGUNUSED
|
65
|
+
#endif
|
66
|
+
|
67
|
+
/* internal inline SWIG method */
|
68
|
+
#ifndef SWIGINTERNINLINE
|
69
|
+
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
|
70
|
+
#endif
|
71
|
+
|
72
|
+
/* exporting methods */
|
73
|
+
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
|
74
|
+
# ifndef GCC_HASCLASSVISIBILITY
|
75
|
+
# define GCC_HASCLASSVISIBILITY
|
76
|
+
# endif
|
77
|
+
#endif
|
78
|
+
|
79
|
+
#ifndef SWIGEXPORT
|
80
|
+
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
81
|
+
# if defined(STATIC_LINKED)
|
82
|
+
# define SWIGEXPORT
|
83
|
+
# else
|
84
|
+
# define SWIGEXPORT __declspec(dllexport)
|
85
|
+
# endif
|
86
|
+
# else
|
87
|
+
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
|
88
|
+
# define SWIGEXPORT __attribute__ ((visibility("default")))
|
89
|
+
# else
|
90
|
+
# define SWIGEXPORT
|
91
|
+
# endif
|
92
|
+
# endif
|
93
|
+
#endif
|
94
|
+
|
95
|
+
/* calling conventions for Windows */
|
96
|
+
#ifndef SWIGSTDCALL
|
97
|
+
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
98
|
+
# define SWIGSTDCALL __stdcall
|
99
|
+
# else
|
100
|
+
# define SWIGSTDCALL
|
101
|
+
# endif
|
102
|
+
#endif
|
103
|
+
|
104
|
+
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
105
|
+
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
106
|
+
# define _CRT_SECURE_NO_DEPRECATE
|
107
|
+
#endif
|
108
|
+
|
109
|
+
/* -----------------------------------------------------------------------------
|
110
|
+
* This section contains generic SWIG labels for method/variable
|
111
|
+
* declarations/attributes, and other compiler dependent labels.
|
112
|
+
* ----------------------------------------------------------------------------- */
|
113
|
+
|
114
|
+
/* template workaround for compilers that cannot correctly implement the C++ standard */
|
115
|
+
#ifndef SWIGTEMPLATEDISAMBIGUATOR
|
116
|
+
# if defined(__SUNPRO_CC)
|
117
|
+
# if (__SUNPRO_CC <= 0x560)
|
118
|
+
# define SWIGTEMPLATEDISAMBIGUATOR template
|
119
|
+
# else
|
120
|
+
# define SWIGTEMPLATEDISAMBIGUATOR
|
121
|
+
# endif
|
122
|
+
# else
|
123
|
+
# define SWIGTEMPLATEDISAMBIGUATOR
|
124
|
+
# endif
|
125
|
+
#endif
|
126
|
+
|
127
|
+
/* inline attribute */
|
128
|
+
#ifndef SWIGINLINE
|
129
|
+
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
|
130
|
+
# define SWIGINLINE inline
|
131
|
+
# else
|
132
|
+
# define SWIGINLINE
|
133
|
+
# endif
|
134
|
+
#endif
|
135
|
+
|
136
|
+
/* attribute recognised by some compilers to avoid 'unused' warnings */
|
137
|
+
#ifndef SWIGUNUSED
|
138
|
+
# if defined(__GNUC__)
|
139
|
+
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
140
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
141
|
+
# else
|
142
|
+
# define SWIGUNUSED
|
143
|
+
# endif
|
144
|
+
# elif defined(__ICC)
|
145
|
+
# define SWIGUNUSED __attribute__ ((__unused__))
|
146
|
+
# else
|
147
|
+
# define SWIGUNUSED
|
148
|
+
# endif
|
149
|
+
#endif
|
150
|
+
|
151
|
+
#ifndef SWIGUNUSEDPARM
|
152
|
+
# ifdef __cplusplus
|
153
|
+
# define SWIGUNUSEDPARM(p)
|
154
|
+
# else
|
155
|
+
# define SWIGUNUSEDPARM(p) p SWIGUNUSED
|
156
|
+
# endif
|
157
|
+
#endif
|
158
|
+
|
159
|
+
/* internal SWIG method */
|
160
|
+
#ifndef SWIGINTERN
|
161
|
+
# define SWIGINTERN static SWIGUNUSED
|
162
|
+
#endif
|
163
|
+
|
164
|
+
/* internal inline SWIG method */
|
165
|
+
#ifndef SWIGINTERNINLINE
|
166
|
+
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
|
167
|
+
#endif
|
168
|
+
|
169
|
+
/* exporting methods */
|
170
|
+
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
|
171
|
+
# ifndef GCC_HASCLASSVISIBILITY
|
172
|
+
# define GCC_HASCLASSVISIBILITY
|
173
|
+
# endif
|
174
|
+
#endif
|
175
|
+
|
176
|
+
#ifndef SWIGEXPORT
|
177
|
+
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
178
|
+
# if defined(STATIC_LINKED)
|
179
|
+
# define SWIGEXPORT
|
180
|
+
# else
|
181
|
+
# define SWIGEXPORT __declspec(dllexport)
|
182
|
+
# endif
|
183
|
+
# else
|
184
|
+
# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
|
185
|
+
# define SWIGEXPORT __attribute__ ((visibility("default")))
|
186
|
+
# else
|
187
|
+
# define SWIGEXPORT
|
188
|
+
# endif
|
189
|
+
# endif
|
190
|
+
#endif
|
191
|
+
|
192
|
+
/* calling conventions for Windows */
|
193
|
+
#ifndef SWIGSTDCALL
|
194
|
+
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
195
|
+
# define SWIGSTDCALL __stdcall
|
196
|
+
# else
|
197
|
+
# define SWIGSTDCALL
|
198
|
+
# endif
|
199
|
+
#endif
|
200
|
+
|
201
|
+
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
202
|
+
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
203
|
+
# define _CRT_SECURE_NO_DEPRECATE
|
204
|
+
#endif
|
205
|
+
|
206
|
+
/* -----------------------------------------------------------------------------
|
207
|
+
* swigrun.swg
|
208
|
+
*
|
209
|
+
* This file contains generic CAPI SWIG runtime support for pointer
|
210
|
+
* type checking.
|
211
|
+
* ----------------------------------------------------------------------------- */
|
212
|
+
|
213
|
+
/* This should only be incremented when either the layout of swig_type_info changes,
|
214
|
+
or for whatever reason, the runtime changes incompatibly */
|
215
|
+
#define SWIG_RUNTIME_VERSION "3"
|
216
|
+
|
217
|
+
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
|
218
|
+
#ifdef SWIG_TYPE_TABLE
|
219
|
+
# define SWIG_QUOTE_STRING(x) #x
|
220
|
+
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
|
221
|
+
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
|
222
|
+
#else
|
223
|
+
# define SWIG_TYPE_TABLE_NAME
|
224
|
+
#endif
|
225
|
+
|
226
|
+
/*
|
227
|
+
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
|
228
|
+
creating a static or dynamic library from the swig runtime code.
|
229
|
+
In 99.9% of the cases, swig just needs to declare them as 'static'.
|
230
|
+
|
231
|
+
But only do this if is strictly necessary, ie, if you have problems
|
232
|
+
with your compiler or so.
|
233
|
+
*/
|
234
|
+
|
235
|
+
#ifndef SWIGRUNTIME
|
236
|
+
# define SWIGRUNTIME SWIGINTERN
|
237
|
+
#endif
|
238
|
+
|
239
|
+
#ifndef SWIGRUNTIMEINLINE
|
240
|
+
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
|
241
|
+
#endif
|
242
|
+
|
243
|
+
/* Generic buffer size */
|
244
|
+
#ifndef SWIG_BUFFER_SIZE
|
245
|
+
# define SWIG_BUFFER_SIZE 1024
|
246
|
+
#endif
|
247
|
+
|
248
|
+
/* Flags for pointer conversions */
|
249
|
+
#define SWIG_POINTER_DISOWN 0x1
|
250
|
+
|
251
|
+
/* Flags for new pointer objects */
|
252
|
+
#define SWIG_POINTER_OWN 0x1
|
253
|
+
|
254
|
+
|
255
|
+
/*
|
256
|
+
Flags/methods for returning states.
|
257
|
+
|
258
|
+
The swig conversion methods, as ConvertPtr, return and integer
|
259
|
+
that tells if the conversion was successful or not. And if not,
|
260
|
+
an error code can be returned (see swigerrors.swg for the codes).
|
261
|
+
|
262
|
+
Use the following macros/flags to set or process the returning
|
263
|
+
states.
|
264
|
+
|
265
|
+
In old swig versions, you usually write code as:
|
266
|
+
|
267
|
+
if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
|
268
|
+
// success code
|
269
|
+
} else {
|
270
|
+
//fail code
|
271
|
+
}
|
272
|
+
|
273
|
+
Now you can be more explicit as:
|
274
|
+
|
275
|
+
int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
|
276
|
+
if (SWIG_IsOK(res)) {
|
277
|
+
// success code
|
278
|
+
} else {
|
279
|
+
// fail code
|
280
|
+
}
|
281
|
+
|
282
|
+
that seems to be the same, but now you can also do
|
283
|
+
|
284
|
+
Type *ptr;
|
285
|
+
int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
|
286
|
+
if (SWIG_IsOK(res)) {
|
287
|
+
// success code
|
288
|
+
if (SWIG_IsNewObj(res) {
|
289
|
+
...
|
290
|
+
delete *ptr;
|
291
|
+
} else {
|
292
|
+
...
|
293
|
+
}
|
294
|
+
} else {
|
295
|
+
// fail code
|
296
|
+
}
|
297
|
+
|
298
|
+
I.e., now SWIG_ConvertPtr can return new objects and you can
|
299
|
+
identify the case and take care of the deallocation. Of course that
|
300
|
+
requires also to SWIG_ConvertPtr to return new result values, as
|
301
|
+
|
302
|
+
int SWIG_ConvertPtr(obj, ptr,...) {
|
303
|
+
if (<obj is ok>) {
|
304
|
+
if (<need new object>) {
|
305
|
+
*ptr = <ptr to new allocated object>;
|
306
|
+
return SWIG_NEWOBJ;
|
307
|
+
} else {
|
308
|
+
*ptr = <ptr to old object>;
|
309
|
+
return SWIG_OLDOBJ;
|
310
|
+
}
|
311
|
+
} else {
|
312
|
+
return SWIG_BADOBJ;
|
313
|
+
}
|
314
|
+
}
|
315
|
+
|
316
|
+
Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
|
317
|
+
more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
|
318
|
+
swig errors code.
|
319
|
+
|
320
|
+
Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
|
321
|
+
allows to return the 'cast rank', for example, if you have this
|
322
|
+
|
323
|
+
int food(double)
|
324
|
+
int fooi(int);
|
325
|
+
|
326
|
+
and you call
|
327
|
+
|
328
|
+
food(1) // cast rank '1' (1 -> 1.0)
|
329
|
+
fooi(1) // cast rank '0'
|
330
|
+
|
331
|
+
just use the SWIG_AddCast()/SWIG_CheckState()
|
332
|
+
|
333
|
+
|
334
|
+
*/
|
335
|
+
#define SWIG_OK (0)
|
336
|
+
#define SWIG_ERROR (-1)
|
337
|
+
#define SWIG_IsOK(r) (r >= 0)
|
338
|
+
#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
|
339
|
+
|
340
|
+
/* The CastRankLimit says how many bits are used for the cast rank */
|
341
|
+
#define SWIG_CASTRANKLIMIT (1 << 8)
|
342
|
+
/* The NewMask denotes the object was created (using new/malloc) */
|
343
|
+
#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
|
344
|
+
/* The TmpMask is for in/out typemaps that use temporal objects */
|
345
|
+
#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
|
346
|
+
/* Simple returning values */
|
347
|
+
#define SWIG_BADOBJ (SWIG_ERROR)
|
348
|
+
#define SWIG_OLDOBJ (SWIG_OK)
|
349
|
+
#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
|
350
|
+
#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
|
351
|
+
/* Check, add and del mask methods */
|
352
|
+
#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
|
353
|
+
#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
|
354
|
+
#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
|
355
|
+
#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
|
356
|
+
#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
|
357
|
+
#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
|
358
|
+
|
359
|
+
|
360
|
+
/* Cast-Rank Mode */
|
361
|
+
#if defined(SWIG_CASTRANK_MODE)
|
362
|
+
# ifndef SWIG_TypeRank
|
363
|
+
# define SWIG_TypeRank unsigned long
|
364
|
+
# endif
|
365
|
+
# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
|
366
|
+
# define SWIG_MAXCASTRANK (2)
|
367
|
+
# endif
|
368
|
+
# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
|
369
|
+
# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
|
370
|
+
SWIGINTERNINLINE int SWIG_AddCast(int r) {
|
371
|
+
return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
|
372
|
+
}
|
373
|
+
SWIGINTERNINLINE int SWIG_CheckState(int r) {
|
374
|
+
return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
|
375
|
+
}
|
376
|
+
#else /* no cast-rank mode */
|
377
|
+
# define SWIG_AddCast
|
378
|
+
# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
|
379
|
+
#endif
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
#include <string.h>
|
385
|
+
|
386
|
+
#ifdef __cplusplus
|
387
|
+
extern "C" {
|
388
|
+
#endif
|
389
|
+
|
390
|
+
typedef void *(*swig_converter_func)(void *);
|
391
|
+
typedef struct swig_type_info *(*swig_dycast_func)(void **);
|
392
|
+
|
393
|
+
/* Structure to store inforomation on one type */
|
394
|
+
typedef struct swig_type_info {
|
395
|
+
const char *name; /* mangled name of this type */
|
396
|
+
const char *str; /* human readable name of this type */
|
397
|
+
swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
|
398
|
+
struct swig_cast_info *cast; /* linked list of types that can cast into this type */
|
399
|
+
void *clientdata; /* language specific type data */
|
400
|
+
int owndata; /* flag if the structure owns the clientdata */
|
401
|
+
} swig_type_info;
|
402
|
+
|
403
|
+
/* Structure to store a type and conversion function used for casting */
|
404
|
+
typedef struct swig_cast_info {
|
405
|
+
swig_type_info *type; /* pointer to type that is equivalent to this type */
|
406
|
+
swig_converter_func converter; /* function to cast the void pointers */
|
407
|
+
struct swig_cast_info *next; /* pointer to next cast in linked list */
|
408
|
+
struct swig_cast_info *prev; /* pointer to the previous cast */
|
409
|
+
} swig_cast_info;
|
410
|
+
|
411
|
+
/* Structure used to store module information
|
412
|
+
* Each module generates one structure like this, and the runtime collects
|
413
|
+
* all of these structures and stores them in a circularly linked list.*/
|
414
|
+
typedef struct swig_module_info {
|
415
|
+
swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
|
416
|
+
size_t size; /* Number of types in this module */
|
417
|
+
struct swig_module_info *next; /* Pointer to next element in circularly linked list */
|
418
|
+
swig_type_info **type_initial; /* Array of initially generated type structures */
|
419
|
+
swig_cast_info **cast_initial; /* Array of initially generated casting structures */
|
420
|
+
void *clientdata; /* Language specific module data */
|
421
|
+
} swig_module_info;
|
422
|
+
|
423
|
+
/*
|
424
|
+
Compare two type names skipping the space characters, therefore
|
425
|
+
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
|
426
|
+
|
427
|
+
Return 0 when the two name types are equivalent, as in
|
428
|
+
strncmp, but skipping ' '.
|
429
|
+
*/
|
430
|
+
SWIGRUNTIME int
|
431
|
+
SWIG_TypeNameComp(const char *f1, const char *l1,
|
432
|
+
const char *f2, const char *l2) {
|
433
|
+
for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
|
434
|
+
while ((*f1 == ' ') && (f1 != l1)) ++f1;
|
435
|
+
while ((*f2 == ' ') && (f2 != l2)) ++f2;
|
436
|
+
if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
|
437
|
+
}
|
438
|
+
return (l1 - f1) - (l2 - f2);
|
439
|
+
}
|
440
|
+
|
441
|
+
/*
|
442
|
+
Check type equivalence in a name list like <name1>|<name2>|...
|
443
|
+
Return 0 if not equal, 1 if equal
|
444
|
+
*/
|
445
|
+
SWIGRUNTIME int
|
446
|
+
SWIG_TypeEquiv(const char *nb, const char *tb) {
|
447
|
+
int equiv = 0;
|
448
|
+
const char* te = tb + strlen(tb);
|
449
|
+
const char* ne = nb;
|
450
|
+
while (!equiv && *ne) {
|
451
|
+
for (nb = ne; *ne; ++ne) {
|
452
|
+
if (*ne == '|') break;
|
453
|
+
}
|
454
|
+
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
|
455
|
+
if (*ne) ++ne;
|
456
|
+
}
|
457
|
+
return equiv;
|
458
|
+
}
|
459
|
+
|
460
|
+
/*
|
461
|
+
Check type equivalence in a name list like <name1>|<name2>|...
|
462
|
+
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
|
463
|
+
*/
|
464
|
+
SWIGRUNTIME int
|
465
|
+
SWIG_TypeCompare(const char *nb, const char *tb) {
|
466
|
+
int equiv = 0;
|
467
|
+
const char* te = tb + strlen(tb);
|
468
|
+
const char* ne = nb;
|
469
|
+
while (!equiv && *ne) {
|
470
|
+
for (nb = ne; *ne; ++ne) {
|
471
|
+
if (*ne == '|') break;
|
472
|
+
}
|
473
|
+
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
|
474
|
+
if (*ne) ++ne;
|
475
|
+
}
|
476
|
+
return equiv;
|
477
|
+
}
|
478
|
+
|
479
|
+
|
480
|
+
/* think of this as a c++ template<> or a scheme macro */
|
481
|
+
#define SWIG_TypeCheck_Template(comparison, ty) \
|
482
|
+
if (ty) { \
|
483
|
+
swig_cast_info *iter = ty->cast; \
|
484
|
+
while (iter) { \
|
485
|
+
if (comparison) { \
|
486
|
+
if (iter == ty->cast) return iter; \
|
487
|
+
/* Move iter to the top of the linked list */ \
|
488
|
+
iter->prev->next = iter->next; \
|
489
|
+
if (iter->next) \
|
490
|
+
iter->next->prev = iter->prev; \
|
491
|
+
iter->next = ty->cast; \
|
492
|
+
iter->prev = 0; \
|
493
|
+
if (ty->cast) ty->cast->prev = iter; \
|
494
|
+
ty->cast = iter; \
|
495
|
+
return iter; \
|
496
|
+
} \
|
497
|
+
iter = iter->next; \
|
498
|
+
} \
|
499
|
+
} \
|
500
|
+
return 0
|
501
|
+
|
502
|
+
/*
|
503
|
+
Check the typename
|
504
|
+
*/
|
505
|
+
SWIGRUNTIME swig_cast_info *
|
506
|
+
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
|
507
|
+
SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
|
508
|
+
}
|
509
|
+
|
510
|
+
/* Same as previous function, except strcmp is replaced with a pointer comparison */
|
511
|
+
SWIGRUNTIME swig_cast_info *
|
512
|
+
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
|
513
|
+
SWIG_TypeCheck_Template(iter->type == from, into);
|
514
|
+
}
|
515
|
+
|
516
|
+
/*
|
517
|
+
Cast a pointer up an inheritance hierarchy
|
518
|
+
*/
|
519
|
+
SWIGRUNTIMEINLINE void *
|
520
|
+
SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
|
521
|
+
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
|
522
|
+
}
|
523
|
+
|
524
|
+
/*
|
525
|
+
Dynamic pointer casting. Down an inheritance hierarchy
|
526
|
+
*/
|
527
|
+
SWIGRUNTIME swig_type_info *
|
528
|
+
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
|
529
|
+
swig_type_info *lastty = ty;
|
530
|
+
if (!ty || !ty->dcast) return ty;
|
531
|
+
while (ty && (ty->dcast)) {
|
532
|
+
ty = (*ty->dcast)(ptr);
|
533
|
+
if (ty) lastty = ty;
|
534
|
+
}
|
535
|
+
return lastty;
|
536
|
+
}
|
537
|
+
|
538
|
+
/*
|
539
|
+
Return the name associated with this type
|
540
|
+
*/
|
541
|
+
SWIGRUNTIMEINLINE const char *
|
542
|
+
SWIG_TypeName(const swig_type_info *ty) {
|
543
|
+
return ty->name;
|
544
|
+
}
|
545
|
+
|
546
|
+
/*
|
547
|
+
Return the pretty name associated with this type,
|
548
|
+
that is an unmangled type name in a form presentable to the user.
|
549
|
+
*/
|
550
|
+
SWIGRUNTIME const char *
|
551
|
+
SWIG_TypePrettyName(const swig_type_info *type) {
|
552
|
+
/* The "str" field contains the equivalent pretty names of the
|
553
|
+
type, separated by vertical-bar characters. We choose
|
554
|
+
to print the last name, as it is often (?) the most
|
555
|
+
specific. */
|
556
|
+
if (!type) return NULL;
|
557
|
+
if (type->str != NULL) {
|
558
|
+
const char *last_name = type->str;
|
559
|
+
const char *s;
|
560
|
+
for (s = type->str; *s; s++)
|
561
|
+
if (*s == '|') last_name = s+1;
|
562
|
+
return last_name;
|
563
|
+
}
|
564
|
+
else
|
565
|
+
return type->name;
|
566
|
+
}
|
567
|
+
|
568
|
+
/*
|
569
|
+
Set the clientdata field for a type
|
570
|
+
*/
|
571
|
+
SWIGRUNTIME void
|
572
|
+
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
|
573
|
+
swig_cast_info *cast = ti->cast;
|
574
|
+
/* if (ti->clientdata == clientdata) return; */
|
575
|
+
ti->clientdata = clientdata;
|
576
|
+
|
577
|
+
while (cast) {
|
578
|
+
if (!cast->converter) {
|
579
|
+
swig_type_info *tc = cast->type;
|
580
|
+
if (!tc->clientdata) {
|
581
|
+
SWIG_TypeClientData(tc, clientdata);
|
582
|
+
}
|
583
|
+
}
|
584
|
+
cast = cast->next;
|
585
|
+
}
|
586
|
+
}
|
587
|
+
SWIGRUNTIME void
|
588
|
+
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
|
589
|
+
SWIG_TypeClientData(ti, clientdata);
|
590
|
+
ti->owndata = 1;
|
591
|
+
}
|
592
|
+
|
593
|
+
/*
|
594
|
+
Search for a swig_type_info structure only by mangled name
|
595
|
+
Search is a O(log #types)
|
596
|
+
|
597
|
+
We start searching at module start, and finish searching when start == end.
|
598
|
+
Note: if start == end at the beginning of the function, we go all the way around
|
599
|
+
the circular list.
|
600
|
+
*/
|
601
|
+
SWIGRUNTIME swig_type_info *
|
602
|
+
SWIG_MangledTypeQueryModule(swig_module_info *start,
|
603
|
+
swig_module_info *end,
|
604
|
+
const char *name) {
|
605
|
+
swig_module_info *iter = start;
|
606
|
+
do {
|
607
|
+
if (iter->size) {
|
608
|
+
register size_t l = 0;
|
609
|
+
register size_t r = iter->size - 1;
|
610
|
+
do {
|
611
|
+
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
|
612
|
+
register size_t i = (l + r) >> 1;
|
613
|
+
const char *iname = iter->types[i]->name;
|
614
|
+
if (iname) {
|
615
|
+
register int compare = strcmp(name, iname);
|
616
|
+
if (compare == 0) {
|
617
|
+
return iter->types[i];
|
618
|
+
} else if (compare < 0) {
|
619
|
+
if (i) {
|
620
|
+
r = i - 1;
|
621
|
+
} else {
|
622
|
+
break;
|
623
|
+
}
|
624
|
+
} else if (compare > 0) {
|
625
|
+
l = i + 1;
|
626
|
+
}
|
627
|
+
} else {
|
628
|
+
break; /* should never happen */
|
629
|
+
}
|
630
|
+
} while (l <= r);
|
631
|
+
}
|
632
|
+
iter = iter->next;
|
633
|
+
} while (iter != end);
|
634
|
+
return 0;
|
635
|
+
}
|
636
|
+
|
637
|
+
/*
|
638
|
+
Search for a swig_type_info structure for either a mangled name or a human readable name.
|
639
|
+
It first searches the mangled names of the types, which is a O(log #types)
|
640
|
+
If a type is not found it then searches the human readable names, which is O(#types).
|
641
|
+
|
642
|
+
We start searching at module start, and finish searching when start == end.
|
643
|
+
Note: if start == end at the beginning of the function, we go all the way around
|
644
|
+
the circular list.
|
645
|
+
*/
|
646
|
+
SWIGRUNTIME swig_type_info *
|
647
|
+
SWIG_TypeQueryModule(swig_module_info *start,
|
648
|
+
swig_module_info *end,
|
649
|
+
const char *name) {
|
650
|
+
/* STEP 1: Search the name field using binary search */
|
651
|
+
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
|
652
|
+
if (ret) {
|
653
|
+
return ret;
|
654
|
+
} else {
|
655
|
+
/* STEP 2: If the type hasn't been found, do a complete search
|
656
|
+
of the str field (the human readable name) */
|
657
|
+
swig_module_info *iter = start;
|
658
|
+
do {
|
659
|
+
register size_t i = 0;
|
660
|
+
for (; i < iter->size; ++i) {
|
661
|
+
if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
|
662
|
+
return iter->types[i];
|
663
|
+
}
|
664
|
+
iter = iter->next;
|
665
|
+
} while (iter != end);
|
666
|
+
}
|
667
|
+
|
668
|
+
/* neither found a match */
|
669
|
+
return 0;
|
670
|
+
}
|
671
|
+
|
672
|
+
/*
|
673
|
+
Pack binary data into a string
|
674
|
+
*/
|
675
|
+
SWIGRUNTIME char *
|
676
|
+
SWIG_PackData(char *c, void *ptr, size_t sz) {
|
677
|
+
static const char hex[17] = "0123456789abcdef";
|
678
|
+
register const unsigned char *u = (unsigned char *) ptr;
|
679
|
+
register const unsigned char *eu = u + sz;
|
680
|
+
for (; u != eu; ++u) {
|
681
|
+
register unsigned char uu = *u;
|
682
|
+
*(c++) = hex[(uu & 0xf0) >> 4];
|
683
|
+
*(c++) = hex[uu & 0xf];
|
684
|
+
}
|
685
|
+
return c;
|
686
|
+
}
|
687
|
+
|
688
|
+
/*
|
689
|
+
Unpack binary data from a string
|
690
|
+
*/
|
691
|
+
SWIGRUNTIME const char *
|
692
|
+
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
|
693
|
+
register unsigned char *u = (unsigned char *) ptr;
|
694
|
+
register const unsigned char *eu = u + sz;
|
695
|
+
for (; u != eu; ++u) {
|
696
|
+
register char d = *(c++);
|
697
|
+
register unsigned char uu;
|
698
|
+
if ((d >= '0') && (d <= '9'))
|
699
|
+
uu = ((d - '0') << 4);
|
700
|
+
else if ((d >= 'a') && (d <= 'f'))
|
701
|
+
uu = ((d - ('a'-10)) << 4);
|
702
|
+
else
|
703
|
+
return (char *) 0;
|
704
|
+
d = *(c++);
|
705
|
+
if ((d >= '0') && (d <= '9'))
|
706
|
+
uu |= (d - '0');
|
707
|
+
else if ((d >= 'a') && (d <= 'f'))
|
708
|
+
uu |= (d - ('a'-10));
|
709
|
+
else
|
710
|
+
return (char *) 0;
|
711
|
+
*u = uu;
|
712
|
+
}
|
713
|
+
return c;
|
714
|
+
}
|
715
|
+
|
716
|
+
/*
|
717
|
+
Pack 'void *' into a string buffer.
|
718
|
+
*/
|
719
|
+
SWIGRUNTIME char *
|
720
|
+
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
|
721
|
+
char *r = buff;
|
722
|
+
if ((2*sizeof(void *) + 2) > bsz) return 0;
|
723
|
+
*(r++) = '_';
|
724
|
+
r = SWIG_PackData(r,&ptr,sizeof(void *));
|
725
|
+
if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
|
726
|
+
strcpy(r,name);
|
727
|
+
return buff;
|
728
|
+
}
|
729
|
+
|
730
|
+
SWIGRUNTIME const char *
|
731
|
+
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
|
732
|
+
if (*c != '_') {
|
733
|
+
if (strcmp(c,"NULL") == 0) {
|
734
|
+
*ptr = (void *) 0;
|
735
|
+
return name;
|
736
|
+
} else {
|
737
|
+
return 0;
|
738
|
+
}
|
739
|
+
}
|
740
|
+
return SWIG_UnpackData(++c,ptr,sizeof(void *));
|
741
|
+
}
|
742
|
+
|
743
|
+
SWIGRUNTIME char *
|
744
|
+
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
|
745
|
+
char *r = buff;
|
746
|
+
size_t lname = (name ? strlen(name) : 0);
|
747
|
+
if ((2*sz + 2 + lname) > bsz) return 0;
|
748
|
+
*(r++) = '_';
|
749
|
+
r = SWIG_PackData(r,ptr,sz);
|
750
|
+
if (lname) {
|
751
|
+
strncpy(r,name,lname+1);
|
752
|
+
} else {
|
753
|
+
*r = 0;
|
754
|
+
}
|
755
|
+
return buff;
|
756
|
+
}
|
757
|
+
|
758
|
+
SWIGRUNTIME const char *
|
759
|
+
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
|
760
|
+
if (*c != '_') {
|
761
|
+
if (strcmp(c,"NULL") == 0) {
|
762
|
+
memset(ptr,0,sz);
|
763
|
+
return name;
|
764
|
+
} else {
|
765
|
+
return 0;
|
766
|
+
}
|
767
|
+
}
|
768
|
+
return SWIG_UnpackData(++c,ptr,sz);
|
769
|
+
}
|
770
|
+
|
771
|
+
#ifdef __cplusplus
|
772
|
+
}
|
773
|
+
#endif
|
774
|
+
|
775
|
+
/* Errors in SWIG */
|
776
|
+
#define SWIG_UnknownError -1
|
777
|
+
#define SWIG_IOError -2
|
778
|
+
#define SWIG_RuntimeError -3
|
779
|
+
#define SWIG_IndexError -4
|
780
|
+
#define SWIG_TypeError -5
|
781
|
+
#define SWIG_DivisionByZero -6
|
782
|
+
#define SWIG_OverflowError -7
|
783
|
+
#define SWIG_SyntaxError -8
|
784
|
+
#define SWIG_ValueError -9
|
785
|
+
#define SWIG_SystemError -10
|
786
|
+
#define SWIG_AttributeError -11
|
787
|
+
#define SWIG_MemoryError -12
|
788
|
+
#define SWIG_NullReferenceError -13
|
789
|
+
|
790
|
+
|
791
|
+
|
792
|
+
#include <ruby.h>
|
793
|
+
|
794
|
+
/* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
|
795
|
+
#ifndef NUM2LL
|
796
|
+
#define NUM2LL(x) NUM2LONG((x))
|
797
|
+
#endif
|
798
|
+
#ifndef LL2NUM
|
799
|
+
#define LL2NUM(x) INT2NUM((long) (x))
|
800
|
+
#endif
|
801
|
+
#ifndef ULL2NUM
|
802
|
+
#define ULL2NUM(x) UINT2NUM((unsigned long) (x))
|
803
|
+
#endif
|
804
|
+
|
805
|
+
/* Ruby 1.7 doesn't (yet) define NUM2ULL() */
|
806
|
+
#ifndef NUM2ULL
|
807
|
+
#ifdef HAVE_LONG_LONG
|
808
|
+
#define NUM2ULL(x) rb_num2ull((x))
|
809
|
+
#else
|
810
|
+
#define NUM2ULL(x) NUM2ULONG(x)
|
811
|
+
#endif
|
812
|
+
#endif
|
813
|
+
|
814
|
+
/* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
|
815
|
+
/* Define these for older versions so we can just write code the new way */
|
816
|
+
#ifndef RSTRING_LEN
|
817
|
+
# define RSTRING_LEN(x) RSTRING(x)->len
|
818
|
+
#endif
|
819
|
+
#ifndef RSTRING_PTR
|
820
|
+
# define RSTRING_PTR(x) RSTRING(x)->ptr
|
821
|
+
#endif
|
822
|
+
#ifndef RARRAY_LEN
|
823
|
+
# define RARRAY_LEN(x) RARRAY(x)->len
|
824
|
+
#endif
|
825
|
+
#ifndef RARRAY_PTR
|
826
|
+
# define RARRAY_PTR(x) RARRAY(x)->ptr
|
827
|
+
#endif
|
828
|
+
|
829
|
+
/*
|
830
|
+
* Need to be very careful about how these macros are defined, especially
|
831
|
+
* when compiling C++ code or C code with an ANSI C compiler.
|
832
|
+
*
|
833
|
+
* VALUEFUNC(f) is a macro used to typecast a C function that implements
|
834
|
+
* a Ruby method so that it can be passed as an argument to API functions
|
835
|
+
* like rb_define_method() and rb_define_singleton_method().
|
836
|
+
*
|
837
|
+
* VOIDFUNC(f) is a macro used to typecast a C function that implements
|
838
|
+
* either the "mark" or "free" stuff for a Ruby Data object, so that it
|
839
|
+
* can be passed as an argument to API functions like Data_Wrap_Struct()
|
840
|
+
* and Data_Make_Struct().
|
841
|
+
*/
|
842
|
+
|
843
|
+
#ifdef __cplusplus
|
844
|
+
# ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
|
845
|
+
# define PROTECTFUNC(f) ((VALUE (*)()) f)
|
846
|
+
# define VALUEFUNC(f) ((VALUE (*)()) f)
|
847
|
+
# define VOIDFUNC(f) ((void (*)()) f)
|
848
|
+
# else
|
849
|
+
# ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
|
850
|
+
# define PROTECTFUNC(f) ((VALUE (*)()) f)
|
851
|
+
# define VALUEFUNC(f) ((VALUE (*)()) f)
|
852
|
+
# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
|
853
|
+
# else /* These definitions should work for Ruby 1.7+ */
|
854
|
+
# define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
|
855
|
+
# define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
|
856
|
+
# define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
|
857
|
+
# endif
|
858
|
+
# endif
|
859
|
+
#else
|
860
|
+
# define VALUEFUNC(f) (f)
|
861
|
+
# define VOIDFUNC(f) (f)
|
862
|
+
#endif
|
863
|
+
|
864
|
+
/* Don't use for expressions have side effect */
|
865
|
+
#ifndef RB_STRING_VALUE
|
866
|
+
#define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
|
867
|
+
#endif
|
868
|
+
#ifndef StringValue
|
869
|
+
#define StringValue(s) RB_STRING_VALUE(s)
|
870
|
+
#endif
|
871
|
+
#ifndef StringValuePtr
|
872
|
+
#define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
|
873
|
+
#endif
|
874
|
+
#ifndef StringValueLen
|
875
|
+
#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
|
876
|
+
#endif
|
877
|
+
#ifndef SafeStringValue
|
878
|
+
#define SafeStringValue(v) do {\
|
879
|
+
StringValue(v);\
|
880
|
+
rb_check_safe_str(v);\
|
881
|
+
} while (0)
|
882
|
+
#endif
|
883
|
+
|
884
|
+
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
|
885
|
+
#define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
|
886
|
+
#define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
|
887
|
+
#endif
|
888
|
+
|
889
|
+
|
890
|
+
/* -----------------------------------------------------------------------------
|
891
|
+
* error manipulation
|
892
|
+
* ----------------------------------------------------------------------------- */
|
893
|
+
|
894
|
+
|
895
|
+
/* Define some additional error types */
|
896
|
+
#define SWIG_ObjectPreviouslyDeletedError -100
|
897
|
+
|
898
|
+
|
899
|
+
/* Define custom exceptions for errors that do not map to existing Ruby
|
900
|
+
exceptions. Note this only works for C++ since a global cannot be
|
901
|
+
initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
|
902
|
+
|
903
|
+
SWIGINTERN VALUE
|
904
|
+
getNullReferenceError(void) {
|
905
|
+
static int init = 0;
|
906
|
+
static VALUE rb_eNullReferenceError ;
|
907
|
+
if (!init) {
|
908
|
+
init = 1;
|
909
|
+
rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
|
910
|
+
}
|
911
|
+
return rb_eNullReferenceError;
|
912
|
+
}
|
913
|
+
|
914
|
+
SWIGINTERN VALUE
|
915
|
+
getObjectPreviouslyDeletedError(void) {
|
916
|
+
static int init = 0;
|
917
|
+
static VALUE rb_eObjectPreviouslyDeleted ;
|
918
|
+
if (!init) {
|
919
|
+
init = 1;
|
920
|
+
rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
|
921
|
+
}
|
922
|
+
return rb_eObjectPreviouslyDeleted;
|
923
|
+
}
|
924
|
+
|
925
|
+
|
926
|
+
SWIGINTERN VALUE
|
927
|
+
SWIG_Ruby_ErrorType(int SWIG_code) {
|
928
|
+
VALUE type;
|
929
|
+
switch (SWIG_code) {
|
930
|
+
case SWIG_MemoryError:
|
931
|
+
type = rb_eNoMemError;
|
932
|
+
break;
|
933
|
+
case SWIG_IOError:
|
934
|
+
type = rb_eIOError;
|
935
|
+
break;
|
936
|
+
case SWIG_RuntimeError:
|
937
|
+
type = rb_eRuntimeError;
|
938
|
+
break;
|
939
|
+
case SWIG_IndexError:
|
940
|
+
type = rb_eIndexError;
|
941
|
+
break;
|
942
|
+
case SWIG_TypeError:
|
943
|
+
type = rb_eTypeError;
|
944
|
+
break;
|
945
|
+
case SWIG_DivisionByZero:
|
946
|
+
type = rb_eZeroDivError;
|
947
|
+
break;
|
948
|
+
case SWIG_OverflowError:
|
949
|
+
type = rb_eRangeError;
|
950
|
+
break;
|
951
|
+
case SWIG_SyntaxError:
|
952
|
+
type = rb_eSyntaxError;
|
953
|
+
break;
|
954
|
+
case SWIG_ValueError:
|
955
|
+
type = rb_eArgError;
|
956
|
+
break;
|
957
|
+
case SWIG_SystemError:
|
958
|
+
type = rb_eFatal;
|
959
|
+
break;
|
960
|
+
case SWIG_AttributeError:
|
961
|
+
type = rb_eRuntimeError;
|
962
|
+
break;
|
963
|
+
case SWIG_NullReferenceError:
|
964
|
+
type = getNullReferenceError();
|
965
|
+
break;
|
966
|
+
case SWIG_ObjectPreviouslyDeletedError:
|
967
|
+
type = getObjectPreviouslyDeletedError();
|
968
|
+
break;
|
969
|
+
case SWIG_UnknownError:
|
970
|
+
type = rb_eRuntimeError;
|
971
|
+
break;
|
972
|
+
default:
|
973
|
+
type = rb_eRuntimeError;
|
974
|
+
}
|
975
|
+
return type;
|
976
|
+
}
|
977
|
+
|
978
|
+
|
979
|
+
|
980
|
+
|
981
|
+
/* -----------------------------------------------------------------------------
|
982
|
+
* See the LICENSE file for information on copyright, usage and redistribution
|
983
|
+
* of SWIG, and the README file for authors - http://www.swig.org/release.html.
|
984
|
+
*
|
985
|
+
* rubytracking.swg
|
986
|
+
*
|
987
|
+
* This file contains support for tracking mappings from
|
988
|
+
* Ruby objects to C++ objects. This functionality is needed
|
989
|
+
* to implement mark functions for Ruby's mark and sweep
|
990
|
+
* garbage collector.
|
991
|
+
* ----------------------------------------------------------------------------- */
|
992
|
+
|
993
|
+
#ifdef __cplusplus
|
994
|
+
extern "C" {
|
995
|
+
#endif
|
996
|
+
|
997
|
+
|
998
|
+
/* Global Ruby hash table to store Trackings from C/C++
|
999
|
+
structs to Ruby Objects. */
|
1000
|
+
static VALUE swig_ruby_trackings;
|
1001
|
+
|
1002
|
+
/* Global variable that stores a reference to the ruby
|
1003
|
+
hash table delete function. */
|
1004
|
+
static ID swig_ruby_hash_delete = 0;
|
1005
|
+
|
1006
|
+
/* Setup a Ruby hash table to store Trackings */
|
1007
|
+
SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
|
1008
|
+
/* Create a ruby hash table to store Trackings from C++
|
1009
|
+
objects to Ruby objects. Also make sure to tell
|
1010
|
+
the garabage collector about the hash table. */
|
1011
|
+
swig_ruby_trackings = rb_hash_new();
|
1012
|
+
rb_gc_register_address(&swig_ruby_trackings);
|
1013
|
+
|
1014
|
+
/* Now store a reference to the hash table delete function
|
1015
|
+
so that we only have to look it up once.*/
|
1016
|
+
swig_ruby_hash_delete = rb_intern("delete");
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
/* Get a Ruby number to reference a pointer */
|
1020
|
+
SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
|
1021
|
+
/* We cast the pointer to an unsigned long
|
1022
|
+
and then store a reference to it using
|
1023
|
+
a Ruby number object. */
|
1024
|
+
|
1025
|
+
/* Convert the pointer to a Ruby number */
|
1026
|
+
unsigned long value = (unsigned long) ptr;
|
1027
|
+
return LONG2NUM(value);
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
/* Get a Ruby number to reference an object */
|
1031
|
+
SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
|
1032
|
+
/* We cast the object to an unsigned long
|
1033
|
+
and then store a reference to it using
|
1034
|
+
a Ruby number object. */
|
1035
|
+
|
1036
|
+
/* Convert the Object to a Ruby number */
|
1037
|
+
unsigned long value = (unsigned long) object;
|
1038
|
+
return LONG2NUM(value);
|
1039
|
+
}
|
1040
|
+
|
1041
|
+
/* Get a Ruby object from a previously stored reference */
|
1042
|
+
SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
|
1043
|
+
/* The provided Ruby number object is a reference
|
1044
|
+
to the Ruby object we want.*/
|
1045
|
+
|
1046
|
+
/* First convert the Ruby number to a C number */
|
1047
|
+
unsigned long value = NUM2LONG(reference);
|
1048
|
+
return (VALUE) value;
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
/* Add a Tracking from a C/C++ struct to a Ruby object */
|
1052
|
+
SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
|
1053
|
+
/* In a Ruby hash table we store the pointer and
|
1054
|
+
the associated Ruby object. The trick here is
|
1055
|
+
that we cannot store the Ruby object directly - if
|
1056
|
+
we do then it cannot be garbage collected. So
|
1057
|
+
instead we typecast it as a unsigned long and
|
1058
|
+
convert it to a Ruby number object.*/
|
1059
|
+
|
1060
|
+
/* Get a reference to the pointer as a Ruby number */
|
1061
|
+
VALUE key = SWIG_RubyPtrToReference(ptr);
|
1062
|
+
|
1063
|
+
/* Get a reference to the Ruby object as a Ruby number */
|
1064
|
+
VALUE value = SWIG_RubyObjectToReference(object);
|
1065
|
+
|
1066
|
+
/* Store the mapping to the global hash table. */
|
1067
|
+
rb_hash_aset(swig_ruby_trackings, key, value);
|
1068
|
+
}
|
1069
|
+
|
1070
|
+
/* Get the Ruby object that owns the specified C/C++ struct */
|
1071
|
+
SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
|
1072
|
+
/* Get a reference to the pointer as a Ruby number */
|
1073
|
+
VALUE key = SWIG_RubyPtrToReference(ptr);
|
1074
|
+
|
1075
|
+
/* Now lookup the value stored in the global hash table */
|
1076
|
+
VALUE value = rb_hash_aref(swig_ruby_trackings, key);
|
1077
|
+
|
1078
|
+
if (value == Qnil) {
|
1079
|
+
/* No object exists - return nil. */
|
1080
|
+
return Qnil;
|
1081
|
+
}
|
1082
|
+
else {
|
1083
|
+
/* Convert this value to Ruby object */
|
1084
|
+
return SWIG_RubyReferenceToObject(value);
|
1085
|
+
}
|
1086
|
+
}
|
1087
|
+
|
1088
|
+
/* Remove a Tracking from a C/C++ struct to a Ruby object. It
|
1089
|
+
is very important to remove objects once they are destroyed
|
1090
|
+
since the same memory address may be reused later to create
|
1091
|
+
a new object. */
|
1092
|
+
SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
|
1093
|
+
/* Get a reference to the pointer as a Ruby number */
|
1094
|
+
VALUE key = SWIG_RubyPtrToReference(ptr);
|
1095
|
+
|
1096
|
+
/* Delete the object from the hash table by calling Ruby's
|
1097
|
+
do this we need to call the Hash.delete method.*/
|
1098
|
+
rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
|
1099
|
+
}
|
1100
|
+
|
1101
|
+
/* This is a helper method that unlinks a Ruby object from its
|
1102
|
+
underlying C++ object. This is needed if the lifetime of the
|
1103
|
+
Ruby object is longer than the C++ object */
|
1104
|
+
SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
|
1105
|
+
VALUE object = SWIG_RubyInstanceFor(ptr);
|
1106
|
+
|
1107
|
+
if (object != Qnil) {
|
1108
|
+
DATA_PTR(object) = 0;
|
1109
|
+
}
|
1110
|
+
}
|
1111
|
+
|
1112
|
+
|
1113
|
+
#ifdef __cplusplus
|
1114
|
+
}
|
1115
|
+
#endif
|
1116
|
+
|
1117
|
+
/* -----------------------------------------------------------------------------
|
1118
|
+
* Ruby API portion that goes into the runtime
|
1119
|
+
* ----------------------------------------------------------------------------- */
|
1120
|
+
|
1121
|
+
#ifdef __cplusplus
|
1122
|
+
extern "C" {
|
1123
|
+
#endif
|
1124
|
+
|
1125
|
+
SWIGINTERN VALUE
|
1126
|
+
SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
|
1127
|
+
if (NIL_P(target)) {
|
1128
|
+
target = o;
|
1129
|
+
} else {
|
1130
|
+
if (TYPE(target) != T_ARRAY) {
|
1131
|
+
VALUE o2 = target;
|
1132
|
+
target = rb_ary_new();
|
1133
|
+
rb_ary_push(target, o2);
|
1134
|
+
}
|
1135
|
+
rb_ary_push(target, o);
|
1136
|
+
}
|
1137
|
+
return target;
|
1138
|
+
}
|
1139
|
+
|
1140
|
+
#ifdef __cplusplus
|
1141
|
+
}
|
1142
|
+
#endif
|
1143
|
+
|
1144
|
+
|
1145
|
+
/* -----------------------------------------------------------------------------
|
1146
|
+
* See the LICENSE file for information on copyright, usage and redistribution
|
1147
|
+
* of SWIG, and the README file for authors - http://www.swig.org/release.html.
|
1148
|
+
*
|
1149
|
+
* rubyrun.swg
|
1150
|
+
*
|
1151
|
+
* This file contains the runtime support for Ruby modules
|
1152
|
+
* and includes code for managing global variables and pointer
|
1153
|
+
* type checking.
|
1154
|
+
* ----------------------------------------------------------------------------- */
|
1155
|
+
|
1156
|
+
/* For backward compatibility only */
|
1157
|
+
#define SWIG_POINTER_EXCEPTION 0
|
1158
|
+
|
1159
|
+
/* for raw pointers */
|
1160
|
+
#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
|
1161
|
+
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
|
1162
|
+
#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
|
1163
|
+
#define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
|
1164
|
+
#define swig_owntype ruby_owntype
|
1165
|
+
|
1166
|
+
/* for raw packed data */
|
1167
|
+
#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
|
1168
|
+
#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
|
1169
|
+
|
1170
|
+
/* for class or struct pointers */
|
1171
|
+
#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
|
1172
|
+
#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
|
1173
|
+
|
1174
|
+
/* for C or C++ function pointers */
|
1175
|
+
#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
|
1176
|
+
#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
|
1177
|
+
|
1178
|
+
/* for C++ member pointers, ie, member methods */
|
1179
|
+
#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
|
1180
|
+
#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
|
1181
|
+
|
1182
|
+
|
1183
|
+
/* Runtime API */
|
1184
|
+
|
1185
|
+
#define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
|
1186
|
+
#define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
|
1187
|
+
|
1188
|
+
|
1189
|
+
/* Error manipulation */
|
1190
|
+
|
1191
|
+
#define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
|
1192
|
+
#define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
|
1193
|
+
#define SWIG_fail goto fail
|
1194
|
+
|
1195
|
+
|
1196
|
+
/* Ruby-specific SWIG API */
|
1197
|
+
|
1198
|
+
#define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
|
1199
|
+
#define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
|
1200
|
+
#define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
|
1201
|
+
#define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
|
1202
|
+
#define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
|
1203
|
+
|
1204
|
+
|
1205
|
+
/* -----------------------------------------------------------------------------
|
1206
|
+
* pointers/data manipulation
|
1207
|
+
* ----------------------------------------------------------------------------- */
|
1208
|
+
|
1209
|
+
#ifdef __cplusplus
|
1210
|
+
extern "C" {
|
1211
|
+
#if 0
|
1212
|
+
} /* cc-mode */
|
1213
|
+
#endif
|
1214
|
+
#endif
|
1215
|
+
|
1216
|
+
typedef struct {
|
1217
|
+
VALUE klass;
|
1218
|
+
VALUE mImpl;
|
1219
|
+
void (*mark)(void *);
|
1220
|
+
void (*destroy)(void *);
|
1221
|
+
int trackObjects;
|
1222
|
+
} swig_class;
|
1223
|
+
|
1224
|
+
|
1225
|
+
static VALUE _mSWIG = Qnil;
|
1226
|
+
static VALUE _cSWIG_Pointer = Qnil;
|
1227
|
+
static VALUE swig_runtime_data_type_pointer = Qnil;
|
1228
|
+
|
1229
|
+
SWIGRUNTIME VALUE
|
1230
|
+
getExceptionClass(void) {
|
1231
|
+
static int init = 0;
|
1232
|
+
static VALUE rubyExceptionClass ;
|
1233
|
+
if (!init) {
|
1234
|
+
init = 1;
|
1235
|
+
rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
|
1236
|
+
}
|
1237
|
+
return rubyExceptionClass;
|
1238
|
+
}
|
1239
|
+
|
1240
|
+
/* This code checks to see if the Ruby object being raised as part
|
1241
|
+
of an exception inherits from the Ruby class Exception. If so,
|
1242
|
+
the object is simply returned. If not, then a new Ruby exception
|
1243
|
+
object is created and that will be returned to Ruby.*/
|
1244
|
+
SWIGRUNTIME VALUE
|
1245
|
+
SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
|
1246
|
+
VALUE exceptionClass = getExceptionClass();
|
1247
|
+
if (rb_obj_is_kind_of(obj, exceptionClass)) {
|
1248
|
+
return obj;
|
1249
|
+
} else {
|
1250
|
+
return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
|
1251
|
+
}
|
1252
|
+
}
|
1253
|
+
|
1254
|
+
/* Initialize Ruby runtime support */
|
1255
|
+
SWIGRUNTIME void
|
1256
|
+
SWIG_Ruby_InitRuntime(void)
|
1257
|
+
{
|
1258
|
+
if (_mSWIG == Qnil) {
|
1259
|
+
_mSWIG = rb_define_module("SWIG");
|
1260
|
+
}
|
1261
|
+
}
|
1262
|
+
|
1263
|
+
/* Define Ruby class for C type */
|
1264
|
+
SWIGRUNTIME void
|
1265
|
+
SWIG_Ruby_define_class(swig_type_info *type)
|
1266
|
+
{
|
1267
|
+
VALUE klass;
|
1268
|
+
char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
|
1269
|
+
sprintf(klass_name, "TYPE%s", type->name);
|
1270
|
+
if (NIL_P(_cSWIG_Pointer)) {
|
1271
|
+
_cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
|
1272
|
+
rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
|
1273
|
+
}
|
1274
|
+
klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
|
1275
|
+
free((void *) klass_name);
|
1276
|
+
}
|
1277
|
+
|
1278
|
+
/* Create a new pointer object */
|
1279
|
+
SWIGRUNTIME VALUE
|
1280
|
+
SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
|
1281
|
+
{
|
1282
|
+
int own = flags & SWIG_POINTER_OWN;
|
1283
|
+
|
1284
|
+
char *klass_name;
|
1285
|
+
swig_class *sklass;
|
1286
|
+
VALUE klass;
|
1287
|
+
VALUE obj;
|
1288
|
+
|
1289
|
+
if (!ptr)
|
1290
|
+
return Qnil;
|
1291
|
+
|
1292
|
+
if (type->clientdata) {
|
1293
|
+
sklass = (swig_class *) type->clientdata;
|
1294
|
+
|
1295
|
+
/* Are we tracking this class and have we already returned this Ruby object? */
|
1296
|
+
if (sklass->trackObjects) {
|
1297
|
+
obj = SWIG_RubyInstanceFor(ptr);
|
1298
|
+
|
1299
|
+
/* Check the object's type and make sure it has the correct type.
|
1300
|
+
It might not in cases where methods do things like
|
1301
|
+
downcast methods. */
|
1302
|
+
if (obj != Qnil) {
|
1303
|
+
VALUE value = rb_iv_get(obj, "__swigtype__");
|
1304
|
+
char* type_name = RSTRING_PTR(value);
|
1305
|
+
|
1306
|
+
if (strcmp(type->name, type_name) == 0) {
|
1307
|
+
return obj;
|
1308
|
+
}
|
1309
|
+
}
|
1310
|
+
}
|
1311
|
+
|
1312
|
+
/* Create a new Ruby object */
|
1313
|
+
obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
|
1314
|
+
|
1315
|
+
/* If tracking is on for this class then track this object. */
|
1316
|
+
if (sklass->trackObjects) {
|
1317
|
+
SWIG_RubyAddTracking(ptr, obj);
|
1318
|
+
}
|
1319
|
+
} else {
|
1320
|
+
klass_name = (char *) malloc(4 + strlen(type->name) + 1);
|
1321
|
+
sprintf(klass_name, "TYPE%s", type->name);
|
1322
|
+
klass = rb_const_get(_mSWIG, rb_intern(klass_name));
|
1323
|
+
free((void *) klass_name);
|
1324
|
+
obj = Data_Wrap_Struct(klass, 0, 0, ptr);
|
1325
|
+
}
|
1326
|
+
rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
|
1327
|
+
|
1328
|
+
return obj;
|
1329
|
+
}
|
1330
|
+
|
1331
|
+
/* Create a new class instance (always owned) */
|
1332
|
+
SWIGRUNTIME VALUE
|
1333
|
+
SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
|
1334
|
+
{
|
1335
|
+
VALUE obj;
|
1336
|
+
swig_class *sklass = (swig_class *) type->clientdata;
|
1337
|
+
obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
|
1338
|
+
rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
|
1339
|
+
return obj;
|
1340
|
+
}
|
1341
|
+
|
1342
|
+
/* Get type mangle from class name */
|
1343
|
+
SWIGRUNTIMEINLINE char *
|
1344
|
+
SWIG_Ruby_MangleStr(VALUE obj)
|
1345
|
+
{
|
1346
|
+
VALUE stype = rb_iv_get(obj, "__swigtype__");
|
1347
|
+
return StringValuePtr(stype);
|
1348
|
+
}
|
1349
|
+
|
1350
|
+
/* Acquire a pointer value */
|
1351
|
+
typedef void (*ruby_owntype)(void*);
|
1352
|
+
|
1353
|
+
SWIGRUNTIME ruby_owntype
|
1354
|
+
SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
|
1355
|
+
if (obj) {
|
1356
|
+
ruby_owntype oldown = RDATA(obj)->dfree;
|
1357
|
+
RDATA(obj)->dfree = own;
|
1358
|
+
return oldown;
|
1359
|
+
} else {
|
1360
|
+
return 0;
|
1361
|
+
}
|
1362
|
+
}
|
1363
|
+
|
1364
|
+
/* Convert a pointer value */
|
1365
|
+
SWIGRUNTIME int
|
1366
|
+
SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
|
1367
|
+
{
|
1368
|
+
char *c;
|
1369
|
+
swig_cast_info *tc;
|
1370
|
+
void *vptr = 0;
|
1371
|
+
|
1372
|
+
/* Grab the pointer */
|
1373
|
+
if (NIL_P(obj)) {
|
1374
|
+
*ptr = 0;
|
1375
|
+
return SWIG_OK;
|
1376
|
+
} else {
|
1377
|
+
if (TYPE(obj) != T_DATA) {
|
1378
|
+
return SWIG_ERROR;
|
1379
|
+
}
|
1380
|
+
Data_Get_Struct(obj, void, vptr);
|
1381
|
+
}
|
1382
|
+
|
1383
|
+
if (own) *own = RDATA(obj)->dfree;
|
1384
|
+
|
1385
|
+
/* Check to see if the input object is giving up ownership
|
1386
|
+
of the underlying C struct or C++ object. If so then we
|
1387
|
+
need to reset the destructor since the Ruby object no
|
1388
|
+
longer owns the underlying C++ object.*/
|
1389
|
+
if (flags & SWIG_POINTER_DISOWN) {
|
1390
|
+
/* Is tracking on for this class? */
|
1391
|
+
int track = 0;
|
1392
|
+
if (ty && ty->clientdata) {
|
1393
|
+
swig_class *sklass = (swig_class *) ty->clientdata;
|
1394
|
+
track = sklass->trackObjects;
|
1395
|
+
}
|
1396
|
+
|
1397
|
+
if (track) {
|
1398
|
+
/* We are tracking objects for this class. Thus we change the destructor
|
1399
|
+
* to SWIG_RubyRemoveTracking. This allows us to
|
1400
|
+
* remove the mapping from the C++ to Ruby object
|
1401
|
+
* when the Ruby object is garbage collected. If we don't
|
1402
|
+
* do this, then it is possible we will return a reference
|
1403
|
+
* to a Ruby object that no longer exists thereby crashing Ruby. */
|
1404
|
+
RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
|
1405
|
+
} else {
|
1406
|
+
RDATA(obj)->dfree = 0;
|
1407
|
+
}
|
1408
|
+
}
|
1409
|
+
|
1410
|
+
/* Do type-checking if type info was provided */
|
1411
|
+
if (ty) {
|
1412
|
+
if (ty->clientdata) {
|
1413
|
+
if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
|
1414
|
+
if (vptr == 0) {
|
1415
|
+
/* The object has already been deleted */
|
1416
|
+
return SWIG_ObjectPreviouslyDeletedError;
|
1417
|
+
}
|
1418
|
+
*ptr = vptr;
|
1419
|
+
return SWIG_OK;
|
1420
|
+
}
|
1421
|
+
}
|
1422
|
+
if ((c = SWIG_MangleStr(obj)) == NULL) {
|
1423
|
+
return SWIG_ERROR;
|
1424
|
+
}
|
1425
|
+
tc = SWIG_TypeCheck(c, ty);
|
1426
|
+
if (!tc) {
|
1427
|
+
return SWIG_ERROR;
|
1428
|
+
}
|
1429
|
+
*ptr = SWIG_TypeCast(tc, vptr);
|
1430
|
+
} else {
|
1431
|
+
*ptr = vptr;
|
1432
|
+
}
|
1433
|
+
|
1434
|
+
return SWIG_OK;
|
1435
|
+
}
|
1436
|
+
|
1437
|
+
/* Check convert */
|
1438
|
+
SWIGRUNTIMEINLINE int
|
1439
|
+
SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
|
1440
|
+
{
|
1441
|
+
char *c = SWIG_MangleStr(obj);
|
1442
|
+
if (!c) return 0;
|
1443
|
+
return SWIG_TypeCheck(c,ty) != 0;
|
1444
|
+
}
|
1445
|
+
|
1446
|
+
SWIGRUNTIME VALUE
|
1447
|
+
SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
|
1448
|
+
char result[1024];
|
1449
|
+
char *r = result;
|
1450
|
+
if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
|
1451
|
+
*(r++) = '_';
|
1452
|
+
r = SWIG_PackData(r, ptr, sz);
|
1453
|
+
strcpy(r, type->name);
|
1454
|
+
return rb_str_new2(result);
|
1455
|
+
}
|
1456
|
+
|
1457
|
+
/* Convert a packed value value */
|
1458
|
+
SWIGRUNTIME int
|
1459
|
+
SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
|
1460
|
+
swig_cast_info *tc;
|
1461
|
+
const char *c;
|
1462
|
+
|
1463
|
+
if (TYPE(obj) != T_STRING) goto type_error;
|
1464
|
+
c = StringValuePtr(obj);
|
1465
|
+
/* Pointer values must start with leading underscore */
|
1466
|
+
if (*c != '_') goto type_error;
|
1467
|
+
c++;
|
1468
|
+
c = SWIG_UnpackData(c, ptr, sz);
|
1469
|
+
if (ty) {
|
1470
|
+
tc = SWIG_TypeCheck(c, ty);
|
1471
|
+
if (!tc) goto type_error;
|
1472
|
+
}
|
1473
|
+
return SWIG_OK;
|
1474
|
+
|
1475
|
+
type_error:
|
1476
|
+
return SWIG_ERROR;
|
1477
|
+
}
|
1478
|
+
|
1479
|
+
SWIGRUNTIME swig_module_info *
|
1480
|
+
SWIG_Ruby_GetModule(void)
|
1481
|
+
{
|
1482
|
+
VALUE pointer;
|
1483
|
+
swig_module_info *ret = 0;
|
1484
|
+
VALUE verbose = rb_gv_get("VERBOSE");
|
1485
|
+
|
1486
|
+
/* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
|
1487
|
+
rb_gv_set("VERBOSE", Qfalse);
|
1488
|
+
|
1489
|
+
/* first check if pointer already created */
|
1490
|
+
pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
|
1491
|
+
if (pointer != Qnil) {
|
1492
|
+
Data_Get_Struct(pointer, swig_module_info, ret);
|
1493
|
+
}
|
1494
|
+
|
1495
|
+
/* reinstate warnings */
|
1496
|
+
rb_gv_set("VERBOSE", verbose);
|
1497
|
+
return ret;
|
1498
|
+
}
|
1499
|
+
|
1500
|
+
SWIGRUNTIME void
|
1501
|
+
SWIG_Ruby_SetModule(swig_module_info *pointer)
|
1502
|
+
{
|
1503
|
+
/* register a new class */
|
1504
|
+
VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
|
1505
|
+
/* create and store the structure pointer to a global variable */
|
1506
|
+
swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
|
1507
|
+
rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
|
1508
|
+
}
|
1509
|
+
|
1510
|
+
#ifdef __cplusplus
|
1511
|
+
#if 0
|
1512
|
+
{ /* cc-mode */
|
1513
|
+
#endif
|
1514
|
+
}
|
1515
|
+
#endif
|
1516
|
+
|
1517
|
+
|
1518
|
+
|
1519
|
+
#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
|
1520
|
+
|
1521
|
+
#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
|
1522
|
+
|
1523
|
+
|
1524
|
+
|
1525
|
+
/* -------- TYPES TABLE (BEGIN) -------- */
|
1526
|
+
|
1527
|
+
#define SWIGTYPE_p_Barcode_Item swig_types[0]
|
1528
|
+
#define SWIGTYPE_p_FILE swig_types[1]
|
1529
|
+
#define SWIGTYPE_p_char swig_types[2]
|
1530
|
+
static swig_type_info *swig_types[4];
|
1531
|
+
static swig_module_info swig_module = {swig_types, 3, 0, 0, 0, 0};
|
1532
|
+
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
|
1533
|
+
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
|
1534
|
+
|
1535
|
+
/* -------- TYPES TABLE (END) -------- */
|
1536
|
+
|
1537
|
+
#define SWIG_init Init_gbarcode
|
1538
|
+
#define SWIG_name "Gbarcode"
|
1539
|
+
|
1540
|
+
static VALUE mGbarcode;
|
1541
|
+
|
1542
|
+
#define SWIGVERSION 0x010331
|
1543
|
+
#define SWIG_VERSION SWIGVERSION
|
1544
|
+
|
1545
|
+
|
1546
|
+
#define SWIG_as_voidptr(a) (void *)((const void *)(a))
|
1547
|
+
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
|
1548
|
+
|
1549
|
+
|
1550
|
+
|
1551
|
+
#include "barcode.h"
|
1552
|
+
|
1553
|
+
|
1554
|
+
|
1555
|
+
#ifdef __cplusplus
|
1556
|
+
extern "C" {
|
1557
|
+
#endif
|
1558
|
+
#include "rubyio.h"
|
1559
|
+
#ifdef __cplusplus
|
1560
|
+
}
|
1561
|
+
#endif
|
1562
|
+
|
1563
|
+
|
1564
|
+
#ifdef __cplusplus
|
1565
|
+
extern "C" {
|
1566
|
+
#endif
|
1567
|
+
#ifdef HAVE_SYS_TIME_H
|
1568
|
+
# include <sys/time.h>
|
1569
|
+
struct timeval rb_time_timeval(VALUE);
|
1570
|
+
#endif
|
1571
|
+
#ifdef __cplusplus
|
1572
|
+
}
|
1573
|
+
#endif
|
1574
|
+
|
1575
|
+
|
1576
|
+
#include <limits.h>
|
1577
|
+
#ifndef LLONG_MIN
|
1578
|
+
# define LLONG_MIN LONG_LONG_MIN
|
1579
|
+
#endif
|
1580
|
+
#ifndef LLONG_MAX
|
1581
|
+
# define LLONG_MAX LONG_LONG_MAX
|
1582
|
+
#endif
|
1583
|
+
#ifndef ULLONG_MAX
|
1584
|
+
# define ULLONG_MAX ULONG_LONG_MAX
|
1585
|
+
#endif
|
1586
|
+
|
1587
|
+
|
1588
|
+
SWIGINTERN VALUE
|
1589
|
+
SWIG_ruby_failed(void)
|
1590
|
+
{
|
1591
|
+
return Qnil;
|
1592
|
+
}
|
1593
|
+
|
1594
|
+
|
1595
|
+
/*@SWIG:%ruby_aux_method@*/
|
1596
|
+
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
|
1597
|
+
{
|
1598
|
+
VALUE obj = args[0];
|
1599
|
+
VALUE type = TYPE(obj);
|
1600
|
+
long *res = (long *)(args[1]);
|
1601
|
+
*res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
|
1602
|
+
return obj;
|
1603
|
+
}
|
1604
|
+
/*@SWIG@*/
|
1605
|
+
|
1606
|
+
SWIGINTERN int
|
1607
|
+
SWIG_AsVal_long (VALUE obj, long* val)
|
1608
|
+
{
|
1609
|
+
VALUE type = TYPE(obj);
|
1610
|
+
if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
|
1611
|
+
long v;
|
1612
|
+
VALUE a[2];
|
1613
|
+
a[0] = obj;
|
1614
|
+
a[1] = (VALUE)(&v);
|
1615
|
+
if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
|
1616
|
+
if (val) *val = v;
|
1617
|
+
return SWIG_OK;
|
1618
|
+
}
|
1619
|
+
}
|
1620
|
+
return SWIG_TypeError;
|
1621
|
+
}
|
1622
|
+
|
1623
|
+
|
1624
|
+
SWIGINTERN int
|
1625
|
+
SWIG_AsVal_int (VALUE obj, int *val)
|
1626
|
+
{
|
1627
|
+
long v;
|
1628
|
+
int res = SWIG_AsVal_long (obj, &v);
|
1629
|
+
if (SWIG_IsOK(res)) {
|
1630
|
+
if ((v < INT_MIN || v > INT_MAX)) {
|
1631
|
+
return SWIG_OverflowError;
|
1632
|
+
} else {
|
1633
|
+
if (val) *val = (int)(v);
|
1634
|
+
}
|
1635
|
+
}
|
1636
|
+
return res;
|
1637
|
+
}
|
1638
|
+
|
1639
|
+
|
1640
|
+
#define SWIG_From_long LONG2NUM
|
1641
|
+
|
1642
|
+
|
1643
|
+
SWIGINTERNINLINE VALUE
|
1644
|
+
SWIG_From_int (int value)
|
1645
|
+
{
|
1646
|
+
return SWIG_From_long (value);
|
1647
|
+
}
|
1648
|
+
|
1649
|
+
|
1650
|
+
SWIGINTERN swig_type_info*
|
1651
|
+
SWIG_pchar_descriptor(void)
|
1652
|
+
{
|
1653
|
+
static int init = 0;
|
1654
|
+
static swig_type_info* info = 0;
|
1655
|
+
if (!init) {
|
1656
|
+
info = SWIG_TypeQuery("_p_char");
|
1657
|
+
init = 1;
|
1658
|
+
}
|
1659
|
+
return info;
|
1660
|
+
}
|
1661
|
+
|
1662
|
+
|
1663
|
+
SWIGINTERN int
|
1664
|
+
SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
1665
|
+
{
|
1666
|
+
if (TYPE(obj) == T_STRING) {
|
1667
|
+
|
1668
|
+
|
1669
|
+
|
1670
|
+
char *cstr = STR2CSTR(obj);
|
1671
|
+
|
1672
|
+
size_t size = RSTRING_LEN(obj) + 1;
|
1673
|
+
if (cptr) {
|
1674
|
+
if (alloc) {
|
1675
|
+
if (*alloc == SWIG_NEWOBJ) {
|
1676
|
+
*cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
|
1677
|
+
} else {
|
1678
|
+
*cptr = cstr;
|
1679
|
+
*alloc = SWIG_OLDOBJ;
|
1680
|
+
}
|
1681
|
+
}
|
1682
|
+
}
|
1683
|
+
if (psize) *psize = size;
|
1684
|
+
return SWIG_OK;
|
1685
|
+
} else {
|
1686
|
+
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
|
1687
|
+
if (pchar_descriptor) {
|
1688
|
+
void* vptr = 0;
|
1689
|
+
if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
|
1690
|
+
if (cptr) *cptr = (char *)vptr;
|
1691
|
+
if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
|
1692
|
+
if (alloc) *alloc = SWIG_OLDOBJ;
|
1693
|
+
return SWIG_OK;
|
1694
|
+
}
|
1695
|
+
}
|
1696
|
+
}
|
1697
|
+
return SWIG_TypeError;
|
1698
|
+
}
|
1699
|
+
|
1700
|
+
|
1701
|
+
|
1702
|
+
|
1703
|
+
|
1704
|
+
SWIGINTERN int
|
1705
|
+
SWIG_AsCharArray(VALUE obj, char *val, size_t size)
|
1706
|
+
{
|
1707
|
+
char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
|
1708
|
+
int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
|
1709
|
+
if (SWIG_IsOK(res)) {
|
1710
|
+
if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize;
|
1711
|
+
if (csize <= size) {
|
1712
|
+
if (val) {
|
1713
|
+
if (csize) memcpy(val, cptr, csize*sizeof(char));
|
1714
|
+
if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
|
1715
|
+
}
|
1716
|
+
if (alloc == SWIG_NEWOBJ) {
|
1717
|
+
free((char*)cptr);
|
1718
|
+
res = SWIG_DelNewMask(res);
|
1719
|
+
}
|
1720
|
+
return res;
|
1721
|
+
}
|
1722
|
+
if (alloc == SWIG_NEWOBJ) free((char*)cptr);
|
1723
|
+
}
|
1724
|
+
return SWIG_TypeError;
|
1725
|
+
}
|
1726
|
+
|
1727
|
+
|
1728
|
+
SWIGINTERN int
|
1729
|
+
SWIG_AsVal_char (VALUE obj, char *val)
|
1730
|
+
{
|
1731
|
+
int res = SWIG_AsCharArray(obj, val, 1);
|
1732
|
+
if (!SWIG_IsOK(res)) {
|
1733
|
+
long v;
|
1734
|
+
res = SWIG_AddCast(SWIG_AsVal_long (obj, &v));
|
1735
|
+
if (SWIG_IsOK(res)) {
|
1736
|
+
if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) {
|
1737
|
+
if (val) *val = (char)(v);
|
1738
|
+
} else {
|
1739
|
+
res = SWIG_OverflowError;
|
1740
|
+
}
|
1741
|
+
}
|
1742
|
+
}
|
1743
|
+
return res;
|
1744
|
+
}
|
1745
|
+
|
1746
|
+
|
1747
|
+
SWIGINTERNINLINE VALUE
|
1748
|
+
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
|
1749
|
+
{
|
1750
|
+
if (carray) {
|
1751
|
+
if (size > LONG_MAX) {
|
1752
|
+
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
|
1753
|
+
return pchar_descriptor ?
|
1754
|
+
SWIG_NewPointerObj((char *)(carray), pchar_descriptor, 0) : Qnil;
|
1755
|
+
} else {
|
1756
|
+
return rb_str_new(carray, (long)(size));
|
1757
|
+
}
|
1758
|
+
} else {
|
1759
|
+
return Qnil;
|
1760
|
+
}
|
1761
|
+
}
|
1762
|
+
|
1763
|
+
|
1764
|
+
SWIGINTERNINLINE VALUE
|
1765
|
+
SWIG_From_char (char c)
|
1766
|
+
{
|
1767
|
+
return SWIG_FromCharPtrAndSize(&c,1);
|
1768
|
+
}
|
1769
|
+
|
1770
|
+
|
1771
|
+
SWIGINTERNINLINE VALUE
|
1772
|
+
SWIG_FromCharPtr(const char *cptr)
|
1773
|
+
{
|
1774
|
+
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
|
1775
|
+
}
|
1776
|
+
|
1777
|
+
|
1778
|
+
/*@SWIG:%ruby_aux_method@*/
|
1779
|
+
SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
|
1780
|
+
{
|
1781
|
+
VALUE obj = args[0];
|
1782
|
+
VALUE type = TYPE(obj);
|
1783
|
+
double *res = (double *)(args[1]);
|
1784
|
+
*res = (type == T_FLOAT ? NUM2DBL(obj) : (type == T_FIXNUM ? (double) FIX2INT(obj) : rb_big2dbl(obj)));
|
1785
|
+
return obj;
|
1786
|
+
}
|
1787
|
+
/*@SWIG@*/
|
1788
|
+
|
1789
|
+
SWIGINTERN int
|
1790
|
+
SWIG_AsVal_double (VALUE obj, double *val)
|
1791
|
+
{
|
1792
|
+
VALUE type = TYPE(obj);
|
1793
|
+
if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) {
|
1794
|
+
double v;
|
1795
|
+
VALUE a[2];
|
1796
|
+
a[0] = obj;
|
1797
|
+
a[1] = (VALUE)(&v);
|
1798
|
+
if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
|
1799
|
+
if (val) *val = v;
|
1800
|
+
return SWIG_OK;
|
1801
|
+
}
|
1802
|
+
}
|
1803
|
+
return SWIG_TypeError;
|
1804
|
+
}
|
1805
|
+
|
1806
|
+
|
1807
|
+
#define SWIG_From_double rb_float_new
|
1808
|
+
|
1809
|
+
SWIGINTERN VALUE
|
1810
|
+
_wrap_barcode_print(int argc, VALUE *argv, VALUE self) {
|
1811
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
1812
|
+
FILE *arg2 = (FILE *) 0 ;
|
1813
|
+
int arg3 ;
|
1814
|
+
int result;
|
1815
|
+
void *argp1 = 0 ;
|
1816
|
+
int res1 = 0 ;
|
1817
|
+
int val3 ;
|
1818
|
+
int ecode3 = 0 ;
|
1819
|
+
VALUE vresult = Qnil;
|
1820
|
+
|
1821
|
+
if ((argc < 3) || (argc > 3)) {
|
1822
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
|
1823
|
+
}
|
1824
|
+
res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
1825
|
+
if (!SWIG_IsOK(res1)) {
|
1826
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Barcode_Print" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
1827
|
+
}
|
1828
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
1829
|
+
{
|
1830
|
+
OpenFile *of;
|
1831
|
+
GetOpenFile(argv[1], of);
|
1832
|
+
rb_io_check_writable(of);
|
1833
|
+
arg2 = GetWriteFile(of);
|
1834
|
+
}
|
1835
|
+
ecode3 = SWIG_AsVal_int(argv[2], &val3);
|
1836
|
+
if (!SWIG_IsOK(ecode3)) {
|
1837
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Barcode_Print" "', argument " "3"" of type '" "int""'");
|
1838
|
+
}
|
1839
|
+
arg3 = (int)(val3);
|
1840
|
+
result = (int)Barcode_Print(arg1,arg2,arg3);
|
1841
|
+
vresult = SWIG_From_int((int)(result));
|
1842
|
+
return vresult;
|
1843
|
+
fail:
|
1844
|
+
return Qnil;
|
1845
|
+
}
|
1846
|
+
|
1847
|
+
|
1848
|
+
SWIGINTERN VALUE
|
1849
|
+
_wrap_barcode_encode_and_print(int argc, VALUE *argv, VALUE self) {
|
1850
|
+
char *arg1 = (char *) 0 ;
|
1851
|
+
FILE *arg2 = (FILE *) 0 ;
|
1852
|
+
int arg3 ;
|
1853
|
+
int arg4 ;
|
1854
|
+
int arg5 ;
|
1855
|
+
int arg6 ;
|
1856
|
+
int arg7 ;
|
1857
|
+
int result;
|
1858
|
+
int res1 ;
|
1859
|
+
char *buf1 = 0 ;
|
1860
|
+
int alloc1 = 0 ;
|
1861
|
+
int val3 ;
|
1862
|
+
int ecode3 = 0 ;
|
1863
|
+
int val4 ;
|
1864
|
+
int ecode4 = 0 ;
|
1865
|
+
int val5 ;
|
1866
|
+
int ecode5 = 0 ;
|
1867
|
+
int val6 ;
|
1868
|
+
int ecode6 = 0 ;
|
1869
|
+
int val7 ;
|
1870
|
+
int ecode7 = 0 ;
|
1871
|
+
VALUE vresult = Qnil;
|
1872
|
+
|
1873
|
+
if ((argc < 7) || (argc > 7)) {
|
1874
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 7)",argc); SWIG_fail;
|
1875
|
+
}
|
1876
|
+
res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
|
1877
|
+
if (!SWIG_IsOK(res1)) {
|
1878
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Barcode_Encode_and_Print" "', argument " "1"" of type '" "char *""'");
|
1879
|
+
}
|
1880
|
+
arg1 = (char *)(buf1);
|
1881
|
+
{
|
1882
|
+
OpenFile *of;
|
1883
|
+
GetOpenFile(argv[1], of);
|
1884
|
+
rb_io_check_writable(of);
|
1885
|
+
arg2 = GetWriteFile(of);
|
1886
|
+
}
|
1887
|
+
ecode3 = SWIG_AsVal_int(argv[2], &val3);
|
1888
|
+
if (!SWIG_IsOK(ecode3)) {
|
1889
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Barcode_Encode_and_Print" "', argument " "3"" of type '" "int""'");
|
1890
|
+
}
|
1891
|
+
arg3 = (int)(val3);
|
1892
|
+
ecode4 = SWIG_AsVal_int(argv[3], &val4);
|
1893
|
+
if (!SWIG_IsOK(ecode4)) {
|
1894
|
+
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Barcode_Encode_and_Print" "', argument " "4"" of type '" "int""'");
|
1895
|
+
}
|
1896
|
+
arg4 = (int)(val4);
|
1897
|
+
ecode5 = SWIG_AsVal_int(argv[4], &val5);
|
1898
|
+
if (!SWIG_IsOK(ecode5)) {
|
1899
|
+
SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Barcode_Encode_and_Print" "', argument " "5"" of type '" "int""'");
|
1900
|
+
}
|
1901
|
+
arg5 = (int)(val5);
|
1902
|
+
ecode6 = SWIG_AsVal_int(argv[5], &val6);
|
1903
|
+
if (!SWIG_IsOK(ecode6)) {
|
1904
|
+
SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Barcode_Encode_and_Print" "', argument " "6"" of type '" "int""'");
|
1905
|
+
}
|
1906
|
+
arg6 = (int)(val6);
|
1907
|
+
ecode7 = SWIG_AsVal_int(argv[6], &val7);
|
1908
|
+
if (!SWIG_IsOK(ecode7)) {
|
1909
|
+
SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Barcode_Encode_and_Print" "', argument " "7"" of type '" "int""'");
|
1910
|
+
}
|
1911
|
+
arg7 = (int)(val7);
|
1912
|
+
result = (int)Barcode_Encode_and_Print(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
|
1913
|
+
vresult = SWIG_From_int((int)(result));
|
1914
|
+
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
1915
|
+
return vresult;
|
1916
|
+
fail:
|
1917
|
+
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
1918
|
+
return Qnil;
|
1919
|
+
}
|
1920
|
+
|
1921
|
+
|
1922
|
+
SWIGINTERN VALUE
|
1923
|
+
_wrap_barcode_svg_print(int argc, VALUE *argv, VALUE self) {
|
1924
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
1925
|
+
FILE *arg2 = (FILE *) 0 ;
|
1926
|
+
int result;
|
1927
|
+
void *argp1 = 0 ;
|
1928
|
+
int res1 = 0 ;
|
1929
|
+
VALUE vresult = Qnil;
|
1930
|
+
|
1931
|
+
if ((argc < 2) || (argc > 2)) {
|
1932
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
1933
|
+
}
|
1934
|
+
res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
1935
|
+
if (!SWIG_IsOK(res1)) {
|
1936
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Barcode_svg_print" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
1937
|
+
}
|
1938
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
1939
|
+
{
|
1940
|
+
OpenFile *of;
|
1941
|
+
GetOpenFile(argv[1], of);
|
1942
|
+
rb_io_check_writable(of);
|
1943
|
+
arg2 = GetWriteFile(of);
|
1944
|
+
}
|
1945
|
+
result = (int)Barcode_svg_print(arg1,arg2);
|
1946
|
+
vresult = SWIG_From_int((int)(result));
|
1947
|
+
return vresult;
|
1948
|
+
fail:
|
1949
|
+
return Qnil;
|
1950
|
+
}
|
1951
|
+
|
1952
|
+
|
1953
|
+
SWIGINTERN VALUE
|
1954
|
+
_wrap_barcode_version(int argc, VALUE *argv, VALUE self) {
|
1955
|
+
char *arg1 = (char *) 0 ;
|
1956
|
+
int result;
|
1957
|
+
char temp1 ;
|
1958
|
+
int res1 = 0 ;
|
1959
|
+
VALUE vresult = Qnil;
|
1960
|
+
|
1961
|
+
if ((argc < 1) || (argc > 1)) {
|
1962
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
1963
|
+
}
|
1964
|
+
if (!(SWIG_IsOK((res1 = SWIG_ConvertPtr(argv[0],SWIG_as_voidptrptr(&arg1),SWIGTYPE_p_char,0))))) {
|
1965
|
+
char val;
|
1966
|
+
int ecode = SWIG_AsVal_char(argv[0], &val);
|
1967
|
+
if (!SWIG_IsOK(ecode)) {
|
1968
|
+
SWIG_exception_fail(SWIG_ArgError(ecode), "in method '" "Barcode_Version" "', argument " "1"" of type '" "char""'");
|
1969
|
+
}
|
1970
|
+
temp1 = (char)(val);
|
1971
|
+
arg1 = &temp1;
|
1972
|
+
res1 = SWIG_AddTmpMask(ecode);
|
1973
|
+
}
|
1974
|
+
result = (int)Barcode_Version(arg1);
|
1975
|
+
vresult = SWIG_From_int((int)(result));
|
1976
|
+
if (SWIG_IsTmpObj(res1)) {
|
1977
|
+
vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_char((*arg1)));
|
1978
|
+
} else {
|
1979
|
+
int new_flags = SWIG_IsNewObj(res1) ? (SWIG_POINTER_OWN | 0 ) : 0 ;
|
1980
|
+
vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg1), SWIGTYPE_p_char, new_flags));
|
1981
|
+
}
|
1982
|
+
return vresult;
|
1983
|
+
fail:
|
1984
|
+
return Qnil;
|
1985
|
+
}
|
1986
|
+
|
1987
|
+
|
1988
|
+
swig_class cBarcodeItem;
|
1989
|
+
|
1990
|
+
SWIGINTERN VALUE
|
1991
|
+
_wrap_BarcodeItem_flags_set(int argc, VALUE *argv, VALUE self) {
|
1992
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
1993
|
+
int arg2 ;
|
1994
|
+
void *argp1 = 0 ;
|
1995
|
+
int res1 = 0 ;
|
1996
|
+
int val2 ;
|
1997
|
+
int ecode2 = 0 ;
|
1998
|
+
|
1999
|
+
if ((argc < 1) || (argc > 1)) {
|
2000
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2001
|
+
}
|
2002
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2003
|
+
if (!SWIG_IsOK(res1)) {
|
2004
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "flags" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2005
|
+
}
|
2006
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2007
|
+
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
2008
|
+
if (!SWIG_IsOK(ecode2)) {
|
2009
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "flags" "', argument " "2"" of type '" "int""'");
|
2010
|
+
}
|
2011
|
+
arg2 = (int)(val2);
|
2012
|
+
if (arg1) (arg1)->flags = arg2;
|
2013
|
+
|
2014
|
+
return Qnil;
|
2015
|
+
fail:
|
2016
|
+
return Qnil;
|
2017
|
+
}
|
2018
|
+
|
2019
|
+
|
2020
|
+
SWIGINTERN VALUE
|
2021
|
+
_wrap_BarcodeItem_flags_get(int argc, VALUE *argv, VALUE self) {
|
2022
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2023
|
+
int result;
|
2024
|
+
void *argp1 = 0 ;
|
2025
|
+
int res1 = 0 ;
|
2026
|
+
VALUE vresult = Qnil;
|
2027
|
+
|
2028
|
+
if ((argc < 0) || (argc > 0)) {
|
2029
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2030
|
+
}
|
2031
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2032
|
+
if (!SWIG_IsOK(res1)) {
|
2033
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "flags" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2034
|
+
}
|
2035
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2036
|
+
result = (int) ((arg1)->flags);
|
2037
|
+
vresult = SWIG_From_int((int)(result));
|
2038
|
+
return vresult;
|
2039
|
+
fail:
|
2040
|
+
return Qnil;
|
2041
|
+
}
|
2042
|
+
|
2043
|
+
|
2044
|
+
SWIGINTERN VALUE
|
2045
|
+
_wrap_BarcodeItem_ascii_set(int argc, VALUE *argv, VALUE self) {
|
2046
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2047
|
+
char *arg2 = (char *) 0 ;
|
2048
|
+
void *argp1 = 0 ;
|
2049
|
+
int res1 = 0 ;
|
2050
|
+
int res2 ;
|
2051
|
+
char *buf2 = 0 ;
|
2052
|
+
int alloc2 = 0 ;
|
2053
|
+
|
2054
|
+
if ((argc < 1) || (argc > 1)) {
|
2055
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2056
|
+
}
|
2057
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2058
|
+
if (!SWIG_IsOK(res1)) {
|
2059
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ascii" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2060
|
+
}
|
2061
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2062
|
+
res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
|
2063
|
+
if (!SWIG_IsOK(res2)) {
|
2064
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ascii" "', argument " "2"" of type '" "char *""'");
|
2065
|
+
}
|
2066
|
+
arg2 = (char *)(buf2);
|
2067
|
+
if (arg1->ascii) free((char*)arg1->ascii);
|
2068
|
+
if (arg2) {
|
2069
|
+
size_t size = strlen((const char *)(arg2)) + 1;
|
2070
|
+
arg1->ascii = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
|
2071
|
+
} else {
|
2072
|
+
arg1->ascii = 0;
|
2073
|
+
}
|
2074
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2075
|
+
return Qnil;
|
2076
|
+
fail:
|
2077
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2078
|
+
return Qnil;
|
2079
|
+
}
|
2080
|
+
|
2081
|
+
|
2082
|
+
SWIGINTERN VALUE
|
2083
|
+
_wrap_BarcodeItem_ascii_get(int argc, VALUE *argv, VALUE self) {
|
2084
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2085
|
+
char *result = 0 ;
|
2086
|
+
void *argp1 = 0 ;
|
2087
|
+
int res1 = 0 ;
|
2088
|
+
VALUE vresult = Qnil;
|
2089
|
+
|
2090
|
+
if ((argc < 0) || (argc > 0)) {
|
2091
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2092
|
+
}
|
2093
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2094
|
+
if (!SWIG_IsOK(res1)) {
|
2095
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ascii" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2096
|
+
}
|
2097
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2098
|
+
result = (char *) ((arg1)->ascii);
|
2099
|
+
vresult = SWIG_FromCharPtr((const char *)result);
|
2100
|
+
return vresult;
|
2101
|
+
fail:
|
2102
|
+
return Qnil;
|
2103
|
+
}
|
2104
|
+
|
2105
|
+
|
2106
|
+
SWIGINTERN VALUE
|
2107
|
+
_wrap_BarcodeItem_partial_set(int argc, VALUE *argv, VALUE self) {
|
2108
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2109
|
+
char *arg2 = (char *) 0 ;
|
2110
|
+
void *argp1 = 0 ;
|
2111
|
+
int res1 = 0 ;
|
2112
|
+
int res2 ;
|
2113
|
+
char *buf2 = 0 ;
|
2114
|
+
int alloc2 = 0 ;
|
2115
|
+
|
2116
|
+
if ((argc < 1) || (argc > 1)) {
|
2117
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2118
|
+
}
|
2119
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2120
|
+
if (!SWIG_IsOK(res1)) {
|
2121
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "partial" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2122
|
+
}
|
2123
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2124
|
+
res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
|
2125
|
+
if (!SWIG_IsOK(res2)) {
|
2126
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "partial" "', argument " "2"" of type '" "char *""'");
|
2127
|
+
}
|
2128
|
+
arg2 = (char *)(buf2);
|
2129
|
+
if (arg1->partial) free((char*)arg1->partial);
|
2130
|
+
if (arg2) {
|
2131
|
+
size_t size = strlen((const char *)(arg2)) + 1;
|
2132
|
+
arg1->partial = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
|
2133
|
+
} else {
|
2134
|
+
arg1->partial = 0;
|
2135
|
+
}
|
2136
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2137
|
+
return Qnil;
|
2138
|
+
fail:
|
2139
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2140
|
+
return Qnil;
|
2141
|
+
}
|
2142
|
+
|
2143
|
+
|
2144
|
+
SWIGINTERN VALUE
|
2145
|
+
_wrap_BarcodeItem_partial_get(int argc, VALUE *argv, VALUE self) {
|
2146
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2147
|
+
char *result = 0 ;
|
2148
|
+
void *argp1 = 0 ;
|
2149
|
+
int res1 = 0 ;
|
2150
|
+
VALUE vresult = Qnil;
|
2151
|
+
|
2152
|
+
if ((argc < 0) || (argc > 0)) {
|
2153
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2154
|
+
}
|
2155
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2156
|
+
if (!SWIG_IsOK(res1)) {
|
2157
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "partial" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2158
|
+
}
|
2159
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2160
|
+
result = (char *) ((arg1)->partial);
|
2161
|
+
vresult = SWIG_FromCharPtr((const char *)result);
|
2162
|
+
return vresult;
|
2163
|
+
fail:
|
2164
|
+
return Qnil;
|
2165
|
+
}
|
2166
|
+
|
2167
|
+
|
2168
|
+
SWIGINTERN VALUE
|
2169
|
+
_wrap_BarcodeItem_textinfo_set(int argc, VALUE *argv, VALUE self) {
|
2170
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2171
|
+
char *arg2 = (char *) 0 ;
|
2172
|
+
void *argp1 = 0 ;
|
2173
|
+
int res1 = 0 ;
|
2174
|
+
int res2 ;
|
2175
|
+
char *buf2 = 0 ;
|
2176
|
+
int alloc2 = 0 ;
|
2177
|
+
|
2178
|
+
if ((argc < 1) || (argc > 1)) {
|
2179
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2180
|
+
}
|
2181
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2182
|
+
if (!SWIG_IsOK(res1)) {
|
2183
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "textinfo" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2184
|
+
}
|
2185
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2186
|
+
res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
|
2187
|
+
if (!SWIG_IsOK(res2)) {
|
2188
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "textinfo" "', argument " "2"" of type '" "char *""'");
|
2189
|
+
}
|
2190
|
+
arg2 = (char *)(buf2);
|
2191
|
+
if (arg1->textinfo) free((char*)arg1->textinfo);
|
2192
|
+
if (arg2) {
|
2193
|
+
size_t size = strlen((const char *)(arg2)) + 1;
|
2194
|
+
arg1->textinfo = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
|
2195
|
+
} else {
|
2196
|
+
arg1->textinfo = 0;
|
2197
|
+
}
|
2198
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2199
|
+
return Qnil;
|
2200
|
+
fail:
|
2201
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2202
|
+
return Qnil;
|
2203
|
+
}
|
2204
|
+
|
2205
|
+
|
2206
|
+
SWIGINTERN VALUE
|
2207
|
+
_wrap_BarcodeItem_textinfo_get(int argc, VALUE *argv, VALUE self) {
|
2208
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2209
|
+
char *result = 0 ;
|
2210
|
+
void *argp1 = 0 ;
|
2211
|
+
int res1 = 0 ;
|
2212
|
+
VALUE vresult = Qnil;
|
2213
|
+
|
2214
|
+
if ((argc < 0) || (argc > 0)) {
|
2215
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2216
|
+
}
|
2217
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2218
|
+
if (!SWIG_IsOK(res1)) {
|
2219
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "textinfo" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2220
|
+
}
|
2221
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2222
|
+
result = (char *) ((arg1)->textinfo);
|
2223
|
+
vresult = SWIG_FromCharPtr((const char *)result);
|
2224
|
+
return vresult;
|
2225
|
+
fail:
|
2226
|
+
return Qnil;
|
2227
|
+
}
|
2228
|
+
|
2229
|
+
|
2230
|
+
SWIGINTERN VALUE
|
2231
|
+
_wrap_BarcodeItem_encoding_set(int argc, VALUE *argv, VALUE self) {
|
2232
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2233
|
+
char *arg2 = (char *) 0 ;
|
2234
|
+
void *argp1 = 0 ;
|
2235
|
+
int res1 = 0 ;
|
2236
|
+
int res2 ;
|
2237
|
+
char *buf2 = 0 ;
|
2238
|
+
int alloc2 = 0 ;
|
2239
|
+
|
2240
|
+
if ((argc < 1) || (argc > 1)) {
|
2241
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2242
|
+
}
|
2243
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2244
|
+
if (!SWIG_IsOK(res1)) {
|
2245
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "encoding" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2246
|
+
}
|
2247
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2248
|
+
res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
|
2249
|
+
if (!SWIG_IsOK(res2)) {
|
2250
|
+
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "encoding" "', argument " "2"" of type '" "char *""'");
|
2251
|
+
}
|
2252
|
+
arg2 = (char *)(buf2);
|
2253
|
+
if (arg1->encoding) free((char*)arg1->encoding);
|
2254
|
+
if (arg2) {
|
2255
|
+
size_t size = strlen((const char *)(arg2)) + 1;
|
2256
|
+
arg1->encoding = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
|
2257
|
+
} else {
|
2258
|
+
arg1->encoding = 0;
|
2259
|
+
}
|
2260
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2261
|
+
return Qnil;
|
2262
|
+
fail:
|
2263
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2264
|
+
return Qnil;
|
2265
|
+
}
|
2266
|
+
|
2267
|
+
|
2268
|
+
SWIGINTERN VALUE
|
2269
|
+
_wrap_BarcodeItem_encoding_get(int argc, VALUE *argv, VALUE self) {
|
2270
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2271
|
+
char *result = 0 ;
|
2272
|
+
void *argp1 = 0 ;
|
2273
|
+
int res1 = 0 ;
|
2274
|
+
VALUE vresult = Qnil;
|
2275
|
+
|
2276
|
+
if ((argc < 0) || (argc > 0)) {
|
2277
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2278
|
+
}
|
2279
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2280
|
+
if (!SWIG_IsOK(res1)) {
|
2281
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "encoding" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2282
|
+
}
|
2283
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2284
|
+
result = (char *) ((arg1)->encoding);
|
2285
|
+
vresult = SWIG_FromCharPtr((const char *)result);
|
2286
|
+
return vresult;
|
2287
|
+
fail:
|
2288
|
+
return Qnil;
|
2289
|
+
}
|
2290
|
+
|
2291
|
+
|
2292
|
+
SWIGINTERN VALUE
|
2293
|
+
_wrap_BarcodeItem_width_set(int argc, VALUE *argv, VALUE self) {
|
2294
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2295
|
+
int arg2 ;
|
2296
|
+
void *argp1 = 0 ;
|
2297
|
+
int res1 = 0 ;
|
2298
|
+
int val2 ;
|
2299
|
+
int ecode2 = 0 ;
|
2300
|
+
|
2301
|
+
if ((argc < 1) || (argc > 1)) {
|
2302
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2303
|
+
}
|
2304
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2305
|
+
if (!SWIG_IsOK(res1)) {
|
2306
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "width" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2307
|
+
}
|
2308
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2309
|
+
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
2310
|
+
if (!SWIG_IsOK(ecode2)) {
|
2311
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "width" "', argument " "2"" of type '" "int""'");
|
2312
|
+
}
|
2313
|
+
arg2 = (int)(val2);
|
2314
|
+
if (arg1) (arg1)->width = arg2;
|
2315
|
+
|
2316
|
+
return Qnil;
|
2317
|
+
fail:
|
2318
|
+
return Qnil;
|
2319
|
+
}
|
2320
|
+
|
2321
|
+
|
2322
|
+
SWIGINTERN VALUE
|
2323
|
+
_wrap_BarcodeItem_width_get(int argc, VALUE *argv, VALUE self) {
|
2324
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2325
|
+
int result;
|
2326
|
+
void *argp1 = 0 ;
|
2327
|
+
int res1 = 0 ;
|
2328
|
+
VALUE vresult = Qnil;
|
2329
|
+
|
2330
|
+
if ((argc < 0) || (argc > 0)) {
|
2331
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2332
|
+
}
|
2333
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2334
|
+
if (!SWIG_IsOK(res1)) {
|
2335
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "width" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2336
|
+
}
|
2337
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2338
|
+
result = (int) ((arg1)->width);
|
2339
|
+
vresult = SWIG_From_int((int)(result));
|
2340
|
+
return vresult;
|
2341
|
+
fail:
|
2342
|
+
return Qnil;
|
2343
|
+
}
|
2344
|
+
|
2345
|
+
|
2346
|
+
SWIGINTERN VALUE
|
2347
|
+
_wrap_BarcodeItem_height_set(int argc, VALUE *argv, VALUE self) {
|
2348
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2349
|
+
int arg2 ;
|
2350
|
+
void *argp1 = 0 ;
|
2351
|
+
int res1 = 0 ;
|
2352
|
+
int val2 ;
|
2353
|
+
int ecode2 = 0 ;
|
2354
|
+
|
2355
|
+
if ((argc < 1) || (argc > 1)) {
|
2356
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2357
|
+
}
|
2358
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2359
|
+
if (!SWIG_IsOK(res1)) {
|
2360
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "height" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2361
|
+
}
|
2362
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2363
|
+
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
2364
|
+
if (!SWIG_IsOK(ecode2)) {
|
2365
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "height" "', argument " "2"" of type '" "int""'");
|
2366
|
+
}
|
2367
|
+
arg2 = (int)(val2);
|
2368
|
+
if (arg1) (arg1)->height = arg2;
|
2369
|
+
|
2370
|
+
return Qnil;
|
2371
|
+
fail:
|
2372
|
+
return Qnil;
|
2373
|
+
}
|
2374
|
+
|
2375
|
+
|
2376
|
+
SWIGINTERN VALUE
|
2377
|
+
_wrap_BarcodeItem_height_get(int argc, VALUE *argv, VALUE self) {
|
2378
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2379
|
+
int result;
|
2380
|
+
void *argp1 = 0 ;
|
2381
|
+
int res1 = 0 ;
|
2382
|
+
VALUE vresult = Qnil;
|
2383
|
+
|
2384
|
+
if ((argc < 0) || (argc > 0)) {
|
2385
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2386
|
+
}
|
2387
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2388
|
+
if (!SWIG_IsOK(res1)) {
|
2389
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "height" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2390
|
+
}
|
2391
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2392
|
+
result = (int) ((arg1)->height);
|
2393
|
+
vresult = SWIG_From_int((int)(result));
|
2394
|
+
return vresult;
|
2395
|
+
fail:
|
2396
|
+
return Qnil;
|
2397
|
+
}
|
2398
|
+
|
2399
|
+
|
2400
|
+
SWIGINTERN VALUE
|
2401
|
+
_wrap_BarcodeItem_xoff_set(int argc, VALUE *argv, VALUE self) {
|
2402
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2403
|
+
int arg2 ;
|
2404
|
+
void *argp1 = 0 ;
|
2405
|
+
int res1 = 0 ;
|
2406
|
+
int val2 ;
|
2407
|
+
int ecode2 = 0 ;
|
2408
|
+
|
2409
|
+
if ((argc < 1) || (argc > 1)) {
|
2410
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2411
|
+
}
|
2412
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2413
|
+
if (!SWIG_IsOK(res1)) {
|
2414
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "xoff" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2415
|
+
}
|
2416
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2417
|
+
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
2418
|
+
if (!SWIG_IsOK(ecode2)) {
|
2419
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "xoff" "', argument " "2"" of type '" "int""'");
|
2420
|
+
}
|
2421
|
+
arg2 = (int)(val2);
|
2422
|
+
if (arg1) (arg1)->xoff = arg2;
|
2423
|
+
|
2424
|
+
return Qnil;
|
2425
|
+
fail:
|
2426
|
+
return Qnil;
|
2427
|
+
}
|
2428
|
+
|
2429
|
+
|
2430
|
+
SWIGINTERN VALUE
|
2431
|
+
_wrap_BarcodeItem_xoff_get(int argc, VALUE *argv, VALUE self) {
|
2432
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2433
|
+
int result;
|
2434
|
+
void *argp1 = 0 ;
|
2435
|
+
int res1 = 0 ;
|
2436
|
+
VALUE vresult = Qnil;
|
2437
|
+
|
2438
|
+
if ((argc < 0) || (argc > 0)) {
|
2439
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2440
|
+
}
|
2441
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2442
|
+
if (!SWIG_IsOK(res1)) {
|
2443
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "xoff" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2444
|
+
}
|
2445
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2446
|
+
result = (int) ((arg1)->xoff);
|
2447
|
+
vresult = SWIG_From_int((int)(result));
|
2448
|
+
return vresult;
|
2449
|
+
fail:
|
2450
|
+
return Qnil;
|
2451
|
+
}
|
2452
|
+
|
2453
|
+
|
2454
|
+
SWIGINTERN VALUE
|
2455
|
+
_wrap_BarcodeItem_yoff_set(int argc, VALUE *argv, VALUE self) {
|
2456
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2457
|
+
int arg2 ;
|
2458
|
+
void *argp1 = 0 ;
|
2459
|
+
int res1 = 0 ;
|
2460
|
+
int val2 ;
|
2461
|
+
int ecode2 = 0 ;
|
2462
|
+
|
2463
|
+
if ((argc < 1) || (argc > 1)) {
|
2464
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2465
|
+
}
|
2466
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2467
|
+
if (!SWIG_IsOK(res1)) {
|
2468
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "yoff" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2469
|
+
}
|
2470
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2471
|
+
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
2472
|
+
if (!SWIG_IsOK(ecode2)) {
|
2473
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "yoff" "', argument " "2"" of type '" "int""'");
|
2474
|
+
}
|
2475
|
+
arg2 = (int)(val2);
|
2476
|
+
if (arg1) (arg1)->yoff = arg2;
|
2477
|
+
|
2478
|
+
return Qnil;
|
2479
|
+
fail:
|
2480
|
+
return Qnil;
|
2481
|
+
}
|
2482
|
+
|
2483
|
+
|
2484
|
+
SWIGINTERN VALUE
|
2485
|
+
_wrap_BarcodeItem_yoff_get(int argc, VALUE *argv, VALUE self) {
|
2486
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2487
|
+
int result;
|
2488
|
+
void *argp1 = 0 ;
|
2489
|
+
int res1 = 0 ;
|
2490
|
+
VALUE vresult = Qnil;
|
2491
|
+
|
2492
|
+
if ((argc < 0) || (argc > 0)) {
|
2493
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2494
|
+
}
|
2495
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2496
|
+
if (!SWIG_IsOK(res1)) {
|
2497
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "yoff" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2498
|
+
}
|
2499
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2500
|
+
result = (int) ((arg1)->yoff);
|
2501
|
+
vresult = SWIG_From_int((int)(result));
|
2502
|
+
return vresult;
|
2503
|
+
fail:
|
2504
|
+
return Qnil;
|
2505
|
+
}
|
2506
|
+
|
2507
|
+
|
2508
|
+
SWIGINTERN VALUE
|
2509
|
+
_wrap_BarcodeItem_margin_set(int argc, VALUE *argv, VALUE self) {
|
2510
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2511
|
+
int arg2 ;
|
2512
|
+
void *argp1 = 0 ;
|
2513
|
+
int res1 = 0 ;
|
2514
|
+
int val2 ;
|
2515
|
+
int ecode2 = 0 ;
|
2516
|
+
|
2517
|
+
if ((argc < 1) || (argc > 1)) {
|
2518
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2519
|
+
}
|
2520
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2521
|
+
if (!SWIG_IsOK(res1)) {
|
2522
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "margin" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2523
|
+
}
|
2524
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2525
|
+
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
2526
|
+
if (!SWIG_IsOK(ecode2)) {
|
2527
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "margin" "', argument " "2"" of type '" "int""'");
|
2528
|
+
}
|
2529
|
+
arg2 = (int)(val2);
|
2530
|
+
if (arg1) (arg1)->margin = arg2;
|
2531
|
+
|
2532
|
+
return Qnil;
|
2533
|
+
fail:
|
2534
|
+
return Qnil;
|
2535
|
+
}
|
2536
|
+
|
2537
|
+
|
2538
|
+
SWIGINTERN VALUE
|
2539
|
+
_wrap_BarcodeItem_margin_get(int argc, VALUE *argv, VALUE self) {
|
2540
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2541
|
+
int result;
|
2542
|
+
void *argp1 = 0 ;
|
2543
|
+
int res1 = 0 ;
|
2544
|
+
VALUE vresult = Qnil;
|
2545
|
+
|
2546
|
+
if ((argc < 0) || (argc > 0)) {
|
2547
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2548
|
+
}
|
2549
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2550
|
+
if (!SWIG_IsOK(res1)) {
|
2551
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "margin" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2552
|
+
}
|
2553
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2554
|
+
result = (int) ((arg1)->margin);
|
2555
|
+
vresult = SWIG_From_int((int)(result));
|
2556
|
+
return vresult;
|
2557
|
+
fail:
|
2558
|
+
return Qnil;
|
2559
|
+
}
|
2560
|
+
|
2561
|
+
|
2562
|
+
SWIGINTERN VALUE
|
2563
|
+
_wrap_BarcodeItem_scalef_set(int argc, VALUE *argv, VALUE self) {
|
2564
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2565
|
+
double arg2 ;
|
2566
|
+
void *argp1 = 0 ;
|
2567
|
+
int res1 = 0 ;
|
2568
|
+
double val2 ;
|
2569
|
+
int ecode2 = 0 ;
|
2570
|
+
|
2571
|
+
if ((argc < 1) || (argc > 1)) {
|
2572
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2573
|
+
}
|
2574
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2575
|
+
if (!SWIG_IsOK(res1)) {
|
2576
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "scalef" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2577
|
+
}
|
2578
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2579
|
+
ecode2 = SWIG_AsVal_double(argv[0], &val2);
|
2580
|
+
if (!SWIG_IsOK(ecode2)) {
|
2581
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "scalef" "', argument " "2"" of type '" "double""'");
|
2582
|
+
}
|
2583
|
+
arg2 = (double)(val2);
|
2584
|
+
if (arg1) (arg1)->scalef = arg2;
|
2585
|
+
|
2586
|
+
return Qnil;
|
2587
|
+
fail:
|
2588
|
+
return Qnil;
|
2589
|
+
}
|
2590
|
+
|
2591
|
+
|
2592
|
+
SWIGINTERN VALUE
|
2593
|
+
_wrap_BarcodeItem_scalef_get(int argc, VALUE *argv, VALUE self) {
|
2594
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2595
|
+
double result;
|
2596
|
+
void *argp1 = 0 ;
|
2597
|
+
int res1 = 0 ;
|
2598
|
+
VALUE vresult = Qnil;
|
2599
|
+
|
2600
|
+
if ((argc < 0) || (argc > 0)) {
|
2601
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2602
|
+
}
|
2603
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2604
|
+
if (!SWIG_IsOK(res1)) {
|
2605
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "scalef" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2606
|
+
}
|
2607
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2608
|
+
result = (double) ((arg1)->scalef);
|
2609
|
+
vresult = SWIG_From_double((double)(result));
|
2610
|
+
return vresult;
|
2611
|
+
fail:
|
2612
|
+
return Qnil;
|
2613
|
+
}
|
2614
|
+
|
2615
|
+
|
2616
|
+
SWIGINTERN VALUE
|
2617
|
+
_wrap_BarcodeItem_error_set(int argc, VALUE *argv, VALUE self) {
|
2618
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2619
|
+
int arg2 ;
|
2620
|
+
void *argp1 = 0 ;
|
2621
|
+
int res1 = 0 ;
|
2622
|
+
int val2 ;
|
2623
|
+
int ecode2 = 0 ;
|
2624
|
+
|
2625
|
+
if ((argc < 1) || (argc > 1)) {
|
2626
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2627
|
+
}
|
2628
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2629
|
+
if (!SWIG_IsOK(res1)) {
|
2630
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "error" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2631
|
+
}
|
2632
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2633
|
+
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
2634
|
+
if (!SWIG_IsOK(ecode2)) {
|
2635
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "error" "', argument " "2"" of type '" "int""'");
|
2636
|
+
}
|
2637
|
+
arg2 = (int)(val2);
|
2638
|
+
if (arg1) (arg1)->error = arg2;
|
2639
|
+
|
2640
|
+
return Qnil;
|
2641
|
+
fail:
|
2642
|
+
return Qnil;
|
2643
|
+
}
|
2644
|
+
|
2645
|
+
|
2646
|
+
SWIGINTERN VALUE
|
2647
|
+
_wrap_BarcodeItem_error_get(int argc, VALUE *argv, VALUE self) {
|
2648
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2649
|
+
int result;
|
2650
|
+
void *argp1 = 0 ;
|
2651
|
+
int res1 = 0 ;
|
2652
|
+
VALUE vresult = Qnil;
|
2653
|
+
|
2654
|
+
if ((argc < 0) || (argc > 0)) {
|
2655
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2656
|
+
}
|
2657
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2658
|
+
if (!SWIG_IsOK(res1)) {
|
2659
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "error" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2660
|
+
}
|
2661
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2662
|
+
result = (int) ((arg1)->error);
|
2663
|
+
vresult = SWIG_From_int((int)(result));
|
2664
|
+
return vresult;
|
2665
|
+
fail:
|
2666
|
+
return Qnil;
|
2667
|
+
}
|
2668
|
+
|
2669
|
+
|
2670
|
+
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
|
2671
|
+
SWIGINTERN VALUE
|
2672
|
+
_wrap_BarcodeItem_allocate(VALUE self) {
|
2673
|
+
#else
|
2674
|
+
SWIGINTERN VALUE
|
2675
|
+
_wrap_BarcodeItem_allocate(int argc, VALUE *argv, VALUE self) {
|
2676
|
+
#endif
|
2677
|
+
|
2678
|
+
|
2679
|
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Barcode_Item);
|
2680
|
+
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
|
2681
|
+
rb_obj_call_init(vresult, argc, argv);
|
2682
|
+
#endif
|
2683
|
+
return vresult;
|
2684
|
+
}
|
2685
|
+
|
2686
|
+
|
2687
|
+
SWIGINTERN VALUE
|
2688
|
+
_wrap_new_BarcodeItem(int argc, VALUE *argv, VALUE self) {
|
2689
|
+
struct Barcode_Item *result = 0 ;
|
2690
|
+
|
2691
|
+
if ((argc < 0) || (argc > 0)) {
|
2692
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2693
|
+
}
|
2694
|
+
result = (struct Barcode_Item *)(struct Barcode_Item *) calloc(1, sizeof(struct Barcode_Item));DATA_PTR(self) = result;
|
2695
|
+
|
2696
|
+
return self;
|
2697
|
+
fail:
|
2698
|
+
return Qnil;
|
2699
|
+
}
|
2700
|
+
|
2701
|
+
|
2702
|
+
SWIGINTERN void
|
2703
|
+
free_Barcode_Item(struct Barcode_Item *arg1) {
|
2704
|
+
free((char *) arg1);
|
2705
|
+
}
|
2706
|
+
|
2707
|
+
SWIGINTERN VALUE
|
2708
|
+
_wrap_barcode_create(int argc, VALUE *argv, VALUE self) {
|
2709
|
+
char *arg1 = (char *) 0 ;
|
2710
|
+
struct Barcode_Item *result = 0 ;
|
2711
|
+
int res1 ;
|
2712
|
+
char *buf1 = 0 ;
|
2713
|
+
int alloc1 = 0 ;
|
2714
|
+
VALUE vresult = Qnil;
|
2715
|
+
|
2716
|
+
if ((argc < 1) || (argc > 1)) {
|
2717
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2718
|
+
}
|
2719
|
+
res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
|
2720
|
+
if (!SWIG_IsOK(res1)) {
|
2721
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Barcode_Create" "', argument " "1"" of type '" "char *""'");
|
2722
|
+
}
|
2723
|
+
arg1 = (char *)(buf1);
|
2724
|
+
result = (struct Barcode_Item *)Barcode_Create(arg1);
|
2725
|
+
vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2726
|
+
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
2727
|
+
return vresult;
|
2728
|
+
fail:
|
2729
|
+
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
2730
|
+
return Qnil;
|
2731
|
+
}
|
2732
|
+
|
2733
|
+
|
2734
|
+
SWIGINTERN VALUE
|
2735
|
+
_wrap_barcode_delete(int argc, VALUE *argv, VALUE self) {
|
2736
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2737
|
+
int result;
|
2738
|
+
void *argp1 = 0 ;
|
2739
|
+
int res1 = 0 ;
|
2740
|
+
VALUE vresult = Qnil;
|
2741
|
+
|
2742
|
+
if ((argc < 1) || (argc > 1)) {
|
2743
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2744
|
+
}
|
2745
|
+
res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2746
|
+
if (!SWIG_IsOK(res1)) {
|
2747
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Barcode_Delete" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2748
|
+
}
|
2749
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2750
|
+
result = (int)Barcode_Delete(arg1);
|
2751
|
+
vresult = SWIG_From_int((int)(result));
|
2752
|
+
return vresult;
|
2753
|
+
fail:
|
2754
|
+
return Qnil;
|
2755
|
+
}
|
2756
|
+
|
2757
|
+
|
2758
|
+
SWIGINTERN VALUE
|
2759
|
+
_wrap_barcode_encode(int argc, VALUE *argv, VALUE self) {
|
2760
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2761
|
+
int arg2 ;
|
2762
|
+
int result;
|
2763
|
+
void *argp1 = 0 ;
|
2764
|
+
int res1 = 0 ;
|
2765
|
+
int val2 ;
|
2766
|
+
int ecode2 = 0 ;
|
2767
|
+
VALUE vresult = Qnil;
|
2768
|
+
|
2769
|
+
if ((argc < 2) || (argc > 2)) {
|
2770
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
2771
|
+
}
|
2772
|
+
res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2773
|
+
if (!SWIG_IsOK(res1)) {
|
2774
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Barcode_Encode" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2775
|
+
}
|
2776
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2777
|
+
ecode2 = SWIG_AsVal_int(argv[1], &val2);
|
2778
|
+
if (!SWIG_IsOK(ecode2)) {
|
2779
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Barcode_Encode" "', argument " "2"" of type '" "int""'");
|
2780
|
+
}
|
2781
|
+
arg2 = (int)(val2);
|
2782
|
+
result = (int)Barcode_Encode(arg1,arg2);
|
2783
|
+
vresult = SWIG_From_int((int)(result));
|
2784
|
+
return vresult;
|
2785
|
+
fail:
|
2786
|
+
return Qnil;
|
2787
|
+
}
|
2788
|
+
|
2789
|
+
|
2790
|
+
SWIGINTERN VALUE
|
2791
|
+
_wrap_barcode_position(int argc, VALUE *argv, VALUE self) {
|
2792
|
+
struct Barcode_Item *arg1 = (struct Barcode_Item *) 0 ;
|
2793
|
+
int arg2 ;
|
2794
|
+
int arg3 ;
|
2795
|
+
int arg4 ;
|
2796
|
+
int arg5 ;
|
2797
|
+
double arg6 ;
|
2798
|
+
int result;
|
2799
|
+
void *argp1 = 0 ;
|
2800
|
+
int res1 = 0 ;
|
2801
|
+
int val2 ;
|
2802
|
+
int ecode2 = 0 ;
|
2803
|
+
int val3 ;
|
2804
|
+
int ecode3 = 0 ;
|
2805
|
+
int val4 ;
|
2806
|
+
int ecode4 = 0 ;
|
2807
|
+
int val5 ;
|
2808
|
+
int ecode5 = 0 ;
|
2809
|
+
double val6 ;
|
2810
|
+
int ecode6 = 0 ;
|
2811
|
+
VALUE vresult = Qnil;
|
2812
|
+
|
2813
|
+
if ((argc < 6) || (argc > 6)) {
|
2814
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
|
2815
|
+
}
|
2816
|
+
res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_Barcode_Item, 0 | 0 );
|
2817
|
+
if (!SWIG_IsOK(res1)) {
|
2818
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Barcode_Position" "', argument " "1"" of type '" "struct Barcode_Item *""'");
|
2819
|
+
}
|
2820
|
+
arg1 = (struct Barcode_Item *)(argp1);
|
2821
|
+
ecode2 = SWIG_AsVal_int(argv[1], &val2);
|
2822
|
+
if (!SWIG_IsOK(ecode2)) {
|
2823
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Barcode_Position" "', argument " "2"" of type '" "int""'");
|
2824
|
+
}
|
2825
|
+
arg2 = (int)(val2);
|
2826
|
+
ecode3 = SWIG_AsVal_int(argv[2], &val3);
|
2827
|
+
if (!SWIG_IsOK(ecode3)) {
|
2828
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Barcode_Position" "', argument " "3"" of type '" "int""'");
|
2829
|
+
}
|
2830
|
+
arg3 = (int)(val3);
|
2831
|
+
ecode4 = SWIG_AsVal_int(argv[3], &val4);
|
2832
|
+
if (!SWIG_IsOK(ecode4)) {
|
2833
|
+
SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Barcode_Position" "', argument " "4"" of type '" "int""'");
|
2834
|
+
}
|
2835
|
+
arg4 = (int)(val4);
|
2836
|
+
ecode5 = SWIG_AsVal_int(argv[4], &val5);
|
2837
|
+
if (!SWIG_IsOK(ecode5)) {
|
2838
|
+
SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Barcode_Position" "', argument " "5"" of type '" "int""'");
|
2839
|
+
}
|
2840
|
+
arg5 = (int)(val5);
|
2841
|
+
ecode6 = SWIG_AsVal_double(argv[5], &val6);
|
2842
|
+
if (!SWIG_IsOK(ecode6)) {
|
2843
|
+
SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Barcode_Position" "', argument " "6"" of type '" "double""'");
|
2844
|
+
}
|
2845
|
+
arg6 = (double)(val6);
|
2846
|
+
result = (int)Barcode_Position(arg1,arg2,arg3,arg4,arg5,arg6);
|
2847
|
+
vresult = SWIG_From_int((int)(result));
|
2848
|
+
return vresult;
|
2849
|
+
fail:
|
2850
|
+
return Qnil;
|
2851
|
+
}
|
2852
|
+
|
2853
|
+
|
2854
|
+
|
2855
|
+
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
|
2856
|
+
|
2857
|
+
static swig_type_info _swigt__p_Barcode_Item = {"_p_Barcode_Item", "struct Barcode_Item *", 0, 0, (void*)0, 0};
|
2858
|
+
static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *", 0, 0, (void*)0, 0};
|
2859
|
+
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
|
2860
|
+
|
2861
|
+
static swig_type_info *swig_type_initial[] = {
|
2862
|
+
&_swigt__p_Barcode_Item,
|
2863
|
+
&_swigt__p_FILE,
|
2864
|
+
&_swigt__p_char,
|
2865
|
+
};
|
2866
|
+
|
2867
|
+
static swig_cast_info _swigc__p_Barcode_Item[] = { {&_swigt__p_Barcode_Item, 0, 0, 0},{0, 0, 0, 0}};
|
2868
|
+
static swig_cast_info _swigc__p_FILE[] = { {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}};
|
2869
|
+
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
|
2870
|
+
|
2871
|
+
static swig_cast_info *swig_cast_initial[] = {
|
2872
|
+
_swigc__p_Barcode_Item,
|
2873
|
+
_swigc__p_FILE,
|
2874
|
+
_swigc__p_char,
|
2875
|
+
};
|
2876
|
+
|
2877
|
+
|
2878
|
+
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
|
2879
|
+
|
2880
|
+
/* -----------------------------------------------------------------------------
|
2881
|
+
* Type initialization:
|
2882
|
+
* This problem is tough by the requirement that no dynamic
|
2883
|
+
* memory is used. Also, since swig_type_info structures store pointers to
|
2884
|
+
* swig_cast_info structures and swig_cast_info structures store pointers back
|
2885
|
+
* to swig_type_info structures, we need some lookup code at initialization.
|
2886
|
+
* The idea is that swig generates all the structures that are needed.
|
2887
|
+
* The runtime then collects these partially filled structures.
|
2888
|
+
* The SWIG_InitializeModule function takes these initial arrays out of
|
2889
|
+
* swig_module, and does all the lookup, filling in the swig_module.types
|
2890
|
+
* array with the correct data and linking the correct swig_cast_info
|
2891
|
+
* structures together.
|
2892
|
+
*
|
2893
|
+
* The generated swig_type_info structures are assigned staticly to an initial
|
2894
|
+
* array. We just loop through that array, and handle each type individually.
|
2895
|
+
* First we lookup if this type has been already loaded, and if so, use the
|
2896
|
+
* loaded structure instead of the generated one. Then we have to fill in the
|
2897
|
+
* cast linked list. The cast data is initially stored in something like a
|
2898
|
+
* two-dimensional array. Each row corresponds to a type (there are the same
|
2899
|
+
* number of rows as there are in the swig_type_initial array). Each entry in
|
2900
|
+
* a column is one of the swig_cast_info structures for that type.
|
2901
|
+
* The cast_initial array is actually an array of arrays, because each row has
|
2902
|
+
* a variable number of columns. So to actually build the cast linked list,
|
2903
|
+
* we find the array of casts associated with the type, and loop through it
|
2904
|
+
* adding the casts to the list. The one last trick we need to do is making
|
2905
|
+
* sure the type pointer in the swig_cast_info struct is correct.
|
2906
|
+
*
|
2907
|
+
* First off, we lookup the cast->type name to see if it is already loaded.
|
2908
|
+
* There are three cases to handle:
|
2909
|
+
* 1) If the cast->type has already been loaded AND the type we are adding
|
2910
|
+
* casting info to has not been loaded (it is in this module), THEN we
|
2911
|
+
* replace the cast->type pointer with the type pointer that has already
|
2912
|
+
* been loaded.
|
2913
|
+
* 2) If BOTH types (the one we are adding casting info to, and the
|
2914
|
+
* cast->type) are loaded, THEN the cast info has already been loaded by
|
2915
|
+
* the previous module so we just ignore it.
|
2916
|
+
* 3) Finally, if cast->type has not already been loaded, then we add that
|
2917
|
+
* swig_cast_info to the linked list (because the cast->type) pointer will
|
2918
|
+
* be correct.
|
2919
|
+
* ----------------------------------------------------------------------------- */
|
2920
|
+
|
2921
|
+
#ifdef __cplusplus
|
2922
|
+
extern "C" {
|
2923
|
+
#if 0
|
2924
|
+
} /* c-mode */
|
2925
|
+
#endif
|
2926
|
+
#endif
|
2927
|
+
|
2928
|
+
#if 0
|
2929
|
+
#define SWIGRUNTIME_DEBUG
|
2930
|
+
#endif
|
2931
|
+
|
2932
|
+
|
2933
|
+
SWIGRUNTIME void
|
2934
|
+
SWIG_InitializeModule(void *clientdata) {
|
2935
|
+
size_t i;
|
2936
|
+
swig_module_info *module_head, *iter;
|
2937
|
+
int found;
|
2938
|
+
|
2939
|
+
clientdata = clientdata;
|
2940
|
+
|
2941
|
+
/* check to see if the circular list has been setup, if not, set it up */
|
2942
|
+
if (swig_module.next==0) {
|
2943
|
+
/* Initialize the swig_module */
|
2944
|
+
swig_module.type_initial = swig_type_initial;
|
2945
|
+
swig_module.cast_initial = swig_cast_initial;
|
2946
|
+
swig_module.next = &swig_module;
|
2947
|
+
}
|
2948
|
+
|
2949
|
+
/* Try and load any already created modules */
|
2950
|
+
module_head = SWIG_GetModule(clientdata);
|
2951
|
+
if (!module_head) {
|
2952
|
+
/* This is the first module loaded for this interpreter */
|
2953
|
+
/* so set the swig module into the interpreter */
|
2954
|
+
SWIG_SetModule(clientdata, &swig_module);
|
2955
|
+
module_head = &swig_module;
|
2956
|
+
} else {
|
2957
|
+
/* the interpreter has loaded a SWIG module, but has it loaded this one? */
|
2958
|
+
found=0;
|
2959
|
+
iter=module_head;
|
2960
|
+
do {
|
2961
|
+
if (iter==&swig_module) {
|
2962
|
+
found=1;
|
2963
|
+
break;
|
2964
|
+
}
|
2965
|
+
iter=iter->next;
|
2966
|
+
} while (iter!= module_head);
|
2967
|
+
|
2968
|
+
/* if the is found in the list, then all is done and we may leave */
|
2969
|
+
if (found) return;
|
2970
|
+
/* otherwise we must add out module into the list */
|
2971
|
+
swig_module.next = module_head->next;
|
2972
|
+
module_head->next = &swig_module;
|
2973
|
+
}
|
2974
|
+
|
2975
|
+
/* Now work on filling in swig_module.types */
|
2976
|
+
#ifdef SWIGRUNTIME_DEBUG
|
2977
|
+
printf("SWIG_InitializeModule: size %d\n", swig_module.size);
|
2978
|
+
#endif
|
2979
|
+
for (i = 0; i < swig_module.size; ++i) {
|
2980
|
+
swig_type_info *type = 0;
|
2981
|
+
swig_type_info *ret;
|
2982
|
+
swig_cast_info *cast;
|
2983
|
+
|
2984
|
+
#ifdef SWIGRUNTIME_DEBUG
|
2985
|
+
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
|
2986
|
+
#endif
|
2987
|
+
|
2988
|
+
/* if there is another module already loaded */
|
2989
|
+
if (swig_module.next != &swig_module) {
|
2990
|
+
type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
|
2991
|
+
}
|
2992
|
+
if (type) {
|
2993
|
+
/* Overwrite clientdata field */
|
2994
|
+
#ifdef SWIGRUNTIME_DEBUG
|
2995
|
+
printf("SWIG_InitializeModule: found type %s\n", type->name);
|
2996
|
+
#endif
|
2997
|
+
if (swig_module.type_initial[i]->clientdata) {
|
2998
|
+
type->clientdata = swig_module.type_initial[i]->clientdata;
|
2999
|
+
#ifdef SWIGRUNTIME_DEBUG
|
3000
|
+
printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
|
3001
|
+
#endif
|
3002
|
+
}
|
3003
|
+
} else {
|
3004
|
+
type = swig_module.type_initial[i];
|
3005
|
+
}
|
3006
|
+
|
3007
|
+
/* Insert casting types */
|
3008
|
+
cast = swig_module.cast_initial[i];
|
3009
|
+
while (cast->type) {
|
3010
|
+
|
3011
|
+
/* Don't need to add information already in the list */
|
3012
|
+
ret = 0;
|
3013
|
+
#ifdef SWIGRUNTIME_DEBUG
|
3014
|
+
printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
|
3015
|
+
#endif
|
3016
|
+
if (swig_module.next != &swig_module) {
|
3017
|
+
ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
|
3018
|
+
#ifdef SWIGRUNTIME_DEBUG
|
3019
|
+
if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
|
3020
|
+
#endif
|
3021
|
+
}
|
3022
|
+
if (ret) {
|
3023
|
+
if (type == swig_module.type_initial[i]) {
|
3024
|
+
#ifdef SWIGRUNTIME_DEBUG
|
3025
|
+
printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
|
3026
|
+
#endif
|
3027
|
+
cast->type = ret;
|
3028
|
+
ret = 0;
|
3029
|
+
} else {
|
3030
|
+
/* Check for casting already in the list */
|
3031
|
+
swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
|
3032
|
+
#ifdef SWIGRUNTIME_DEBUG
|
3033
|
+
if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
|
3034
|
+
#endif
|
3035
|
+
if (!ocast) ret = 0;
|
3036
|
+
}
|
3037
|
+
}
|
3038
|
+
|
3039
|
+
if (!ret) {
|
3040
|
+
#ifdef SWIGRUNTIME_DEBUG
|
3041
|
+
printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
|
3042
|
+
#endif
|
3043
|
+
if (type->cast) {
|
3044
|
+
type->cast->prev = cast;
|
3045
|
+
cast->next = type->cast;
|
3046
|
+
}
|
3047
|
+
type->cast = cast;
|
3048
|
+
}
|
3049
|
+
cast++;
|
3050
|
+
}
|
3051
|
+
/* Set entry in modules->types array equal to the type */
|
3052
|
+
swig_module.types[i] = type;
|
3053
|
+
}
|
3054
|
+
swig_module.types[i] = 0;
|
3055
|
+
|
3056
|
+
#ifdef SWIGRUNTIME_DEBUG
|
3057
|
+
printf("**** SWIG_InitializeModule: Cast List ******\n");
|
3058
|
+
for (i = 0; i < swig_module.size; ++i) {
|
3059
|
+
int j = 0;
|
3060
|
+
swig_cast_info *cast = swig_module.cast_initial[i];
|
3061
|
+
printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
|
3062
|
+
while (cast->type) {
|
3063
|
+
printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
|
3064
|
+
cast++;
|
3065
|
+
++j;
|
3066
|
+
}
|
3067
|
+
printf("---- Total casts: %d\n",j);
|
3068
|
+
}
|
3069
|
+
printf("**** SWIG_InitializeModule: Cast List ******\n");
|
3070
|
+
#endif
|
3071
|
+
}
|
3072
|
+
|
3073
|
+
/* This function will propagate the clientdata field of type to
|
3074
|
+
* any new swig_type_info structures that have been added into the list
|
3075
|
+
* of equivalent types. It is like calling
|
3076
|
+
* SWIG_TypeClientData(type, clientdata) a second time.
|
3077
|
+
*/
|
3078
|
+
SWIGRUNTIME void
|
3079
|
+
SWIG_PropagateClientData(void) {
|
3080
|
+
size_t i;
|
3081
|
+
swig_cast_info *equiv;
|
3082
|
+
static int init_run = 0;
|
3083
|
+
|
3084
|
+
if (init_run) return;
|
3085
|
+
init_run = 1;
|
3086
|
+
|
3087
|
+
for (i = 0; i < swig_module.size; i++) {
|
3088
|
+
if (swig_module.types[i]->clientdata) {
|
3089
|
+
equiv = swig_module.types[i]->cast;
|
3090
|
+
while (equiv) {
|
3091
|
+
if (!equiv->converter) {
|
3092
|
+
if (equiv->type && !equiv->type->clientdata)
|
3093
|
+
SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
|
3094
|
+
}
|
3095
|
+
equiv = equiv->next;
|
3096
|
+
}
|
3097
|
+
}
|
3098
|
+
}
|
3099
|
+
}
|
3100
|
+
|
3101
|
+
#ifdef __cplusplus
|
3102
|
+
#if 0
|
3103
|
+
{ /* c-mode */
|
3104
|
+
#endif
|
3105
|
+
}
|
3106
|
+
#endif
|
3107
|
+
|
3108
|
+
|
3109
|
+
#ifdef __cplusplus
|
3110
|
+
extern "C"
|
3111
|
+
#endif
|
3112
|
+
SWIGEXPORT void Init_gbarcode(void) {
|
3113
|
+
size_t i;
|
3114
|
+
|
3115
|
+
SWIG_InitRuntime();
|
3116
|
+
mGbarcode = rb_define_module("Gbarcode");
|
3117
|
+
|
3118
|
+
SWIG_InitializeModule(0);
|
3119
|
+
for (i = 0; i < swig_module.size; i++) {
|
3120
|
+
SWIG_define_class(swig_module.types[i]);
|
3121
|
+
}
|
3122
|
+
|
3123
|
+
SWIG_RubyInitializeTrackings();
|
3124
|
+
rb_define_module_function(mGbarcode, "barcode_print", _wrap_barcode_print, -1);
|
3125
|
+
rb_define_module_function(mGbarcode, "barcode_encode_and_print", _wrap_barcode_encode_and_print, -1);
|
3126
|
+
rb_define_module_function(mGbarcode, "barcode_svg_print", _wrap_barcode_svg_print, -1);
|
3127
|
+
rb_define_module_function(mGbarcode, "barcode_version", _wrap_barcode_version, -1);
|
3128
|
+
rb_define_const(mGbarcode, "BARCODE_VERSION", SWIG_FromCharPtr("0.98"));
|
3129
|
+
rb_define_const(mGbarcode, "BARCODE_VERSION_INT", SWIG_From_int((int)(9800)));
|
3130
|
+
|
3131
|
+
cBarcodeItem.klass = rb_define_class_under(mGbarcode, "BarcodeItem", rb_cObject);
|
3132
|
+
SWIG_TypeClientData(SWIGTYPE_p_Barcode_Item, (void *) &cBarcodeItem);
|
3133
|
+
rb_define_alloc_func(cBarcodeItem.klass, _wrap_BarcodeItem_allocate);
|
3134
|
+
rb_define_method(cBarcodeItem.klass, "initialize", _wrap_new_BarcodeItem, -1);
|
3135
|
+
/* rb_define_method(cBarcodeItem.klass, "flags=", _wrap_BarcodeItem_flags_set, -1);*/
|
3136
|
+
rb_define_method(cBarcodeItem.klass, "flags", _wrap_BarcodeItem_flags_get, -1);
|
3137
|
+
rb_define_method(cBarcodeItem.klass, "ascii=", _wrap_BarcodeItem_ascii_set, -1);
|
3138
|
+
rb_define_method(cBarcodeItem.klass, "ascii", _wrap_BarcodeItem_ascii_get, -1);
|
3139
|
+
/* rb_define_method(cBarcodeItem.klass, "partial=", _wrap_BarcodeItem_partial_set, -1);*/
|
3140
|
+
rb_define_method(cBarcodeItem.klass, "partial", _wrap_BarcodeItem_partial_get, -1);
|
3141
|
+
/* rb_define_method(cBarcodeItem.klass, "textinfo=", _wrap_BarcodeItem_textinfo_set, -1);*/
|
3142
|
+
rb_define_method(cBarcodeItem.klass, "textinfo", _wrap_BarcodeItem_textinfo_get, -1);
|
3143
|
+
/* rb_define_method(cBarcodeItem.klass, "encoding=", _wrap_BarcodeItem_encoding_set, -1);*/
|
3144
|
+
rb_define_method(cBarcodeItem.klass, "encoding", _wrap_BarcodeItem_encoding_get, -1);
|
3145
|
+
rb_define_method(cBarcodeItem.klass, "width=", _wrap_BarcodeItem_width_set, -1);
|
3146
|
+
rb_define_method(cBarcodeItem.klass, "width", _wrap_BarcodeItem_width_get, -1);
|
3147
|
+
rb_define_method(cBarcodeItem.klass, "height=", _wrap_BarcodeItem_height_set, -1);
|
3148
|
+
rb_define_method(cBarcodeItem.klass, "height", _wrap_BarcodeItem_height_get, -1);
|
3149
|
+
rb_define_method(cBarcodeItem.klass, "xoff=", _wrap_BarcodeItem_xoff_set, -1);
|
3150
|
+
rb_define_method(cBarcodeItem.klass, "xoff", _wrap_BarcodeItem_xoff_get, -1);
|
3151
|
+
rb_define_method(cBarcodeItem.klass, "yoff=", _wrap_BarcodeItem_yoff_set, -1);
|
3152
|
+
rb_define_method(cBarcodeItem.klass, "yoff", _wrap_BarcodeItem_yoff_get, -1);
|
3153
|
+
rb_define_method(cBarcodeItem.klass, "margin=", _wrap_BarcodeItem_margin_set, -1);
|
3154
|
+
rb_define_method(cBarcodeItem.klass, "margin", _wrap_BarcodeItem_margin_get, -1);
|
3155
|
+
rb_define_method(cBarcodeItem.klass, "scalef=", _wrap_BarcodeItem_scalef_set, -1);
|
3156
|
+
rb_define_method(cBarcodeItem.klass, "scalef", _wrap_BarcodeItem_scalef_get, -1);
|
3157
|
+
/* rb_define_method(cBarcodeItem.klass, "error=", _wrap_BarcodeItem_error_set, -1);*/
|
3158
|
+
rb_define_method(cBarcodeItem.klass, "error", _wrap_BarcodeItem_error_get, -1);
|
3159
|
+
cBarcodeItem.mark = 0;
|
3160
|
+
cBarcodeItem.destroy = (void (*)(void *)) free_Barcode_Item;
|
3161
|
+
cBarcodeItem.trackObjects = 0;
|
3162
|
+
rb_define_const(mGbarcode, "BARCODE_DEFAULT_FLAGS", SWIG_From_int((int)(0x00000000)));
|
3163
|
+
rb_define_const(mGbarcode, "BARCODE_ENCODING_MASK", SWIG_From_int((int)(0x000000ff)));
|
3164
|
+
rb_define_const(mGbarcode, "BARCODE_NO_ASCII", SWIG_From_int((int)(0x00000100)));
|
3165
|
+
rb_define_const(mGbarcode, "BARCODE_NO_CHECKSUM", SWIG_From_int((int)(0x00000200)));
|
3166
|
+
rb_define_const(mGbarcode, "BARCODE_OUTPUT_MASK", SWIG_From_int((int)(0x000ff000)));
|
3167
|
+
rb_define_const(mGbarcode, "BARCODE_OUT_EPS", SWIG_From_int((int)(0x00001000)));
|
3168
|
+
rb_define_const(mGbarcode, "BARCODE_OUT_PS", SWIG_From_int((int)(0x00002000)));
|
3169
|
+
rb_define_const(mGbarcode, "BARCODE_OUT_PCL", SWIG_From_int((int)(0x00004000)));
|
3170
|
+
rb_define_const(mGbarcode, "BARCODE_OUT_PCL_III", SWIG_From_int((int)(0x0000C000)));
|
3171
|
+
rb_define_const(mGbarcode, "BARCODE_OUT_NOHEADERS", SWIG_From_int((int)(0x00100000)));
|
3172
|
+
rb_define_const(mGbarcode, "BARCODE_ANY", SWIG_From_int((int)(BARCODE_ANY)));
|
3173
|
+
rb_define_const(mGbarcode, "BARCODE_EAN", SWIG_From_int((int)(BARCODE_EAN)));
|
3174
|
+
rb_define_const(mGbarcode, "BARCODE_UPC", SWIG_From_int((int)(BARCODE_UPC)));
|
3175
|
+
rb_define_const(mGbarcode, "BARCODE_ISBN", SWIG_From_int((int)(BARCODE_ISBN)));
|
3176
|
+
rb_define_const(mGbarcode, "BARCODE_39", SWIG_From_int((int)(BARCODE_39)));
|
3177
|
+
rb_define_const(mGbarcode, "BARCODE_128", SWIG_From_int((int)(BARCODE_128)));
|
3178
|
+
rb_define_const(mGbarcode, "BARCODE_128C", SWIG_From_int((int)(BARCODE_128C)));
|
3179
|
+
rb_define_const(mGbarcode, "BARCODE_128B", SWIG_From_int((int)(BARCODE_128B)));
|
3180
|
+
rb_define_const(mGbarcode, "BARCODE_I25", SWIG_From_int((int)(BARCODE_I25)));
|
3181
|
+
rb_define_const(mGbarcode, "BARCODE_128RAW", SWIG_From_int((int)(BARCODE_128RAW)));
|
3182
|
+
rb_define_const(mGbarcode, "BARCODE_CBR", SWIG_From_int((int)(BARCODE_CBR)));
|
3183
|
+
rb_define_const(mGbarcode, "BARCODE_MSI", SWIG_From_int((int)(BARCODE_MSI)));
|
3184
|
+
rb_define_const(mGbarcode, "BARCODE_PLS", SWIG_From_int((int)(BARCODE_PLS)));
|
3185
|
+
rb_define_const(mGbarcode, "BARCODE_93", SWIG_From_int((int)(BARCODE_93)));
|
3186
|
+
rb_define_const(mGbarcode, "BARCODE_DEFAULT_MARGIN", SWIG_From_int((int)(10)));
|
3187
|
+
rb_define_module_function(mGbarcode, "barcode_create", _wrap_barcode_create, -1);
|
3188
|
+
rb_define_module_function(mGbarcode, "barcode_delete", _wrap_barcode_delete, -1);
|
3189
|
+
rb_define_module_function(mGbarcode, "barcode_encode", _wrap_barcode_encode, -1);
|
3190
|
+
rb_define_module_function(mGbarcode, "barcode_position", _wrap_barcode_position, -1);
|
3191
|
+
}
|
3192
|
+
|