1/*
2 * MODULE: ibase.h
3 * DESCRIPTION: OSRI entrypoints and defines
4 *
5 * The contents of this file are subject to the Interbase Public
6 * License Version 1.0 (the "License"); you may not use this file
7 * except in compliance with the License. You may obtain a copy
8 * of the License at http://www.Inprise.com/IPL.html
9 *
10 * Software distributed under the License is distributed on an
11 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
12 * or implied. See the License for the specific language governing
13 * rights and limitations under the License.
14 *
15 * The Original Code was created by Inprise Corporation
16 * and its predecessors. Portions created by Inprise Corporation are
17 * Copyright (C) Inprise Corporation.
18 *
19 * All Rights Reserved.
20 * Contributor(s): ______________________________________.
21 *
22 * 2001.07.28: John Bellardo: Added blr_skip
23 * 2001.09.18: Ann Harrison: New info codes
24 * 17-Oct-2001 Mike Nordell: CPU affinity
25 * 2001-04-16 Paul Beach: ISC_TIME_SECONDS_PRECISION_SCALE modified for HP10
26 * Compiler Compatibility
27 * 2002.02.15 Sean Leyne - Code Cleanup, removed obsolete ports:
28 * - EPSON, XENIX, MAC (MAC_AUX), Cray and OS/2
29 * 2002.10.29 Nickolay Samofatov: Added support for savepoints
30 *
31 * 2002.10.29 Sean Leyne - Removed support for obsolete IPX/SPX Protocol
32 *
33 * 2006.09.06 Steve Boyd - Added various prototypes required by Cobol ESQL
34 * isc_embed_dsql_length
35 * isc_event_block_a
36 * isc_sqlcode_s
37 * isc_embed_dsql_fetch_a
38 * isc_event_block_s
39 * isc_baddress
40 * isc_baddress_s
41 *
42 */
43
44#ifndef JRD_IBASE_H
45#define JRD_IBASE_H
46
47#define FB_API_VER 25
48#define isc_version4
49
50#define ISC_TRUE 1
51#define ISC_FALSE 0
52#if !(defined __cplusplus)
53#define ISC__TRUE ISC_TRUE
54#define ISC__FALSE ISC_FALSE
55#endif
56
57#define ISC_FAR
58
59#if defined _MSC_VER && _MSC_VER >= 1300
60#define FB_API_DEPRECATED __declspec(deprecated)
61#elif defined __GNUC__ && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2))
62#define FB_API_DEPRECATED __attribute__((__deprecated__))
63#else
64#define FB_API_DEPRECATED
65#endif
66
67#include "types_pub.h"
68
69/********************************/
70/* Firebird Handle Definitions */
71/********************************/
72
73typedef FB_API_HANDLE isc_att_handle;
74typedef FB_API_HANDLE isc_blob_handle;
75typedef FB_API_HANDLE isc_db_handle;
76typedef FB_API_HANDLE isc_req_handle;
77typedef FB_API_HANDLE isc_stmt_handle;
78typedef FB_API_HANDLE isc_svc_handle;
79typedef FB_API_HANDLE isc_tr_handle;
80typedef void (* isc_callback) ();
81typedef ISC_LONG isc_resv_handle;
82
83typedef void (*ISC_PRINT_CALLBACK) (void*, ISC_SHORT, const char*);
84typedef void (*ISC_VERSION_CALLBACK)(void*, const char*);
85typedef void (*ISC_EVENT_CALLBACK)(void*, ISC_USHORT, const ISC_UCHAR*);
86
87/*******************************************************************/
88/* Blob id structure */
89/*******************************************************************/
90
91#if !(defined __cplusplus)
92typedef GDS_QUAD GDS__QUAD;
93#endif /* !(defined __cplusplus) */
94
95typedef struct
96{
97 short array_bound_lower;
98 short array_bound_upper;
99} ISC_ARRAY_BOUND;
100
101typedef struct
102{
103 ISC_UCHAR array_desc_dtype;
104 ISC_SCHAR array_desc_scale;
105 unsigned short array_desc_length;
106 ISC_SCHAR array_desc_field_name[32];
107 ISC_SCHAR array_desc_relation_name[32];
108 short array_desc_dimensions;
109 short array_desc_flags;
110 ISC_ARRAY_BOUND array_desc_bounds[16];
111} ISC_ARRAY_DESC;
112
113typedef struct
114{
115 short blob_desc_subtype;
116 short blob_desc_charset;
117 short blob_desc_segment_size;
118 ISC_UCHAR blob_desc_field_name[32];
119 ISC_UCHAR blob_desc_relation_name[32];
120} ISC_BLOB_DESC;
121
122/***************************/
123/* Blob control structure */
124/***************************/
125
126typedef struct isc_blob_ctl
127{
128 ISC_STATUS (* ctl_source)(); /* Source filter */
129 struct isc_blob_ctl* ctl_source_handle; /* Argument to pass to source filter */
130 short ctl_to_sub_type; /* Target type */
131 short ctl_from_sub_type; /* Source type */
132 unsigned short ctl_buffer_length; /* Length of buffer */
133 unsigned short ctl_segment_length; /* Length of current segment */
134 unsigned short ctl_bpb_length; /* Length of blob parameter block */
135 /* Internally, this is const UCHAR*, but this public struct probably can't change. */
136 ISC_SCHAR* ctl_bpb; /* Address of blob parameter block */
137 ISC_UCHAR* ctl_buffer; /* Address of segment buffer */
138 ISC_LONG ctl_max_segment; /* Length of longest segment */
139 ISC_LONG ctl_number_segments; /* Total number of segments */
140 ISC_LONG ctl_total_length; /* Total length of blob */
141 ISC_STATUS* ctl_status; /* Address of status vector */
142 long ctl_data[8]; /* Application specific data */
143} * ISC_BLOB_CTL;
144
145/***************************/
146/* Blob stream definitions */
147/***************************/
148
149typedef struct bstream
150{
151 isc_blob_handle bstr_blob; /* Blob handle */
152 ISC_SCHAR * bstr_buffer; /* Address of buffer */
153 ISC_SCHAR * bstr_ptr; /* Next character */
154 short bstr_length; /* Length of buffer */
155 short bstr_cnt; /* Characters in buffer */
156 char bstr_mode; /* (mode) ? OUTPUT : INPUT */
157} BSTREAM, * FB_BLOB_STREAM;
158
159/* Three ugly macros, one even using octal radix... sigh... */
160#define getb(p) (--(p)->bstr_cnt >= 0 ? *(p)->bstr_ptr++ & 0377: BLOB_get (p))
161#define putb(x, p) (((x) == '\n' || (!(--(p)->bstr_cnt))) ? BLOB_put ((x),p) : ((int) (*(p)->bstr_ptr++ = (unsigned) (x))))
162#define putbx(x, p) ((!(--(p)->bstr_cnt)) ? BLOB_put ((x),p) : ((int) (*(p)->bstr_ptr++ = (unsigned) (x))))
163
164/********************************************************************/
165/* CVC: Public blob interface definition held in val.h. */
166/* For some unknown reason, it was only documented in langRef */
167/* and being the structure passed by the engine to UDFs it never */
168/* made its way into this public definitions file. */
169/* Being its original name "blob", I renamed it blobcallback here. */
170/* I did the full definition with the proper parameters instead of */
171/* the weak C declaration with any number and type of parameters. */
172/* Since the first parameter -BLB- is unknown outside the engine, */
173/* it's more accurate to use void* than int* as the blob pointer */
174/********************************************************************/
175
176#if !defined(JRD_VAL_H)
177/* Blob passing structure */
178
179/* This enum applies to parameter "mode" in blob_lseek */
180enum blob_lseek_mode {blb_seek_relative = 1, blb_seek_from_tail = 2};
181/* This enum applies to the value returned by blob_get_segment */
182enum blob_get_result {blb_got_fragment = -1, blb_got_eof = 0, blb_got_full_segment = 1};
183
184typedef struct blobcallback {
185 short (*blob_get_segment)
186 (void* hnd, ISC_UCHAR* buffer, ISC_USHORT buf_size, ISC_USHORT* result_len);
187 void* blob_handle;
188 ISC_LONG blob_number_segments;
189 ISC_LONG blob_max_segment;
190 ISC_LONG blob_total_length;
191 void (*blob_put_segment)
192 (void* hnd, const ISC_UCHAR* buffer, ISC_USHORT buf_size);
193 ISC_LONG (*blob_lseek)
194 (void* hnd, ISC_USHORT mode, ISC_LONG offset);
195} *BLOBCALLBACK;
196#endif /* !defined(JRD_VAL_H) */
197
198
199/********************************************************************/
200/* CVC: Public descriptor interface held in dsc2.h. */
201/* We need it documented to be able to recognize NULL in UDFs. */
202/* Being its original name "dsc", I renamed it paramdsc here. */
203/* Notice that I adjust to the original definition: contrary to */
204/* other cases, the typedef is the same struct not the pointer. */
205/* I included the enumeration of dsc_dtype possible values. */
206/* Ultimately, dsc2.h should be part of the public interface. */
207/********************************************************************/
208
209#if !defined(JRD_DSC_H)
210/* This is the famous internal descriptor that UDFs can use, too. */
211typedef struct paramdsc {
212 ISC_UCHAR dsc_dtype;
213 signed char dsc_scale;
214 ISC_USHORT dsc_length;
215 short dsc_sub_type;
216 ISC_USHORT dsc_flags;
217 ISC_UCHAR *dsc_address;
218} PARAMDSC;
219
220#if !defined(JRD_VAL_H)
221/* This is a helper struct to work with varchars. */
222typedef struct paramvary {
223 ISC_USHORT vary_length;
224 ISC_UCHAR vary_string[1];
225} PARAMVARY;
226#endif /* !defined(JRD_VAL_H) */
227
228#include "../common/dsc_pub.h"
229
230#endif /* !defined(JRD_DSC_H) */
231
232/***************************/
233/* Dynamic SQL definitions */
234/***************************/
235
236#include "../dsql/sqlda_pub.h"
237
238/*************************************/
239/* Namespace compatibility for C/C++ */
240/*************************************/
241
242#ifdef __cplusplus
243#define FB_NAMESPACE_FORWARD(n, x) namespace n { class x; }
244#define FB_NAMESPACE_USE(n, x) n::x
245#else
246#define FB_NAMESPACE_FORWARD(n, x) struct x;
247#define FB_NAMESPACE_USE(n, x) struct x
248#endif
249
250/************************/
251/* Forward declarations */
252/************************/
253
254FB_NAMESPACE_FORWARD(Firebird, ICryptKeyCallback)
255
256/***************************/
257/* OSRI database functions */
258/***************************/
259
260#ifdef __cplusplus
261extern "C" {
262#endif
263
264ISC_STATUS ISC_EXPORT isc_attach_database(ISC_STATUS*,
265 short,
266 const ISC_SCHAR*,
267 isc_db_handle*,
268 short,
269 const ISC_SCHAR*);
270
271ISC_STATUS ISC_EXPORT isc_array_gen_sdl(ISC_STATUS*,
272 const ISC_ARRAY_DESC*,
273 ISC_SHORT*,
274 ISC_UCHAR*,
275 ISC_SHORT*);
276
277ISC_STATUS ISC_EXPORT isc_array_get_slice(ISC_STATUS*,
278 isc_db_handle*,
279 isc_tr_handle*,
280 ISC_QUAD*,
281 const ISC_ARRAY_DESC*,
282 void*,
283 ISC_LONG*);
284
285ISC_STATUS ISC_EXPORT isc_array_lookup_bounds(ISC_STATUS*,
286 isc_db_handle*,
287 isc_tr_handle*,
288 const ISC_SCHAR*,
289 const ISC_SCHAR*,
290 ISC_ARRAY_DESC*);
291
292ISC_STATUS ISC_EXPORT isc_array_lookup_desc(ISC_STATUS*,
293 isc_db_handle*,
294 isc_tr_handle*,
295 const ISC_SCHAR*,
296 const ISC_SCHAR*,
297 ISC_ARRAY_DESC*);
298
299ISC_STATUS ISC_EXPORT isc_array_set_desc(ISC_STATUS*,
300 const ISC_SCHAR*,
301 const ISC_SCHAR*,
302 const short*,
303 const short*,
304 const short*,
305 ISC_ARRAY_DESC*);
306
307ISC_STATUS ISC_EXPORT isc_array_put_slice(ISC_STATUS*,
308 isc_db_handle*,
309 isc_tr_handle*,
310 ISC_QUAD*,
311 const ISC_ARRAY_DESC*,
312 void*,
313 ISC_LONG *);
314
315void ISC_EXPORT isc_blob_default_desc(ISC_BLOB_DESC*,
316 const ISC_UCHAR*,
317 const ISC_UCHAR*);
318
319ISC_STATUS ISC_EXPORT isc_blob_gen_bpb(ISC_STATUS*,
320 const ISC_BLOB_DESC*,
321 const ISC_BLOB_DESC*,
322 unsigned short,
323 ISC_UCHAR*,
324 unsigned short*);
325
326ISC_STATUS ISC_EXPORT isc_blob_info(ISC_STATUS*,
327 isc_blob_handle*,
328 short,
329 const ISC_SCHAR*,
330 short,
331 ISC_SCHAR*);
332
333ISC_STATUS ISC_EXPORT isc_blob_lookup_desc(ISC_STATUS*,
334 isc_db_handle*,
335 isc_tr_handle*,
336 const ISC_UCHAR*,
337 const ISC_UCHAR*,
338 ISC_BLOB_DESC*,
339 ISC_UCHAR*);
340
341ISC_STATUS ISC_EXPORT isc_blob_set_desc(ISC_STATUS*,
342 const ISC_UCHAR*,
343 const ISC_UCHAR*,
344 short,
345 short,
346 short,
347 ISC_BLOB_DESC*);
348
349ISC_STATUS ISC_EXPORT isc_cancel_blob(ISC_STATUS *,
350 isc_blob_handle *);
351
352ISC_STATUS ISC_EXPORT isc_cancel_events(ISC_STATUS *,
353 isc_db_handle *,
354 ISC_LONG *);
355
356ISC_STATUS ISC_EXPORT isc_close_blob(ISC_STATUS *,
357 isc_blob_handle *);
358
359ISC_STATUS ISC_EXPORT isc_commit_retaining(ISC_STATUS *,
360 isc_tr_handle *);
361
362ISC_STATUS ISC_EXPORT isc_commit_transaction(ISC_STATUS *,
363 isc_tr_handle *);
364
365ISC_STATUS ISC_EXPORT isc_create_blob(ISC_STATUS*,
366 isc_db_handle*,
367 isc_tr_handle*,
368 isc_blob_handle*,
369 ISC_QUAD*);
370
371ISC_STATUS ISC_EXPORT isc_create_blob2(ISC_STATUS*,
372 isc_db_handle*,
373 isc_tr_handle*,
374 isc_blob_handle*,
375 ISC_QUAD*,
376 short,
377 const ISC_SCHAR*);
378
379ISC_STATUS ISC_EXPORT isc_create_database(ISC_STATUS*,
380 short,
381 const ISC_SCHAR*,
382 isc_db_handle*,
383 short,
384 const ISC_SCHAR*,
385 short);
386
387ISC_STATUS ISC_EXPORT isc_database_info(ISC_STATUS*,
388 isc_db_handle*,
389 short,
390 const ISC_SCHAR*,
391 short,
392 ISC_SCHAR*);
393
394void ISC_EXPORT isc_decode_date(const ISC_QUAD*,
395 void*);
396
397void ISC_EXPORT isc_decode_sql_date(const ISC_DATE*,
398 void*);
399
400void ISC_EXPORT isc_decode_sql_time(const ISC_TIME*,
401 void*);
402
403void ISC_EXPORT isc_decode_timestamp(const ISC_TIMESTAMP*,
404 void*);
405
406ISC_STATUS ISC_EXPORT isc_detach_database(ISC_STATUS *,
407 isc_db_handle *);
408
409ISC_STATUS ISC_EXPORT isc_drop_database(ISC_STATUS *,
410 isc_db_handle *);
411
412ISC_STATUS ISC_EXPORT isc_dsql_allocate_statement(ISC_STATUS *,
413 isc_db_handle *,
414 isc_stmt_handle *);
415
416ISC_STATUS ISC_EXPORT isc_dsql_alloc_statement2(ISC_STATUS *,
417 isc_db_handle *,
418 isc_stmt_handle *);
419
420ISC_STATUS ISC_EXPORT isc_dsql_describe(ISC_STATUS *,
421 isc_stmt_handle *,
422 unsigned short,
423 XSQLDA *);
424
425ISC_STATUS ISC_EXPORT isc_dsql_describe_bind(ISC_STATUS *,
426 isc_stmt_handle *,
427 unsigned short,
428 XSQLDA *);
429
430ISC_STATUS ISC_EXPORT isc_dsql_exec_immed2(ISC_STATUS*,
431 isc_db_handle*,
432 isc_tr_handle*,
433 unsigned short,
434 const ISC_SCHAR*,
435 unsigned short,
436 const XSQLDA*,
437 const XSQLDA*);
438
439ISC_STATUS ISC_EXPORT isc_dsql_execute(ISC_STATUS*,
440 isc_tr_handle*,
441 isc_stmt_handle*,
442 unsigned short,
443 const XSQLDA*);
444
445ISC_STATUS ISC_EXPORT isc_dsql_execute2(ISC_STATUS*,
446 isc_tr_handle*,
447 isc_stmt_handle*,
448 unsigned short,
449 const XSQLDA*,
450 const XSQLDA*);
451
452ISC_STATUS ISC_EXPORT isc_dsql_execute_immediate(ISC_STATUS*,
453 isc_db_handle*,
454 isc_tr_handle*,
455 unsigned short,
456 const ISC_SCHAR*,
457 unsigned short,
458 const XSQLDA*);
459
460ISC_STATUS ISC_EXPORT isc_dsql_fetch(ISC_STATUS *,
461 isc_stmt_handle *,
462 unsigned short,
463 const XSQLDA *);
464
465ISC_STATUS ISC_EXPORT isc_dsql_finish(isc_db_handle *);
466
467ISC_STATUS ISC_EXPORT isc_dsql_free_statement(ISC_STATUS *,
468 isc_stmt_handle *,
469 unsigned short);
470
471ISC_STATUS ISC_EXPORT isc_dsql_insert(ISC_STATUS*,
472 isc_stmt_handle*,
473 unsigned short,
474 XSQLDA*);
475
476ISC_STATUS ISC_EXPORT isc_dsql_prepare(ISC_STATUS*,
477 isc_tr_handle*,
478 isc_stmt_handle*,
479 unsigned short,
480 const ISC_SCHAR*,
481 unsigned short,
482 XSQLDA*);
483
484ISC_STATUS ISC_EXPORT isc_dsql_set_cursor_name(ISC_STATUS*,
485 isc_stmt_handle*,
486 const ISC_SCHAR*,
487 unsigned short);
488
489ISC_STATUS ISC_EXPORT isc_dsql_sql_info(ISC_STATUS*,
490 isc_stmt_handle*,
491 short,
492 const ISC_SCHAR*,
493 short,
494 ISC_SCHAR*);
495
496void ISC_EXPORT isc_encode_date(const void*,
497 ISC_QUAD*);
498
499void ISC_EXPORT isc_encode_sql_date(const void*,
500 ISC_DATE*);
501
502void ISC_EXPORT isc_encode_sql_time(const void*,
503 ISC_TIME*);
504
505void ISC_EXPORT isc_encode_timestamp(const void*,
506 ISC_TIMESTAMP*);
507
508ISC_LONG ISC_EXPORT_VARARG isc_event_block(ISC_UCHAR**,
509 ISC_UCHAR**,
510 ISC_USHORT, ...);
511
512ISC_USHORT ISC_EXPORT isc_event_block_a(ISC_SCHAR**,
513 ISC_SCHAR**,
514 ISC_USHORT,
515 ISC_SCHAR**);
516
517void ISC_EXPORT isc_event_block_s(ISC_SCHAR**,
518 ISC_SCHAR**,
519 ISC_USHORT,
520 ISC_SCHAR**,
521 ISC_USHORT*);
522
523void ISC_EXPORT isc_event_counts(ISC_ULONG*,
524 short,
525 ISC_UCHAR*,
526 const ISC_UCHAR *);
527
528/* 17 May 2001 - isc_expand_dpb is DEPRECATED */
529void FB_API_DEPRECATED ISC_EXPORT_VARARG isc_expand_dpb(ISC_SCHAR**,
530 short*, ...);
531
532int ISC_EXPORT isc_modify_dpb(ISC_SCHAR**,
533 short*,
534 unsigned short,
535 const ISC_SCHAR*,
536 short);
537
538ISC_LONG ISC_EXPORT isc_free(ISC_SCHAR *);
539
540ISC_STATUS ISC_EXPORT isc_get_segment(ISC_STATUS *,
541 isc_blob_handle *,
542 unsigned short *,
543 unsigned short,
544 ISC_SCHAR *);
545
546ISC_STATUS ISC_EXPORT isc_get_slice(ISC_STATUS*,
547 isc_db_handle*,
548 isc_tr_handle*,
549 ISC_QUAD*,
550 short,
551 const ISC_SCHAR*,
552 short,
553 const ISC_LONG*,
554 ISC_LONG,
555 void*,
556 ISC_LONG*);
557
558/* CVC: This non-const signature is needed for compatibility, see gds.cpp. */
559ISC_LONG FB_API_DEPRECATED ISC_EXPORT isc_interprete(ISC_SCHAR*,
560 ISC_STATUS**);
561
562/* This const params version used in the engine and other places. */
563ISC_LONG ISC_EXPORT fb_interpret(ISC_SCHAR*,
564 unsigned int,
565 const ISC_STATUS**);
566
567ISC_STATUS ISC_EXPORT isc_open_blob(ISC_STATUS*,
568 isc_db_handle*,
569 isc_tr_handle*,
570 isc_blob_handle*,
571 ISC_QUAD*);
572
573ISC_STATUS ISC_EXPORT isc_open_blob2(ISC_STATUS*,
574 isc_db_handle*,
575 isc_tr_handle*,
576 isc_blob_handle*,
577 ISC_QUAD*,
578 ISC_USHORT,
579 const ISC_UCHAR*);
580
581ISC_STATUS ISC_EXPORT isc_prepare_transaction2(ISC_STATUS*,
582 isc_tr_handle*,
583 ISC_USHORT,
584 const ISC_UCHAR*);
585
586void ISC_EXPORT isc_print_sqlerror(ISC_SHORT,
587 const ISC_STATUS*);
588
589ISC_STATUS ISC_EXPORT isc_print_status(const ISC_STATUS*);
590
591ISC_STATUS ISC_EXPORT isc_put_segment(ISC_STATUS*,
592 isc_blob_handle*,
593 unsigned short,
594 const ISC_SCHAR*);
595
596ISC_STATUS ISC_EXPORT isc_put_slice(ISC_STATUS*,
597 isc_db_handle*,
598 isc_tr_handle*,
599 ISC_QUAD*,
600 short,
601 const ISC_SCHAR*,
602 short,
603 const ISC_LONG*,
604 ISC_LONG,
605 void*);
606
607ISC_STATUS ISC_EXPORT isc_que_events(ISC_STATUS*,
608 isc_db_handle*,
609 ISC_LONG*,
610 short,
611 const ISC_UCHAR*,
612 ISC_EVENT_CALLBACK,
613 void*);
614
615ISC_STATUS ISC_EXPORT isc_rollback_retaining(ISC_STATUS*,
616 isc_tr_handle*);
617
618ISC_STATUS ISC_EXPORT isc_rollback_transaction(ISC_STATUS*,
619 isc_tr_handle*);
620
621ISC_STATUS ISC_EXPORT isc_start_multiple(ISC_STATUS*,
622 isc_tr_handle*,
623 short,
624 void *);
625
626ISC_STATUS ISC_EXPORT_VARARG isc_start_transaction(ISC_STATUS*,
627 isc_tr_handle*,
628 short, ...);
629
630ISC_STATUS ISC_EXPORT fb_disconnect_transaction(ISC_STATUS*, isc_tr_handle*);
631
632ISC_LONG ISC_EXPORT isc_sqlcode(const ISC_STATUS*);
633
634void ISC_EXPORT isc_sqlcode_s(const ISC_STATUS*,
635 ISC_ULONG*);
636
637void ISC_EXPORT fb_sqlstate(char*,
638 const ISC_STATUS*);
639
640void ISC_EXPORT isc_sql_interprete(short,
641 ISC_SCHAR*,
642 short);
643
644ISC_STATUS ISC_EXPORT isc_transaction_info(ISC_STATUS*,
645 isc_tr_handle*,
646 short,
647 const ISC_SCHAR*,
648 short,
649 ISC_SCHAR*);
650
651ISC_STATUS ISC_EXPORT isc_transact_request(ISC_STATUS*,
652 isc_db_handle*,
653 isc_tr_handle*,
654 unsigned short,
655 ISC_SCHAR*,
656 unsigned short,
657 ISC_SCHAR*,
658 unsigned short,
659 ISC_SCHAR*);
660
661ISC_LONG ISC_EXPORT isc_vax_integer(const ISC_SCHAR*,
662 short);
663
664ISC_INT64 ISC_EXPORT isc_portable_integer(const ISC_UCHAR*,
665 short);
666
667/*************************************/
668/* Security Functions and structures */
669/*************************************/
670
671#define sec_uid_spec 0x01
672#define sec_gid_spec 0x02
673#define sec_server_spec 0x04
674#define sec_password_spec 0x08
675#define sec_group_name_spec 0x10
676#define sec_first_name_spec 0x20
677#define sec_middle_name_spec 0x40
678#define sec_last_name_spec 0x80
679#define sec_dba_user_name_spec 0x100
680#define sec_dba_password_spec 0x200
681
682#define sec_protocol_tcpip 1
683#define sec_protocol_netbeui 2
684#define sec_protocol_spx 3 /* -- Deprecated Protocol. Declaration retained for compatibility */
685#define sec_protocol_local 4
686
687typedef struct {
688 short sec_flags; /* which fields are specified */
689 int uid; /* the user's id */
690 int gid; /* the user's group id */
691 int protocol; /* protocol to use for connection */
692 ISC_SCHAR *server; /* server to administer */
693 ISC_SCHAR *user_name; /* the user's name */
694 ISC_SCHAR *password; /* the user's password */
695 ISC_SCHAR *group_name; /* the group name */
696 ISC_SCHAR *first_name; /* the user's first name */
697 ISC_SCHAR *middle_name; /* the user's middle name */
698 ISC_SCHAR *last_name; /* the user's last name */
699 ISC_SCHAR *dba_user_name; /* the dba user name */
700 ISC_SCHAR *dba_password; /* the dba password */
701} USER_SEC_DATA;
702
703ISC_STATUS ISC_EXPORT isc_add_user(ISC_STATUS*, const USER_SEC_DATA*);
704
705ISC_STATUS ISC_EXPORT isc_delete_user(ISC_STATUS*, const USER_SEC_DATA*);
706
707ISC_STATUS ISC_EXPORT isc_modify_user(ISC_STATUS*, const USER_SEC_DATA*);
708
709/**********************************/
710/* Other OSRI functions */
711/**********************************/
712
713ISC_STATUS ISC_EXPORT isc_compile_request(ISC_STATUS*,
714 isc_db_handle*,
715 isc_req_handle*,
716 short,
717 const ISC_SCHAR*);
718
719ISC_STATUS ISC_EXPORT isc_compile_request2(ISC_STATUS*,
720 isc_db_handle*,
721 isc_req_handle*,
722 short,
723 const ISC_SCHAR*);
724
725// This function always returns error since FB 3.0.
726ISC_STATUS FB_API_DEPRECATED ISC_EXPORT isc_ddl(ISC_STATUS*,
727 isc_db_handle*,
728 isc_tr_handle*,
729 short,
730 const ISC_SCHAR*);
731
732ISC_STATUS ISC_EXPORT isc_prepare_transaction(ISC_STATUS*,
733 isc_tr_handle*);
734
735
736ISC_STATUS ISC_EXPORT isc_receive(ISC_STATUS*,
737 isc_req_handle*,
738 short,
739 short,
740 void*,
741 short);
742
743ISC_STATUS ISC_EXPORT isc_reconnect_transaction(ISC_STATUS*,
744 isc_db_handle*,
745 isc_tr_handle*,
746 short,
747 const ISC_SCHAR*);
748
749ISC_STATUS ISC_EXPORT isc_release_request(ISC_STATUS*,
750 isc_req_handle*);
751
752ISC_STATUS ISC_EXPORT isc_request_info(ISC_STATUS*,
753 isc_req_handle*,
754 short,
755 short,
756 const ISC_SCHAR*,
757 short,
758 ISC_SCHAR*);
759
760ISC_STATUS ISC_EXPORT isc_seek_blob(ISC_STATUS*,
761 isc_blob_handle*,
762 short,
763 ISC_LONG,
764 ISC_LONG*);
765
766ISC_STATUS ISC_EXPORT isc_send(ISC_STATUS*,
767 isc_req_handle*,
768 short,
769 short,
770 const void*,
771 short);
772
773ISC_STATUS ISC_EXPORT isc_start_and_send(ISC_STATUS*,
774 isc_req_handle*,
775 isc_tr_handle*,
776 short,
777 short,
778 const void*,
779 short);
780
781ISC_STATUS ISC_EXPORT isc_start_request(ISC_STATUS *,
782 isc_req_handle *,
783 isc_tr_handle *,
784 short);
785
786ISC_STATUS ISC_EXPORT isc_unwind_request(ISC_STATUS *,
787 isc_tr_handle *,
788 short);
789
790ISC_STATUS ISC_EXPORT isc_wait_for_event(ISC_STATUS*,
791 isc_db_handle*,
792 short,
793 const ISC_UCHAR*,
794 ISC_UCHAR*);
795
796
797/*****************************/
798/* Other Sql functions */
799/*****************************/
800
801ISC_STATUS ISC_EXPORT isc_close(ISC_STATUS*,
802 const ISC_SCHAR*);
803
804ISC_STATUS ISC_EXPORT isc_declare(ISC_STATUS*,
805 const ISC_SCHAR*,
806 const ISC_SCHAR*);
807
808ISC_STATUS ISC_EXPORT isc_describe(ISC_STATUS*,
809 const ISC_SCHAR*,
810 XSQLDA *);
811
812ISC_STATUS ISC_EXPORT isc_describe_bind(ISC_STATUS*,
813 const ISC_SCHAR*,
814 XSQLDA*);
815
816ISC_STATUS ISC_EXPORT isc_execute(ISC_STATUS*,
817 isc_tr_handle*,
818 const ISC_SCHAR*,
819 XSQLDA*);
820
821ISC_STATUS ISC_EXPORT isc_execute_immediate(ISC_STATUS*,
822 isc_db_handle*,
823 isc_tr_handle*,
824 short*,
825 const ISC_SCHAR*);
826
827ISC_STATUS ISC_EXPORT isc_fetch(ISC_STATUS*,
828 const ISC_SCHAR*,
829 XSQLDA*);
830
831ISC_STATUS ISC_EXPORT isc_open(ISC_STATUS*,
832 isc_tr_handle*,
833 const ISC_SCHAR*,
834 XSQLDA*);
835
836ISC_STATUS ISC_EXPORT isc_prepare(ISC_STATUS*,
837 isc_db_handle*,
838 isc_tr_handle*,
839 const ISC_SCHAR*,
840 const short*,
841 const ISC_SCHAR*,
842 XSQLDA*);
843
844
845/*************************************/
846/* Other Dynamic sql functions */
847/*************************************/
848
849ISC_STATUS ISC_EXPORT isc_dsql_execute_m(ISC_STATUS*,
850 isc_tr_handle*,
851 isc_stmt_handle*,
852 unsigned short,
853 const ISC_SCHAR*,
854 unsigned short,
855 unsigned short,
856 ISC_SCHAR*);
857
858ISC_STATUS ISC_EXPORT isc_dsql_execute2_m(ISC_STATUS*,
859 isc_tr_handle*,
860 isc_stmt_handle*,
861 unsigned short,
862 const ISC_SCHAR*,
863 unsigned short,
864 unsigned short,
865 ISC_SCHAR*,
866 unsigned short,
867 ISC_SCHAR*,
868 unsigned short,
869 unsigned short,
870 ISC_SCHAR*);
871
872ISC_STATUS ISC_EXPORT isc_dsql_execute_immediate_m(ISC_STATUS*,
873 isc_db_handle*,
874 isc_tr_handle*,
875 unsigned short,
876 const ISC_SCHAR*,
877 unsigned short,
878 unsigned short,
879 ISC_SCHAR*,
880 unsigned short,
881 unsigned short,
882 ISC_SCHAR*);
883
884ISC_STATUS ISC_EXPORT isc_dsql_exec_immed3_m(ISC_STATUS*,
885 isc_db_handle*,
886 isc_tr_handle*,
887 unsigned short,
888 const ISC_SCHAR*,
889 unsigned short,
890 unsigned short,
891 ISC_SCHAR*,
892 unsigned short,
893 unsigned short,
894 const ISC_SCHAR*,
895 unsigned short,
896 ISC_SCHAR*,
897 unsigned short,
898 unsigned short,
899 ISC_SCHAR*);
900
901ISC_STATUS ISC_EXPORT isc_dsql_fetch_m(ISC_STATUS*,
902 isc_stmt_handle*,
903 unsigned short,
904 ISC_SCHAR*,
905 unsigned short,
906 unsigned short,
907 ISC_SCHAR*);
908
909ISC_STATUS ISC_EXPORT isc_dsql_insert_m(ISC_STATUS*,
910 isc_stmt_handle*,
911 unsigned short,
912 const ISC_SCHAR*,
913 unsigned short,
914 unsigned short,
915 const ISC_SCHAR*);
916
917ISC_STATUS ISC_EXPORT isc_dsql_prepare_m(ISC_STATUS*,
918 isc_tr_handle*,
919 isc_stmt_handle*,
920 unsigned short,
921 const ISC_SCHAR*,
922 unsigned short,
923 unsigned short,
924 const ISC_SCHAR*,
925 unsigned short,
926 ISC_SCHAR*);
927
928ISC_STATUS ISC_EXPORT isc_dsql_release(ISC_STATUS*,
929 const ISC_SCHAR*);
930
931ISC_STATUS ISC_EXPORT isc_embed_dsql_close(ISC_STATUS*,
932 const ISC_SCHAR*);
933
934ISC_STATUS ISC_EXPORT isc_embed_dsql_declare(ISC_STATUS*,
935 const ISC_SCHAR*,
936 const ISC_SCHAR*);
937
938ISC_STATUS ISC_EXPORT isc_embed_dsql_describe(ISC_STATUS*,
939 const ISC_SCHAR*,
940 unsigned short,
941 XSQLDA*);
942
943ISC_STATUS ISC_EXPORT isc_embed_dsql_describe_bind(ISC_STATUS*,
944 const ISC_SCHAR*,
945 unsigned short,
946 XSQLDA*);
947
948ISC_STATUS ISC_EXPORT isc_embed_dsql_execute(ISC_STATUS*,
949 isc_tr_handle*,
950 const ISC_SCHAR*,
951 unsigned short,
952 XSQLDA*);
953
954ISC_STATUS ISC_EXPORT isc_embed_dsql_execute2(ISC_STATUS*,
955 isc_tr_handle*,
956 const ISC_SCHAR*,
957 unsigned short,
958 XSQLDA*,
959 XSQLDA*);
960
961ISC_STATUS ISC_EXPORT isc_embed_dsql_execute_immed(ISC_STATUS*,
962 isc_db_handle*,
963 isc_tr_handle*,
964 unsigned short,
965 const ISC_SCHAR*,
966 unsigned short,
967 XSQLDA*);
968
969ISC_STATUS ISC_EXPORT isc_embed_dsql_fetch(ISC_STATUS*,
970 const ISC_SCHAR*,
971 unsigned short,
972 XSQLDA*);
973
974ISC_STATUS ISC_EXPORT isc_embed_dsql_fetch_a(ISC_STATUS*,
975 int*,
976 const ISC_SCHAR*,
977 ISC_USHORT,
978 XSQLDA*);
979
980void ISC_EXPORT isc_embed_dsql_length(const ISC_UCHAR*,
981 ISC_USHORT*);
982
983ISC_STATUS ISC_EXPORT isc_embed_dsql_open(ISC_STATUS*,
984 isc_tr_handle*,
985 const ISC_SCHAR*,
986 unsigned short,
987 XSQLDA*);
988
989ISC_STATUS ISC_EXPORT isc_embed_dsql_open2(ISC_STATUS*,
990 isc_tr_handle*,
991 const ISC_SCHAR*,
992 unsigned short,
993 XSQLDA*,
994 XSQLDA*);
995
996ISC_STATUS ISC_EXPORT isc_embed_dsql_insert(ISC_STATUS*,
997 const ISC_SCHAR*,
998 unsigned short,
999 XSQLDA*);
1000
1001ISC_STATUS ISC_EXPORT isc_embed_dsql_prepare(ISC_STATUS*,
1002 isc_db_handle*,
1003 isc_tr_handle*,
1004 const ISC_SCHAR*,
1005 unsigned short,
1006 const ISC_SCHAR*,
1007 unsigned short,
1008 XSQLDA*);
1009
1010ISC_STATUS ISC_EXPORT isc_embed_dsql_release(ISC_STATUS*,
1011 const ISC_SCHAR*);
1012
1013
1014/******************************/
1015/* Other Blob functions */
1016/******************************/
1017
1018FB_BLOB_STREAM ISC_EXPORT BLOB_open(isc_blob_handle,
1019 ISC_SCHAR*,
1020 int);
1021
1022int ISC_EXPORT BLOB_put(ISC_SCHAR,
1023 FB_BLOB_STREAM);
1024
1025int ISC_EXPORT BLOB_close(FB_BLOB_STREAM);
1026
1027int ISC_EXPORT BLOB_get(FB_BLOB_STREAM);
1028
1029int ISC_EXPORT BLOB_display(ISC_QUAD*,
1030 isc_db_handle,
1031 isc_tr_handle,
1032 const ISC_SCHAR*);
1033
1034int ISC_EXPORT BLOB_dump(ISC_QUAD*,
1035 isc_db_handle,
1036 isc_tr_handle,
1037 const ISC_SCHAR*);
1038
1039int ISC_EXPORT BLOB_edit(ISC_QUAD*,
1040 isc_db_handle,
1041 isc_tr_handle,
1042 const ISC_SCHAR*);
1043
1044int ISC_EXPORT BLOB_load(ISC_QUAD*,
1045 isc_db_handle,
1046 isc_tr_handle,
1047 const ISC_SCHAR*);
1048
1049int ISC_EXPORT BLOB_text_dump(ISC_QUAD*,
1050 isc_db_handle,
1051 isc_tr_handle,
1052 const ISC_SCHAR*);
1053
1054int ISC_EXPORT BLOB_text_load(ISC_QUAD*,
1055 isc_db_handle,
1056 isc_tr_handle,
1057 const ISC_SCHAR*);
1058
1059FB_BLOB_STREAM ISC_EXPORT Bopen(ISC_QUAD*,
1060 isc_db_handle,
1061 isc_tr_handle,
1062 const ISC_SCHAR*);
1063
1064
1065/******************************/
1066/* Other Misc functions */
1067/******************************/
1068
1069ISC_LONG ISC_EXPORT isc_ftof(const ISC_SCHAR*,
1070 const unsigned short,
1071 ISC_SCHAR*,
1072 const unsigned short);
1073
1074ISC_STATUS ISC_EXPORT isc_print_blr(const ISC_SCHAR*,
1075 ISC_PRINT_CALLBACK,
1076 void*,
1077 short);
1078
1079int ISC_EXPORT fb_print_blr(const ISC_UCHAR*,
1080 ISC_ULONG,
1081 ISC_PRINT_CALLBACK,
1082 void*,
1083 short);
1084
1085void ISC_EXPORT isc_set_debug(int);
1086
1087void ISC_EXPORT isc_qtoq(const ISC_QUAD*,
1088 ISC_QUAD*);
1089
1090void ISC_EXPORT isc_vtof(const ISC_SCHAR*,
1091 ISC_SCHAR*,
1092 unsigned short);
1093
1094void ISC_EXPORT isc_vtov(const ISC_SCHAR*,
1095 ISC_SCHAR*,
1096 short);
1097
1098int ISC_EXPORT isc_version(isc_db_handle*,
1099 ISC_VERSION_CALLBACK,
1100 void*);
1101
1102ISC_LONG FB_API_DEPRECATED ISC_EXPORT isc_reset_fpe(ISC_USHORT);
1103
1104uintptr_t ISC_EXPORT isc_baddress(ISC_SCHAR*);
1105void ISC_EXPORT isc_baddress_s(const ISC_SCHAR*,
1106 uintptr_t*);
1107
1108/*****************************************/
1109/* Service manager functions */
1110/*****************************************/
1111
1112#define ADD_SPB_LENGTH(p, length) {*(p)++ = (length); \
1113 *(p)++ = (length) >> 8;}
1114
1115#define ADD_SPB_NUMERIC(p, data) {*(p)++ = (ISC_SCHAR) (ISC_UCHAR) (data); \
1116 *(p)++ = (ISC_SCHAR) (ISC_UCHAR) ((data) >> 8); \
1117 *(p)++ = (ISC_SCHAR) (ISC_UCHAR) ((data) >> 16); \
1118 *(p)++ = (ISC_SCHAR) (ISC_UCHAR) ((data) >> 24);}
1119
1120ISC_STATUS ISC_EXPORT isc_service_attach(ISC_STATUS*,
1121 unsigned short,
1122 const ISC_SCHAR*,
1123 isc_svc_handle*,
1124 unsigned short,
1125 const ISC_SCHAR*);
1126
1127ISC_STATUS ISC_EXPORT isc_service_detach(ISC_STATUS *,
1128 isc_svc_handle *);
1129
1130ISC_STATUS ISC_EXPORT isc_service_query(ISC_STATUS*,
1131 isc_svc_handle*,
1132 isc_resv_handle*,
1133 unsigned short,
1134 const ISC_SCHAR*,
1135 unsigned short,
1136 const ISC_SCHAR*,
1137 unsigned short,
1138 ISC_SCHAR*);
1139
1140ISC_STATUS ISC_EXPORT isc_service_start(ISC_STATUS*,
1141 isc_svc_handle*,
1142 isc_resv_handle*,
1143 unsigned short,
1144 const ISC_SCHAR*);
1145
1146/***********************/
1147/* Shutdown and cancel */
1148/***********************/
1149
1150int ISC_EXPORT fb_shutdown(unsigned int, const int);
1151
1152ISC_STATUS ISC_EXPORT fb_shutdown_callback(ISC_STATUS*,
1153 FB_SHUTDOWN_CALLBACK,
1154 const int,
1155 void*);
1156
1157ISC_STATUS ISC_EXPORT fb_cancel_operation(ISC_STATUS*,
1158 isc_db_handle*,
1159 ISC_USHORT);
1160
1161/***********************/
1162/* Ping the connection */
1163/***********************/
1164
1165ISC_STATUS ISC_EXPORT fb_ping(ISC_STATUS*, isc_db_handle*);
1166
1167/********************/
1168/* Object interface */
1169/********************/
1170
1171ISC_STATUS ISC_EXPORT fb_get_database_handle(ISC_STATUS*, isc_db_handle*, void*);
1172ISC_STATUS ISC_EXPORT fb_get_transaction_handle(ISC_STATUS*, isc_tr_handle*, void*);
1173
1174/********************************/
1175/* Client information functions */
1176/********************************/
1177
1178void ISC_EXPORT isc_get_client_version ( ISC_SCHAR *);
1179int ISC_EXPORT isc_get_client_major_version ();
1180int ISC_EXPORT isc_get_client_minor_version ();
1181
1182/*******************************************/
1183/* Set callback for database crypt plugins */
1184/*******************************************/
1185
1186ISC_STATUS ISC_EXPORT fb_database_crypt_callback(ISC_STATUS*,
1187 FB_NAMESPACE_USE(Firebird, ICryptKeyCallback*));
1188
1189#ifdef __cplusplus
1190} /* extern "C" */
1191#endif
1192
1193
1194/***************************************************/
1195/* Actions to pass to the blob filter (ctl_source) */
1196/***************************************************/
1197
1198#define isc_blob_filter_open 0
1199#define isc_blob_filter_get_segment 1
1200#define isc_blob_filter_close 2
1201#define isc_blob_filter_create 3
1202#define isc_blob_filter_put_segment 4
1203#define isc_blob_filter_alloc 5
1204#define isc_blob_filter_free 6
1205#define isc_blob_filter_seek 7
1206
1207/*******************/
1208/* Blr definitions */
1209/*******************/
1210
1211#include "blr.h"
1212
1213#include "consts_pub.h"
1214
1215/*********************************/
1216/* Information call declarations */
1217/*********************************/
1218
1219#include "../jrd/inf_pub.h"
1220
1221#include "iberror.h"
1222
1223#endif /* JRD_IBASE_H */
1224
1225