8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 07:23:03 +01:00

-Removing gdsold.h and gds.h

-Replace gds__ functions with isc_ functions for internal use
This commit is contained in:
brodsom 2003-11-09 15:38:31 +00:00
parent 39f9f7ccc4
commit 35ea85a115
6 changed files with 194 additions and 52 deletions

View File

@ -46,6 +46,7 @@
#include "../utilities/gsec/secur_proto.h"
#include "../jrd/event.h"
#include "../jrd/alt_proto.h"
#if !defined(BOOT_BUILD)
bool is_valid_server(ISC_STATUS* status, const TEXT* server);
@ -389,13 +390,13 @@ ISC_STATUS API_ROUTINE gds__create_database(ISC_STATUS* status_vector,
dpb_length, dpb, db_type);
}
ISC_STATUS API_ROUTINE isc_database_cleanup(ISC_STATUS * status_vector,
ISC_STATUS API_ROUTINE gds__database_cleanup(ISC_STATUS * status_vector,
FRBRD **db_handle,
DatabaseCleanupRoutine *routine, SCHAR * arg)
DatabaseCleanupRoutine *routine, SLONG arg)
{
return gds__database_cleanup(status_vector, (FRBRD **) db_handle,
routine, (SLONG) arg);
return isc_database_cleanup(status_vector, (FRBRD **) db_handle,
routine, (SCHAR*) arg);
}
ISC_STATUS API_ROUTINE gds__database_info(ISC_STATUS* status_vector,
@ -616,12 +617,12 @@ ISC_STATUS API_ROUTINE gds__ddl(ISC_STATUS* status_vector,
return isc_ddl(status_vector, db_handle, tra_handle, ddl_length, ddl);
}
void API_ROUTINE isc_event_counts(
void API_ROUTINE gds__event_counts(
ULONG * result_vector,
SSHORT length,
SCHAR * before, SCHAR * after)
{
gds__event_counts(result_vector, length, before, after);
isc_event_counts(result_vector, length, before, after);
}
SLONG API_ROUTINE isc_free(SCHAR * blk)
@ -637,19 +638,19 @@ SLONG API_ROUTINE isc_ftof(const SCHAR* string1,
return gds__ftof(string1, length1, string2, length2);
}
void API_ROUTINE isc_get_client_version(SCHAR * buffer)
void API_ROUTINE gds__get_client_version(SCHAR * buffer)
{
gds__get_client_version(buffer);
isc_get_client_version(buffer);
}
int API_ROUTINE isc_get_client_major_version()
int API_ROUTINE gds__get_client_major_version()
{
return gds__get_client_major_version();
return isc_get_client_major_version();
}
int API_ROUTINE isc_get_client_minor_version()
int API_ROUTINE gds__get_client_minor_version()
{
return gds__get_client_minor_version();
return isc_get_client_minor_version();
}
ISC_STATUS API_ROUTINE isc_print_blr(const SCHAR* blr,
@ -708,13 +709,14 @@ SLONG API_ROUTINE isc_vax_integer(const SCHAR* input, SSHORT length)
}
#ifndef REQUESTER
ISC_STATUS API_ROUTINE isc_wait_for_event(ISC_STATUS * status_vector,
ISC_STATUS API_ROUTINE gds__event_wait(ISC_STATUS * status_vector,
FRBRD **db_handle,
SSHORT events_length,
SCHAR * events, SCHAR * events_update)
UCHAR * events,
UCHAR * events_update)
{
return gds__event_wait(status_vector, db_handle, events_length,
(UCHAR*) events, (UCHAR*) events_update);
return isc_wait_for_event(status_vector, db_handle, events_length,
(SCHAR*) events, (SCHAR*) events_update);
}
#endif
@ -731,18 +733,18 @@ SLONG API_ROUTINE isc_interprete_cpp(SCHAR* const buffer,
return gds__interprete(buffer, const_cast<ISC_STATUS**>(status_vector_p));
}
int API_ROUTINE isc_version(
int API_ROUTINE gds__version(
FRBRD **db_handle,
void (*callback) (), void *callback_argument)
{
return gds__version(db_handle, callback, callback_argument);
return isc_version(db_handle, callback, callback_argument);
}
void API_ROUTINE isc_set_debug(int flag)
void API_ROUTINE gds__set_debug(int flag)
{
#ifndef SUPERCLIENT
#ifndef REQUESTER
gds__set_debug(flag);
isc_set_debug(flag);
#endif
#endif
}

140
src/jrd/alt_proto.h Normal file
View File

@ -0,0 +1,140 @@
/*
* PROGRAM: JRD Access Method
* MODULE: alt_proto.h
* DESCRIPTION: Alternative entrypoints
*
* 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): Blas Rodriguez Somoza
*
*
*/
#ifndef ALT_PROTO_H
#define ALT_PROTO_H
extern "C" {
//
// gds_ functions using isc_ functions (OK)
//
ISC_STATUS API_ROUTINE_VARARG gds__start_transaction(ISC_STATUS*, FRBRD**,
SSHORT, ...);
ISC_STATUS API_ROUTINE gds__attach_database(ISC_STATUS*, SSHORT, const SCHAR*,
FRBRD**, SSHORT, const SCHAR*);
ISC_STATUS API_ROUTINE gds__blob_info(ISC_STATUS*, FRBRD**, SSHORT, const SCHAR*,
SSHORT, SCHAR*);
ISC_STATUS API_ROUTINE gds__cancel_blob(ISC_STATUS*, FRBRD**);
ISC_STATUS API_ROUTINE gds__cancel_events(ISC_STATUS*, FRBRD**, SLONG*);
ISC_STATUS API_ROUTINE gds__close_blob(ISC_STATUS*, FRBRD**);
ISC_STATUS API_ROUTINE gds__commit_retaining(ISC_STATUS*, FRBRD**);
ISC_STATUS API_ROUTINE gds__commit_transaction(ISC_STATUS*, FRBRD**);
ISC_STATUS API_ROUTINE gds__compile_request(ISC_STATUS*, FRBRD**, FRBRD**,
SSHORT, const SCHAR*);
ISC_STATUS API_ROUTINE gds__compile_request2(ISC_STATUS*, FRBRD**, FRBRD**,
SSHORT, const SCHAR*);
ISC_STATUS API_ROUTINE gds__create_blob(ISC_STATUS*, FRBRD**, FRBRD**, FRBRD**,
GDS_QUAD*);
ISC_STATUS API_ROUTINE gds__create_blob2(ISC_STATUS*, FRBRD**, FRBRD**, FRBRD**,
GDS_QUAD*, SSHORT, const SCHAR*);
ISC_STATUS API_ROUTINE gds__create_database(ISC_STATUS*, SSHORT, const SCHAR*,
FRBRD**, SSHORT, const SCHAR*, SSHORT);
ISC_STATUS API_ROUTINE gds__database_cleanup(ISC_STATUS*, FRBRD**,
DatabaseCleanupRoutine*, SLONG);
ISC_STATUS API_ROUTINE gds__database_info(ISC_STATUS*, FRBRD**, SSHORT, const SCHAR*,
SSHORT, SCHAR*);
ISC_STATUS API_ROUTINE gds__detach_database(ISC_STATUS*, FRBRD**);
void API_ROUTINE gds__event_counts(ULONG*, SSHORT, SCHAR*, SCHAR*);
void API_ROUTINE gds__get_client_version(SCHAR*);
int API_ROUTINE gds__get_client_major_version();
int API_ROUTINE gds__get_client_minor_version();
#ifndef REQUESTER
ISC_STATUS API_ROUTINE gds__event_wait(ISC_STATUS*, FRBRD**, SSHORT,
UCHAR*, UCHAR*);
#endif
ISC_STATUS API_ROUTINE gds__get_segment(ISC_STATUS*, FRBRD**, USHORT*,
USHORT, SCHAR*);
ISC_STATUS API_ROUTINE gds__get_slice(ISC_STATUS*, FRBRD**, FRBRD**, GDS_QUAD*,
SSHORT, SCHAR*, SSHORT, SLONG*, SLONG,
void*, SLONG*);
ISC_STATUS API_ROUTINE gds__open_blob(ISC_STATUS*, FRBRD**, FRBRD**, FRBRD**,
GDS_QUAD*);
ISC_STATUS API_ROUTINE gds__open_blob2(ISC_STATUS*, FRBRD**, FRBRD**, FRBRD**,
GDS_QUAD*, SSHORT, const SCHAR*);
ISC_STATUS API_ROUTINE gds__prepare_transaction(ISC_STATUS*, FRBRD**);
ISC_STATUS API_ROUTINE gds__prepare_transaction2(ISC_STATUS*, FRBRD**, SSHORT,
SCHAR*);
ISC_STATUS API_ROUTINE gds__put_segment(ISC_STATUS*, FRBRD**, USHORT, const SCHAR*);
ISC_STATUS API_ROUTINE gds__put_slice(ISC_STATUS*, FRBRD**, FRBRD**, GDS_QUAD*,
SSHORT, SCHAR*, SSHORT, SLONG*, SLONG, void*);
ISC_STATUS API_ROUTINE gds__que_events(ISC_STATUS*, FRBRD**, SLONG*, SSHORT, SCHAR*,
void(*)(), void*);
ISC_STATUS API_ROUTINE gds__receive(ISC_STATUS*, FRBRD**, SSHORT, SSHORT,
void*, SSHORT);
ISC_STATUS API_ROUTINE gds__reconnect_transaction(ISC_STATUS*, FRBRD**, FRBRD**,
SSHORT, const SCHAR*);
ISC_STATUS API_ROUTINE gds__release_request(ISC_STATUS*, FRBRD**);
ISC_STATUS API_ROUTINE gds__request_info(ISC_STATUS*, FRBRD**, SSHORT, SSHORT,
const SCHAR*, SSHORT, SCHAR*);
ISC_STATUS API_ROUTINE gds__rollback_transaction(ISC_STATUS*, FRBRD**);
ISC_STATUS API_ROUTINE gds__seek_blob(ISC_STATUS*, FRBRD**, SSHORT, SLONG, SLONG*);
ISC_STATUS API_ROUTINE gds__send(ISC_STATUS*, FRBRD**, SSHORT, SSHORT, void*,
SSHORT);
ISC_STATUS API_ROUTINE gds__start_and_send(ISC_STATUS*, FRBRD**, FRBRD**,
SSHORT, SSHORT, void*, SSHORT);
ISC_STATUS API_ROUTINE gds__start_multiple(ISC_STATUS*, FRBRD**, SSHORT, void*);
ISC_STATUS API_ROUTINE gds__start_request(ISC_STATUS*, FRBRD**, FRBRD**, SSHORT);
ISC_STATUS API_ROUTINE gds__transaction_info(ISC_STATUS*, FRBRD**, SSHORT,
const SCHAR*, SSHORT, SCHAR*);
ISC_STATUS API_ROUTINE gds__unwind_request(ISC_STATUS*, FRBRD**, SSHORT);
ISC_STATUS API_ROUTINE gds__ddl(ISC_STATUS*, FRBRD**, FRBRD**, SSHORT, const SCHAR*);
void API_ROUTINE gds__decode_date(const GDS_QUAD*, void*);
void API_ROUTINE gds__encode_date(const void*, GDS_QUAD*);
int API_ROUTINE gds__version(FRBRD**, void(*) (), void*);
void API_ROUTINE gds__set_debug(int);
//
// isc_ functions which are not mapped to gds_ functions (the gds_ ones are in utl.cpp)
// Should analyzed
//
SLONG API_ROUTINE_VARARG isc_event_block(SCHAR**, SCHAR**, USHORT, ...);
USHORT API_ROUTINE isc_event_block_a(SCHAR**, SCHAR**, USHORT, TEXT**);
void API_ROUTINE isc_event_block_s(SCHAR**, SCHAR**, USHORT, TEXT**, USHORT*);
//
// isc functions using gds_ functions (gds_ functions defined in gds.cpp)
//
SLONG API_ROUTINE isc_free(SCHAR*);
SLONG API_ROUTINE isc_ftof(const SCHAR*, const USHORT, SCHAR*, const USHORT);
ISC_STATUS API_ROUTINE isc_print_blr(const SCHAR*, void (*) (), void*, SSHORT);
ISC_STATUS API_ROUTINE isc_print_status(const ISC_STATUS*);
void API_ROUTINE isc_qtoq(const GDS_QUAD*, GDS_QUAD*);
SLONG API_ROUTINE isc_sqlcode(const ISC_STATUS*);
void API_ROUTINE isc_sqlcode_s(const ISC_STATUS*, ULONG*);
void API_ROUTINE isc_vtof(const SCHAR*, SCHAR*, USHORT);
void API_ROUTINE isc_vtov(const SCHAR*, SCHAR*, SSHORT);
SLONG API_ROUTINE isc_vax_integer(const SCHAR*, SSHORT);
SLONG API_ROUTINE isc_interprete(SCHAR*, ISC_STATUS**);
SLONG API_ROUTINE isc_interprete_cpp(SCHAR* const, const ISC_STATUS**);
//
// isc_ functions with no gds_ equivalence
//
int API_ROUTINE isc_add_user(ISC_STATUS*, USER_SEC_DATA*);
int API_ROUTINE isc_delete_user(ISC_STATUS*, USER_SEC_DATA*);
int API_ROUTINE isc_modify_user(ISC_STATUS*, USER_SEC_DATA*);
} // extern "C"
#endif //ALT_PROTO_H

View File

@ -892,11 +892,11 @@ SCHAR ** name_buffer, SSHORT * return_count)
}
void API_ROUTINE gds__event_counts(
ULONG * result_vector,
SSHORT buffer_length,
SCHAR * event_buffer,
SCHAR * result_buffer)
void API_ROUTINE isc_event_counts(
ULONG * result_vector,
SSHORT buffer_length,
SCHAR * event_buffer,
SCHAR * result_buffer)
{
/**************************************
*
@ -954,7 +954,7 @@ SCHAR * result_buffer)
}
void API_ROUTINE gds__get_client_version(SCHAR *buffer)
void API_ROUTINE isc_get_client_version(SCHAR *buffer)
{
/**************************************
*
@ -971,7 +971,7 @@ void API_ROUTINE gds__get_client_version(SCHAR *buffer)
}
int API_ROUTINE gds__get_client_major_version()
int API_ROUTINE isc_get_client_major_version()
{
/**************************************
*
@ -987,7 +987,7 @@ int API_ROUTINE gds__get_client_major_version()
}
int API_ROUTINE gds__get_client_minor_version()
int API_ROUTINE isc_get_client_minor_version()
{
/**************************************
*
@ -1034,7 +1034,7 @@ void API_ROUTINE gds__map_blobs(int *handle1, int *handle2)
#if !(defined REQUESTER)
void API_ROUTINE gds__set_debug(int value)
void API_ROUTINE isc_set_debug(int value)
{
/**************************************
*
@ -1225,7 +1225,7 @@ void API_ROUTINE isc_set_single_user(const UCHAR** dpb,
}
int API_ROUTINE gds__version(FRBRD** handle,
int API_ROUTINE isc_version(FRBRD** handle,
FPTR_VOID routine, void* user_arg)
{
/**************************************

View File

@ -45,16 +45,16 @@ USHORT API_ROUTINE gds__event_block_a(SCHAR **, SCHAR **, SSHORT,
SCHAR **);
void API_ROUTINE gds__event_block_s(SCHAR **, SCHAR **, SSHORT,
SCHAR **, SSHORT *);
void API_ROUTINE gds__event_counts(ULONG *, SSHORT, SCHAR *, SCHAR *);
void API_ROUTINE gds__get_client_version(SCHAR *);
int API_ROUTINE gds__get_client_major_version();
int API_ROUTINE gds__get_client_minor_version();
void API_ROUTINE isc_event_counts(ULONG *, SSHORT, SCHAR *, SCHAR *);
void API_ROUTINE isc_get_client_version(SCHAR *);
int API_ROUTINE isc_get_client_major_version();
int API_ROUTINE isc_get_client_minor_version();
void API_ROUTINE gds__map_blobs(int*, int*);
void API_ROUTINE gds__set_debug(int);
void API_ROUTINE isc_set_debug(int);
void API_ROUTINE isc_set_login(const UCHAR**, SSHORT*);
BOOLEAN API_ROUTINE isc_set_path(TEXT*, USHORT, TEXT*);
void API_ROUTINE isc_set_single_user(const UCHAR**, SSHORT*, const TEXT*);
int API_ROUTINE gds__version(FRBRD **, FPTR_VOID, void *);
int API_ROUTINE isc_version(FRBRD **, FPTR_VOID, void *);
void API_ROUTINE isc_format_implementation(USHORT, USHORT, TEXT *,
USHORT, USHORT, TEXT *);
U_IPTR API_ROUTINE isc_baddress(SCHAR *);

View File

@ -42,7 +42,7 @@
*
*/
/*
$Id: why.cpp,v 1.37 2003-11-08 16:40:16 brodsom Exp $
$Id: why.cpp,v 1.38 2003-11-09 15:38:31 brodsom Exp $
*/
#include "firebird.h"
@ -323,7 +323,7 @@ static const TEXT glbunknown[10] = "<unknown>";
#define GDS_DDL isc_ddl
#define GDS_DETACH isc_detach_database
#define GDS_DROP_DATABASE isc_drop_database
#define GDS_EVENT_WAIT gds__event_wait
//#define GDS_EVENT_WAIT gds__event_wait
#define GDS_GET_SEGMENT isc_get_segment
#define GDS_GET_SLICE isc_get_slice
#define GDS_OPEN_BLOB isc_open_blob
@ -1457,10 +1457,10 @@ ISC_STATUS API_ROUTINE GDS_CREATE_DATABASE(ISC_STATUS* user_status,
}
ISC_STATUS API_ROUTINE gds__database_cleanup(ISC_STATUS * user_status,
ISC_STATUS API_ROUTINE isc_database_cleanup(ISC_STATUS * user_status,
WHY_ATT * handle,
DatabaseCleanupRoutine * routine,
SLONG arg)
SCHAR* arg)
{
/**************************************
*
@ -1491,7 +1491,7 @@ ISC_STATUS API_ROUTINE gds__database_cleanup(ISC_STATUS * user_status,
clean->clean_next = database->cleanup;
database->cleanup = clean;
clean->DatabaseRoutine = routine;
clean->clean_arg = arg;
clean->clean_arg = (SLONG) arg;
status[0] = gds_arg_gds;
status[1] = 0;
@ -3447,11 +3447,11 @@ int API_ROUTINE gds__enable_subsystem(TEXT * subsystem)
#ifndef REQUESTER
ISC_STATUS API_ROUTINE GDS_EVENT_WAIT(ISC_STATUS * user_status,
ISC_STATUS API_ROUTINE isc_wait_for_event(ISC_STATUS * user_status,
WHY_ATT * handle,
USHORT length,
UCHAR * events,
UCHAR * buffer)
SCHAR * events,
SCHAR * buffer)
{
/**************************************
*
@ -3479,7 +3479,7 @@ ISC_STATUS API_ROUTINE GDS_EVENT_WAIT(ISC_STATUS * user_status,
value = ISC_event_clear(why_event);
if (GDS_QUE_EVENTS
(status, handle, &id, length, events, event_ast, buffer))
(status, handle, &id, length, (UCHAR*) events, event_ast, (UCHAR*) buffer))
{
return error2(status, local);
}

View File

@ -240,6 +240,11 @@ ISC_STATUS API_ROUTINE isc_transaction_info(ISC_STATUS*, FRBRD**, SSHORT,
const SCHAR*, SSHORT, UCHAR*);
ISC_STATUS API_ROUTINE isc_unwind_request(ISC_STATUS*, FRBRD**, SSHORT);
#ifndef REQUESTER
ISC_STATUS API_ROUTINE isc_wait_for_event(ISC_STATUS*, FRBRD**, USHORT, SCHAR*,
SCHAR*);
#endif
#endif
typedef void DatabaseCleanupRoutine(FRBRD**, SLONG);
@ -251,16 +256,11 @@ typedef void DatabaseCleanupRoutine(FRBRD**, SLONG);
ISC_STATUS API_ROUTINE gds__cancel_operation(ISC_STATUS*, FRBRD**, USHORT);
#endif
ISC_STATUS API_ROUTINE gds__database_cleanup(ISC_STATUS*, FRBRD**,
DatabaseCleanupRoutine*, SLONG);
ISC_STATUS API_ROUTINE isc_database_cleanup(ISC_STATUS*, FRBRD**,
DatabaseCleanupRoutine*, SCHAR*);
int API_ROUTINE gds__disable_subsystem(TEXT*);
int API_ROUTINE gds__enable_subsystem(TEXT*);
#ifndef REQUESTER
ISC_STATUS API_ROUTINE gds__event_wait(ISC_STATUS*, FRBRD**, USHORT, UCHAR*,
UCHAR*);
#endif
ISC_STATUS gds__handle_cleanup(ISC_STATUS*, FRBRD**);
typedef void TransactionCleanupRoutine(FRBRD*, SLONG);
ISC_STATUS API_ROUTINE gds__transaction_cleanup(ISC_STATUS*, FRBRD**,