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/Database.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
|
@@ -54,23 +54,19 @@ VALUE cDatabase;
|
|
54
54
|
* @return A reference to the new Database class instance.
|
55
55
|
*
|
56
56
|
*/
|
57
|
-
static VALUE allocateDatabase(VALUE klass)
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
"Memory allocation failure creating a Database object.");
|
71
|
-
}
|
72
|
-
|
73
|
-
return(instance);
|
57
|
+
static VALUE allocateDatabase(VALUE klass) {
|
58
|
+
VALUE instance = Qnil;
|
59
|
+
DatabaseHandle *database = ALLOC(DatabaseHandle);
|
60
|
+
|
61
|
+
if(database != NULL) {
|
62
|
+
/* Wrap the structure in a class. */
|
63
|
+
instance = Data_Wrap_Struct(klass, NULL, databaseFree, database);
|
64
|
+
} else {
|
65
|
+
rb_raise(rb_eNoMemError,
|
66
|
+
"Memory allocation failure creating a Database object.");
|
67
|
+
}
|
68
|
+
|
69
|
+
return(instance);
|
74
70
|
}
|
75
71
|
|
76
72
|
|
@@ -87,29 +83,26 @@ static VALUE allocateDatabase(VALUE klass)
|
|
87
83
|
* @return A reference to the new initialized object instance.
|
88
84
|
*
|
89
85
|
*/
|
90
|
-
VALUE initializeDatabase(int argc, VALUE *argv, VALUE self)
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
rb_iv_set(self, "@options", options);
|
111
|
-
|
112
|
-
return(self);
|
86
|
+
VALUE initializeDatabase(int argc, VALUE *argv, VALUE self) {
|
87
|
+
VALUE options = rb_hash_new();
|
88
|
+
|
89
|
+
/* Check the number of parameters. */
|
90
|
+
if(argc < 1) {
|
91
|
+
rb_raise(rb_eArgError, "Wrong number of arguments (%d for %d).", argc, 1);
|
92
|
+
}
|
93
|
+
|
94
|
+
/* Perform type checks on the input parameters. */
|
95
|
+
Check_Type(argv[0], T_STRING);
|
96
|
+
if(argc > 1) {
|
97
|
+
Check_Type(argv[1], T_STRING);
|
98
|
+
rb_hash_aset(options, INT2FIX(isc_dpb_lc_ctype), argv[1]);
|
99
|
+
}
|
100
|
+
|
101
|
+
/* Store the database details. */
|
102
|
+
rb_iv_set(self, "@file", argv[0]);
|
103
|
+
rb_iv_set(self, "@options", options);
|
104
|
+
|
105
|
+
return(self);
|
113
106
|
}
|
114
107
|
|
115
108
|
|
@@ -122,9 +115,8 @@ VALUE initializeDatabase(int argc, VALUE *argv, VALUE self)
|
|
122
115
|
* object
|
123
116
|
*
|
124
117
|
*/
|
125
|
-
static VALUE getDatabaseFile(VALUE self)
|
126
|
-
|
127
|
-
return(rb_iv_get(self, "@file"));
|
118
|
+
static VALUE getDatabaseFile(VALUE self) {
|
119
|
+
return(rb_iv_get(self, "@file"));
|
128
120
|
}
|
129
121
|
|
130
122
|
|
@@ -140,38 +132,31 @@ static VALUE getDatabaseFile(VALUE self)
|
|
140
132
|
* @return A reference to a Connection object or nil if an error occurs.
|
141
133
|
*
|
142
134
|
*/
|
143
|
-
static VALUE connectToDatabase(int argc, VALUE *argv, VALUE self)
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
}
|
169
|
-
else
|
170
|
-
{
|
171
|
-
result = connection;
|
172
|
-
}
|
173
|
-
|
174
|
-
return(result);
|
135
|
+
static VALUE connectToDatabase(int argc, VALUE *argv, VALUE self) {
|
136
|
+
VALUE result = Qnil,
|
137
|
+
user = Qnil,
|
138
|
+
password = Qnil,
|
139
|
+
options = rb_iv_get(self, "@options"),
|
140
|
+
connection = Qnil;
|
141
|
+
|
142
|
+
if(argc > 0) {
|
143
|
+
user = argv[0];
|
144
|
+
}
|
145
|
+
if(argc > 1) {
|
146
|
+
password = argv[1];
|
147
|
+
}
|
148
|
+
if(argc > 2) {
|
149
|
+
rb_funcall(options, rb_intern("update"), 1, argv[2]);
|
150
|
+
}
|
151
|
+
|
152
|
+
connection = rb_connection_new(self, user, password, options);
|
153
|
+
if(rb_block_given_p()) {
|
154
|
+
result = rb_ensure(connectBlock, connection, connectEnsure, connection);
|
155
|
+
} else {
|
156
|
+
result = connection;
|
157
|
+
}
|
158
|
+
|
159
|
+
return(result);
|
175
160
|
}
|
176
161
|
|
177
162
|
|
@@ -192,99 +177,87 @@ static VALUE connectToDatabase(int argc, VALUE *argv, VALUE self)
|
|
192
177
|
* @return A reference to a Database object on success, nil on failure.
|
193
178
|
*
|
194
179
|
*/
|
195
|
-
static VALUE createDatabase(int argc, VALUE *argv, VALUE unused)
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
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
|
-
|
243
|
-
|
180
|
+
static VALUE createDatabase(int argc, VALUE *argv, VALUE unused) {
|
181
|
+
VALUE database = Qnil,
|
182
|
+
set = Qnil,
|
183
|
+
tmp_str = Qnil;
|
184
|
+
char sql[512] = "",
|
185
|
+
*text = NULL;
|
186
|
+
int value = 1024;
|
187
|
+
isc_db_handle connection = 0;
|
188
|
+
isc_tr_handle transaction = 0;
|
189
|
+
ISC_STATUS status[ISC_STATUS_LENGTH];
|
190
|
+
|
191
|
+
/* Check that sufficient parameters have been provided. */
|
192
|
+
if(argc < 3) {
|
193
|
+
rb_raise(rb_eArgError, "Wrong number of parameters (%d for %d).", argc,
|
194
|
+
3);
|
195
|
+
}
|
196
|
+
|
197
|
+
/* Check values that are permitted restricted values. */
|
198
|
+
if(argc > 3) {
|
199
|
+
value = FIX2INT(argv[3]);
|
200
|
+
if(value != 1024 && value != 2048 && value != 4096 && value != 8192) {
|
201
|
+
rb_raise(rb_eException,
|
202
|
+
"Invalid database page size value . Valid values are 1024, " \
|
203
|
+
"2048 4096 or 8192.");
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
/* Prepare the SQL statement. */
|
208
|
+
tmp_str = rb_funcall(argv[0], rb_intern("to_s"), 0);
|
209
|
+
sprintf(sql, "CREATE DATABASE '%s'", StringValuePtr(tmp_str));
|
210
|
+
|
211
|
+
tmp_str = rb_funcall(argv[1], rb_intern("to_s"), 0);
|
212
|
+
text = StringValuePtr(tmp_str);
|
213
|
+
if(strlen(text) > 0) {
|
214
|
+
strcat(sql, " USER '");
|
215
|
+
strcat(sql, text);
|
216
|
+
strcat(sql, "'");
|
217
|
+
}
|
218
|
+
|
219
|
+
tmp_str = rb_funcall(argv[2], rb_intern("to_s"), 0);
|
220
|
+
text = StringValuePtr(tmp_str);
|
221
|
+
if(strlen(text) > 0) {
|
222
|
+
strcat(sql, " PASSWORD '");
|
223
|
+
strcat(sql, text);
|
224
|
+
strcat(sql, "'");
|
225
|
+
}
|
226
|
+
|
227
|
+
if(argc > 3) {
|
228
|
+
char text[50];
|
229
|
+
|
230
|
+
sprintf(text, " PAGE_SIZE = %d", value);
|
231
|
+
strcat(sql, text);
|
232
|
+
}
|
233
|
+
|
234
|
+
if(argc > 4 && argv[4] != Qnil) {
|
235
|
+
char *text = NULL;
|
236
|
+
|
237
|
+
set = rb_funcall(argv[4], rb_intern("to_s"), 0);
|
238
|
+
text = StringValuePtr(set);
|
239
|
+
if(strlen(text) > 0) {
|
240
|
+
strcat(sql, " DEFAULT CHARACTER SET ");
|
244
241
|
strcat(sql, text);
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
strcat(sql, " DEFAULT CHARACTER SET ");
|
265
|
-
strcat(sql, text);
|
266
|
-
}
|
267
|
-
}
|
268
|
-
strcat(sql, ";");
|
269
|
-
|
270
|
-
if(isc_dsql_execute_immediate(status, &connection, &transaction, 0, sql,
|
271
|
-
3, NULL) != 0)
|
272
|
-
{
|
273
|
-
rb_fireruby_raise(status, "Database creation error.");
|
274
|
-
}
|
275
|
-
|
276
|
-
if(connection != 0)
|
277
|
-
{
|
278
|
-
isc_detach_database(status, &connection);
|
279
|
-
}
|
280
|
-
|
281
|
-
database = rb_database_new(argv[0]);
|
282
|
-
if(set != Qnil)
|
283
|
-
{
|
284
|
-
setDatabaseCharacterSet(database, set);
|
285
|
-
}
|
286
|
-
|
287
|
-
return(database);
|
242
|
+
}
|
243
|
+
}
|
244
|
+
strcat(sql, ";");
|
245
|
+
|
246
|
+
if(isc_dsql_execute_immediate(status, &connection, &transaction, 0, sql,
|
247
|
+
3, NULL) != 0) {
|
248
|
+
rb_fireruby_raise(status, "Database creation error.");
|
249
|
+
}
|
250
|
+
|
251
|
+
if(connection != 0) {
|
252
|
+
isc_detach_database(status, &connection);
|
253
|
+
}
|
254
|
+
|
255
|
+
database = rb_database_new(argv[0]);
|
256
|
+
if(set != Qnil) {
|
257
|
+
setDatabaseCharacterSet(database, set);
|
258
|
+
}
|
259
|
+
|
260
|
+
return(database);
|
288
261
|
}
|
289
262
|
|
290
263
|
|
@@ -302,19 +275,17 @@ static VALUE createDatabase(int argc, VALUE *argv, VALUE unused)
|
|
302
275
|
* @return Always returns nil.
|
303
276
|
*
|
304
277
|
*/
|
305
|
-
static VALUE dropDatabase(VALUE self, VALUE user, VALUE password)
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
return(Qnil);
|
278
|
+
static VALUE dropDatabase(VALUE self, VALUE user, VALUE password) {
|
279
|
+
VALUE connection = rb_connection_new(self, user, password, Qnil);
|
280
|
+
ConnectionHandle *cHandle = NULL;
|
281
|
+
ISC_STATUS status[ISC_STATUS_LENGTH];
|
282
|
+
|
283
|
+
Data_Get_Struct(connection, ConnectionHandle, cHandle);
|
284
|
+
if(isc_drop_database(status, &cHandle->handle) != 0) {
|
285
|
+
rb_fireruby_raise(status, "Error dropping database.");
|
286
|
+
}
|
287
|
+
|
288
|
+
return(Qnil);
|
318
289
|
}
|
319
290
|
|
320
291
|
|
@@ -327,11 +298,10 @@ static VALUE dropDatabase(VALUE self, VALUE user, VALUE password)
|
|
327
298
|
* @return A reference to the database character set. May be nil.
|
328
299
|
*
|
329
300
|
*/
|
330
|
-
static VALUE getDatabaseCharacterSet(VALUE self)
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
return(rb_hash_aref(options, INT2FIX(isc_dpb_lc_ctype)));
|
301
|
+
static VALUE getDatabaseCharacterSet(VALUE self) {
|
302
|
+
VALUE options = rb_iv_get(self, "@options");
|
303
|
+
|
304
|
+
return(rb_hash_aref(options, INT2FIX(isc_dpb_lc_ctype)));
|
335
305
|
}
|
336
306
|
|
337
307
|
|
@@ -345,24 +315,20 @@ static VALUE getDatabaseCharacterSet(VALUE self)
|
|
345
315
|
* @return A reference to the updated Database object.
|
346
316
|
*
|
347
317
|
*/
|
348
|
-
static VALUE setDatabaseCharacterSet(VALUE self, VALUE set)
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
rb_hash_delete(options, INT2FIX(isc_dpb_lc_ctype));
|
359
|
-
}
|
360
|
-
|
361
|
-
return(self);
|
318
|
+
static VALUE setDatabaseCharacterSet(VALUE self, VALUE set) {
|
319
|
+
VALUE options = rb_iv_get(self, "@options");
|
320
|
+
|
321
|
+
if(set != Qnil) {
|
322
|
+
rb_hash_aset(options, INT2FIX(isc_dpb_lc_ctype), set);
|
323
|
+
} else {
|
324
|
+
rb_hash_delete(options, INT2FIX(isc_dpb_lc_ctype));
|
325
|
+
}
|
326
|
+
|
327
|
+
return(self);
|
362
328
|
}
|
363
329
|
|
364
330
|
|
365
|
-
/**
|
331
|
+
/**
|
366
332
|
* This function is used to integrate with the Ruby garbage collection system
|
367
333
|
* to guarantee the release of the resources associated with a Database object.
|
368
334
|
*
|
@@ -370,12 +336,10 @@ static VALUE setDatabaseCharacterSet(VALUE self, VALUE set)
|
|
370
336
|
* a Database object being destroyed.
|
371
337
|
*
|
372
338
|
*/
|
373
|
-
void databaseFree(void *database)
|
374
|
-
{
|
375
|
-
|
376
|
-
|
377
|
-
free((DatabaseHandle *)database);
|
378
|
-
}
|
339
|
+
void databaseFree(void *database) {
|
340
|
+
if(database != NULL) {
|
341
|
+
free((DatabaseHandle *)database);
|
342
|
+
}
|
379
343
|
}
|
380
344
|
|
381
345
|
|
@@ -390,9 +354,8 @@ void databaseFree(void *database)
|
|
390
354
|
* @return The return value provided by execution of the provided block.
|
391
355
|
*
|
392
356
|
*/
|
393
|
-
VALUE connectBlock(VALUE connection)
|
394
|
-
|
395
|
-
return(rb_yield(connection));
|
357
|
+
VALUE connectBlock(VALUE connection) {
|
358
|
+
return(rb_yield(connection));
|
396
359
|
}
|
397
360
|
|
398
361
|
|
@@ -406,10 +369,9 @@ VALUE connectBlock(VALUE connection)
|
|
406
369
|
* @return Always Qnil.
|
407
370
|
*
|
408
371
|
*/
|
409
|
-
VALUE connectEnsure(VALUE connection)
|
410
|
-
|
411
|
-
|
412
|
-
return(Qnil);
|
372
|
+
VALUE connectEnsure(VALUE connection) {
|
373
|
+
rb_funcall(connection, rb_intern("close"), 0);
|
374
|
+
return(Qnil);
|
413
375
|
}
|
414
376
|
|
415
377
|
|
@@ -421,14 +383,13 @@ VALUE connectEnsure(VALUE connection)
|
|
421
383
|
* @return A reference to the Database object created.
|
422
384
|
*
|
423
385
|
*/
|
424
|
-
VALUE rb_database_new(VALUE file)
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
return(database);
|
386
|
+
VALUE rb_database_new(VALUE file) {
|
387
|
+
VALUE database = allocateDatabase(cDatabase),
|
388
|
+
parameters[] = {file};
|
389
|
+
|
390
|
+
initializeDatabase(1, parameters, database);
|
391
|
+
|
392
|
+
return(database);
|
432
393
|
}
|
433
394
|
|
434
395
|
|
@@ -439,15 +400,14 @@ VALUE rb_database_new(VALUE file)
|
|
439
400
|
* @param module A reference to the module to create the class within.
|
440
401
|
*
|
441
402
|
*/
|
442
|
-
void Init_Database(VALUE module)
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
rb_define_module_function(cDatabase, "create", createDatabase, -1);
|
403
|
+
void Init_Database(VALUE module) {
|
404
|
+
cDatabase = rb_define_class_under(module, "Database", rb_cObject);
|
405
|
+
rb_define_alloc_func(cDatabase, allocateDatabase);
|
406
|
+
rb_define_method(cDatabase, "initialize", initializeDatabase, -1);
|
407
|
+
rb_define_method(cDatabase, "file", getDatabaseFile, 0);
|
408
|
+
rb_define_method(cDatabase, "connect", connectToDatabase, -1);
|
409
|
+
rb_define_method(cDatabase, "drop", dropDatabase, 2);
|
410
|
+
rb_define_method(cDatabase, "character_set", getDatabaseCharacterSet, 0);
|
411
|
+
rb_define_method(cDatabase, "character_set=", setDatabaseCharacterSet, 1);
|
412
|
+
rb_define_module_function(cDatabase, "create", createDatabase, -1);
|
453
413
|
}
|
data/ext/Database.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,7 +25,7 @@
|
|
25
25
|
#ifndef FIRERUBY_DATABASE_H
|
26
26
|
#define FIRERUBY_DATABASE_H
|
27
27
|
|
28
|
-
|
28
|
+
/* Includes. */
|
29
29
|
#ifndef FIRERUBY_FIRE_RUBY_H
|
30
30
|
#include "FireRuby.h"
|
31
31
|
#endif
|
@@ -34,15 +34,14 @@
|
|
34
34
|
#include "FireRubyException.h"
|
35
35
|
#endif
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
VALUE rb_database_new(VALUE);
|
37
|
+
/* Structure definitions. */
|
38
|
+
typedef struct {
|
39
|
+
int unused;
|
40
|
+
} DatabaseHandle;
|
41
|
+
|
42
|
+
/* Function prototypes. */
|
43
|
+
void Init_Database(VALUE);
|
44
|
+
void databaseFree(void *);
|
45
|
+
VALUE rb_database_new(VALUE);
|
47
46
|
|
48
47
|
#endif /* FIRERUBY_DATABASE_H */
|