-
-
Notifications
You must be signed in to change notification settings - Fork 268
Expand file tree
/
Copy pathalice.cpp
More file actions
737 lines (634 loc) · 18.6 KB
/
alice.cpp
File metadata and controls
737 lines (634 loc) · 18.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
//____________________________________________________________
//
// PROGRAM: Alice (All Else) Utility
// MODULE: alice.cpp
// DESCRIPTION: Neo-Debe (does everything but eat)
//
// The contents of this file are subject to the Interbase Public
// License Version 1.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.Inprise.com/IPL.html
//
// Software distributed under the License is distributed on an
// "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
// or implied. See the License for the specific language governing
// rights and limitations under the License.
//
// The Original Code was created by Inprise Corporation
// and its predecessors. Portions created by Inprise Corporation are
// Copyright (C) Inprise Corporation.
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
//
//
//____________________________________________________________
//
// 2001.07.06 Sean Leyne - Code Cleanup, removed "#ifdef READONLY_DATABASE"
// conditionals, as the engine now fully supports
// readonly databases.
//
// 2002.10.29 Sean Leyne - Removed support for obsolete "Netware" port
//
// 2002.10.30 Sean Leyne - Removed support for obsolete "PC_PLATFORM" define
//
//
#include "firebird.h"
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include "ibase.h"
#include "../jrd/license.h"
#include "../alice/alice.h"
#include "../alice/exe_proto.h"
#include "../common/msg_encode.h"
#include "../yvalve/gds_proto.h"
#include "../alice/alice_proto.h"
#include "../common/utils_proto.h"
#include "../common/classes/Switches.h"
#include "../common/SimpleStatusVector.h"
#include "../alice/aliceswi.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#endif
namespace Firebird::Alice
{
using MsgFormat::SafeArg;
static constexpr USHORT val_err_table[] =
{
0,
55, // msg 55: \n\tNumber of record level errors\t: %ld
56, // msg 56: \tNumber of Blob page errors\t: %ld
57, // msg 57: \tNumber of data page errors\t: %ld
58, // msg 58: \tNumber of index page errors\t: %ld
59, // msg 59: \tNumber of pointer page errors\t: %ld
60, // msg 60: \tNumber of transaction page errors\t: %ld
61, // msg 61: \tNumber of database page errors\t: %ld
122, // msg 122: \tNumber of inventory page errors\t: @1
123, // msg 123: \tNumber of record level warnings\t: @1
124, // msg 124: \tNumber of Blob page warnings\t: @1
125, // msg 125: \tNumber of data page warnings\t: @1
126, // msg 126: \tNumber of index page warnings\t: @1
127, // msg 127: \tNumber of pointer page warnings\t: @1
128, // msg 128: \tNumber of transaction page warnings\t: @1
129, // msg 129: \tNumber of database page warnings\t: @1
130 // msg 130: \tNumber of inventory page warnings\t: @1
};
constexpr int ALICE_MSG_FAC = FB_IMPL_MSG_FACILITY_GFIX;
[[noreturn]] void ALICE_exit(int code, AliceGlobals* tdgbl)
{
tdgbl->exit_code = code;
LongJump::raise();
}
static void alice_output(bool error, const SCHAR*, ...) ATTRIBUTE_FORMAT(2,3);
//____________________________________________________________
//
// Entry point for GFIX in case of service manager.
//
int ALICE_main(UtilSvc* uSvc)
{
int exit_code = FINI_OK;
try {
exit_code = alice(uSvc);
}
catch (const Exception& e)
{
StaticStatusVector status;
e.stuffException(status);
uSvc->getStatusAccessor().setServiceStatus(status.begin());
uSvc->started();
exit_code = FB_FAILURE;
}
return exit_code;
}
//____________________________________________________________
//
// Routine called by command line utility, and server manager
// Parse switches and do work
//
int alice(UtilSvc* uSvc)
{
AliceGlobals gblInstance(uSvc);
AliceGlobals* tdgbl = &gblInstance;
AliceGlobals::putSpecific(tdgbl);
int exit_code = FINI_ERROR;
try {
// Perform some special handling when run as a Firebird service. The
// first switch can be "-svc" (lower case!) or it can be "-svc_re" followed
// by 3 file descriptors to use in re-directing stdin, stdout, and stderr.
tdgbl->ALICE_data.ua_user = NULL;
tdgbl->ALICE_data.ua_role = NULL;
tdgbl->ALICE_data.ua_password = NULL;
#ifdef TRUSTED_AUTH
tdgbl->ALICE_data.ua_trusted = false;
#endif
tdgbl->ALICE_data.ua_parallel_workers = uSvc->getParallelWorkers();
// Start by parsing switches
bool error = false, help = false, version = false;
SINT64 flags = 0;
tdgbl->ALICE_data.ua_shutdown_delay = 0;
const TEXT* database = NULL;
TEXT string[512] = "";
const char** argv = uSvc->argv.begin();
int argc = uSvc->argv.getCount();
if (argc == 1)
error = true;
++argv;
// tested outside the loop
const Switches::in_sw_tab_t* table = NULL;
const Switches switches(alice_in_sw_table, FB_NELEM(alice_in_sw_table), false, true);
while (--argc > 0)
{
if ((*argv)[0] != '-')
{
if (database)
{
ALICE_error(1, SafeArg() << database);
// msg 1: "data base file name (%s) already given",
}
database = *argv++;
continue;
}
const char* opt = *argv++;
if (!opt[1]) {
continue;
}
if (strcmp(opt, "-?") == 0)
{
error = help = true;
break;
}
table = switches.findSwitch(opt);
if (!table)
{
ALICE_print(2, SafeArg() << opt); // msg 2: invalid switch %s
error = true;
break;
}
if (table->in_sw == IN_SW_ALICE_X) {
tdgbl->ALICE_data.ua_debug++;
}
else if (table->in_sw == IN_SW_ALICE_VERSION)
{
ALICE_print(3, SafeArg() << FB_VERSION); // msg 3: gfix version %s
version = true;
}
#ifdef TRUSTED_AUTH
if (table->in_sw_value & sw_trusted_auth)
{
tdgbl->ALICE_data.ua_trusted = true;
continue;
}
#endif
if ((table->in_sw_incompatibilities & flags) ||
(table->in_sw_requires && !(table->in_sw_requires & flags)))
{
ALICE_print(4); // msg 4: incompatible switch combination
error = true;
break;
}
flags |= table->in_sw_value;
if ((table->in_sw_value & (sw_shut | sw_online)) && (argc > 1))
{
ALICE_upper_case(*argv, string, sizeof(string));
bool found = true;
if (strcmp(string, ALICE_SW_SHUT_NORMAL) == 0)
tdgbl->ALICE_data.ua_shutdown_mode = SHUT_NORMAL;
else if (strcmp(string, ALICE_SW_SHUT_MULTI) == 0)
tdgbl->ALICE_data.ua_shutdown_mode = SHUT_MULTI;
else if (strcmp(string, ALICE_SW_SHUT_SINGLE) == 0)
tdgbl->ALICE_data.ua_shutdown_mode = SHUT_SINGLE;
else if (strcmp(string, ALICE_SW_SHUT_FULL) == 0)
tdgbl->ALICE_data.ua_shutdown_mode = SHUT_FULL;
else
found = false;
// Consume argument only if we identified mode
// Let's hope that database with names of modes above are unusual
if (found)
{
argv++;
argc--;
}
}
#ifdef DEV_BUILD
/*
if (table->in_sw_value & sw_begin_log)
{
if (--argc <= 0) {
ALICE_error(5); // msg 5: replay log pathname required
}
fb_utils::copy_terminate(tdgbl->ALICE_data.ua_log_file, *argv++, sizeof(tdgbl->ALICE_data.ua_log_file));
}
*/
#endif
if (table->in_sw_value & sw_buffers)
{
if (--argc <= 0) {
ALICE_error(6); // msg 6: number of page buffers for cache required
}
ALICE_upper_case(*argv++, string, sizeof(string));
if ((!(tdgbl->ALICE_data.ua_page_buffers = atoi(string))) && (strcmp(string, "0")))
{
ALICE_error(7); // msg 7: numeric value required
}
if (tdgbl->ALICE_data.ua_page_buffers < 0) {
ALICE_error(114); // msg 114: positive or zero numeric value required
}
}
if (table->in_sw_value & sw_parallel_workers)
{
if (--argc <= 0) { // TODO: error message!
ALICE_error(6); // msg 6: number of page buffers for cache required
}
ALICE_upper_case(*argv++, string, sizeof(string));
if ((!(tdgbl->ALICE_data.ua_parallel_workers = atoi(string))) && (strcmp(string, "0")))
{
ALICE_error(7); // msg 7: numeric value required
}
}
if (table->in_sw_value & sw_housekeeping)
{
if (--argc <= 0) {
ALICE_error(9); // msg 9: number of transactions per sweep required
}
ALICE_upper_case(*argv++, string, sizeof(string));
if ((!(tdgbl->ALICE_data.ua_sweep_interval = atoi(string))) && (strcmp(string, "0")))
{
ALICE_error(7); // msg 7: numeric value required
}
if (tdgbl->ALICE_data.ua_sweep_interval < 0) {
ALICE_error(114); // msg 114: positive or zero numeric value required
}
}
if (table->in_sw_value & sw_set_db_dialect)
{
if (--argc <= 0) {
ALICE_error(113); // msg 113: dialect number required
}
ALICE_upper_case(*argv++, string, sizeof(string));
if ((!(tdgbl->ALICE_data.ua_db_SQL_dialect = atoi(string))) && (strcmp(string, "0")))
{
ALICE_error(7); // msg 7: numeric value required
}
}
if (table->in_sw_value & (sw_commit | sw_rollback | sw_two_phase))
{
if (--argc <= 0) {
ALICE_error(10); // msg 10: transaction number or "all" required
}
ALICE_upper_case(*argv++, string, sizeof(string));
if (!sscanf(string, "%" SQUADFORMAT, &tdgbl->ALICE_data.ua_transaction))
{
if (strcmp(string, "ALL")) {
ALICE_error(10); // msg 10: transaction number or "all" required
}
else {
flags |= sw_list;
}
}
}
if (table->in_sw_value & sw_write)
{
if (--argc <= 0) {
ALICE_error(11); // msg 11: "sync" or "async" required
}
ALICE_upper_case(*argv++, string, sizeof(string));
if (!strcmp(string, ALICE_SW_SYNC)) {
tdgbl->ALICE_data.ua_force = true;
}
else if (!strcmp(string, ALICE_SW_ASYNC)) {
tdgbl->ALICE_data.ua_force = false;
}
else {
ALICE_error(11); // msg 11: "sync" or "async" required
}
}
if (table->in_sw_value & sw_no_reserve)
{
if (--argc <= 0) {
ALICE_error(12); // msg 12: "full" or "reserve" required
}
ALICE_upper_case(*argv++, string, sizeof(string));
if (!strcmp(string, "FULL")) {
tdgbl->ALICE_data.ua_no_reserve = true;
}
else if (!strcmp(string, "RESERVE")) {
tdgbl->ALICE_data.ua_no_reserve = false;
}
else {
ALICE_error(12); // msg 12: "full" or "reserve" required
}
}
if (table->in_sw_value & sw_user)
{
if (--argc <= 0) {
ALICE_error(13); // msg 13: user name required
}
tdgbl->ALICE_data.ua_user = *argv++;
}
if (table->in_sw_value & sw_role)
{
if (--argc <= 0) {
ALICE_error(133); // msg 133: role name required
}
tdgbl->ALICE_data.ua_role = *argv++;
}
if (table->in_sw_value & sw_password)
{
if (--argc <= 0) {
ALICE_error(14); // msg 14: password required
}
uSvc->hidePasswd(uSvc->argv, argv - uSvc->argv.begin());
tdgbl->ALICE_data.ua_password = *argv++;
}
if (table->in_sw_value & sw_fetch_password)
{
if (--argc <= 0) {
ALICE_error(14); // msg 14: password required
}
switch (fb_utils::fetchPassword(*argv, tdgbl->ALICE_data.ua_password))
{
case fb_utils::FETCH_PASS_OK:
break;
case fb_utils::FETCH_PASS_FILE_OPEN_ERROR:
ALICE_error(116, MsgFormat::SafeArg() << *argv << errno);
// error @2 opening password file @1
break;
case fb_utils::FETCH_PASS_FILE_READ_ERROR:
ALICE_error(117, MsgFormat::SafeArg() << *argv << errno);
// error @2 reading password file @1
break;
case fb_utils::FETCH_PASS_FILE_EMPTY:
ALICE_error(118, MsgFormat::SafeArg() << *argv);
// password file @1 is empty
break;
}
++argv;
}
if (table->in_sw_value & sw_disable)
{
if (--argc <= 0) {
ALICE_error(15); // msg 15: subsystem name
}
ALICE_upper_case(*argv++, string, sizeof(string));
if (strcmp(string, "WAL")) {
ALICE_error(16); // msg 16: "wal" required
}
}
if (table->in_sw_value & (sw_attach | sw_force | sw_tran))
{
if (--argc <= 0) {
ALICE_error(17); // msg 17: number of seconds required
}
ALICE_upper_case(*argv++, string, sizeof(string));
if ((!(tdgbl->ALICE_data.ua_shutdown_delay = atoi(string))) && (strcmp(string, "0")))
{
ALICE_error(7); // msg 7: numeric value required
}
if (tdgbl->ALICE_data.ua_shutdown_delay < 0 ||
tdgbl->ALICE_data.ua_shutdown_delay > 32767)
{
ALICE_error(18); // msg 18: numeric value between 0 and 32767 inclusive required
}
}
if (table->in_sw_value & sw_mode)
{
if (--argc <= 0) {
ALICE_error(110); // msg 110: "read_only" or "read_write" required
}
ALICE_upper_case(*argv++, string, sizeof(string));
if (!strcmp(string, ALICE_SW_MODE_RO)) {
tdgbl->ALICE_data.ua_read_only = true;
}
else if (!strcmp(string, ALICE_SW_MODE_RW)) {
tdgbl->ALICE_data.ua_read_only = false;
}
else {
ALICE_error(110); // msg 110: "read_only" or "read_write" required
}
}
if (table->in_sw_value & sw_replica)
{
if (--argc <= 0)
ALICE_error(135); // msg 135: replica mode (none / read_only / read_write) required
ALICE_upper_case(*argv++, string, sizeof(string));
if (!strcmp(string, ALICE_SW_MODE_NONE))
tdgbl->ALICE_data.ua_replica_mode = REPL_NONE;
else if (!strcmp(string, ALICE_SW_MODE_RO))
tdgbl->ALICE_data.ua_replica_mode = REPL_READ_ONLY;
else if (!strcmp(string, ALICE_SW_MODE_RW))
tdgbl->ALICE_data.ua_replica_mode = REPL_READ_WRITE;
else
ALICE_error(135); // msg 135: replica mode (none / read_only / read_write) required
}
}
// put this here since to put it above overly complicates the parsing.
// can't use tbl_requires since it only looks backwards on command line.
if ((flags & sw_shut) && !(flags & ((sw_attach | sw_force | sw_tran))))
{
ALICE_error(19); // msg 19: must specify type of shutdown
}
// catch the case where -z is only command line option.
// flags is unset since sw_z == 0
if (!flags && !error && version && !tdgbl->ALICE_data.ua_debug)
{
ALICE_exit(FINI_OK, tdgbl);
}
if (!flags || !(flags & ~(sw_user | sw_password | sw_fetch_password | sw_trusted_auth)))
{
if (!help && !uSvc->isService())
{
ALICE_print(20); // msg 20: please retry, specifying an option
}
error = true;
}
if (error)
{
if (uSvc->isService())
{
uSvc->getStatusAccessor().setServiceStatus(ALICE_MSG_FAC, 20, MsgFormat::SafeArg());
}
else
{
if (help)
ALICE_print(120); // usage: gfix [options] <database>
ALICE_print(21); // msg 21: plausible options are:
for (table = alice_in_sw_table; table->in_sw_name; table++)
{
if (table->in_sw_msg)
ALICE_print(table->in_sw_msg);
}
ALICE_print(22); // msg 22: \n qualifiers show the major option in parenthesis
}
ALICE_exit(FINI_ERROR, tdgbl);
}
if (!database) {
ALICE_error(23); // msg 23: please retry, giving a database name
}
// generate the database parameter block for the attach,
// based on the various flags
USHORT ret;
if (flags & (sw_list | sw_commit | sw_rollback | sw_two_phase))
{
ret = EXE_two_phase(database, flags);
}
else
{
ret = EXE_action(database, flags);
const ULONG* ua_val_errors = tdgbl->ALICE_data.ua_val_errors;
if (!ua_val_errors[VAL_INVALID_DB_VERSION])
{
bool any_error = false;
for (int i = 0; i < MAX_VAL_ERRORS; ++i)
{
if (ua_val_errors[i])
{
any_error = true;
break;
}
}
if (any_error)
{
ALICE_print(24); // msg 24: Summary of validation errors\n
for (int i = 0; i < MAX_VAL_ERRORS; ++i)
{
if (ua_val_errors[i]) {
ALICE_print(val_err_table[i], SafeArg() << ua_val_errors[i]);
}
}
}
}
}
if (ret == FINI_ERROR)
{
ALICE_print_status(true, tdgbl->status);
ALICE_exit(FINI_ERROR, tdgbl);
}
ALICE_exit(FINI_OK, tdgbl);
} // try
catch (const LongJump&)
{
// All "calls" to ALICE_exit(), normal and error exits, wind up here
exit_code = tdgbl->exit_code;
}
catch (const Exception& e)
{
// Non-alice exception was caught
StaticStatusVector status;
e.stuffException(status);
fb_utils::copyStatus(tdgbl->status_vector, ISC_STATUS_LENGTH, status.begin(), status.getCount());
ALICE_print_status(true, tdgbl->status_vector);
exit_code = FINI_ERROR;
}
AliceGlobals::restoreSpecific();
#if defined(DEBUG_GDS_ALLOC)
if (!uSvc->isService())
{
gds_alloc_report(0, __FILE__, __LINE__);
}
#endif
if ((exit_code != FINI_OK) && uSvc->isService() &&
(tdgbl->status[0] == 1) && (tdgbl->status[1] != 0))
{
UtilSvc::StatusAccessor sa = uSvc->getStatusAccessor();
sa.init();
uSvc->getStatusAccessor().setServiceStatus(tdgbl->status);
}
tdgbl->uSvc->started();
return exit_code;
}
//____________________________________________________________
//
// Copy a string, uppercasing as we go.
//
void ALICE_upper_case(const TEXT* in, TEXT* out, const size_t buf_size) noexcept
{
const TEXT* const end = out + buf_size - 1;
for (TEXT c = *in++; c && out < end; c = *in++) {
*out++ = (c >= 'a' && c <= 'z') ? c - 'a' + 'A' : c;
}
*out = 0;
}
//____________________________________________________________
//
// Display a formatted error message
//
void ALICE_print(USHORT number, const SafeArg& arg)
{
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
if (tdgbl->uSvc->isService())
{
tdgbl->uSvc->getStatusAccessor().setServiceStatus(ALICE_MSG_FAC, number, arg);
tdgbl->uSvc->started();
return;
}
TEXT buffer[256];
fb_msg_format(0, ALICE_MSG_FAC, number, sizeof(buffer), buffer, arg);
alice_output(false, "%s\n", buffer);
}
//____________________________________________________________
//
// Print error message. Use fb_interpret
// to allow redirecting output.
//
void ALICE_print_status(bool error, const ISC_STATUS* status_vector)
{
if (status_vector && status_vector[1])
{
const ISC_STATUS* vector = status_vector;
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
tdgbl->uSvc->getStatusAccessor().setServiceStatus(status_vector);
if (error && tdgbl->uSvc->isService())
{
return;
}
SCHAR s[1024];
if (fb_interpret(s, sizeof(s), &vector))
{
alice_output(error, "%s\n", s);
// Continuation of error
s[0] = '-';
while (fb_interpret(s + 1, sizeof(s) - 1, &vector)) {
alice_output(error, "%s\n", s);
}
}
}
}
//____________________________________________________________
//
// Format and print an error message, then punt.
//
[[noreturn]] void ALICE_error(USHORT number, const SafeArg& arg)
{
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
TEXT buffer[256];
tdgbl->uSvc->getStatusAccessor().setServiceStatus(ALICE_MSG_FAC, number, arg);
if (!tdgbl->uSvc->isService())
{
fb_msg_format(0, ALICE_MSG_FAC, number, sizeof(buffer), buffer, arg);
alice_output(true, "%s\n", buffer);
}
ALICE_exit(FINI_ERROR, tdgbl);
}
//____________________________________________________________
//
// Platform independent output routine.
//
static void alice_output(bool error, const SCHAR* format, ...)
{
AliceGlobals* tdgbl = AliceGlobals::getSpecific();
va_list arglist;
va_start(arglist, format);
string buf;
buf.vprintf(format, arglist);
va_end(arglist);
if (error)
tdgbl->uSvc->outputError(buf.c_str());
else
tdgbl->uSvc->outputVerbose(buf.c_str());
}
} // namespace Firebird::Alice