2001-05-23 15:26:42 +02:00
|
|
|
/*
|
|
|
|
* PROGRAM: JRD Access Method
|
|
|
|
* MODULE: jrd_proto.h
|
2003-10-29 11:53:47 +01:00
|
|
|
* DESCRIPTION: Prototype header file for jrd.cpp
|
2001-05-23 15:26:42 +02:00
|
|
|
*
|
|
|
|
* 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): ______________________________________.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef JRD_JRD_PROTO_H
|
|
|
|
#define JRD_JRD_PROTO_H
|
|
|
|
|
2004-12-17 06:41:47 +01:00
|
|
|
#include "../common/classes/fb_string.h"
|
2004-03-14 14:40:14 +01:00
|
|
|
|
2004-03-20 15:57:40 +01:00
|
|
|
namespace Jrd {
|
|
|
|
class Attachment;
|
|
|
|
class jrd_tra;
|
|
|
|
class blb;
|
2004-03-31 19:58:04 +02:00
|
|
|
struct bid;
|
2004-03-20 15:57:40 +01:00
|
|
|
class jrd_req;
|
|
|
|
class Service;
|
|
|
|
class BlockingThread;
|
2004-06-08 15:41:08 +02:00
|
|
|
class thread_db;
|
2004-03-20 15:57:40 +01:00
|
|
|
struct teb;
|
|
|
|
}
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2004-05-03 01:06:37 +02:00
|
|
|
extern "C" {
|
|
|
|
|
2003-10-29 11:53:47 +01:00
|
|
|
ISC_STATUS jrd8_attach_database(ISC_STATUS*, SSHORT, const TEXT*,
|
2004-03-20 15:57:40 +01:00
|
|
|
Jrd::Attachment**, SSHORT,
|
2003-11-07 09:06:35 +01:00
|
|
|
const UCHAR*, const TEXT*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_blob_info(ISC_STATUS*, Jrd::blb**, SSHORT,
|
2003-10-29 11:53:47 +01:00
|
|
|
const SCHAR*, SSHORT, SCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_cancel_blob(ISC_STATUS *, Jrd::blb **);
|
|
|
|
ISC_STATUS jrd8_cancel_events(ISC_STATUS *, Jrd::Attachment**, SLONG *);
|
2001-05-23 15:26:42 +02:00
|
|
|
#ifdef CANCEL_OPERATION
|
2003-11-08 17:40:17 +01:00
|
|
|
#define CANCEL_disable 1
|
|
|
|
#define CANCEL_enable 2
|
|
|
|
#define CANCEL_raise 3
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_cancel_operation(ISC_STATUS *, Jrd::Attachment**,
|
2001-05-23 15:26:42 +02:00
|
|
|
USHORT);
|
|
|
|
#endif
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_close_blob(ISC_STATUS *, Jrd::blb **);
|
|
|
|
ISC_STATUS jrd8_commit_transaction(ISC_STATUS *, Jrd::jrd_tra **);
|
|
|
|
ISC_STATUS jrd8_commit_retaining(ISC_STATUS *, Jrd::jrd_tra **);
|
|
|
|
ISC_STATUS jrd8_compile_request(ISC_STATUS*, Jrd::Attachment**,
|
|
|
|
Jrd::jrd_req**,
|
2003-11-07 09:06:35 +01:00
|
|
|
SSHORT, const SCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_create_blob2(ISC_STATUS*, Jrd::Attachment**,
|
|
|
|
Jrd::jrd_tra**, Jrd::blb**,
|
|
|
|
Jrd::bid*, USHORT, const UCHAR*);
|
2003-10-29 11:53:47 +01:00
|
|
|
ISC_STATUS jrd8_create_database(ISC_STATUS*, USHORT, const TEXT*,
|
2004-03-20 15:57:40 +01:00
|
|
|
Jrd::Attachment**, USHORT,
|
2003-11-07 09:06:35 +01:00
|
|
|
const UCHAR*, USHORT,
|
|
|
|
const TEXT*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_database_info(ISC_STATUS*, Jrd::Attachment**, SSHORT,
|
2003-10-29 11:53:47 +01:00
|
|
|
const SCHAR*, SSHORT, SCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_ddl(ISC_STATUS*, Jrd::Attachment**, Jrd::jrd_tra**,
|
2003-11-05 10:02:33 +01:00
|
|
|
USHORT, const SCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_detach_database(ISC_STATUS *, Jrd::Attachment**);
|
|
|
|
ISC_STATUS jrd8_drop_database(ISC_STATUS *, Jrd::Attachment**);
|
2005-08-21 17:52:30 +02:00
|
|
|
ISC_STATUS jrd8_intl_function(ISC_STATUS *, Jrd::Attachment**,
|
|
|
|
USHORT, UCHAR, USHORT, const UCHAR*, USHORT*);
|
2006-07-10 05:12:10 +02:00
|
|
|
ISC_STATUS jrd8_dsql_cache(ISC_STATUS *, Jrd::Attachment**,
|
|
|
|
USHORT, int, const char*, bool*);
|
2007-01-20 15:18:18 +01:00
|
|
|
ISC_STATUS jrd8_internal_compile_request(ISC_STATUS*, Jrd::Attachment**,
|
|
|
|
Jrd::jrd_req**,
|
|
|
|
SSHORT, const SCHAR*,
|
|
|
|
USHORT, const char*,
|
|
|
|
USHORT, const UCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_get_segment(ISC_STATUS *, Jrd::blb**, USHORT *,
|
2001-05-23 15:26:42 +02:00
|
|
|
USHORT, UCHAR *);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_get_slice(ISC_STATUS*, Jrd::Attachment**,
|
|
|
|
Jrd::jrd_tra**, ISC_QUAD*, USHORT,
|
2003-12-03 09:19:24 +01:00
|
|
|
const UCHAR*, USHORT, const UCHAR*, SLONG,
|
|
|
|
UCHAR*, SLONG*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_open_blob2(ISC_STATUS*, Jrd::Attachment**,
|
|
|
|
Jrd::jrd_tra**, Jrd::blb**,
|
|
|
|
Jrd::bid*, USHORT, const UCHAR*);
|
|
|
|
ISC_STATUS jrd8_prepare_transaction(ISC_STATUS *, Jrd::jrd_tra **,
|
2006-02-23 06:08:26 +01:00
|
|
|
USHORT, const UCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_put_segment(ISC_STATUS*, Jrd::blb**, USHORT,
|
2003-10-29 11:53:47 +01:00
|
|
|
const UCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_put_slice(ISC_STATUS*, Jrd::Attachment**,
|
|
|
|
Jrd::jrd_tra**, ISC_QUAD*, USHORT,
|
2003-12-03 09:19:24 +01:00
|
|
|
const UCHAR*, USHORT, const UCHAR*, SLONG,
|
|
|
|
UCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_que_events(ISC_STATUS*, Jrd::Attachment**, SLONG*,
|
2003-12-22 11:00:59 +01:00
|
|
|
SSHORT, const UCHAR*,
|
|
|
|
FPTR_EVENT_CALLBACK, void*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_receive(ISC_STATUS *, Jrd::jrd_req**, USHORT, USHORT,
|
2001-05-23 15:26:42 +02:00
|
|
|
SCHAR *, SSHORT);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_reconnect_transaction(ISC_STATUS*, Jrd::Attachment**,
|
|
|
|
Jrd::jrd_tra**, SSHORT,
|
2003-11-01 11:26:43 +01:00
|
|
|
const UCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_release_request(ISC_STATUS *, Jrd::jrd_req**);
|
|
|
|
ISC_STATUS jrd8_request_info(ISC_STATUS*, Jrd::jrd_req**, SSHORT,
|
2003-10-29 11:53:47 +01:00
|
|
|
SSHORT, const SCHAR*, SSHORT, SCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_rollback_transaction(ISC_STATUS *, Jrd::jrd_tra **);
|
|
|
|
ISC_STATUS jrd8_rollback_retaining(ISC_STATUS *, Jrd::jrd_tra **);
|
|
|
|
ISC_STATUS jrd8_seek_blob(ISC_STATUS *, Jrd::blb **, SSHORT,
|
2001-05-23 15:26:42 +02:00
|
|
|
SLONG, SLONG *);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_send(ISC_STATUS *, Jrd::jrd_req**, USHORT, USHORT,
|
2001-05-23 15:26:42 +02:00
|
|
|
SCHAR *, SSHORT);
|
2003-12-03 09:19:24 +01:00
|
|
|
ISC_STATUS jrd8_service_attach(ISC_STATUS*, USHORT, const SCHAR*,
|
2004-03-20 15:57:40 +01:00
|
|
|
Jrd::Service**, USHORT, const SCHAR*);
|
|
|
|
ISC_STATUS jrd8_service_detach(ISC_STATUS *, Jrd::Service**);
|
|
|
|
ISC_STATUS jrd8_service_query(ISC_STATUS*, Jrd::Service**, ULONG*,
|
2003-10-29 11:53:47 +01:00
|
|
|
USHORT, const SCHAR*,
|
|
|
|
USHORT, const SCHAR*,
|
|
|
|
USHORT, SCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_service_start(ISC_STATUS*, Jrd::Service**, ULONG*,
|
2003-11-28 07:48:34 +01:00
|
|
|
USHORT, const SCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_start_and_send(ISC_STATUS *, Jrd::jrd_req**,
|
|
|
|
Jrd::jrd_tra **, USHORT, USHORT,
|
2001-05-23 15:26:42 +02:00
|
|
|
SCHAR *, SSHORT);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_start_request(ISC_STATUS *, Jrd::jrd_req**,
|
|
|
|
Jrd::jrd_tra **, SSHORT);
|
|
|
|
ISC_STATUS jrd8_start_multiple(ISC_STATUS *, Jrd::jrd_tra **, USHORT,
|
|
|
|
Jrd::teb *);
|
|
|
|
ISC_STATUS jrd8_start_transaction(ISC_STATUS *, Jrd::jrd_tra **,
|
2001-05-23 15:26:42 +02:00
|
|
|
SSHORT, ...);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_transaction_info(ISC_STATUS*, Jrd::jrd_tra**,
|
2003-10-29 11:53:47 +01:00
|
|
|
SSHORT, const SCHAR*, SSHORT,
|
|
|
|
SCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_transact_request(ISC_STATUS*, Jrd::Attachment**,
|
|
|
|
Jrd::jrd_tra**, USHORT, const SCHAR*,
|
2003-10-29 11:53:47 +01:00
|
|
|
USHORT, SCHAR*, USHORT,
|
|
|
|
SCHAR*);
|
2004-03-20 15:57:40 +01:00
|
|
|
ISC_STATUS jrd8_unwind_request(ISC_STATUS *, Jrd::jrd_req**, SSHORT);
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2004-05-03 01:06:37 +02:00
|
|
|
} // extern "C"
|
|
|
|
|
|
|
|
void jrd_vtof(const char*, char*, SSHORT);
|
2004-03-11 06:04:26 +01:00
|
|
|
|
2001-05-23 15:26:42 +02:00
|
|
|
#ifdef SERVER_SHUTDOWN
|
|
|
|
/* Defines for paramater 3 of JRD_num_attachments */
|
2004-05-05 23:55:13 +02:00
|
|
|
const USHORT JRD_info_drivemask = 1;
|
|
|
|
const USHORT JRD_info_dbnames = 2;
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2006-10-30 13:39:08 +01:00
|
|
|
TEXT* JRD_num_attachments(TEXT* const, USHORT, USHORT, ULONG*, ULONG*);
|
2005-06-24 13:14:51 +02:00
|
|
|
void JRD_shutdown_all(bool);
|
2007-01-20 15:45:45 +01:00
|
|
|
#else /* SERVER_SHUTDOWN */
|
|
|
|
void JRD_process_close();
|
|
|
|
void JRD_database_close(Jrd::Attachment**, Jrd::Attachment**);
|
2001-05-23 15:26:42 +02:00
|
|
|
#endif /* SERVER_SHUTDOWN */
|
|
|
|
|
2003-10-03 03:53:34 +02:00
|
|
|
void JRD_set_cache_default(ULONG *);
|
2004-03-20 15:57:40 +01:00
|
|
|
void JRD_blocked(Jrd::Attachment*, Jrd::BlockingThread**);
|
2006-05-01 07:11:52 +02:00
|
|
|
void JRD_mutex_lock(Firebird::Mutex*);
|
|
|
|
void JRD_mutex_unlock(Firebird::Mutex*);
|
2004-03-20 15:57:40 +01:00
|
|
|
bool JRD_reschedule(Jrd::thread_db*, SLONG, bool);
|
2003-10-03 03:53:34 +02:00
|
|
|
void JRD_restore_context(void);
|
2004-03-20 15:57:40 +01:00
|
|
|
void JRD_set_context(Jrd::thread_db*);
|
2004-08-30 20:11:08 +02:00
|
|
|
void JRD_inuse_clear(Jrd::thread_db* tdbb);
|
2004-03-20 15:57:40 +01:00
|
|
|
void JRD_unblock(Jrd::BlockingThread**);
|
2004-05-03 01:06:37 +02:00
|
|
|
void JRD_thread_security_disable(bool disable);
|
2004-12-19 16:24:59 +01:00
|
|
|
bool JRD_get_thread_security_disabled();
|
2001-05-23 15:26:42 +02:00
|
|
|
|
2004-10-25 07:14:12 +02:00
|
|
|
// Call this function from the debugger if desired
|
|
|
|
void JRD_print_pools(const char* filename);
|
|
|
|
|
2001-05-23 15:26:42 +02:00
|
|
|
#ifdef SUPERSERVER
|
2003-10-29 11:53:47 +01:00
|
|
|
void JRD_print_all_counters(const TEXT*);
|
2004-03-14 14:40:14 +01:00
|
|
|
bool JRD_getdir(Firebird::PathName&);
|
2001-05-23 15:26:42 +02:00
|
|
|
#endif
|
|
|
|
|
2003-06-01 18:22:47 +02:00
|
|
|
#ifdef DEBUG_PROCS
|
2004-03-20 15:57:40 +01:00
|
|
|
void JRD_print_procedure_info(Jrd::thread_db*, const char*);
|
2003-06-01 18:22:47 +02:00
|
|
|
#endif
|
|
|
|
|
2004-03-18 06:56:06 +01:00
|
|
|
#ifdef WIN_NT
|
|
|
|
#include <direct.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
|
|
|
#endif
|
|
|
|
|
2004-03-14 14:40:14 +01:00
|
|
|
inline bool fb_getcwd(Firebird::PathName& pn)
|
|
|
|
{
|
|
|
|
char buffer[MAXPATHLEN];
|
|
|
|
#if defined(WIN_NT)
|
|
|
|
_getcwd(buffer, MAXPATHLEN);
|
|
|
|
#elif defined(HAVE_GETCWD)
|
|
|
|
getcwd(buffer, MAXPATHLEN);
|
|
|
|
#else
|
|
|
|
getwd(buffer);
|
|
|
|
#endif
|
|
|
|
pn = buffer;
|
|
|
|
return bool(buffer);
|
|
|
|
}
|
|
|
|
|
2004-03-18 06:56:06 +01:00
|
|
|
|
2001-05-23 15:26:42 +02:00
|
|
|
#endif /* JRD_JRD_PROTO_H */
|
2003-10-29 11:53:47 +01:00
|
|
|
|