rubyfb 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +6 -0
- data/Manifest +0 -1
- data/Rakefile +1 -1
- data/ext/AddUser.c +217 -248
- data/ext/AddUser.h +3 -3
- data/ext/Backup.c +337 -404
- data/ext/Backup.h +3 -3
- data/ext/Blob.c +197 -248
- data/ext/Blob.h +30 -31
- data/ext/Common.c +17 -18
- data/ext/Common.h +10 -10
- data/ext/Connection.c +413 -487
- data/ext/Connection.h +18 -19
- data/ext/DataArea.c +172 -189
- data/ext/DataArea.h +11 -11
- data/ext/Database.c +198 -238
- data/ext/Database.h +16 -17
- data/ext/FireRuby.c +118 -142
- data/ext/FireRuby.h +17 -17
- data/ext/FireRubyException.c +68 -138
- data/ext/FireRubyException.h +14 -21
- data/ext/Generator.c +296 -377
- data/ext/Generator.h +17 -18
- data/ext/RemoveUser.c +91 -102
- data/ext/RemoveUser.h +3 -3
- data/ext/Restore.c +353 -423
- data/ext/Restore.h +3 -3
- data/ext/ResultSet.c +423 -456
- data/ext/ResultSet.h +26 -27
- data/ext/Row.c +505 -568
- data/ext/Row.h +27 -28
- data/ext/ServiceManager.c +143 -164
- data/ext/ServiceManager.h +17 -18
- data/ext/Services.c +58 -67
- data/ext/Services.h +3 -3
- data/ext/Statement.c +388 -449
- data/ext/Statement.h +30 -31
- data/ext/Transaction.c +374 -448
- data/ext/Transaction.h +17 -18
- data/ext/TypeMap.c +654 -774
- data/ext/TypeMap.h +17 -17
- data/ext/rfbint.h +3 -3
- data/lib/active_record/connection_adapters/rubyfb_adapter.rb +1 -1
- data/lib/rubyfb_lib.so +0 -0
- data/lib/src.rb +33 -0
- data/rubyfb.gemspec +3 -3
- data/test/ResultSetTest.rb +13 -0
- data/test/RowTest.rb +16 -0
- metadata +4 -5
- data/test/UnitTest.rb +0 -65
data/ext/Backup.h
CHANGED
@@ -25,13 +25,13 @@
|
|
25
25
|
#ifndef FIRERUBY_BACKUP_H
|
26
26
|
#define FIRERUBY_BACKUP_H
|
27
27
|
|
28
|
-
|
28
|
+
/* Includes. */
|
29
29
|
#ifndef RUBY_H_INCLUDED
|
30
30
|
#include "ruby.h"
|
31
31
|
#define RUBY_H_INCLUDED
|
32
32
|
#endif
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
/* Function prototypes. */
|
35
|
+
void Init_Backup(VALUE);
|
36
36
|
|
37
37
|
#endif /* FIRERUBY_BACKUP_H */
|
data/ext/Blob.c
CHANGED
@@ -3,20 +3,20 @@
|
|
3
3
|
*----------------------------------------------------------------------------*/
|
4
4
|
/**
|
5
5
|
* Copyright � Peter Wood, 2005
|
6
|
-
*
|
6
|
+
*
|
7
7
|
* The contents of this file are subject to the Mozilla Public License Version
|
8
8
|
* 1.1 (the "License"); you may not use this file except in compliance with the
|
9
|
-
* License. You may obtain a copy of the License at
|
9
|
+
* License. You may obtain a copy of the License at
|
10
10
|
*
|
11
11
|
* http://www.mozilla.org/MPL/
|
12
|
-
*
|
12
|
+
*
|
13
13
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
14
14
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
15
15
|
* the specificlanguage governing rights and limitations under the License.
|
16
|
-
*
|
16
|
+
*
|
17
17
|
* The Original Code is the FireRuby extension for the Ruby language.
|
18
|
-
*
|
19
|
-
* The Initial Developer of the Original Code is Peter Wood. All Rights
|
18
|
+
*
|
19
|
+
* The Initial Developer of the Original Code is Peter Wood. All Rights
|
20
20
|
* Reserved.
|
21
21
|
*
|
22
22
|
* @author Peter Wood
|
@@ -47,24 +47,20 @@ VALUE cBlob;
|
|
47
47
|
* @param klass A reference to the Blob Class object.
|
48
48
|
*
|
49
49
|
*/
|
50
|
-
static VALUE allocateBlob(VALUE klass)
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
rb_raise(rb_eNoMemError, "Memory allocation failure allocating a blob.");
|
65
|
-
}
|
66
|
-
|
67
|
-
return(instance);
|
50
|
+
static VALUE allocateBlob(VALUE klass) {
|
51
|
+
VALUE instance;
|
52
|
+
BlobHandle *blob = ALLOC(BlobHandle);
|
53
|
+
|
54
|
+
if(blob != NULL) {
|
55
|
+
memset(&blob->description, 0, sizeof(ISC_BLOB_DESC));
|
56
|
+
blob->segments = blob->size = 0;
|
57
|
+
blob->handle = 0;
|
58
|
+
instance = Data_Wrap_Struct(klass, NULL, blobFree, blob);
|
59
|
+
} else {
|
60
|
+
rb_raise(rb_eNoMemError, "Memory allocation failure allocating a blob.");
|
61
|
+
}
|
62
|
+
|
63
|
+
return(instance);
|
68
64
|
}
|
69
65
|
|
70
66
|
|
@@ -76,10 +72,9 @@ static VALUE allocateBlob(VALUE klass)
|
|
76
72
|
* @return A reference to the newly initialized Blob object.
|
77
73
|
*
|
78
74
|
*/
|
79
|
-
VALUE initializeBlob(VALUE self)
|
80
|
-
|
81
|
-
|
82
|
-
return(self);
|
75
|
+
VALUE initializeBlob(VALUE self) {
|
76
|
+
rb_iv_set(self, "@data", Qnil);
|
77
|
+
return(self);
|
83
78
|
}
|
84
79
|
|
85
80
|
|
@@ -92,29 +87,25 @@ VALUE initializeBlob(VALUE self)
|
|
92
87
|
* @return A reference to a String containing the Blob object data.
|
93
88
|
*
|
94
89
|
*/
|
95
|
-
static VALUE getBlobData(VALUE self)
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
{
|
106
|
-
|
107
|
-
|
108
|
-
if(buffer != NULL)
|
109
|
-
{
|
110
|
-
data = rb_str_new(buffer, blob->size);
|
111
|
-
}
|
112
|
-
free(buffer);
|
90
|
+
static VALUE getBlobData(VALUE self) {
|
91
|
+
VALUE data = rb_iv_get(self, "@data");
|
92
|
+
|
93
|
+
if(data == Qnil) {
|
94
|
+
BlobHandle *blob = NULL;
|
95
|
+
|
96
|
+
Data_Get_Struct(self, BlobHandle, blob);
|
97
|
+
if(blob->size > 0) {
|
98
|
+
char *buffer = loadBlobData(blob);
|
99
|
+
|
100
|
+
if(buffer != NULL) {
|
101
|
+
data = rb_str_new(buffer, blob->size);
|
113
102
|
}
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
103
|
+
free(buffer);
|
104
|
+
}
|
105
|
+
rb_iv_set(self, "@data", data);
|
106
|
+
}
|
107
|
+
|
108
|
+
return(data);
|
118
109
|
}
|
119
110
|
|
120
111
|
|
@@ -128,29 +119,25 @@ static VALUE getBlobData(VALUE self)
|
|
128
119
|
* @return A reference to the closed Blob object.
|
129
120
|
*
|
130
121
|
*/
|
131
|
-
static VALUE closeBlob(VALUE self)
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
blob->handle = 0;
|
151
|
-
}
|
152
|
-
|
153
|
-
return(self);
|
122
|
+
static VALUE closeBlob(VALUE self) {
|
123
|
+
VALUE data = rb_iv_get(self, "@data");
|
124
|
+
BlobHandle *blob = NULL;
|
125
|
+
|
126
|
+
if(data != Qnil) {
|
127
|
+
rb_iv_set(self, "@data", Qnil);
|
128
|
+
}
|
129
|
+
|
130
|
+
Data_Get_Struct(self, BlobHandle, blob);
|
131
|
+
if(blob->handle != 0) {
|
132
|
+
ISC_STATUS status[ISC_STATUS_LENGTH];
|
133
|
+
|
134
|
+
if(isc_close_blob(status, &blob->handle) != 0) {
|
135
|
+
rb_fireruby_raise(status, "Error closing blob.");
|
136
|
+
}
|
137
|
+
blob->handle = 0;
|
138
|
+
}
|
139
|
+
|
140
|
+
return(self);
|
154
141
|
}
|
155
142
|
|
156
143
|
|
@@ -163,27 +150,24 @@ static VALUE closeBlob(VALUE self)
|
|
163
150
|
* @return A reference to the last return value from the block called.
|
164
151
|
*
|
165
152
|
*/
|
166
|
-
static VALUE eachBlobSegment(VALUE self)
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
153
|
+
static VALUE eachBlobSegment(VALUE self) {
|
154
|
+
VALUE result = Qnil;
|
155
|
+
|
156
|
+
if(rb_block_given_p()) {
|
157
|
+
BlobHandle *blob = NULL;
|
158
|
+
char *segment = NULL;
|
159
|
+
unsigned short size = 0;
|
160
|
+
|
161
|
+
Data_Get_Struct(self, BlobHandle, blob);
|
162
|
+
segment = loadBlobSegment(blob, &size);
|
163
|
+
while(segment != NULL) {
|
164
|
+
result = rb_yield(rb_str_new(segment, size));
|
165
|
+
free(segment);
|
177
166
|
segment = loadBlobSegment(blob, &size);
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
segment = loadBlobSegment(blob, &size);
|
183
|
-
}
|
184
|
-
}
|
185
|
-
|
186
|
-
return(result);
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
return(result);
|
187
171
|
}
|
188
172
|
|
189
173
|
|
@@ -207,68 +191,54 @@ BlobHandle *openBlob(ISC_QUAD blobId,
|
|
207
191
|
char *table,
|
208
192
|
char *column,
|
209
193
|
isc_db_handle *connection,
|
210
|
-
isc_tr_handle *transaction)
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
blob->segments = isc_vax_integer(&data[offset + 3], length);
|
243
|
-
done++;
|
244
|
-
}
|
245
|
-
else if(data[offset] == isc_info_blob_total_length)
|
246
|
-
{
|
247
|
-
blob->size = isc_vax_integer(&data[offset + 3], length);
|
248
|
-
done++;
|
249
|
-
}
|
250
|
-
else
|
251
|
-
{
|
252
|
-
free(blob);
|
253
|
-
rb_fireruby_raise(NULL, "Error reading blob details.");
|
254
|
-
}
|
255
|
-
offset += length + 3;
|
256
|
-
}
|
257
|
-
}
|
258
|
-
else
|
259
|
-
{
|
194
|
+
isc_tr_handle *transaction) {
|
195
|
+
BlobHandle *blob = ALLOC(BlobHandle);
|
196
|
+
|
197
|
+
if(blob != NULL) {
|
198
|
+
ISC_STATUS status[ISC_STATUS_LENGTH];
|
199
|
+
|
200
|
+
/* Extract the blob details and open it. */
|
201
|
+
blob->handle = 0;
|
202
|
+
isc_blob_default_desc(&blob->description,
|
203
|
+
(unsigned char *)table,
|
204
|
+
(unsigned char *)column);
|
205
|
+
if(isc_open_blob2(status, connection, transaction, &blob->handle, &blobId,
|
206
|
+
0, NULL) == 0) {
|
207
|
+
char items[] = {isc_info_blob_num_segments,
|
208
|
+
isc_info_blob_total_length},
|
209
|
+
data[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
210
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
211
|
+
|
212
|
+
if(isc_blob_info(status, &blob->handle, 2, items, 20, data) == 0) {
|
213
|
+
int offset = 0,
|
214
|
+
done = 0;
|
215
|
+
|
216
|
+
while(done < 2) {
|
217
|
+
int length = isc_vax_integer(&data[offset + 1], 2);
|
218
|
+
|
219
|
+
if(data[offset] == isc_info_blob_num_segments) {
|
220
|
+
blob->segments = isc_vax_integer(&data[offset + 3], length);
|
221
|
+
done++;
|
222
|
+
} else if(data[offset] == isc_info_blob_total_length) {
|
223
|
+
blob->size = isc_vax_integer(&data[offset + 3], length);
|
224
|
+
done++;
|
225
|
+
} else {
|
260
226
|
free(blob);
|
261
|
-
rb_fireruby_raise(
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
{
|
266
|
-
|
267
|
-
|
227
|
+
rb_fireruby_raise(NULL, "Error reading blob details.");
|
228
|
+
}
|
229
|
+
offset += length + 3;
|
230
|
+
}
|
231
|
+
} else {
|
232
|
+
free(blob);
|
233
|
+
rb_fireruby_raise(status, "Error fetching blob details.");
|
268
234
|
}
|
269
|
-
|
270
|
-
|
271
|
-
|
235
|
+
} else {
|
236
|
+
free(blob);
|
237
|
+
rb_fireruby_raise(status, "Error opening blob.");
|
238
|
+
}
|
239
|
+
}
|
240
|
+
|
241
|
+
return(blob);
|
272
242
|
}
|
273
243
|
|
274
244
|
|
@@ -282,47 +252,38 @@ BlobHandle *openBlob(ISC_QUAD blobId,
|
|
282
252
|
* blob.
|
283
253
|
*
|
284
254
|
*/
|
285
|
-
char *loadBlobData(BlobHandle *blob)
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
{
|
308
|
-
free(data);
|
309
|
-
rb_fireruby_raise(status, "Error loading blob data.");
|
310
|
-
}
|
311
|
-
offset = offset + quantity;
|
312
|
-
}
|
313
|
-
}
|
314
|
-
else
|
315
|
-
{
|
316
|
-
rb_raise(rb_eNoMemError,
|
317
|
-
"Memory allocation failure loading blob data.");
|
255
|
+
char *loadBlobData(BlobHandle *blob) {
|
256
|
+
char *data = NULL;
|
257
|
+
|
258
|
+
if(blob != NULL && blob->handle != 0) {
|
259
|
+
if((data = ALLOC_N(char, blob->size)) != NULL) {
|
260
|
+
ISC_STATUS status[ISC_STATUS_LENGTH],
|
261
|
+
result = 0;
|
262
|
+
int offset = 0;
|
263
|
+
|
264
|
+
while(result == 0 || result == isc_segment) {
|
265
|
+
unsigned short quantity = 0,
|
266
|
+
available = 0;
|
267
|
+
int remains = blob->size - offset;
|
268
|
+
|
269
|
+
available = remains > USHRT_MAX ? USHRT_MAX : remains;
|
270
|
+
result = isc_get_segment(status, &blob->handle, &quantity,
|
271
|
+
available, &data[offset]);
|
272
|
+
if(result != 0 && result != isc_segment && result != isc_segstr_eof) {
|
273
|
+
free(data);
|
274
|
+
rb_fireruby_raise(status, "Error loading blob data.");
|
275
|
+
}
|
276
|
+
offset = offset + quantity;
|
318
277
|
}
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
278
|
+
} else {
|
279
|
+
rb_raise(rb_eNoMemError,
|
280
|
+
"Memory allocation failure loading blob data.");
|
281
|
+
}
|
282
|
+
} else {
|
283
|
+
rb_fireruby_raise(NULL, "Invalid blob specified for loading.");
|
284
|
+
}
|
285
|
+
|
286
|
+
return(data);
|
326
287
|
}
|
327
288
|
|
328
289
|
|
@@ -339,39 +300,31 @@ char *loadBlobData(BlobHandle *blob)
|
|
339
300
|
* segements to be read.
|
340
301
|
*
|
341
302
|
*/
|
342
|
-
char *loadBlobSegment(BlobHandle *blob, unsigned short *length)
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
if(result != 0 && result != isc_segstr_eof)
|
358
|
-
{
|
359
|
-
free(data);
|
360
|
-
rb_fireruby_raise(status, "Error reading blob segment.");
|
361
|
-
}
|
362
|
-
}
|
363
|
-
else
|
364
|
-
{
|
365
|
-
rb_raise(rb_eNoMemError,
|
366
|
-
"Memory allocation failre loading blob segment.");
|
303
|
+
char *loadBlobSegment(BlobHandle *blob, unsigned short *length) {
|
304
|
+
char *data = NULL;
|
305
|
+
|
306
|
+
*length = 0;
|
307
|
+
if(blob != NULL && blob->handle != 0) {
|
308
|
+
unsigned short size = blob->description.blob_desc_segment_size;
|
309
|
+
|
310
|
+
if((data = ALLOC_N(char, size)) != NULL) {
|
311
|
+
ISC_STATUS status[ISC_STATUS_LENGTH],
|
312
|
+
result;
|
313
|
+
|
314
|
+
result = isc_get_segment(status, &blob->handle, length, size, data);
|
315
|
+
if(result != 0 && result != isc_segstr_eof) {
|
316
|
+
free(data);
|
317
|
+
rb_fireruby_raise(status, "Error reading blob segment.");
|
367
318
|
}
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
319
|
+
} else {
|
320
|
+
rb_raise(rb_eNoMemError,
|
321
|
+
"Memory allocation failre loading blob segment.");
|
322
|
+
}
|
323
|
+
} else {
|
324
|
+
rb_fireruby_raise(NULL, "Invalid blob specified for loading.");
|
325
|
+
}
|
326
|
+
|
327
|
+
return(data);
|
375
328
|
}
|
376
329
|
|
377
330
|
|
@@ -384,20 +337,17 @@ char *loadBlobSegment(BlobHandle *blob, unsigned short *length)
|
|
384
337
|
* object being collected.
|
385
338
|
*
|
386
339
|
*/
|
387
|
-
void blobFree(void *blob)
|
388
|
-
{
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
}
|
399
|
-
free(handle);
|
400
|
-
}
|
340
|
+
void blobFree(void *blob) {
|
341
|
+
if(blob != NULL) {
|
342
|
+
BlobHandle *handle = (BlobHandle *)blob;
|
343
|
+
|
344
|
+
if(handle->handle != 0) {
|
345
|
+
ISC_STATUS status[ISC_STATUS_LENGTH];
|
346
|
+
|
347
|
+
isc_close_blob(status, &handle->handle);
|
348
|
+
}
|
349
|
+
free(handle);
|
350
|
+
}
|
401
351
|
}
|
402
352
|
|
403
353
|
|
@@ -409,13 +359,12 @@ void blobFree(void *blob)
|
|
409
359
|
* under.
|
410
360
|
*
|
411
361
|
*/
|
412
|
-
void Init_Blob(VALUE module)
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
rb_define_method(cBlob, "each", eachBlobSegment, 0);
|
362
|
+
void Init_Blob(VALUE module) {
|
363
|
+
cBlob = rb_define_class_under(module, "Blob", rb_cObject);
|
364
|
+
rb_define_alloc_func(cBlob, allocateBlob);
|
365
|
+
rb_define_method(cBlob, "initialize", initializeBlob, 0);
|
366
|
+
rb_define_method(cBlob, "initialize_copy", forbidObjectCopy, 1);
|
367
|
+
rb_define_method(cBlob, "to_s", getBlobData, 0);
|
368
|
+
rb_define_method(cBlob, "close", closeBlob, 0);
|
369
|
+
rb_define_method(cBlob, "each", eachBlobSegment, 0);
|
421
370
|
}
|
data/ext/Blob.h
CHANGED
@@ -3,20 +3,20 @@
|
|
3
3
|
*----------------------------------------------------------------------------*/
|
4
4
|
/**
|
5
5
|
* Copyright � Peter Wood, 2005
|
6
|
-
*
|
6
|
+
*
|
7
7
|
* The contents of this file are subject to the Mozilla Public License Version
|
8
8
|
* 1.1 (the "License"); you may not use this file except in compliance with the
|
9
|
-
* License. You may obtain a copy of the License at
|
9
|
+
* License. You may obtain a copy of the License at
|
10
10
|
*
|
11
11
|
* http://www.mozilla.org/MPL/
|
12
|
-
*
|
12
|
+
*
|
13
13
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
14
14
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
15
15
|
* the specificlanguage governing rights and limitations under the License.
|
16
|
-
*
|
16
|
+
*
|
17
17
|
* The Original Code is the FireRuby extension for the Ruby language.
|
18
|
-
*
|
19
|
-
* The Initial Developer of the Original Code is Peter Wood. All Rights
|
18
|
+
*
|
19
|
+
* The Initial Developer of the Original Code is Peter Wood. All Rights
|
20
20
|
* Reserved.
|
21
21
|
*
|
22
22
|
* @author Peter Wood
|
@@ -25,41 +25,40 @@
|
|
25
25
|
#ifndef FIRERUBY_BLOB_H
|
26
26
|
#define FIRERUBY_BLOB_H
|
27
27
|
|
28
|
-
|
28
|
+
/* Includes. */
|
29
29
|
#ifndef FIRERUBY_FIRE_RUBY_EXCEPTION_H
|
30
30
|
#include "FireRubyException.h"
|
31
31
|
#endif
|
32
|
-
|
32
|
+
|
33
33
|
#ifndef IBASE_H_INCLUDED
|
34
34
|
#include "ibase.h"
|
35
35
|
#define IBASE_H_INCLUDED
|
36
36
|
#endif
|
37
|
-
|
37
|
+
|
38
38
|
#ifndef RUBY_H_INCLUDED
|
39
39
|
#include "ruby.h"
|
40
40
|
#define RUBY_H_INCLUDED
|
41
41
|
#endif
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
VALUE initializeBlob(VALUE);
|
42
|
+
|
43
|
+
/* Type definitions. */
|
44
|
+
typedef struct {
|
45
|
+
ISC_BLOB_DESC description;
|
46
|
+
ISC_LONG segments,
|
47
|
+
size;
|
48
|
+
isc_blob_handle handle;
|
49
|
+
} BlobHandle;
|
50
|
+
|
51
|
+
/* Data elements. */
|
52
|
+
extern VALUE cBlob;
|
53
|
+
|
54
|
+
/* Function prototypes. */
|
55
|
+
BlobHandle *openBlob(ISC_QUAD,
|
56
|
+
char *,
|
57
|
+
char *,
|
58
|
+
isc_db_handle *,
|
59
|
+
isc_tr_handle *);
|
60
|
+
void Init_Blob(VALUE);
|
61
|
+
void blobFree(void *);
|
62
|
+
VALUE initializeBlob(VALUE);
|
64
63
|
|
65
64
|
#endif /* FIRERUBY_BLOB_H */
|