1 | /* |
2 | * PROGRAM: JRD Access Method |
3 | * MODULE: gds_proto.h |
4 | * DESCRIPTION: Prototype header file for gds.cpp |
5 | * |
6 | * The contents of this file are subject to the Interbase Public |
7 | * License Version 1.0 (the "License"); you may not use this file |
8 | * except in compliance with the License. You may obtain a copy |
9 | * of the License at http://www.Inprise.com/IPL.html |
10 | * |
11 | * Software distributed under the License is distributed on an |
12 | * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express |
13 | * or implied. See the License for the specific language governing |
14 | * rights and limitations under the License. |
15 | * |
16 | * The Original Code was created by Inprise Corporation |
17 | * and its predecessors. Portions created by Inprise Corporation are |
18 | * Copyright (C) Inprise Corporation. |
19 | * |
20 | * All Rights Reserved. |
21 | * Contributor(s): ______________________________________. |
22 | * |
23 | * 2002.10.29 Sean Leyne - Removed obsolete "Netware" port |
24 | * |
25 | */ |
26 | |
27 | #ifndef JRD_GDS_PROTO_H |
28 | #define JRD_GDS_PROTO_H |
29 | |
30 | |
31 | const SSHORT IB_PREFIX_TYPE = 0; |
32 | const SSHORT IB_PREFIX_LOCK_TYPE = 1; |
33 | const SSHORT IB_PREFIX_MSG_TYPE = 2; |
34 | |
35 | // flags for gds_alloc_report |
36 | const ULONG ALLOC_dont_report = 1L << 0; /* Don't report this block */ |
37 | const ULONG ALLOC_silent = 1L << 1; /* Don't report new leaks */ |
38 | const ULONG ALLOC_verbose = 1L << 2; /* Report all leaks, even old */ |
39 | const ULONG ALLOC_mark_current = 1L << 3; /* Mark all current leaks */ |
40 | const ULONG ALLOC_check_each_call = 1L << 4; /* Check memory integrity on each alloc/free call */ |
41 | const ULONG ALLOC_dont_check = 1L << 5; /* Stop checking integrity on each call */ |
42 | |
43 | #ifdef __cplusplus |
44 | extern "C" { |
45 | #endif |
46 | |
47 | typedef void* VoidPtr; |
48 | |
49 | VoidPtr API_ROUTINE gds__alloc_debug(SLONG, const TEXT*, ULONG); |
50 | void API_ROUTINE gds_alloc_flag_unfreed(void*); |
51 | void API_ROUTINE gds_alloc_report(ULONG, const char*, int); |
52 | |
53 | VoidPtr API_ROUTINE gds__alloc(SLONG); |
54 | |
55 | #ifdef DEBUG_GDS_ALLOC |
56 | #define gds__alloc(s) gds__alloc_debug ((s), (TEXT*)__FILE__, (ULONG)__LINE__) |
57 | #endif /* DEBUG_GDS_ALLOC */ |
58 | |
59 | |
60 | ISC_STATUS API_ROUTINE gds__decode(ISC_STATUS, USHORT*, USHORT*); |
61 | void API_ROUTINE isc_decode_date(const ISC_QUAD*, void*); |
62 | void API_ROUTINE isc_decode_sql_date(const GDS_DATE*, void*); |
63 | void API_ROUTINE isc_decode_sql_time(const GDS_TIME*, void*); |
64 | void API_ROUTINE isc_decode_timestamp(const GDS_TIMESTAMP*, void*); |
65 | ISC_STATUS API_ROUTINE gds__encode(ISC_STATUS, USHORT); |
66 | void API_ROUTINE isc_encode_date(const void*, ISC_QUAD*); |
67 | void API_ROUTINE isc_encode_sql_date(const void*, GDS_DATE*); |
68 | void API_ROUTINE isc_encode_sql_time(const void*, GDS_TIME*); |
69 | void API_ROUTINE isc_encode_timestamp(const void*, GDS_TIMESTAMP*); |
70 | ULONG API_ROUTINE gds__free(void*); |
71 | |
72 | /* CVC: This function was created to be used inside the engine, but I don't see |
73 | a problem if it's used from outside, too. |
74 | This function has been renamed and made public. */ |
75 | SLONG API_ROUTINE fb_interpret(char*, unsigned int, const ISC_STATUS**); |
76 | /* CVC: This non-const signature is needed for compatibility, see gds.cpp. */ |
77 | SLONG API_ROUTINE gds__interprete(char*, ISC_STATUS**); |
78 | void API_ROUTINE gds__interprete_a(SCHAR*, SSHORT*, ISC_STATUS*, SSHORT*); |
79 | |
80 | void API_ROUTINE gds__log(const TEXT*, ...); |
81 | void API_ROUTINE gds__trace(const char*); |
82 | void API_ROUTINE gds__trace_raw(const char*, unsigned int = 0); |
83 | void API_ROUTINE gds__log_status(const TEXT*, const ISC_STATUS*); |
84 | int API_ROUTINE gds__msg_close(void*); |
85 | SSHORT API_ROUTINE gds__msg_format(void* handle, |
86 | USHORT facility, |
87 | USHORT msgNumber, |
88 | USHORT bufsize, |
89 | TEXT* buffer, |
90 | const TEXT* arg1, |
91 | const TEXT* arg2, |
92 | const TEXT* arg3, |
93 | const TEXT* arg4, |
94 | const TEXT* arg5); |
95 | SSHORT API_ROUTINE gds__msg_lookup(void*, USHORT, USHORT, USHORT, |
96 | TEXT*, USHORT*); |
97 | int API_ROUTINE gds__msg_open(void**, const TEXT*); |
98 | void API_ROUTINE gds__msg_put(void*, USHORT, USHORT, const TEXT*, |
99 | const TEXT*, const TEXT*, const TEXT*, const TEXT*); |
100 | void API_ROUTINE gds__prefix(TEXT*, const TEXT*); |
101 | void API_ROUTINE gds__prefix_lock(TEXT*, const TEXT*); |
102 | void API_ROUTINE gds__prefix_msg(TEXT*, const TEXT*); |
103 | |
104 | SLONG API_ROUTINE gds__get_prefix(SSHORT, const TEXT*); |
105 | ISC_STATUS API_ROUTINE gds__print_status(const ISC_STATUS*); |
106 | USHORT API_ROUTINE gds__parse_bpb(USHORT, const UCHAR*, USHORT*, USHORT*); |
107 | USHORT API_ROUTINE gds__parse_bpb2(USHORT, const UCHAR*, SSHORT*, SSHORT*, |
108 | USHORT*, USHORT*, bool*, bool*, bool*, bool*); |
109 | SLONG API_ROUTINE gds__ftof(const SCHAR*, const USHORT length1, SCHAR*, const USHORT length2); |
110 | int API_ROUTINE fb_print_blr(const UCHAR*, ULONG, FPTR_PRINT_CALLBACK, void*, SSHORT); |
111 | int API_ROUTINE gds__print_blr(const UCHAR*, FPTR_PRINT_CALLBACK, void*, SSHORT); |
112 | void API_ROUTINE gds__put_error(const TEXT*); |
113 | void API_ROUTINE gds__qtoq(const void*, void*); |
114 | void API_ROUTINE gds__register_cleanup(FPTR_VOID_PTR, void*); |
115 | SLONG API_ROUTINE gds__sqlcode(const ISC_STATUS*); |
116 | void API_ROUTINE gds__sqlcode_s(const ISC_STATUS*, ULONG*); |
117 | VoidPtr API_ROUTINE gds__temp_file(BOOLEAN, const TEXT*, TEXT*, TEXT* = NULL, BOOLEAN = FALSE); |
118 | void API_ROUTINE gds__unregister_cleanup(FPTR_VOID_PTR, void*); |
119 | BOOLEAN API_ROUTINE gds__validate_lib_path(const TEXT*, const TEXT*, TEXT*, SLONG); |
120 | SLONG API_ROUTINE gds__vax_integer(const UCHAR*, SSHORT); |
121 | void API_ROUTINE gds__vtof(const SCHAR*, SCHAR*, USHORT); |
122 | void API_ROUTINE gds__vtov(const SCHAR*, char*, SSHORT); |
123 | void API_ROUTINE isc_print_sqlerror(SSHORT, const ISC_STATUS*); |
124 | void API_ROUTINE isc_sql_interprete(SSHORT, TEXT*, SSHORT); |
125 | SINT64 API_ROUTINE isc_portable_integer(const UCHAR*, SSHORT); |
126 | |
127 | // 14-June-2004. Nickolay Samofatov. The routines below are not part of the |
128 | // API and are not exported. Maybe use another prefix like GDS_ for them? |
129 | void gds__cleanup(); |
130 | void gds__ulstr(char* buffer, FB_UINT64 value, const int minlen, const char filler); |
131 | |
132 | void FB_EXPORTED gds__default_printer(void*, SSHORT, const TEXT*); |
133 | void FB_EXPORTED gds__trace_printer(void*, SSHORT, const TEXT*); |
134 | void gds__print_pool(Firebird::MemoryPool*, const TEXT*, ...); |
135 | void GDS_init_prefix(); |
136 | |
137 | #ifdef __cplusplus |
138 | } /* extern "C" */ |
139 | #endif |
140 | |
141 | |
142 | #endif /* JRD_GDS_PROTO_H */ |
143 | |