mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 00:43:03 +01:00
Remove PIPE and STACK defines (PIPE_SERVER, PIPE_CLIENT, PIPE_LIBRARY, PIPE_SERVER_YVALUE, PIPE_BRIDGE_TO_V3, V3, V3_PATH, ALTPIPE)(STACK_EFFICIENT, STACK_REDUCTION)
This commit is contained in:
parent
cc622ae143
commit
3cb91fce80
697
src/csv/csi.cpp
697
src/csv/csi.cpp
@ -33,23 +33,6 @@
|
||||
#include "../jrd/gds_proto.h"
|
||||
#include "../remote/merge_proto.h"
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
#include descrip
|
||||
#include libdef
|
||||
#include ssdef
|
||||
#include jpidef
|
||||
#include pqldef
|
||||
#include "../jrd/lnmdef.h"
|
||||
|
||||
#ifndef ORACLE_ALT
|
||||
#define GDS_PIPE "[sysexe]gds_pipe_orcl.exe"
|
||||
#else
|
||||
#define GDS_PIPE "[sysexe]gds_pipe_orcl_alt.exe"
|
||||
#endif
|
||||
#endif
|
||||
#endif // PIPE_SERVER
|
||||
|
||||
#define ALLOC(type, length) CSS_alloc_local (type, length)
|
||||
#define FREE(block) CSS_free_local (block)
|
||||
|
||||
@ -60,33 +43,6 @@
|
||||
static RDB CSI_databases, CSI_free_servers;
|
||||
static TEXT error_buffer[1024];
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
/* Define logical names that sub-process should inherit */
|
||||
|
||||
static SCHAR *inherit_logicals[] = {
|
||||
"SYS$LOGIN",
|
||||
"SYS$SCRATCH",
|
||||
"SYS$NODE",
|
||||
"SYS$INTERBASE",
|
||||
0
|
||||
};
|
||||
|
||||
typedef struct itm {
|
||||
SSHORT itm_length;
|
||||
SSHORT itm_code;
|
||||
SCHAR *itm_buffer;
|
||||
SSHORT *itm_return_length;
|
||||
} ITM;
|
||||
|
||||
typedef struct itmq {
|
||||
SCHAR itmq_code;
|
||||
SLONG itmq_value;
|
||||
} ITMQ;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef MULTI_THREAD
|
||||
static void event_handler(PTR);
|
||||
#else
|
||||
@ -111,13 +67,6 @@ static void release_request(RRQ);
|
||||
static void release_sql_request(RSR);
|
||||
static void release_transaction(RTR);
|
||||
static STATUS send_blob(STATUS *, RBL, USHORT, UCHAR *);
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
static void setup_creprc_info(SLONG **, ITMQ **, SLONG *);
|
||||
static int spawn(STATUS *, UCHAR *, PTR *);
|
||||
static void trans_logicals(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define CHECK_HANDLE(blk, type, error) if (!blk || ((BLK) blk)->blk_type != (SCHAR) type) \
|
||||
return handle_error (user_status, error)
|
||||
@ -133,7 +82,6 @@ typedef struct teb {
|
||||
} TEB;
|
||||
|
||||
|
||||
#ifndef PIPE_SERVER
|
||||
#define GDS_ATTACH_DATABASE CSI_attach_database
|
||||
#define GDS_BLOB_INFO CSI_blob_info
|
||||
#define GDS_CANCEL_BLOB CSI_cancel_blob
|
||||
@ -181,58 +129,6 @@ typedef struct teb {
|
||||
#define GDS_DSQL_PREPARE CSI_prepare
|
||||
#define GDS_DSQL_SET_CURSOR CSI_set_cursor_name
|
||||
#define GDS_DSQL_SQL_INFO CSI_sql_info
|
||||
#else
|
||||
#define GDS_ATTACH_DATABASE PSI_attach_database
|
||||
#define GDS_BLOB_INFO PSI_blob_info
|
||||
#define GDS_CANCEL_BLOB PSI_cancel_blob
|
||||
#define GDS_CLOSE_BLOB PSI_close_blob
|
||||
#define GDS_COMMIT PSI_commit_transaction
|
||||
#define GDS_COMMIT_RETAINING PSI_commit_retaining
|
||||
#define GDS_COMPILE PSI_compile_request
|
||||
#define GDS_CREATE_BLOB PSI_create_blob
|
||||
#define GDS_CREATE_BLOB2 PSI_create_blob2
|
||||
#define GDS_CREATE_DATABASE PSI_create_database
|
||||
#define GDS_DATABASE_INFO PSI_database_info
|
||||
#define GDS_DDL PSI_ddl
|
||||
#define GDS_DETACH PSI_detach_database
|
||||
#define GDS_DROP_DATABASE PSI_drop_database
|
||||
#define GDS_GET_SEGMENT PSI_get_segment
|
||||
#define GDS_GET_SLICE PSI_get_slice
|
||||
#define GDS_OPEN_BLOB PSI_open_blob
|
||||
#define GDS_OPEN_BLOB2 PSI_open_blob2
|
||||
#define GDS_PREPARE PSI_prepare_transaction
|
||||
#define GDS_PUT_SEGMENT PSI_put_segment
|
||||
#define GDS_PUT_SLICE PSI_put_slice
|
||||
#define GDS_RECEIVE PSI_receive
|
||||
#define GDS_RECONNECT PSI_reconnect_transaction
|
||||
#define GDS_RELEASE_REQUEST PSI_release_request
|
||||
#define GDS_REQUEST_INFO PSI_request_info
|
||||
#define GDS_ROLLBACK PSI_rollback_transaction
|
||||
#define GDS_SEND PSI_send
|
||||
#define GDS_SEEK_BLOB PSI_seek_blob
|
||||
#define GDS_START_AND_SEND PSI_start_and_send
|
||||
#define GDS_START PSI_start_request
|
||||
#define GDS_START_MULTIPLE PSI_start_multiple
|
||||
#define GDS_START_TRANSACTION PSI_start_transaction
|
||||
#define GDS_TRANSACT_REQUEST PSI_transact_request
|
||||
#define GDS_TRANSACTION_INFO PSI_transaction_info
|
||||
#define GDS_UNWIND PSI_unwind_request
|
||||
#define GDS_QUE_EVENTS PSI_que_events
|
||||
#define GDS_CANCEL_EVENTS PSI_cancel_events
|
||||
|
||||
#define GDS_DSQL_ALLOCATE PSI_allocate_statement
|
||||
#define GDS_DSQL_EXECUTE PSI_execute
|
||||
#define GDS_DSQL_EXECUTE2 PSI_execute2
|
||||
#define GDS_DSQL_EXECUTE_IMMED PSI_execute_immediate
|
||||
#define GDS_DSQL_EXECUTE_IMMED2 PSI_execute_immediate2
|
||||
#define GDS_DSQL_FETCH PSI_fetch
|
||||
#define GDS_DSQL_FREE PSI_free_statement
|
||||
#define GDS_DSQL_INSERT PSI_insert
|
||||
#define GDS_DSQL_PREPARE PSI_prepare
|
||||
#define GDS_DSQL_SET_CURSOR PSI_set_cursor_name
|
||||
#define GDS_DSQL_SQL_INFO PSI_sql_info
|
||||
#endif
|
||||
|
||||
|
||||
STATUS GDS_ATTACH_DATABASE(
|
||||
STATUS * user_status,
|
||||
@ -549,29 +445,6 @@ STATUS GDS_CREATE_BLOB2(STATUS * user_status,
|
||||
return user_status[1];
|
||||
}
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
STATUS GDS_CREATE_BLOB(STATUS * user_status,
|
||||
RDB * db_handle,
|
||||
RTR * rtr_handle, RBL * blob_handle, BID blob_id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* g d s _ c r e a t e _ b l o b
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Open an existing blob.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return GDS_CREATE_BLOB2(user_status, db_handle, rtr_handle, blob_handle,
|
||||
blob_id, 0, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
STATUS GDS_CREATE_DATABASE(STATUS * user_status,
|
||||
SSHORT file_length,
|
||||
SCHAR * file_name,
|
||||
@ -630,11 +503,7 @@ STATUS GDS_DATABASE_INFO(STATUS * user_status,
|
||||
return user_status[1];
|
||||
|
||||
MERGE_database_info(temp, buffer, buffer_length,
|
||||
#ifndef PIPE_SERVER
|
||||
IMPLEMENTATION, 9, 1, GDS_VERSION, "", 0);
|
||||
#else
|
||||
IMPLEMENTATION, 7, 1, GDS_VERSION, "", 0);
|
||||
#endif
|
||||
|
||||
return user_status[1];
|
||||
}
|
||||
@ -1631,28 +1500,6 @@ STATUS GDS_OPEN_BLOB2(STATUS * user_status,
|
||||
}
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
STATUS GDS_OPEN_BLOB(STATUS * user_status,
|
||||
RDB * db_handle,
|
||||
RTR * rtr_handle, RBL * blob_handle, BID blob_id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* g d s _ o p e n _ b l o b
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Open an existing blob.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
return GDS_OPEN_BLOB2(user_status, db_handle, rtr_handle, blob_handle,
|
||||
blob_id, 0, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
STATUS GDS_PREPARE(STATUS * user_status,
|
||||
RTR * rtr_handle, USHORT buffer_length, UCHAR * buffer)
|
||||
{
|
||||
@ -2496,7 +2343,6 @@ USHORT item_length, UCHAR * items, USHORT buffer_length, UCHAR * buffer)
|
||||
}
|
||||
|
||||
|
||||
#ifndef PIPE_SERVER
|
||||
static RDB init(
|
||||
STATUS * user_status,
|
||||
MSG_T type,
|
||||
@ -2598,252 +2444,6 @@ USHORT client_flags, TEXT * buffer, USHORT * buffer_length)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
static RDB init(
|
||||
STATUS * user_status,
|
||||
MSG_T type,
|
||||
UCHAR * file_name,
|
||||
USHORT file_length,
|
||||
UCHAR * dpb,
|
||||
USHORT dpb_length,
|
||||
TEXT * expanded_filename,
|
||||
USHORT server_flags,
|
||||
USHORT client_flags, TEXT * buffer, USHORT * buffer_length)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* i n i t ( p i p e _ s e r v e r )
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Initialize for database access. First call from both CREATE and
|
||||
* OPEN.
|
||||
*
|
||||
**************************************/
|
||||
MSG_ATT message;
|
||||
MSG_RESP response;
|
||||
RDB rdb;
|
||||
SRQ *que;
|
||||
PRB process;
|
||||
PTR connection, client;
|
||||
CSH CSS_header;
|
||||
HANDLE handle;
|
||||
USHORT expanded_length, length;
|
||||
TEXT local_expanded[256], pipe_xl[64], version[16], var_name[16];
|
||||
SLONG status, len, itemnums[4], items[4], isc_level, var_type;
|
||||
STATUS local_status[ISC_STATUS_LENGTH];
|
||||
|
||||
/* Assume that we don't want a PIPE. */
|
||||
|
||||
user_status[0] = gds_arg_gds;
|
||||
user_status[1] = gds__unavailable;
|
||||
user_status[2] = 0;
|
||||
|
||||
/* If the user has explicitly asked for a local attachment, skip the pipe */
|
||||
|
||||
if (!
|
||||
(length =
|
||||
strncmp(expanded_filename, AM_SENTINEL, sizeof(AM_SENTINEL) - 1))
|
||||
|| !CSS_init(local_status, FALSE, 0)) {
|
||||
if (!length) {
|
||||
/* Re-expand the filename, minus the sentinel */
|
||||
|
||||
strcpy(local_expanded,
|
||||
expanded_filename + sizeof(AM_SENTINEL) - 1);
|
||||
ISC_expand_filename(local_expanded, strlen(local_expanded),
|
||||
expanded_filename);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* See if the user explicitly requested a pipe attachment! */
|
||||
|
||||
if (!strncmp(expanded_filename, PIPE_SENTINEL, sizeof(PIPE_SENTINEL) - 1)) {
|
||||
/* Re-expand the filename, minus the sentinel */
|
||||
|
||||
expanded_filename += sizeof(PIPE_SENTINEL) - 1;
|
||||
ISC_expand_filename(expanded_filename, strlen(expanded_filename),
|
||||
local_expanded);
|
||||
expanded_filename = local_expanded;
|
||||
}
|
||||
else {
|
||||
/* Don't use a pipe for non-interactive attachments */
|
||||
|
||||
HPCIGETVAR("HPINTERACTIVE", &status, VAR_BOOL_VALUE, &isc_level,
|
||||
VAR_TYPE, &var_type);
|
||||
if (!status && var_type == VAR_BOOL_VALUE && isc_level == 0)
|
||||
return NULL;
|
||||
|
||||
/* Also don't use a pipe when variable ISC_LOCAL[ISC_UDCLVL] is true */
|
||||
|
||||
HPCIGETVAR("ISC_UDCLVL", &status, VAR_INT_VALUE, &isc_level, VAR_TYPE,
|
||||
&var_type);
|
||||
if (!status && var_type == VAR_INT_VALUE) {
|
||||
sprintf(var_name, "ISC_LOCAL%d", isc_level);
|
||||
HPCIGETVAR(var_name, &status, VAR_BOOL_VALUE, &isc_level,
|
||||
VAR_TYPE, &var_type);
|
||||
if (!status && var_type == VAR_BOOL_VALUE && isc_level == 1)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!file_length)
|
||||
file_length = strlen(file_name);
|
||||
|
||||
expanded_length = strlen(expanded_filename);
|
||||
client_flags |= PRB_client;
|
||||
client = CSS_create_process(client_flags);
|
||||
|
||||
/* Check to see if child process has already been created.
|
||||
If so, make sure it is still alive. */
|
||||
|
||||
if (child_pin) {
|
||||
GETPROCINFO(child_pin);
|
||||
if (ccode() != CCE)
|
||||
child_pin = 0;
|
||||
}
|
||||
|
||||
/* Create a child process if one doesn't yet exist. */
|
||||
|
||||
if (child_pin)
|
||||
connection = CSS_connect(pipe_server);
|
||||
else {
|
||||
/* Create a program fid and an XL fid for the CREATEPROCESS call */
|
||||
|
||||
version[0] = 0;
|
||||
HPCIGETVAR("ISC_UDCLVL", &status, VAR_INT_VALUE, &isc_level, VAR_TYPE,
|
||||
&var_type);
|
||||
if (!status && var_type == VAR_INT_VALUE) {
|
||||
sprintf(var_name, "ISC_VERS%d", isc_level);
|
||||
HPCIGETVAR(var_name, &status, VAR_STR_VALUE, version, VAR_LENGTH,
|
||||
&len);
|
||||
if (!status && len)
|
||||
version[len] = 0;
|
||||
}
|
||||
|
||||
sprintf(pipe_program, GDS_PIPE, version);
|
||||
|
||||
HPMYFILE(pipe_xl, &status, &len);
|
||||
if (!status && len
|
||||
&& !strncmp(pipe_xl, " GDSLIB.", sizeof(" GDSLIB.") - 1))
|
||||
pipe_xl[len - 1] = 0;
|
||||
else
|
||||
pipe_xl[0] = pipe_xl[1] = 0;
|
||||
|
||||
/* Create an item list for CREATEPROCESS. The XL items must be at the
|
||||
end because if we can't lookup the XL name we don't pass one in. */
|
||||
|
||||
itemnums[0] = CP_ACT;
|
||||
items[0] = 0;
|
||||
itemnums[1] = pipe_xl[0] ? CP_XL : ITM_END;
|
||||
items[1] = (SLONG) & pipe_xl[1];
|
||||
itemnums[2] = CP_XLLEN;
|
||||
items[2] = strlen(items[1]);
|
||||
itemnums[3] = ITM_END;
|
||||
|
||||
CREATEPROCESS(&status, &child_pin, pipe_program, itemnums, items);
|
||||
if (ccode() == CCL) {
|
||||
*user_status++ = gds_arg_gds;
|
||||
*user_status++ = gds__sys_request;
|
||||
*user_status++ = gds_arg_string;
|
||||
*user_status++ = (STATUS) "CREATEPROCESS";
|
||||
*user_status++ = gds_arg_string;
|
||||
*user_status++ = (STATUS) pipe_program;
|
||||
*user_status = gds_arg_end;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gds__register_cleanup(exit_handler, 0);
|
||||
|
||||
/* Wait for a message from our dear child. */
|
||||
|
||||
while (!(response = CSS_get_message((SLONG) 0, 0, 10))) {
|
||||
GETPROCINFO(child_pin);
|
||||
if (ccode() != CCE) {
|
||||
child_pin = 0;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
connection = response->msg_resp_header.msg_connection;
|
||||
CSS_free_global(response);
|
||||
|
||||
/* Search for the child process. */
|
||||
|
||||
CSS_header = ACQUIRE;
|
||||
pipe_server = 0;
|
||||
pipe_util_cnct = 0;
|
||||
|
||||
QUE_LOOP(CSS_header->csh_processes, que) {
|
||||
process = (PRB) ((UCHAR *) que - OFFSET(PRB, prb_processes));
|
||||
if (client != REL_PTR(process) &&
|
||||
process->prb_protocol_version == CSI_PROTOCOL_VERSION &&
|
||||
process->prb_process_id == child_pin) {
|
||||
pipe_server = REL_PTR(process);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
RELEASE;
|
||||
}
|
||||
|
||||
/* We've got a candidate server. Now go back and talk to it. */
|
||||
|
||||
if (pipe_server) {
|
||||
length =
|
||||
sizeof(struct msg_att) + file_length + expanded_length +
|
||||
dpb_length;
|
||||
message = (MSG_ATT) CSS_alloc_message(type_msg, (int) length);
|
||||
message->msg_att_header.msg_type = type;
|
||||
message->msg_att_dpb_length = dpb_length;
|
||||
message->msg_att_file_length = file_length;
|
||||
message->msg_att_expanded_length = expanded_length;
|
||||
MOVE(file_name, message->msg_att_data, file_length);
|
||||
MOVE(expanded_filename, message->msg_att_data + file_length,
|
||||
expanded_length);
|
||||
MOVE(dpb, message->msg_att_data + file_length + expanded_length,
|
||||
dpb_length);
|
||||
if (CSS_put_message(connection, message, 0)
|
||||
&& (response = CSS_get_message(connection, 0, 0))
|
||||
&& !process_response(response, user_status, &handle, 0, 0, 0)) {
|
||||
rdb = (RDB) ALLOC(type_rdb, sizeof(struct rdb));
|
||||
rdb->rdb_handle = handle;
|
||||
rdb->rdb_connection = connection;
|
||||
rdb->rdb_server = pipe_server;
|
||||
|
||||
/* At all times, keep a utility connection open to the pipe server.
|
||||
This is for the sake of efficiency. It will force the port to
|
||||
remain open. */
|
||||
|
||||
if (!pipe_util_cnct) {
|
||||
pipe_util_cnct = CSS_connect(pipe_server);
|
||||
message =
|
||||
(MSG_ATT) CSS_alloc_message(type_msg,
|
||||
sizeof(struct msg_util));
|
||||
((MSG_UTIL) message)->msg_util_header.msg_type = MSG_util_cmd;
|
||||
((MSG_UTIL) message)->msg_util_cmd = UTIL_noop;
|
||||
if (CSS_put_message(pipe_util_cnct, message, 0) &&
|
||||
(response = CSS_get_message(pipe_util_cnct, 0, 0)))
|
||||
CSS_free_global(response);
|
||||
else {
|
||||
CSS_disconnect(pipe_util_cnct);
|
||||
pipe_util_cnct = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return rdb;
|
||||
}
|
||||
CSS_disconnect(connection);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static RTR make_transaction( RDB rdb, HANDLE handle)
|
||||
{
|
||||
@ -2937,11 +2537,7 @@ USHORT buffer_length, UCHAR * buffer, USHORT * return_length)
|
||||
*status++ = gds_arg_gds;
|
||||
*status++ = gds__random;
|
||||
*status++ = gds_arg_string;
|
||||
#ifndef PIPE_SERVER
|
||||
*status++ = (STATUS) "connection lost to central server";
|
||||
#else
|
||||
*status++ = (STATUS) "connection lost to pipe server";
|
||||
#endif
|
||||
*status = gds_arg_end;
|
||||
return user_status[1];
|
||||
}
|
||||
@ -3162,296 +2758,3 @@ static STATUS send_blob(
|
||||
|
||||
return get_response(blob->rbl_rdb, message, user_status, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
static void setup_creprc_info(
|
||||
SLONG ** privileges,
|
||||
ITMQ ** quotas, SLONG * priority)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* s e t u p _ c r e p r c _ i n f o
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Get the information relating to process quotas and
|
||||
* privileges that is useful when creating a sub-process.
|
||||
*
|
||||
**************************************/
|
||||
ITM items[16];
|
||||
SLONG values[16];
|
||||
SSHORT lengths[16];
|
||||
ITMQ *quota;
|
||||
int i;
|
||||
|
||||
for (i = FB_NELEM(items); i--;) {
|
||||
items[i].itm_length = sizeof(SLONG);
|
||||
items[i].itm_buffer = &values[i];
|
||||
items[i].itm_return_length = &lengths[i];
|
||||
}
|
||||
items[10].itm_buffer = priority;
|
||||
items[11].itm_length = sizeof(SLONG) * 2;
|
||||
items[11].itm_buffer = *privileges;
|
||||
|
||||
items[0].itm_code = JPI$_ASTLM;
|
||||
items[1].itm_code = JPI$_BIOLM;
|
||||
items[2].itm_code = JPI$_BYTLM;
|
||||
items[3].itm_code = JPI$_CPULIM;
|
||||
items[4].itm_code = JPI$_DIOLM;
|
||||
items[5].itm_code = JPI$_ENQLM;
|
||||
items[6].itm_code = JPI$_DFWSCNT;
|
||||
items[7].itm_code = JPI$_FILLM;
|
||||
items[8].itm_code = JPI$_PGFLQUOTA;
|
||||
items[9].itm_code = JPI$_PRCLM;
|
||||
items[10].itm_code = JPI$_PRIB;
|
||||
items[11].itm_code = JPI$_PROCPRIV;
|
||||
items[12].itm_code = JPI$_TQLM;
|
||||
items[13].itm_code = JPI$_WSQUOTA;
|
||||
items[14].itm_code = JPI$_WSAUTHEXT;
|
||||
|
||||
items[15].itm_code = 0;
|
||||
items[15].itm_length = 0;
|
||||
|
||||
if (sys$getjpiw(NULL, NULL, NULL, items, NULL, NULL, NULL) & 1) {
|
||||
for (quota = *quotas, i = FB_NELEM(items); i--;)
|
||||
if (lengths[i]) {
|
||||
switch (items[i].itm_code) {
|
||||
case JPI$_ASTLM:
|
||||
quota->itmq_code = PQL$_ASTLM;
|
||||
break;
|
||||
|
||||
case JPI$_BIOLM:
|
||||
quota->itmq_code = PQL$_BIOLM;
|
||||
break;
|
||||
|
||||
case JPI$_BYTLM:
|
||||
quota->itmq_code = PQL$_BYTLM;
|
||||
break;
|
||||
|
||||
case JPI$_CPULIM:
|
||||
quota->itmq_code = PQL$_CPULM;
|
||||
break;
|
||||
|
||||
case JPI$_DIOLM:
|
||||
quota->itmq_code = PQL$_DIOLM;
|
||||
break;
|
||||
|
||||
case JPI$_ENQLM:
|
||||
quota->itmq_code = PQL$_ENQLM;
|
||||
break;
|
||||
|
||||
case JPI$_DFWSCNT:
|
||||
quota->itmq_code = PQL$_FILLM;
|
||||
break;
|
||||
|
||||
case JPI$_FILLM:
|
||||
quota->itmq_code = PQL$_PGFLQUOTA;
|
||||
break;
|
||||
|
||||
case JPI$_PGFLQUOTA:
|
||||
quota->itmq_code = PQL$_PRCLM;
|
||||
break;
|
||||
|
||||
case JPI$_PRCLM:
|
||||
quota->itmq_code = PQL$_TQELM;
|
||||
break;
|
||||
|
||||
case JPI$_TQLM:
|
||||
quota->itmq_code = PQL$_WSDEFAULT;
|
||||
break;
|
||||
|
||||
case JPI$_WSQUOTA:
|
||||
quota->itmq_code = PQL$_WSEXTENT;
|
||||
break;
|
||||
|
||||
case JPI$_WSAUTHEXT:
|
||||
quota->itmq_code = PQL$_WSQUOTA;
|
||||
break;
|
||||
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
|
||||
(quota++)->itmq_value =
|
||||
(lengths[i] == 4) ? values[i] : (SSHORT) (values[i]);
|
||||
}
|
||||
else {
|
||||
if (items[i].itm_code == JPI$_PRIB)
|
||||
*priority = 4;
|
||||
else if (items[i].itm_code == JPI$_PROCPRIV)
|
||||
*privileges = NULL;
|
||||
}
|
||||
|
||||
quota->itmq_code = PQL$_LISTEND;
|
||||
}
|
||||
else {
|
||||
*privileges = NULL;
|
||||
*quotas = NULL;
|
||||
*priority = 4;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
static int spawn( STATUS * user_status, UCHAR * gbl_file, PTR * connection)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* s p a w n
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Spawn a sub-process using SYS$CREPRC. Return > 0 if a
|
||||
* process was created, -1 if create process failed. Also
|
||||
* return a pointer to the created process's connection block.
|
||||
*
|
||||
**************************************/
|
||||
UCHAR output[128], error[128], *p, *q, process_name[16],
|
||||
pipe_temp[MAXPATHLEN], pipe_file[MAXPATHLEN];
|
||||
USHORT i, len;
|
||||
ULONG status, pid, flags, item;
|
||||
SLONG *privileges, procpriv[2], priority;
|
||||
ITMQ quota_list[14], *quotas;
|
||||
MSG_RESP response;
|
||||
struct dsc$descriptor_s desc1, desc2, desc3, desc4;
|
||||
|
||||
privileges = procpriv;
|
||||
quotas = quota_list;
|
||||
setup_creprc_info(&privileges, "as, &priority);
|
||||
|
||||
/* Tell the sub-process about the values of some important logical names. */
|
||||
|
||||
trans_logicals();
|
||||
|
||||
gds__prefix(pipe_temp, GDS_PIPE);
|
||||
for (p = pipe_temp, q = p - 1; *p; p++)
|
||||
if (*p == ':')
|
||||
q = p;
|
||||
if (q < pipe_temp)
|
||||
strcpy(pipe_file, pipe_temp);
|
||||
else {
|
||||
len = ISC_expand_logical(pipe_temp, q - pipe_temp, pipe_file);
|
||||
if (pipe_file[len - 1] != ']')
|
||||
pipe_file[len++] = ':';
|
||||
strcpy(&pipe_file[len], q + 1);
|
||||
}
|
||||
|
||||
q = error - 1;
|
||||
if (ISC_expand_logical_once("SYS$LOGIN", sizeof("SYS$LOGIN") - 1, error)) {
|
||||
for (p = error; *p; p++)
|
||||
if (*p == ':' || *p == ']')
|
||||
q = p;
|
||||
if (q < error)
|
||||
*(q = p) = ':';
|
||||
}
|
||||
for (p = "GDS_PIPE.ERR"; *++q = *p++;);
|
||||
len = q - error;
|
||||
|
||||
strcpy(output, error);
|
||||
strcpy(&output[len - 3], "OUT");
|
||||
|
||||
ISC_make_desc(pipe_file, &desc1, 0);
|
||||
ISC_make_desc(output, &desc2, len);
|
||||
ISC_make_desc(error, &desc3, len);
|
||||
i = 0;
|
||||
do {
|
||||
/* Loop until the sub-process is given a unique process name */
|
||||
|
||||
sprintf(process_name, "%s_%02x", gbl_file, i++);
|
||||
ISC_make_desc(process_name, &desc4, 0);
|
||||
status = sys$creprc(&pid, /* pidadr */
|
||||
&desc1, /* image */
|
||||
NULL, /* input */
|
||||
&desc2, /* output */
|
||||
&desc3, /* error */
|
||||
privileges, /* prvadr */
|
||||
quotas, /* quota */
|
||||
&desc4, /* prcnam */
|
||||
priority, /* baspri */
|
||||
NULL, NULL, NULL);
|
||||
} while (status == SS$_DUPLNAM);
|
||||
|
||||
if (!(status & 1)) {
|
||||
/* We failed. Fill in the status vector. */
|
||||
|
||||
*user_status++ = gds_arg_gds;
|
||||
*user_status++ = gds__sys_request;
|
||||
*user_status++ = gds_arg_string;
|
||||
*user_status++ = (STATUS) "sys$creprc";
|
||||
*user_status++ = gds_arg_vms;
|
||||
*user_status++ = status;
|
||||
*user_status = gds_arg_end;
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (!(response = CSS_get_message((SLONG) 0, 0, 10))) {
|
||||
item = JPI$_PID;
|
||||
if (lib$getjpi(&item, &pid, NULL, NULL, NULL, NULL) != SS$_NORMAL)
|
||||
return -1;
|
||||
}
|
||||
|
||||
*connection = response->msg_resp_header.msg_connection;
|
||||
CSS_free_global(response);
|
||||
|
||||
return pid;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
static void trans_logicals(void)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* t r a n s _ l o g i c a l s
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Translate some logicals and write their values
|
||||
* to the job logical table.
|
||||
*
|
||||
**************************************/
|
||||
UCHAR **logicals, value[256], job_logical[32], buffer[256];
|
||||
int attr;
|
||||
SSHORT len;
|
||||
ITM items[2];
|
||||
struct dsc$descriptor_s tab_desc, log_desc;
|
||||
|
||||
for (logicals = inherit_logicals; *logicals; logicals++) {
|
||||
items[0].itm_code = LNM$_STRING;
|
||||
items[0].itm_buffer = value;
|
||||
items[0].itm_length = sizeof(value);
|
||||
items[0].itm_return_length = &len;
|
||||
items[1].itm_length = 0;
|
||||
items[1].itm_code = 0;
|
||||
|
||||
attr = LNM$M_CASE_BLIND;
|
||||
|
||||
ISC_make_desc(*logicals, &log_desc, 0);
|
||||
ISC_make_desc("LNM$PROCESS", &tab_desc, sizeof("LNM$PROCESS") - 1);
|
||||
if (!(sys$trnlnm(&attr, &tab_desc, &log_desc, NULL, items) & 1))
|
||||
continue;
|
||||
|
||||
/* We have a value to set. Do so in the JOB table. */
|
||||
|
||||
items[0].itm_length = len;
|
||||
|
||||
sprintf(job_logical, "GDS_PIPE_%s", *logicals);
|
||||
ISC_make_desc(job_logical, &log_desc, 0);
|
||||
ISC_make_desc("LNM$JOB", &tab_desc, sizeof("LNM$JOB") - 1);
|
||||
|
||||
sys$crelnm(NULL, &tab_desc, &log_desc, NULL, items);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -34,13 +34,8 @@
|
||||
#ifdef VMS
|
||||
#define CSI_FILE "[000000]isc_csv_gbl.%s"
|
||||
#if !(defined MULTI_THREAD) || defined (__ALPHA)
|
||||
#ifndef PIPE_SERVER
|
||||
#define CSV_SIGNAL 33
|
||||
#define EVENT_SIGNAL 3
|
||||
#else
|
||||
#define CSV_SIGNAL 34
|
||||
#define EVENT_SIGNAL 4
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -561,23 +556,4 @@ typedef struct csu_list {
|
||||
TEXT csu_list_name[1];
|
||||
} *CSU_LIST;
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#define CSS_acquire PSS_acquire
|
||||
#define CSS_alloc_message PSS_alloc_message
|
||||
#define CSS_alloc_local PSS_alloc_local
|
||||
#define CSS_check_partner PSS_check_partner
|
||||
#define CSS_connect PSS_connect
|
||||
#define CSS_create_process PSS_create_process
|
||||
#define CSS_disconnect PSS_disconnect
|
||||
#define CSS_free_global PSS_free_global
|
||||
#define CSS_free_local PSS_free_local
|
||||
#define CSS_find_process PSS_find_process
|
||||
#define CSS_get_message PSS_get_message
|
||||
#define CSS_init PSS_init
|
||||
#define CSS_probe_processes PSS_probe_processes
|
||||
#define CSS_put_message PSS_put_message
|
||||
#define CSS_release PSS_release
|
||||
#define CSS_validate PSS_validate
|
||||
#endif
|
||||
|
||||
#endif /* _CSV_CSI_H_ */
|
||||
|
135
src/csv/css.cpp
135
src/csv/css.cpp
@ -47,9 +47,6 @@
|
||||
|
||||
#ifdef VMS
|
||||
#include lckdef
|
||||
#ifdef PIPE_SERVER
|
||||
#include rms
|
||||
#endif
|
||||
#define SYS_ARG gds_arg_vms
|
||||
|
||||
static LKSB CSS_lksb;
|
||||
@ -88,12 +85,6 @@ static void release_semaphore(USHORT);
|
||||
static void remove_que(SRQ *);
|
||||
static void set_timer(USHORT, PRB);
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
static void shutdown_section(void);
|
||||
#endif
|
||||
#endif // PIPE_SERVER
|
||||
|
||||
#ifdef VMS
|
||||
static void timeout_ast(PRB);
|
||||
#endif
|
||||
@ -102,13 +93,6 @@ static USHORT acquire_count, resignal;
|
||||
static CSH CSS_header, CSS_region;
|
||||
static SLONG CSS_length, CSS_process;
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
static SH_MEM_T shmem_data;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
CSH CSS_acquire(void)
|
||||
{
|
||||
/**************************************
|
||||
@ -490,77 +474,6 @@ CSV_MSG CSS_get_message(PTR partner, CSV_MSG old_message, SSHORT timeout)
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
CSH CSS_init(STATUS * status_vector, USHORT server_flag, SSHORT id)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* C S S _ i n i t ( p i p e _ s e r v e r )
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Initialize for access to shared global region. Return
|
||||
* address of header if region exits, otherwise return NULL.
|
||||
*
|
||||
**************************************/
|
||||
TEXT *filename, csi_file[128], *p;
|
||||
int (*init_routine) ();
|
||||
SH_MEM_T shmem_data;
|
||||
SLONG desc[2];
|
||||
STATUS status;
|
||||
|
||||
/* If we're already initialized, there's nothing to do */
|
||||
|
||||
if (CSS_region)
|
||||
return CSS_region;
|
||||
|
||||
init_routine = server_flag ? init : NULL;
|
||||
|
||||
if (!(filename = getenv("CSS_DEBUG")))
|
||||
filename = CSI_FILE;
|
||||
|
||||
#ifdef VMS
|
||||
shmem_data->sh_mem_system_flag = FALSE;
|
||||
#endif
|
||||
#ifdef UNIX
|
||||
shmem_data->sh_mem_semaphores = MAX_PROCESSES;
|
||||
#endif
|
||||
if (!(CSS_header = ISC_map_file(status_vector,
|
||||
filename, init_routine, 0,
|
||||
CSI_DEFAULT_SIZE,
|
||||
&shmem_data))) return NULL;
|
||||
|
||||
CSS_length = shmem_data.sh_mem_length_mapped;
|
||||
|
||||
#ifdef VMS
|
||||
/* Strip off any device prefix. */
|
||||
|
||||
for (p = filename; *p; p++)
|
||||
if (*p == ':' || *p == ']')
|
||||
filename = p + 1;
|
||||
ISC_make_desc(filename, desc, 0);
|
||||
|
||||
status = sys$enqw(EVENT_FLAG, LCK$K_NLMODE, &CSS_lksb, LCK$M_SYSTEM | LCK$M_NODLCKWT, &desc, NULL, /* Lock parent (not used) */
|
||||
0, /* AST routine when granted */
|
||||
0, 0, NULL, NULL);
|
||||
|
||||
if (!(status & 1) || !((status = CSS_lksb.lksb_status) & 1)) {
|
||||
error(status_vector, "sys$enqw", status);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
CSS_region = CSS_header;
|
||||
gds__register_cleanup(exit_handler, 0);
|
||||
|
||||
return CSS_header;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef PIPE_SERVER
|
||||
CSH CSS_init(STATUS * status_vector, USHORT server_flag)
|
||||
{
|
||||
/**************************************
|
||||
@ -626,8 +539,6 @@ CSH CSS_init(STATUS * status_vector, USHORT server_flag)
|
||||
|
||||
return CSS_header;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void CSS_probe_processes(void)
|
||||
{
|
||||
@ -1193,12 +1104,6 @@ static void exit_handler( void *arg)
|
||||
while (acquire_count > 0)
|
||||
RELEASE;
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
shutdown_section();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef UNIX
|
||||
#ifndef MAP_TYPE
|
||||
shmdt(CSS_region);
|
||||
@ -1513,45 +1418,6 @@ static void set_timer( USHORT timeout, PRB process)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
static void shutdown_section(void)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* s h u t d o w n _ s e c t i o n
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Remove the mapped file.
|
||||
*
|
||||
**************************************/
|
||||
struct FAB fab;
|
||||
|
||||
/* Delete the shared address space and deassign the file. */
|
||||
|
||||
sys$deltva(shmem_data->sh_mem_retadr, 0, 0);
|
||||
sys$dassgn((USHORT) shmem_data->sh_mem_channel);
|
||||
|
||||
/* Now try to delete the file by opening it with the delete flag set. */
|
||||
|
||||
fab = cc$rms_fab;
|
||||
fab.fab$l_fna = shmem_data->sh_mem_filename
|
||||
fab.fab$b_fns = strlen(shmem_data->sh_mem_filename);
|
||||
fab.fab$l_fop = FAB$M_DLT;
|
||||
fab.fab$b_fac = FAB$M_UPD | FAB$M_PUT;
|
||||
fab.fab$b_shr = FAB$M_SHRGET | FAB$M_SHRPUT | FAB$M_UPI;
|
||||
fab.fab$b_rfm = FAB$C_UDF;
|
||||
|
||||
if (sys$open(&fab) & 1)
|
||||
sys$dassgn(fab.fab$l_stv);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VMS
|
||||
static void timeout_ast( PRB process)
|
||||
{
|
||||
@ -1574,4 +1440,3 @@ static void timeout_ast( PRB process)
|
||||
RELEASE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -35,11 +35,7 @@ extern void CSS_free_global(FRB);
|
||||
extern void CSS_free_local(BLK);
|
||||
extern PTR CSS_find_process(SLONG);
|
||||
extern CSV_MSG CSS_get_message(PTR, CSV_MSG, SSHORT);
|
||||
#ifndef PIPE_SERVER
|
||||
extern CSH CSS_init(STATUS *, USHORT);
|
||||
#else
|
||||
extern CSH CSS_init(STATUS *, USHORT, SSHORT);
|
||||
#endif
|
||||
extern void CSS_probe_processes(void);
|
||||
extern int CSS_put_message(PTR, CSV_MSG, CSV_MSG);
|
||||
extern void CSS_release(void);
|
||||
|
238
src/csv/csv.cpp
238
src/csv/csv.cpp
@ -21,7 +21,7 @@
|
||||
* Contributor(s): ______________________________________.
|
||||
*/
|
||||
/*
|
||||
$Id: csv.cpp,v 1.10 2003-02-10 13:28:10 eku Exp $
|
||||
$Id: csv.cpp,v 1.11 2003-02-14 02:19:47 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -33,15 +33,6 @@ $Id: csv.cpp,v 1.10 2003-02-10 13:28:10 eku Exp $
|
||||
#include "../jrd/gds_proto.h"
|
||||
#include "../remote/merge_proto.h"
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
#include "../jrd/lnmdef.h"
|
||||
#include jpidef
|
||||
#include descrip
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define ALLOC(type, length) CSS_alloc_local (type, length)
|
||||
#define FREE(block) CSS_free_local (block)
|
||||
#define EVENT_FLAG 65
|
||||
@ -49,9 +40,7 @@ $Id: csv.cpp,v 1.10 2003-02-10 13:28:10 eku Exp $
|
||||
static void allocate_statement(MSG_OP);
|
||||
static void alt_connection(MSG_OP);
|
||||
static void attach_database(MSG_ATT);
|
||||
#ifndef PIPE_SERVER
|
||||
static STATUS attach_for_servicing(DBN, STATUS *, USHORT);
|
||||
#endif
|
||||
static void cancel_events(MSG_OP);
|
||||
static void check_if_done(DBN);
|
||||
static void compile(MSG_OP);
|
||||
@ -105,11 +94,6 @@ static void server_utility(MSG_UTIL);
|
||||
static void thread(void);
|
||||
#endif
|
||||
static void transact_request(MSG_TRRQ);
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
static void trans_logicals(void);
|
||||
#endif
|
||||
#endif
|
||||
static void unwind(MSG_OP);
|
||||
|
||||
static RDB CSV_databases;
|
||||
@ -138,21 +122,6 @@ typedef struct req {
|
||||
static REQ request_que, free_requests;
|
||||
static EVENT_T thread_event[1];
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
/* Define logical names that sub-process should inherit */
|
||||
|
||||
static SCHAR *inherit_logicals[] = {
|
||||
"SYS$LOGIN",
|
||||
"SYS$SCRATCH",
|
||||
"SYS$NODE",
|
||||
"SYS$INTERBASE",
|
||||
0
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#define GDS_ATTACH_DATABASE gds__attach_database
|
||||
#define GDS_BLOB_INFO gds__blob_info
|
||||
#define GDS_CANCEL_BLOB gds__cancel_blob
|
||||
@ -199,7 +168,6 @@ static SCHAR *inherit_logicals[] = {
|
||||
#define GDS_DSQL_SET_CURSOR isc_dsql_set_cursor_name
|
||||
#define GDS_DSQL_SQL_INFO isc_dsql_sql_info
|
||||
|
||||
#ifndef PIPE_SERVER
|
||||
int CLIB_ROUTINE main( int argc, char **argv)
|
||||
{
|
||||
/**************************************
|
||||
@ -337,75 +305,6 @@ int CLIB_ROUTINE main( int argc, char **argv)
|
||||
process_message(message);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
int CLIB_ROUTINE main( int argc, char **argv)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* m a i n ( p i p e _ s e r v e r )
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Start up single user server.
|
||||
*
|
||||
**************************************/
|
||||
STATUS status_vector[ISC_STATUS_LENGTH];
|
||||
CSH CSS_header;
|
||||
SRQ *que;
|
||||
PRB process;
|
||||
PTR connection, server, client;
|
||||
MSG_RESP response;
|
||||
CSV_MSG message;
|
||||
SSHORT parent_pin;
|
||||
|
||||
THREAD_ENTER;
|
||||
|
||||
gds__enable_subsystem("GDSSHR");
|
||||
gds__enable_subsystem("GDSSHR5");
|
||||
|
||||
parent_pin = FATHER();
|
||||
|
||||
if (!(CSS_header = CSS_init(status_vector, FALSE, parent_pin))) {
|
||||
gds__print_status(status_vector);
|
||||
exit(FINI_ERROR);
|
||||
}
|
||||
|
||||
client = (PRB) ABS_PTR(CSS_create_process(PRB_client));
|
||||
|
||||
CSS_header = ACQUIRE;
|
||||
server = (PTR) 0;
|
||||
|
||||
QUE_LOOP(CSS_header->csh_processes, que) {
|
||||
process = (PRB) ((UCHAR *) que - OFFSET(PRB, prb_processes));
|
||||
if (client != REL_PTR(process) &&
|
||||
process->prb_protocol_version == CSI_PROTOCOL_VERSION &&
|
||||
process->prb_process_id == parent_pin) {
|
||||
server = REL_PTR(process);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
RELEASE;
|
||||
|
||||
if (!server) {
|
||||
printf("Unable to find parent process.\n");
|
||||
exit(FINI_ERROR);
|
||||
}
|
||||
|
||||
connection = CSS_connect(server);
|
||||
response = CSS_alloc_message(type_msg, sizeof(struct msg_resp));
|
||||
response->msg_resp_header.msg_type = MSG_response;
|
||||
response->msg_resp_length = 0;
|
||||
if (CSS_put_message(connection, response, 0))
|
||||
while (!sw_shutdown && (message = CSS_get_message((SLONG) 0, 0, 0)))
|
||||
process_message(message);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void allocate_statement( MSG_OP message)
|
||||
{
|
||||
@ -545,7 +444,6 @@ static void attach_database( MSG_ATT message)
|
||||
}
|
||||
|
||||
|
||||
#ifndef PIPE_SERVER
|
||||
static STATUS attach_for_servicing(
|
||||
DBN db_name,
|
||||
STATUS * status_vector, USHORT detach_flag)
|
||||
@ -609,8 +507,6 @@ static STATUS attach_for_servicing(
|
||||
|
||||
return status_vector[1];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void cancel_events( MSG_OP message)
|
||||
{
|
||||
@ -769,7 +665,6 @@ static void ddl( MSG_DDL message)
|
||||
}
|
||||
|
||||
|
||||
#ifndef PIPE_SERVER
|
||||
static void disable_or_kill( DBN db_name, USHORT cmd)
|
||||
{
|
||||
/**************************************
|
||||
@ -810,8 +705,6 @@ static void disable_or_kill( DBN db_name, USHORT cmd)
|
||||
else
|
||||
ptr = &(*ptr)->rdb_next;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void disconnect( PTR connection)
|
||||
{
|
||||
@ -1228,8 +1121,6 @@ static void fetch( MSG_SQLMSG message)
|
||||
free_buffer(msg, msg_length);
|
||||
}
|
||||
|
||||
|
||||
#ifndef PIPE_SERVER
|
||||
static DBN find_dbname(
|
||||
TEXT * expanded_name,
|
||||
USHORT expanded_length, USHORT search_flag)
|
||||
@ -1254,33 +1145,6 @@ static DBN find_dbname(
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
static DBN find_dbname(
|
||||
TEXT * expanded_name,
|
||||
USHORT expanded_length, USHORT search_flag)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* f i n d _ d b n a m e ( p i p e _ s e r v e r )
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Find a database name in the list of database that
|
||||
* can be serviced by this server.
|
||||
*
|
||||
**************************************/
|
||||
|
||||
if (!CSV_dbnames)
|
||||
CSV_dbnames = (DBN) ALLOC(type_dbn, sizeof(struct dbn));
|
||||
|
||||
return CSV_dbnames;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static void free_buffer( UCHAR * buffer, USHORT length)
|
||||
{
|
||||
@ -1574,12 +1438,8 @@ static void info( MSG_INFO message)
|
||||
temp))
|
||||
MERGE_database_info(temp, buffer,
|
||||
message->msg_info_buffer_length,
|
||||
#ifndef PIPE_SERVER
|
||||
IMPLEMENTATION, 10, 1, GDS_VERSION, "",
|
||||
0);
|
||||
#else
|
||||
IMPLEMENTATION, 8, 1, GDS_VERSION, "", 0);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case MSG_blob_info:
|
||||
@ -2855,7 +2715,6 @@ static void start_transaction( MSG_TRANS message)
|
||||
}
|
||||
|
||||
|
||||
#ifndef PIPE_SERVER
|
||||
static void server_utility( MSG_UTIL message)
|
||||
{
|
||||
/**************************************
|
||||
@ -2979,50 +2838,6 @@ static void server_utility( MSG_UTIL message)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
static void server_utility( MSG_UTIL message)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* s e r v e r _ u t i l i t y
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Process a message from the central server utility.
|
||||
*
|
||||
**************************************/
|
||||
STATUS status_vector[ISC_STATUS_LENGTH];
|
||||
RDB *ptr, rdb;
|
||||
PTR connection;
|
||||
|
||||
switch (message->msg_util_cmd) {
|
||||
case UTIL_kill:
|
||||
/* Loop through the database attachments and zap them all */
|
||||
|
||||
for (ptr = &CSV_databases; rdb = *ptr;)
|
||||
disconnect(rdb->rdb_connection);
|
||||
|
||||
sw_shutdown = TRUE;
|
||||
|
||||
connection = message->msg_util_header.msg_connection;
|
||||
CSS_free_global(message);
|
||||
CSS_disconnect(connection);
|
||||
return;
|
||||
|
||||
default:
|
||||
status_vector[0] = gds_arg_gds;
|
||||
status_vector[1] = gds__unavailable;
|
||||
status_vector[2] = gds_arg_end;
|
||||
send_response(message, status_vector, (SLONG) 0, 0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef MULTI_THREAD
|
||||
static void thread(void)
|
||||
@ -3131,57 +2946,6 @@ static void transact_request( MSG_TRRQ message)
|
||||
free_buffer(out_msg, buffer_length);
|
||||
}
|
||||
|
||||
|
||||
#ifdef PIPE_SERVER
|
||||
#ifdef VMS
|
||||
static void trans_logicals(void)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* t r a n s _ l o g i c a l s
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Translate logicals and write their values to
|
||||
* the process logical table.
|
||||
*
|
||||
**************************************/
|
||||
UCHAR **logicals, value[256], job_logical[32];
|
||||
int attr, status;
|
||||
SSHORT len;
|
||||
ITM items[2];
|
||||
struct dsc$descriptor_s tab_desc, log_desc;
|
||||
|
||||
for (logicals = inherit_logicals; *logicals; logicals++) {
|
||||
items[0].itm_length = sizeof(value);
|
||||
items[0].itm_code = LNM$_STRING;
|
||||
items[0].itm_buffer = value;
|
||||
items[0].itm_return_length = &len;
|
||||
items[1].itm_length = 0;
|
||||
items[1].itm_code = 0;
|
||||
|
||||
attr = LNM$M_CASE_BLIND;
|
||||
|
||||
sprintf(job_logical, "GDS_PIPE_%s", *logicals);
|
||||
ISC_make_desc(job_logical, &log_desc, 0);
|
||||
|
||||
ISC_make_desc("LNM$JOB", &tab_desc, sizeof("LNM$JOB") - 1);
|
||||
if (!(sys$trnlnm(&attr, &tab_desc, &log_desc, NULL, items) & 1))
|
||||
continue;
|
||||
|
||||
/* Logical must be copied into the process logical table */
|
||||
|
||||
items[0].itm_length = len;
|
||||
ISC_make_desc(*logicals, &log_desc, 0);
|
||||
ISC_make_desc("LNM$PROCESS", &tab_desc, sizeof("LNM$PROCESS") - 1);
|
||||
sys$crelnm(NULL, &tab_desc, &log_desc, NULL, items);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
static void unwind( MSG_OP message)
|
||||
{
|
||||
/**************************************
|
||||
|
@ -114,18 +114,7 @@ extern "C" {
|
||||
}
|
||||
#define RESTORE_THREAD_DATA THD_restore_specific()
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
#define FREE_MEM_RETURN {\
|
||||
if (buffer)\
|
||||
{\
|
||||
gds__free ((SLONG *)buffer);\
|
||||
buffer = (TEXT*) NULL;\
|
||||
}\
|
||||
return;\
|
||||
}
|
||||
#else
|
||||
#define FREE_MEM_RETURN return
|
||||
#endif
|
||||
|
||||
static void cleanup(void*);
|
||||
static void cleanup_database(FRBRD**, SLONG);
|
||||
@ -1772,19 +1761,11 @@ void DSQL_pretty(DSQL_NOD node, int column)
|
||||
STR string;
|
||||
VAR variable;
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
TEXT* buffer;
|
||||
#else
|
||||
TEXT buffer[1024];
|
||||
#endif
|
||||
|
||||
TEXT* verb;
|
||||
TEXT s[64];
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
buffer = (TEXT *) gds__alloc(BUFFER_LARGE);
|
||||
#endif
|
||||
|
||||
TEXT* p = buffer;
|
||||
p += sprintf(p, "%.7X ", node);
|
||||
|
||||
|
@ -609,13 +609,8 @@ void AIL_get_file_list(LLS * stack)
|
||||
SLONG prev_log_partition_offset;
|
||||
SLONG log_flags;
|
||||
|
||||
#ifndef STACK_REDUCTION
|
||||
SCHAR log_name1[MAXPATHLEN];
|
||||
SCHAR log_name2[MAXPATHLEN];
|
||||
#else
|
||||
SCHAR *log_name1;
|
||||
SCHAR *log_name2;
|
||||
#endif
|
||||
|
||||
SCHAR *temp_name;
|
||||
SLONG log_seqno;
|
||||
@ -657,12 +652,6 @@ void AIL_get_file_list(LLS * stack)
|
||||
*/
|
||||
|
||||
/* WAL_segment->wals_logname is the current log file */
|
||||
#ifdef STACK_REDUCTION
|
||||
log_name1 = (SCHAR *) gds__alloc((SLONG) (sizeof(SCHAR) * MAXPATHLEN));
|
||||
log_name2 = (SCHAR *) gds__alloc((SLONG) (sizeof(SCHAR) * MAXPATHLEN));
|
||||
#endif
|
||||
|
||||
|
||||
curr_name = log_name1;
|
||||
prev_name = log_name2;
|
||||
strcpy(curr_name, WAL_segment->wals_logname);
|
||||
@ -697,10 +686,6 @@ void AIL_get_file_list(LLS * stack)
|
||||
curr_name = temp_name;
|
||||
curr_log_partition_offset = prev_log_partition_offset;
|
||||
}
|
||||
#ifdef STACK_REDUCTION
|
||||
gds__free((SLONG *) log_name1);
|
||||
gds__free((SLONG *) log_name2);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
$Id: blb.cpp,v 1.24 2003-02-13 13:33:54 dimitr Exp $
|
||||
$Id: blb.cpp,v 1.25 2003-02-14 02:24:44 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -1814,16 +1814,10 @@ static BLB copy_blob(TDBB tdbb, BID source, JRD_REL relation, BID destination)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
#ifndef STACK_REDUCTION
|
||||
UCHAR buffer[2000];
|
||||
#endif
|
||||
UCHAR* buff;
|
||||
STR string;
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
UCHAR* buffer = (UCHAR*) gds__alloc((SLONG) (sizeof(UCHAR) * BUFFER_XLARGE));
|
||||
#endif
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
JRD_REQ request = tdbb->tdbb_request;
|
||||
@ -1835,11 +1829,7 @@ static BLB copy_blob(TDBB tdbb, BID source, JRD_REL relation, BID destination)
|
||||
output->blb_flags |= BLB_stream;
|
||||
}
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
if (input->blb_max_segment > BUFFER_XLARGE)
|
||||
#else
|
||||
if (input->blb_max_segment > sizeof(buffer))
|
||||
#endif
|
||||
|
||||
{
|
||||
string = FB_NEW_RPT(*tdbb->tdbb_default, input->blb_max_segment) str();
|
||||
@ -1860,10 +1850,6 @@ static BLB copy_blob(TDBB tdbb, BID source, JRD_REL relation, BID destination)
|
||||
|
||||
delete string;
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
gds__free((SLONG *) buffer);
|
||||
#endif
|
||||
|
||||
BLB_close(tdbb, input);
|
||||
BLB_close(tdbb, output);
|
||||
|
||||
|
@ -49,7 +49,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
$Id: common.h,v 1.57 2003-02-13 15:33:50 brodsom Exp $
|
||||
$Id: common.h,v 1.58 2003-02-14 02:24:44 brodsom Exp $
|
||||
*/
|
||||
|
||||
#ifndef JRD_COMMON_H
|
||||
@ -313,13 +313,11 @@ typedef RETSIGTYPE (*SIG_FPTR) ();
|
||||
|
||||
#ifdef SOLARIS
|
||||
|
||||
#ifndef PIPE_IS_SHRLIB
|
||||
/* This is NOT defined when building the special shared-pipe library
|
||||
* which customers can use to avoid the problems with signals & threads
|
||||
* in Solaris
|
||||
*/
|
||||
#define SOLARIS_MT 1
|
||||
#endif
|
||||
|
||||
/* Define the following only on platforms whose standard I/O
|
||||
* implementation is so weak that we wouldn't be able to fopen
|
||||
|
@ -539,12 +539,7 @@ SSHORT CVT2_blob_compare(DSC * arg1, DSC * arg2, FPTR_VOID err)
|
||||
if (arg2->dsc_dtype == dtype_blob)
|
||||
{
|
||||
BLB blob1, blob2;
|
||||
#ifndef STACK_REDUCTION
|
||||
UCHAR buffer1[BUFFER_LARGE], buffer2[BUFFER_LARGE];
|
||||
#else
|
||||
STR temp_str = 0;
|
||||
UCHAR *buffer1 = 0, *buffer2 = 0;
|
||||
#endif
|
||||
|
||||
/* Same blob id address? */
|
||||
if (arg1->dsc_address == arg2->dsc_address)
|
||||
@ -614,13 +609,6 @@ SSHORT CVT2_blob_compare(DSC * arg1, DSC * arg2, FPTR_VOID err)
|
||||
(err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
}
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
/* do a block allocate */
|
||||
temp_str = FB_NEW_RPT(*tdbb->tdbb_default, sizeof(UCHAR) * (2 * BUFFER_LARGE)) str();
|
||||
buffer1 = temp_str->str_data;
|
||||
buffer2 = buffer1 + BUFFER_LARGE;
|
||||
#endif
|
||||
|
||||
while (!(blob1->blb_flags & BLB_eof) && !(blob2->blb_flags & BLB_eof))
|
||||
{
|
||||
l1 = BLB_get_segment(tdbb, blob1, buffer1, BUFFER_LARGE);
|
||||
@ -715,11 +703,6 @@ SSHORT CVT2_blob_compare(DSC * arg1, DSC * arg2, FPTR_VOID err)
|
||||
}
|
||||
BLB_close(tdbb, blob1);
|
||||
BLB_close(tdbb, blob2);
|
||||
#ifdef STACK_REDUCTION
|
||||
/* do a block deallocation of local variables */
|
||||
if (temp_str)
|
||||
delete temp_str;
|
||||
#endif
|
||||
}
|
||||
/* We do not accept arrays for now. Maybe ADS in the future. */
|
||||
else if (arg2->dsc_dtype == dtype_array)
|
||||
@ -729,11 +712,7 @@ SSHORT CVT2_blob_compare(DSC * arg1, DSC * arg2, FPTR_VOID err)
|
||||
else
|
||||
{
|
||||
BLB blob1;
|
||||
#ifndef STACK_REDUCTION
|
||||
UCHAR buffer1[BUFFER_LARGE];
|
||||
#else
|
||||
UCHAR *buffer1 = 0;
|
||||
#endif
|
||||
STR temp_str = 0;
|
||||
UCHAR *dbuf = 0;
|
||||
|
||||
@ -781,11 +760,6 @@ SSHORT CVT2_blob_compare(DSC * arg1, DSC * arg2, FPTR_VOID err)
|
||||
reinterpret_cast < pfn_cvt_private_cludge2 >
|
||||
(err) (gds_wish_list, gds_arg_gds, gds_datnotsup, 0);
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
/* do a block allocate */
|
||||
temp_str = FB_NEW_RPT(*tdbb->tdbb_default, sizeof(UCHAR) * arg2->dsc_length) str();
|
||||
dbuf = temp_str->str_data;
|
||||
#else
|
||||
if (arg2->dsc_length > BUFFER_LARGE)
|
||||
{
|
||||
temp_str = FB_NEW_RPT(*tdbb->tdbb_default, sizeof(UCHAR) * arg2->dsc_length) str();
|
||||
@ -793,7 +767,6 @@ SSHORT CVT2_blob_compare(DSC * arg1, DSC * arg2, FPTR_VOID err)
|
||||
}
|
||||
else
|
||||
dbuf = buffer1;
|
||||
#endif
|
||||
|
||||
desc1.dsc_address = dbuf;
|
||||
blob1 = BLB_open(tdbb, tdbb->tdbb_request->req_transaction, (BID) arg1->dsc_address);
|
||||
|
@ -19,7 +19,7 @@
|
||||
*
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
* $Id: evl.cpp,v 1.28 2003-02-13 17:28:38 tamlin Exp $
|
||||
* $Id: evl.cpp,v 1.29 2003-02-14 02:24:44 brodsom Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -117,11 +117,7 @@
|
||||
|
||||
#define TEMP_LENGTH 128
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
#define TEMP_SIZE(x) TEMP_LENGTH
|
||||
#else
|
||||
#define TEMP_SIZE(x) sizeof (x)
|
||||
#endif
|
||||
|
||||
#define MAX_INT64_LIMIT (MAX_SINT64 / 10)
|
||||
#define MIN_INT64_LIMIT (MIN_SINT64 / 10)
|
||||
@ -4522,13 +4518,8 @@ static SSHORT sleuth(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
**************************************/
|
||||
BLB blob;
|
||||
DSC *desc3;
|
||||
#ifndef STACK_REDUCTION
|
||||
UCHAR *p1, *p2, temp1[TEMP_LENGTH], temp2[TEMP_LENGTH],
|
||||
buffer[BUFFER_LARGE], control[BUFFER_SMALL];
|
||||
#else
|
||||
STR temp_str;
|
||||
UCHAR *p1, *p2, *temp1, *temp2, *buffer, *control;
|
||||
#endif
|
||||
SSHORT l1, l2;
|
||||
USHORT ttype;
|
||||
STR data_str = NULL, match_str = NULL, sleuth_str = NULL;
|
||||
@ -4538,18 +4529,6 @@ static SSHORT sleuth(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
|
||||
DEV_BLKCHK(node, type_nod);
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
/* do a block allocate */
|
||||
temp_str = FB_NEW_RPT(*tdbb->tdbb_default, ((SLONG)
|
||||
(sizeof(UCHAR) *
|
||||
(2 * TEMP_LENGTH + BUFFER_LARGE +
|
||||
BUFFER_SMALL)))) str();
|
||||
temp1 = temp_str->str_data;
|
||||
temp2 = temp1 + TEMP_LENGTH;
|
||||
buffer = temp2 + TEMP_LENGTH;
|
||||
control = buffer + BUFFER_LARGE;
|
||||
#endif
|
||||
|
||||
/* Choose interpretation for the operation */
|
||||
|
||||
if (desc1->dsc_dtype == dtype_blob) {
|
||||
@ -4604,11 +4583,7 @@ static SSHORT sleuth(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
ret_val = FALSE;
|
||||
while (!(blob->blb_flags & BLB_eof))
|
||||
{
|
||||
#ifdef STACK_REDUCTION
|
||||
l1 = BLB_get_segment(tdbb, blob, buffer, BUFFER_LARGE);
|
||||
#else
|
||||
l1 = BLB_get_segment(tdbb, blob, buffer, sizeof(buffer));
|
||||
#endif
|
||||
if (obj->sleuth_check(tdbb, 0, buffer, l1, control, l2))
|
||||
{
|
||||
ret_val = TRUE;
|
||||
@ -4626,10 +4601,6 @@ static SSHORT sleuth(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
if (match_str)
|
||||
delete match_str;
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
/* block de-alloc all local variables */
|
||||
delete temp_str;
|
||||
#endif
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
@ -4649,13 +4620,8 @@ static SSHORT string_boolean(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
**************************************/
|
||||
BLB blob;
|
||||
|
||||
#ifndef STACK_REDUCTION
|
||||
UCHAR *p1, *p2, temp1[TEMP_LENGTH], temp2[TEMP_LENGTH],
|
||||
buffer[BUFFER_LARGE];
|
||||
#else
|
||||
STR temp_str;
|
||||
UCHAR *p1, *p2, *temp1, *temp2, *buffer;
|
||||
#endif
|
||||
SSHORT l1, l2;
|
||||
USHORT type1, xtype1;
|
||||
STR match_str = NULL;
|
||||
@ -4665,17 +4631,6 @@ static SSHORT string_boolean(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
|
||||
DEV_BLKCHK(node, type_nod);
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
/* do a block allocation of local variables */
|
||||
temp_str =
|
||||
FB_NEW_RPT(*tdbb->tdbb_default,
|
||||
(SLONG) (sizeof(UCHAR) *
|
||||
(2 * TEMP_LENGTH + BUFFER_LARGE))) str();
|
||||
temp1 = temp_str->str_data;
|
||||
temp2 = temp1 + TEMP_LENGTH;
|
||||
buffer = temp2 + TEMP_LENGTH;
|
||||
#endif
|
||||
|
||||
if (desc1->dsc_dtype != dtype_blob) {
|
||||
/* Source is not a blob, do a simple search */
|
||||
|
||||
@ -4727,11 +4682,7 @@ static SSHORT string_boolean(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
|
||||
ret_val = FALSE;
|
||||
while (!(blob->blb_flags & BLB_eof)) {
|
||||
#ifdef STACK_REDUCTION
|
||||
l1 = BLB_get_segment(tdbb, blob, buffer, BUFFER_LARGE);
|
||||
#else
|
||||
l1 = BLB_get_segment(tdbb, blob, buffer, sizeof(buffer));
|
||||
#endif
|
||||
if (string_function(tdbb, node, l1, buffer, l2, p2, type1)) {
|
||||
ret_val = TRUE;
|
||||
break;
|
||||
@ -4746,10 +4697,6 @@ static SSHORT string_boolean(TDBB tdbb, JRD_NOD node, DSC * desc1, DSC * desc2)
|
||||
if (match_str)
|
||||
delete match_str;
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
/* do a block deallocation of local variables */
|
||||
delete temp_str;
|
||||
#endif
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
@ -4805,16 +4752,7 @@ static SSHORT string_function(
|
||||
if (node->nod_count == 3) {
|
||||
const char* q1;
|
||||
USHORT l3, consumed;
|
||||
#ifndef STACK_REDUCTION
|
||||
UCHAR temp3[TEMP_LENGTH];
|
||||
#else
|
||||
STR temp_str;
|
||||
UCHAR *temp3;
|
||||
|
||||
SET_TDBB(tdbb);
|
||||
temp_str = FB_NEW_RPT(*tdbb->tdbb_default, (sizeof(UCHAR) * TEMP_LENGTH)) str();
|
||||
temp3 = temp_str->str_data;
|
||||
#endif
|
||||
|
||||
/* Convert ESCAPE to operation character set */
|
||||
l3 = MOV_make_string(EVL_expr(tdbb, node->nod_arg[2]),
|
||||
@ -4829,9 +4767,6 @@ static SSHORT string_function(
|
||||
if (consumed <= 0 || consumed != l3 || (escape == 0))
|
||||
ERR_post(gds_like_escape_invalid, 0);
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
delete temp_str;
|
||||
#endif
|
||||
}
|
||||
return obj->like(tdbb, p1, l1, p2, l2, escape);
|
||||
}
|
||||
@ -4897,11 +4832,7 @@ static DSC *substring(
|
||||
{
|
||||
/* Both cases are the same for now. Let's see if we can optimize in the future. */
|
||||
USHORT waste = MIN(bufflen, offset);
|
||||
#ifdef STACK_REDUCTION
|
||||
USHORT l1 = BLB_get_segment(tdbb, blob, buffer, waste);
|
||||
#else
|
||||
USHORT l1 = BLB_get_segment(tdbb, blob, buffer, waste);
|
||||
#endif
|
||||
offset -= l1;
|
||||
}
|
||||
assert(!offset && !(blob->blb_flags & BLB_eof));
|
||||
|
@ -116,10 +116,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef SOLARIS_MT
|
||||
#ifndef PIPE_LIBRARY
|
||||
#define V4_THREADING
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SUPERSERVER
|
||||
#define V4_THREADING /* RFM: 9/22/2000 fix from Inprise tree,
|
||||
@ -1866,11 +1864,7 @@ void API_ROUTINE gds__log(TEXT * text, ...)
|
||||
IB_FILE *file;
|
||||
int oldmask;
|
||||
time_t now;
|
||||
#if defined(STACK_EFFICIENT) && !defined(DEV_BUILD) && !defined(DEBUG_GDS_ALLOC)
|
||||
TEXT *name = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
#else /* STACK_EFFICIENT */
|
||||
TEXT name[MAXPATHLEN];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
#ifdef HAVE_GETTIMEOFDAY
|
||||
{
|
||||
@ -1902,10 +1896,6 @@ void API_ROUTINE gds__log(TEXT * text, ...)
|
||||
|
||||
umask(oldmask);
|
||||
|
||||
#if defined(STACK_EFFICIENT) && !defined(DEV_BUILD) && !defined(DEBUG_GDS_ALLOC)
|
||||
gds__free((SLONG *) name);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2265,19 +2255,11 @@ TEXT * arg2, TEXT * arg3, TEXT * arg4, TEXT * arg5)
|
||||
* as fits in callers buffer.
|
||||
*
|
||||
**************************************/
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *formatted =
|
||||
(TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * BUFFER_MEDIUM));
|
||||
#else /* STACK_EFFICIENT */
|
||||
TEXT formatted[512];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
gds__msg_format(handle, facility, number, sizeof(TEXT) * BUFFER_MEDIUM,
|
||||
formatted, arg1, arg2, arg3, arg4, arg5);
|
||||
gds__put_error(formatted);
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) formatted);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
}
|
||||
|
||||
|
||||
|
@ -290,12 +290,8 @@ int ISC_analyze_nfs(TEXT * expanded_filename, TEXT * node_name)
|
||||
**************************************/
|
||||
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *mnt_buffer, *remote_filename, *max_node, *max_path, *expand_mount;
|
||||
#else /* STACK_EFFICIENT */
|
||||
TEXT mnt_buffer[BUFFER_LARGE], remote_filename[MAXPATHLEN],
|
||||
max_node[MAXHOSTLEN], max_path[MAXPATHLEN], expand_mount[MAXPATHLEN];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
MNT mount;
|
||||
TEXT *p, *q, *temp;
|
||||
@ -311,18 +307,6 @@ int ISC_analyze_nfs(TEXT * expanded_filename, TEXT * node_name)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
/* allocate all strings in one block */
|
||||
mnt_buffer = (TEXT *)
|
||||
gds__alloc((SLONG)
|
||||
(sizeof(TEXT) *
|
||||
(BUFFER_LARGE + 3 * MAXPATHLEN + MAXHOSTLEN)));
|
||||
remote_filename = mnt_buffer + BUFFER_LARGE;
|
||||
max_node = remote_filename + MAXPATHLEN;
|
||||
max_path = max_node + MAXHOSTLEN;
|
||||
expand_mount = max_path + MAXPATHLEN;
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
len = 0;
|
||||
*max_path = 0;
|
||||
flag = FALSE;
|
||||
@ -336,9 +320,6 @@ int ISC_analyze_nfs(TEXT * expanded_filename, TEXT * node_name)
|
||||
while (get_mounts(&mount, mnt_buffer, &temp, &context))
|
||||
#else
|
||||
if (!(mtab = MTAB_OPEN(MTAB, "r"))) {
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) mnt_buffer);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
return flag;
|
||||
}
|
||||
while (get_mounts(&mount, mnt_buffer, mtab))
|
||||
@ -426,10 +407,6 @@ int ISC_analyze_nfs(TEXT * expanded_filename, TEXT * node_name)
|
||||
gds__free(temp);
|
||||
#endif
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) mnt_buffer);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
return flag;
|
||||
}
|
||||
#endif
|
||||
@ -583,25 +560,14 @@ BOOLEAN DLL_EXPORT ISC_check_if_remote(TEXT * file_name,
|
||||
* check for an explicit node name.
|
||||
*
|
||||
**************************************/
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *temp_name;
|
||||
#else /* STACK_EFFICIENT */
|
||||
TEXT temp_name[MAXPATHLEN];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
TEXT host_name[64];
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
temp_name = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
strcpy(temp_name, file_name);
|
||||
|
||||
/* Always check for an explicit TCP node name */
|
||||
|
||||
if (ISC_analyze_tcp(temp_name, host_name)) {
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) temp_name);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -610,10 +576,6 @@ BOOLEAN DLL_EXPORT ISC_check_if_remote(TEXT * file_name,
|
||||
/* Check for a file on an NFS mounted device */
|
||||
|
||||
if (ISC_analyze_nfs(temp_name, host_name)) {
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) temp_name);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -623,20 +585,12 @@ BOOLEAN DLL_EXPORT ISC_check_if_remote(TEXT * file_name,
|
||||
/* Check for an explicit named pipe node name */
|
||||
|
||||
if (ISC_analyze_pclan(temp_name, host_name)) {
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) temp_name);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (implicit_flag) {
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *temp_name2;
|
||||
temp_name2 = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
#else /* STACK_EFFICIENT */
|
||||
TEXT temp_name2[MAXPATHLEN];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
/* Check for a file on a shared drive. First try to expand
|
||||
the path. Then check the expanded path for a TCP or
|
||||
@ -645,25 +599,12 @@ BOOLEAN DLL_EXPORT ISC_check_if_remote(TEXT * file_name,
|
||||
ISC_expand_share(temp_name, temp_name2);
|
||||
if (ISC_analyze_tcp(temp_name2, host_name) ||
|
||||
ISC_analyze_pclan(temp_name2, host_name)) {
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) temp_name2);
|
||||
gds__free((SLONG *) temp_name);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) temp_name2);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
}
|
||||
#endif // WIN_NT
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) temp_name);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -1166,20 +1107,11 @@ static int expand_filename2(TEXT * from_buff, USHORT length, TEXT * to_buff)
|
||||
* shows up, stop translating.
|
||||
*
|
||||
**************************************/
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *temp, *temp2;
|
||||
#else /* STACK_EFFICIENT */
|
||||
TEXT temp[MAXPATHLEN], temp2[MAXPATHLEN];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
TEXT *from, *to, *p, *segment;
|
||||
SSHORT n;
|
||||
struct passwd *passwd;
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
temp = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * 2 * MAXPATHLEN));
|
||||
temp2 = temp + MAXPATHLEN;
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
if (length) {
|
||||
strncpy(temp2, from_buff, length);
|
||||
temp2[length] = 0;
|
||||
@ -1194,9 +1126,6 @@ static int expand_filename2(TEXT * from_buff, USHORT length, TEXT * to_buff)
|
||||
|
||||
if (strchr(from, INET_FLAG)) {
|
||||
strcpy(to, from);
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) temp);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
return strlen(to);
|
||||
}
|
||||
|
||||
@ -1286,9 +1215,6 @@ static int expand_filename2(TEXT * from_buff, USHORT length, TEXT * to_buff)
|
||||
|
||||
if (strchr(temp, INET_FLAG)) {
|
||||
strcpy(to_buff, temp);
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) temp);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
return n;
|
||||
}
|
||||
|
||||
@ -1309,10 +1235,6 @@ static int expand_filename2(TEXT * from_buff, USHORT length, TEXT * to_buff)
|
||||
|
||||
*to = 0;
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) temp);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
return to - to_buff;
|
||||
}
|
||||
#endif
|
||||
@ -1339,11 +1261,7 @@ static void expand_share_name(TEXT * share_name)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *data_buf, *workspace;
|
||||
#else /* STACK_EFFICIENT */
|
||||
TEXT data_buf[MAXPATHLEN], workspace[MAXPATHLEN];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
TEXT *p, *q, *data;
|
||||
HKEY hkey;
|
||||
DWORD ret, d_size, type_code;
|
||||
@ -1354,27 +1272,17 @@ static void expand_share_name(TEXT * share_name)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
data_buf = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * 2 * MAXPATHLEN));
|
||||
workspace = data_buf + MAXPATHLEN;
|
||||
#endif /* STACK_EFFICIENT */
|
||||
strcpy(workspace, p);
|
||||
for (q = workspace; *p && *p != '!'; p++, q++);
|
||||
|
||||
*q = '\0';
|
||||
if (*p++ != '!' || *p++ != '\\') {
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) data_buf);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
return;
|
||||
}
|
||||
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
"SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares",
|
||||
0, KEY_QUERY_VALUE, &hkey) != ERROR_SUCCESS) {
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) data_buf);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1389,9 +1297,6 @@ static void expand_share_name(TEXT * share_name)
|
||||
data = (TEXT *) gds__alloc((SLONG) d_size);
|
||||
/* FREE: unknown */
|
||||
if (!data) { /* NOMEM: */
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) data_buf);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
RegCloseKey(hkey);
|
||||
return; /* Error not really handled */
|
||||
}
|
||||
@ -1426,10 +1331,6 @@ static void expand_share_name(TEXT * share_name)
|
||||
gds__free(data);
|
||||
}
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) data_buf);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* $Id: isc_ipc.cpp,v 1.29 2002-11-20 13:37:22 kkuznetsov Exp $ */
|
||||
/* $Id: isc_ipc.cpp,v 1.30 2003-02-14 02:24:44 brodsom Exp $ */
|
||||
|
||||
#ifdef SHLIB_DEFS
|
||||
#define LOCAL_SHLIB_DEFS
|
||||
@ -827,7 +827,6 @@ void DLL_EXPORT ISC_signal_init(void)
|
||||
**************************************/
|
||||
|
||||
#ifndef REQUESTER
|
||||
#ifndef PIPE_CLIENT
|
||||
if (initialized_signals)
|
||||
return;
|
||||
|
||||
@ -844,7 +843,6 @@ void DLL_EXPORT ISC_signal_init(void)
|
||||
isc_signal2(SIGFPE, (SIG_FPTR) overflow_handler, 0, SIG_informs);
|
||||
#endif
|
||||
|
||||
#endif /* PIPE_CLIENT */
|
||||
#endif /* REQUESTER */
|
||||
|
||||
#ifdef WIN_NT
|
||||
|
@ -397,24 +397,18 @@ int ISC_event_init(EVENT event, int semid, int semnum)
|
||||
|
||||
event->event_count = 0;
|
||||
|
||||
#ifdef PIPE_IS_SHRLIB
|
||||
assert(semnum == 0);
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
if (!semnum) {
|
||||
/* Prepare an Inter-Thread event block */
|
||||
event->event_semid = -1;
|
||||
mutex_init(event->event_mutex, USYNC_THREAD, NULL);
|
||||
cond_init(event->event_semnum, USYNC_THREAD, NULL);
|
||||
}
|
||||
#ifndef PIPE_IS_SHRLIB
|
||||
else {
|
||||
/* Prepare an Inter-Process event block */
|
||||
event->event_semid = semid;
|
||||
mutex_init(event->event_mutex, USYNC_PROCESS, NULL);
|
||||
cond_init(event->event_semnum, USYNC_PROCESS, NULL);
|
||||
}
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -434,10 +428,6 @@ int ISC_event_post(EVENT event)
|
||||
**************************************/
|
||||
int ret;
|
||||
|
||||
#ifdef PIPE_IS_SHRLIB
|
||||
assert(event->event_semid == -1);
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
/* For Solaris, we use cond_broadcast rather than cond_signal so that
|
||||
all waiters on the event are notified and awakened */
|
||||
|
||||
@ -627,10 +617,6 @@ int ISC_event_init(EVENT event, int semid, int semnum)
|
||||
|
||||
event->event_count = 0;
|
||||
|
||||
#ifdef PIPE_IS_SHRLIB
|
||||
assert(semnum == 0);
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
if (!semnum) {
|
||||
/* Prepare an Inter-Thread event block */
|
||||
event->event_semid = -1;
|
||||
@ -646,7 +632,6 @@ int ISC_event_init(EVENT event, int semid, int semnum)
|
||||
pthread_cond_init(event->event_semnum, NULL);
|
||||
#endif /* HP10 */
|
||||
}
|
||||
#ifndef PIPE_IS_SHRLIB
|
||||
else {
|
||||
/* Prepare an Inter-Process event block */
|
||||
event->event_semid = semid;
|
||||
@ -678,7 +663,6 @@ int ISC_event_init(EVENT event, int semid, int semnum)
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -698,10 +682,6 @@ int ISC_event_post(EVENT event)
|
||||
**************************************/
|
||||
int ret;
|
||||
|
||||
#ifdef PIPE_IS_SHRLIB
|
||||
assert(event->event_semid == -1);
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
pthread_mutex_lock(event->event_mutex);
|
||||
++event->event_count;
|
||||
ret = pthread_cond_broadcast(event->event_semnum);
|
||||
@ -877,16 +857,10 @@ SLONG ISC_event_clear(EVENT event)
|
||||
int ret;
|
||||
union semun arg;
|
||||
|
||||
#ifdef PIPE_IS_SHRLIB
|
||||
assert(event->event_semid == -1);
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
#ifndef PIPE_IS_SHRLIB
|
||||
if (event->event_semid != -1) {
|
||||
arg.val = 1;
|
||||
ret = semctl(event->event_semid, event->event_semnum, SETVAL, arg);
|
||||
}
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
return (event->event_count + 1);
|
||||
}
|
||||
@ -928,22 +902,16 @@ int ISC_event_init(EVENT event, int semid, int semnum)
|
||||
|
||||
event->event_count = 0;
|
||||
|
||||
#ifdef PIPE_IS_SHRLIB
|
||||
assert(semnum == 0);
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
if (!semnum) {
|
||||
event->event_semid = -1;
|
||||
event->event_semnum = 0;
|
||||
}
|
||||
#ifndef PIPE_IS_SHRLIB
|
||||
else {
|
||||
event->event_semid = semid;
|
||||
event->event_semnum = semnum;
|
||||
arg.val = 0;
|
||||
n = semctl(semid, semnum, SETVAL, arg);
|
||||
}
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -968,12 +936,6 @@ int ISC_event_post(EVENT event)
|
||||
|
||||
++event->event_count;
|
||||
|
||||
#ifdef PIPE_IS_SHRLIB
|
||||
|
||||
assert(event->event_semid == -1);
|
||||
|
||||
#else
|
||||
|
||||
while (event->event_semid != -1) {
|
||||
arg.val = 0;
|
||||
ret = semctl(event->event_semid, event->event_semnum, SETVAL, arg);
|
||||
@ -985,8 +947,6 @@ int ISC_event_post(EVENT event)
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1055,9 +1015,6 @@ int ISC_event_wait(
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PIPE_IS_SHRLIB
|
||||
assert(FALSE);
|
||||
#else
|
||||
/* Only the internal event work is available in the SHRLIB version of pipe server
|
||||
*/
|
||||
|
||||
@ -1108,13 +1065,11 @@ int ISC_event_wait(
|
||||
ISC_reset_timer(timeout_handler, handler_arg, (SLONG*)&user_timer, (void**)&user_handler);
|
||||
|
||||
return ret;
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
}
|
||||
#endif /* EVENTS */
|
||||
#endif /* UNIX */
|
||||
|
||||
|
||||
#ifndef PIPE_IS_SHRLIB
|
||||
#ifdef VMS
|
||||
#define EVENTS
|
||||
int ISC_event_blocked(USHORT count, EVENT * events, SLONG * values)
|
||||
@ -4321,8 +4276,6 @@ static BOOLEAN semaphore_wait_isc_sync(int count, int semid, int *semnums)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PIPE_IS_SHRLIB */
|
||||
|
||||
|
||||
} // extern "C"
|
||||
|
||||
|
@ -603,11 +603,7 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
*
|
||||
**************************************/
|
||||
DBB dbb;
|
||||
#ifdef STACK_REDUCTION
|
||||
TEXT *allocated_space = NULL;
|
||||
#else
|
||||
TEXT opt_buffer[DPB_EXPAND_BUFFER];
|
||||
#endif
|
||||
TEXT alias_buffer[MAXPATHLEN];
|
||||
TEXT file_name_buffer[MAXPATHLEN];
|
||||
TEXT temp_buffer[MAXPATHLEN];
|
||||
@ -703,21 +699,11 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
|
||||
/* Allocate buffer space */
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
allocated_space =
|
||||
ALL_malloc(DPB_EXPAND_BUFFER + (4 * MAXPATHLEN), ERR_jmp);
|
||||
TEXT* opt_ptr = allocated_space;
|
||||
TEXT* archive_name = opt_ptr + MAXPATHLEN;
|
||||
TEXT* journal_name = archive_name + MAXPATHLEN;
|
||||
TEXT* journal_dir = journal_name + MAXPATHLEN;
|
||||
UCHAR* data = (UCHAR*) (journal_dir + MAXPATHLEN);
|
||||
#else
|
||||
TEXT* opt_ptr = opt_buffer;
|
||||
TEXT archive_name[MAXPATHLEN];
|
||||
TEXT journal_name[MAXPATHLEN];
|
||||
TEXT journal_dir[MAXPATHLEN];
|
||||
UCHAR data[MAXPATHLEN];
|
||||
#endif
|
||||
|
||||
/* Process database parameter block */
|
||||
|
||||
@ -1317,10 +1303,6 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
LOG_call(log_handle_returned, *handle);
|
||||
#endif
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
ALL_free(allocated_space);
|
||||
#endif
|
||||
|
||||
return return_success(tdbb);
|
||||
|
||||
} // try
|
||||
@ -1340,11 +1322,6 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
|
||||
/* At this point, mutex dbb->dbb_mutexes [DBB_MUTX_init_fini] has been
|
||||
unlocked and mutex databases_mutex has been locked. */
|
||||
#ifdef STACK_REDUCTION
|
||||
if (allocated_space) {
|
||||
ALL_free(allocated_space);
|
||||
}
|
||||
#endif
|
||||
if (MemoryPool::blk_type(dbb) == type_dbb)
|
||||
{
|
||||
if (!dbb->dbb_attachments)
|
||||
@ -1780,11 +1757,7 @@ STATUS DLL_EXPORT GDS_CREATE_DATABASE(STATUS* user_status,
|
||||
**************************************/
|
||||
DBB dbb;
|
||||
TEXT expanded_name[MAXPATHLEN];
|
||||
#ifdef STACK_REDUCTION
|
||||
TEXT *allocated_space = NULL;
|
||||
#else
|
||||
TEXT opt_buffer[DPB_EXPAND_BUFFER];
|
||||
#endif
|
||||
TEXT *opt_ptr;
|
||||
USHORT length, page_size;
|
||||
ATT attachment;
|
||||
@ -1839,12 +1812,7 @@ STATUS DLL_EXPORT GDS_CREATE_DATABASE(STATUS* user_status,
|
||||
|
||||
/* Process database parameter block */
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
allocated_space = ALL_malloc(DPB_EXPAND_BUFFER, ERR_jmp);
|
||||
opt_ptr = allocated_space;
|
||||
#else
|
||||
opt_ptr = opt_buffer;
|
||||
#endif
|
||||
|
||||
get_options((UCHAR *)dpb, dpb_length, &opt_ptr, DPB_EXPAND_BUFFER, &options);
|
||||
if (invalid_client_SQL_dialect == FALSE && options.dpb_sql_dialect == 99)
|
||||
@ -2075,10 +2043,6 @@ STATUS DLL_EXPORT GDS_CREATE_DATABASE(STATUS* user_status,
|
||||
*handle = attachment;
|
||||
CCH_flush(tdbb, (USHORT) FLUSH_FINI, 0);
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
ALL_free(allocated_space);
|
||||
#endif
|
||||
|
||||
return return_success(tdbb);
|
||||
|
||||
} // try
|
||||
@ -2098,11 +2062,6 @@ STATUS DLL_EXPORT GDS_CREATE_DATABASE(STATUS* user_status,
|
||||
|
||||
/* At this point, mutex dbb->dbb_mutexes [DBB_MUTX_init_fini] has been
|
||||
unlocked and mutex databases_mutex has been locked. */
|
||||
#ifdef STACK_REDUCTION
|
||||
if (allocated_space) {
|
||||
ALL_free(allocated_space);
|
||||
}
|
||||
#endif
|
||||
if (MemoryPool::blk_type(dbb) == type_dbb)
|
||||
{
|
||||
if (!dbb->dbb_attachments)
|
||||
|
@ -618,23 +618,10 @@ static void open_log(TEXT * file_name, SSHORT file_length, SCHAR * mode)
|
||||
**************************************/
|
||||
DBB dbb;
|
||||
LOG log;
|
||||
#ifndef STACK_REDUCTION
|
||||
SCHAR *log_name, buffer[MAXPATHLEN];
|
||||
#else
|
||||
SCHAR *log_name, *buffer;
|
||||
#endif /* !STACK_REDUCTION */
|
||||
void *log_file;
|
||||
int mask;
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
assert(MAXPATHLEN <= BUFFER_MEDIUM);
|
||||
buffer = (SCHAR *) gds__alloc((SLONG) BUFFER_MEDIUM);
|
||||
if (!buffer) { /* NOMEM: */
|
||||
error("can't open log file (out of memory)");
|
||||
return;
|
||||
}
|
||||
#endif /* STACK_REDUCTION */
|
||||
|
||||
dbb = GET_DBB;
|
||||
|
||||
if (dbb->dbb_log)
|
||||
@ -658,9 +645,5 @@ static void open_log(TEXT * file_name, SSHORT file_length, SCHAR * mode)
|
||||
log->log_string = FB_NEW_RPT(*dbb->dbb_permanent, LOG_BUFFER_LENGTH) str();
|
||||
log->log_ptr = log->log_buffer = log->log_string->str_data;
|
||||
}
|
||||
#ifdef STACK_REDUCTION
|
||||
if (buffer)
|
||||
gds__free((SLONG *) buffer);
|
||||
#endif /* STACK_REDUCTION */
|
||||
}
|
||||
#endif /* REPLAY_OSRI_API_CALLS_SUBSYSTEM */
|
||||
|
@ -301,16 +301,10 @@ RSB OPT_compile(TDBB tdbb,
|
||||
JRD_REL relation;
|
||||
SLONG idx_size, conjunct_count;
|
||||
SSHORT i, stream;
|
||||
#ifndef STACK_REDUCTION
|
||||
UCHAR *p, *q, streams[MAX_STREAMS], beds[MAX_STREAMS],
|
||||
*k, *b_end, *k_end, key_streams[MAX_STREAMS],
|
||||
local_streams[MAX_STREAMS], outer_streams[MAX_STREAMS],
|
||||
sub_streams[MAX_STREAMS]
|
||||
#else
|
||||
UCHAR *local_streams, *outer_streams, *sub_streams;
|
||||
UCHAR *p, *q, *streams, *beds, *k, *b_end, *k_end, *key_streams;
|
||||
#endif
|
||||
|
||||
DEV_BLKCHK(csb, type_csb);
|
||||
DEV_BLKCHK(rse, type_nod);
|
||||
DEV_BLKCHK(parent_stack, type_lls);
|
||||
@ -338,52 +332,8 @@ RSB OPT_compile(TDBB tdbb,
|
||||
idx = (IDX *) NULL;
|
||||
idx_size = 0;
|
||||
|
||||
#ifdef STACK_REDUCTION
|
||||
|
||||
/* allocate local memory, make a block allocation for similar items */
|
||||
|
||||
streams =
|
||||
(UCHAR *) ALLOC_LIB_MEMORY((DWORD) (sizeof(UCHAR) * MAX_STREAMS));
|
||||
beds = (UCHAR *) ALLOC_LIB_MEMORY((DWORD) (sizeof(UCHAR) * MAX_STREAMS));
|
||||
key_streams =
|
||||
(UCHAR *) ALLOC_LIB_MEMORY((DWORD) (sizeof(UCHAR) * MAX_STREAMS));
|
||||
local_streams =
|
||||
(UCHAR *) ALLOC_LIB_MEMORY((DWORD) (sizeof(UCHAR) * MAX_STREAMS));
|
||||
outer_streams =
|
||||
(UCHAR *) ALLOC_LIB_MEMORY((DWORD) (sizeof(UCHAR) * MAX_STREAMS));
|
||||
sub_streams =
|
||||
(UCHAR *) ALLOC_LIB_MEMORY((DWORD) (sizeof(UCHAR) * MAX_STREAMS));
|
||||
opt_ = (OPT) ALLOC_LIB_MEMORY((DWORD) (sizeof(Opt)));
|
||||
if (streams == NULL || beds == NULL || key_streams == NULL ||
|
||||
local_streams == NULL || opt_ == NULL) {
|
||||
if (local_streams != NULL)
|
||||
FREE_LIB_MEMORY(local_streams);
|
||||
if (key_streams != NULL)
|
||||
FREE_LIB_MEMORY(key_streams);
|
||||
if (beds != NULL)
|
||||
FREE_LIB_MEMORY(beds);
|
||||
if (streams != NULL)
|
||||
FREE_LIB_MEMORY(streams);
|
||||
if (outer_streams != NULL)
|
||||
FREE_LIB_MEMORY(outer_streams);
|
||||
if (sub_streams != NULL)
|
||||
FREE_LIB_MEMORY(sub_streams);
|
||||
if (opt_ != NULL)
|
||||
FREE_LIB_MEMORY(opt_);
|
||||
ERR_post(isc_virmemexh, 0);
|
||||
}
|
||||
|
||||
/* clear block and set block type */
|
||||
|
||||
MOVE_CLEAR(opt_, sizeof(Opt));
|
||||
((BLK) opt_)->blk_type = type_opt;
|
||||
|
||||
#else
|
||||
|
||||
opt_ = FB_NEW(*dbb->dbb_permanent) Opt();
|
||||
|
||||
#endif
|
||||
|
||||
try {
|
||||
|
||||
opt_->opt_csb = csb;
|
||||
@ -747,19 +697,7 @@ RSB OPT_compile(TDBB tdbb,
|
||||
|
||||
DEBUG
|
||||
/* free up memory for optimizer structures */
|
||||
#ifdef STACK_REDUCTION
|
||||
FREE_LIB_MEMORY(sub_streams);
|
||||
FREE_LIB_MEMORY(outer_streams);
|
||||
FREE_LIB_MEMORY(local_streams);
|
||||
FREE_LIB_MEMORY(key_streams);
|
||||
FREE_LIB_MEMORY(beds);
|
||||
FREE_LIB_MEMORY(streams);
|
||||
FREE_LIB_MEMORY(opt_);
|
||||
|
||||
#else
|
||||
delete opt_;
|
||||
|
||||
#endif
|
||||
delete opt_;
|
||||
|
||||
#ifdef OPT_DEBUG
|
||||
if (opt_debug_file) {
|
||||
@ -777,17 +715,7 @@ RSB OPT_compile(TDBB tdbb,
|
||||
delete csb->csb_rpt[stream].csb_idx_allocation;
|
||||
csb->csb_rpt[stream].csb_idx_allocation = 0;
|
||||
}
|
||||
#ifdef STACK_REDUCTION
|
||||
FREE_LIB_MEMORY(sub_streams);
|
||||
FREE_LIB_MEMORY(outer_streams);
|
||||
FREE_LIB_MEMORY(local_streams);
|
||||
FREE_LIB_MEMORY(key_streams);
|
||||
FREE_LIB_MEMORY(beds);
|
||||
FREE_LIB_MEMORY(streams);
|
||||
FREE_LIB_MEMORY(opt_);
|
||||
#else
|
||||
delete opt_;
|
||||
#endif
|
||||
ERR_punt();
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
*
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
* $Id: sort.cpp,v 1.28 2003-02-13 13:33:57 dimitr Exp $
|
||||
* $Id: sort.cpp,v 1.29 2003-02-14 02:24:43 brodsom Exp $
|
||||
*
|
||||
* 2001-09-24 SJL - Temporary fix for large sort file bug
|
||||
*
|
||||
@ -2679,9 +2679,7 @@ static ULONG order(SCB scb)
|
||||
SORT_RECORD **ptr;
|
||||
SORTP* buffer = 0;
|
||||
SSHORT length;
|
||||
#ifndef STACK_EFFICIENT
|
||||
ULONG temp[1024];
|
||||
#endif
|
||||
|
||||
ptr = scb->scb_first_pointer + 1; /* 1st ptr is low key */
|
||||
|
||||
@ -2693,17 +2691,12 @@ static ULONG order(SCB scb)
|
||||
>(scb->scb_last_record));
|
||||
|
||||
try {
|
||||
#ifdef STACK_EFFICIENT
|
||||
buffer =
|
||||
(ULONG *) gds__alloc((SLONG) (scb->scb_longs * sizeof(ULONG)));
|
||||
#else
|
||||
if ((scb->scb_longs * sizeof(ULONG)) > sizeof(temp))
|
||||
buffer =
|
||||
(ULONG *) gds__alloc((SLONG) (scb->scb_longs*sizeof(ULONG)));
|
||||
/* FREE: buffer is freed later in this routine */
|
||||
else
|
||||
buffer = temp;
|
||||
#endif /* STACK_EFFICIENT */
|
||||
} catch(const std::exception&) {
|
||||
if (!buffer)
|
||||
error_memory(scb);
|
||||
@ -2788,9 +2781,7 @@ static ULONG order(SCB scb)
|
||||
* only fatal failures possible there
|
||||
*/
|
||||
|
||||
#ifndef STACK_EFFICIENT
|
||||
if (buffer != temp)
|
||||
#endif
|
||||
if (buffer != NULL)
|
||||
gds__free(buffer);
|
||||
|
||||
|
@ -1040,7 +1040,6 @@ int API_ROUTINE gds__get_client_minor_version()
|
||||
}
|
||||
|
||||
|
||||
#ifndef PIPE_CLIENT
|
||||
void API_ROUTINE gds__map_blobs(int *handle1, int *handle2)
|
||||
{
|
||||
/**************************************
|
||||
@ -1069,7 +1068,6 @@ void API_ROUTINE gds__map_blobs(int *handle1, int *handle2)
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !(defined REQUESTER)
|
||||
|
265
src/jrd/why.cpp
265
src/jrd/why.cpp
@ -42,7 +42,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
$Id: why.cpp,v 1.13 2003-02-13 22:49:15 brodsom Exp $
|
||||
$Id: why.cpp,v 1.14 2003-02-14 02:24:43 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -163,12 +163,6 @@ extern int access();
|
||||
#define NO_LOCAL_DSQL
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_CLIENT
|
||||
#define NO_LOCAL_DSQL
|
||||
#define THREAD_ENTER
|
||||
#define THREAD_EXIT
|
||||
#endif
|
||||
|
||||
#ifdef SUPERCLIENT
|
||||
#define NO_LOCAL_DSQL
|
||||
#endif
|
||||
@ -235,10 +229,6 @@ static const PTR get_entrypoint(int, int);
|
||||
static SCHAR *get_sqlda_buffer(SCHAR *, USHORT, XSQLDA *, USHORT, USHORT *);
|
||||
static STATUS get_transaction_info(STATUS *, WHY_TRA, TEXT **);
|
||||
|
||||
#ifdef INITIALIZE_PATHS
|
||||
static void init_paths(void);
|
||||
#endif
|
||||
|
||||
static void iterative_sql_info(STATUS *, WHY_STMT *, SSHORT, const SCHAR *, SSHORT,
|
||||
SCHAR *, USHORT, XSQLDA *);
|
||||
static STATUS no_entrypoint(STATUS * user_status, ...);
|
||||
@ -282,7 +272,7 @@ static SLONG why_enabled = 0;
|
||||
#define FPE_RESET_NEXT_API_CALL 0x1 /* Reset FPE on next gds call */
|
||||
#define FPE_RESET_ALL_API_CALL 0x2 /* Reset FPE on all gds call */
|
||||
|
||||
#if !(defined REQUESTER || defined PIPE_CLIENT || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
#if !(defined REQUESTER || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
extern ULONG isc_enter_count;
|
||||
static ULONG subsystem_usage = 0;
|
||||
static USHORT subsystem_FPE_reset = FPE_RESET_INIT_ONLY;
|
||||
@ -476,60 +466,14 @@ typedef struct
|
||||
TEXT *path;
|
||||
} IMAGE;
|
||||
|
||||
#ifdef INITIALIZE_PATHS
|
||||
#define CONST_IMAGE /* nothing */
|
||||
#else
|
||||
#define CONST_IMAGE const
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef PIPE_CLIENT
|
||||
|
||||
/* Define simple table for pipe server client-side */
|
||||
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe, win,winipi) extern STATUS pipe(STATUS * user_status, ...), bridge_pipe(STATUS * user_status, ...);
|
||||
#include "../jrd/entry.h"
|
||||
|
||||
static CONST_IMAGE IMAGE images[] =
|
||||
{
|
||||
"PIPE", "PIPE", /* Pipe interface */
|
||||
"PIPE5", "PIPE5" /* Pipe interface bridge to V3 */
|
||||
};
|
||||
|
||||
#else /* PIPE_CLIENT */
|
||||
|
||||
/* Define complicated table for multi-subsystem world */
|
||||
|
||||
#ifdef VMS
|
||||
#define V3
|
||||
#define RDB
|
||||
#endif
|
||||
|
||||
#if (defined UNIX) && \
|
||||
!(defined SUPERCLIENT || defined SUPERSERVER || defined linux || defined FREEBSD || defined NETBSD || defined AIX_PPC || defined DARWIN || defined SINIXZ || defined SOLARIS /* platforms without a V3 bridge */)
|
||||
#ifndef PIPE_SERVER_YVALUE
|
||||
#define PIPE_BRIDGE_TO_V3
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_BRIDGE_TO_V3
|
||||
#if !(defined BACKEND) && (defined hpux)
|
||||
#undef PIPE_BRIDGE_TO_V3
|
||||
#define V3
|
||||
#define V3_PATH "lib/bridge5"
|
||||
#define GDS_A_PATH "lib/gds_1"
|
||||
#define GDS_B_PATH "lib/gds_2"
|
||||
#define GDS_C_PATH "lib/gds_3"
|
||||
#define GDS_D_PATH "lib/gds_4"
|
||||
#define INITIALIZE_PATHS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef V3_PATH
|
||||
#define V3_PATH "GDSSHR5"
|
||||
#endif
|
||||
|
||||
#ifndef GDS_A_PATH
|
||||
#define GDS_A_PATH "GDS_A"
|
||||
#define GDS_B_PATH "GDS_B"
|
||||
@ -537,12 +481,6 @@ static CONST_IMAGE IMAGE images[] =
|
||||
#define GDS_D_PATH "GDS_D"
|
||||
#endif
|
||||
|
||||
#ifdef INITIALIZE_PATHS
|
||||
static SSHORT paths_initialized = 0;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef CSI
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) extern STATUS rem(STATUS * user_status, ...), cur(STATUS * user_status, ...), csi(STATUS * user_status, ...);
|
||||
#else
|
||||
@ -559,16 +497,6 @@ static SSHORT paths_initialized = 0;
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_BRIDGE_TO_V3
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) extern STATUS bridge_pipe(STATUS * user_status, ...);
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef ALTPIPE
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) extern STATUS pipe(STATUS * user_status, ...);
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef IPSERV
|
||||
#ifndef XNET
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) extern STATUS winipi(STATUS * user_status, ...);
|
||||
@ -584,24 +512,12 @@ static CONST_IMAGE IMAGE images[] =
|
||||
{"CSI", "CSI"}, /* Central server interface */
|
||||
#endif
|
||||
|
||||
#ifdef ALTPIPE
|
||||
{"GDSPIPE", "ALTPIPE"}, /* Alternate pipe interface */
|
||||
#endif
|
||||
|
||||
#ifndef REQUESTER
|
||||
#ifndef SUPERCLIENT
|
||||
{"GDSSHR", "GDSSHR"}, /* Primary access method */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef V3
|
||||
{"GDSSHR5", V3_PATH}, /* Previous access method */
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_BRIDGE_TO_V3
|
||||
{"PIPE5", "PIPE5"}, /* Pipe interface bridge to V3 */
|
||||
#endif
|
||||
|
||||
#ifdef RDB
|
||||
{"GDSRDB", "GDSRDB"}, /* Rdb Interface */
|
||||
#endif
|
||||
@ -619,22 +535,11 @@ static CONST_IMAGE IMAGE images[] =
|
||||
#endif
|
||||
|
||||
};
|
||||
#endif /* PIPE_CLIENT */
|
||||
|
||||
|
||||
#define SUBSYSTEMS sizeof (images) / (sizeof (IMAGE))
|
||||
|
||||
static const ENTRY entrypoints[PROC_count * SUBSYSTEMS] =
|
||||
{
|
||||
#ifdef PIPE_CLIENT
|
||||
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, pipe},
|
||||
#include "../jrd/entry.h"
|
||||
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, bridge_pipe},
|
||||
#include "../jrd/entry.h"
|
||||
|
||||
#else
|
||||
|
||||
#ifndef EMBEDDED
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, rem},
|
||||
@ -646,11 +551,6 @@ static const ENTRY entrypoints[PROC_count * SUBSYSTEMS] =
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef ALTPIPE
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, pipe},
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifndef REQUESTER
|
||||
#ifndef SUPERCLIENT
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, cur},
|
||||
@ -658,16 +558,6 @@ static const ENTRY entrypoints[PROC_count * SUBSYSTEMS] =
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef V3
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {bridge, NULL},
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_BRIDGE_TO_V3
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, bridge_pipe},
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef RDB
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, rdb},
|
||||
#include "../jrd/entry.h"
|
||||
@ -680,7 +570,6 @@ static const ENTRY entrypoints[PROC_count * SUBSYSTEMS] =
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
static const TEXT *generic[] = {
|
||||
@ -772,13 +661,9 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
USHORT n, length, org_length, temp_length;
|
||||
WHY_DBB database;
|
||||
UCHAR *current_dpb_ptr, *last_dpb_ptr;
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *expanded_filename, *temp_filebuf;
|
||||
#else
|
||||
TEXT expanded_filename[MAXPATHLEN], temp_filebuf[MAXPATHLEN];
|
||||
#endif
|
||||
TEXT *p, *q, *temp_filename;
|
||||
#if defined(UNIX) && !defined(PIPE_CLIENT)
|
||||
#if defined(UNIX)
|
||||
TEXT single_user[5];
|
||||
#endif
|
||||
|
||||
@ -816,28 +701,6 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
subsystem_enter();
|
||||
SUBSYSTEM_USAGE_INCR;
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
expanded_filename =
|
||||
(TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
if (!expanded_filename)
|
||||
{
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = isc_virmemexh;
|
||||
status[2] = isc_arg_end;
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
}
|
||||
temp_filebuf = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
if (!temp_filebuf)
|
||||
{
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = isc_virmemexh;
|
||||
status[2] = isc_arg_end;
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
}
|
||||
#endif
|
||||
temp_filename = temp_filebuf;
|
||||
|
||||
ptr = status;
|
||||
@ -875,7 +738,6 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
|
||||
#ifdef UNIX
|
||||
/* added so that only the pipe_server goes in here */
|
||||
#ifndef PIPE_CLIENT
|
||||
single_user[0] = 0;
|
||||
if (open_marker_file(status, expanded_filename, single_user))
|
||||
{
|
||||
@ -887,7 +749,6 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
isc_set_single_user(¤t_dpb_ptr, &dpb_length, single_user);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Special handling of dpb pointers to handle multiple extends of the dpb */
|
||||
last_dpb_ptr = current_dpb_ptr;
|
||||
@ -941,10 +802,6 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
gds__free((SLONG *) current_dpb_ptr);
|
||||
}
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
gds__free((SLONG *) temp_filebuf);
|
||||
#endif
|
||||
database->cleanup = NULL;
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = 0;
|
||||
@ -973,11 +830,6 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
gds__free((SLONG *) current_dpb_ptr);
|
||||
}
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
gds__free((SLONG *) temp_filebuf);
|
||||
#endif
|
||||
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
}
|
||||
@ -1425,11 +1277,7 @@ STATUS API_ROUTINE GDS_CREATE_DATABASE(STATUS * user_status,
|
||||
STATUS local[ISC_STATUS_LENGTH], *status, temp[ISC_STATUS_LENGTH], *ptr;
|
||||
USHORT n, length, org_length, temp_length;
|
||||
WHY_DBB database;
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *expanded_filename, *temp_filebuf;
|
||||
#else
|
||||
TEXT expanded_filename[MAXPATHLEN], temp_filebuf[MAXPATHLEN];
|
||||
#endif
|
||||
TEXT *p, *q, *temp_filename;
|
||||
UCHAR *current_dpb_ptr, *last_dpb_ptr;
|
||||
#ifdef UNIX
|
||||
@ -1469,27 +1317,6 @@ STATUS API_ROUTINE GDS_CREATE_DATABASE(STATUS * user_status,
|
||||
subsystem_enter();
|
||||
SUBSYSTEM_USAGE_INCR;
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
expanded_filename = (TEXT*)gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
if (!expanded_filename)
|
||||
{
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = isc_virmemexh;
|
||||
status[2] = isc_arg_end;
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
}
|
||||
temp_filebuf = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
if (!temp_filebuf)
|
||||
{
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = isc_virmemexh;
|
||||
status[2] = isc_arg_end;
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
}
|
||||
#endif
|
||||
temp_filename = temp_filebuf;
|
||||
|
||||
ptr = status;
|
||||
@ -1610,10 +1437,6 @@ STATUS API_ROUTINE GDS_CREATE_DATABASE(STATUS * user_status,
|
||||
|
||||
if (current_dpb_ptr != dpb)
|
||||
gds__free((SLONG *) current_dpb_ptr);
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
gds__free((SLONG *) temp_filebuf);
|
||||
#endif
|
||||
database->cleanup = NULL;
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = 0;
|
||||
@ -1629,10 +1452,6 @@ STATUS API_ROUTINE GDS_CREATE_DATABASE(STATUS * user_status,
|
||||
|
||||
if (current_dpb_ptr != dpb)
|
||||
gds__free((SLONG *) current_dpb_ptr);
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
gds__free((SLONG *) temp_filebuf);
|
||||
#endif
|
||||
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
@ -1739,7 +1558,7 @@ STATUS API_ROUTINE GDS_DDL(STATUS * user_status,
|
||||
WHY_ATT database;
|
||||
WHY_TRA transaction;
|
||||
|
||||
#if !defined(PIPE_CLIENT) && !defined(SUPERCLIENT)
|
||||
#if !defined(SUPERCLIENT)
|
||||
TEXT *image;
|
||||
PTR entrypoint;
|
||||
#endif
|
||||
@ -1773,7 +1592,6 @@ STATUS API_ROUTINE GDS_DDL(STATUS * user_status,
|
||||
|
||||
no_entrypoint(status);
|
||||
|
||||
#ifndef PIPE_CLIENT
|
||||
#ifndef SUPERCLIENT
|
||||
char DYN_ddl[] = "DYN_ddl";
|
||||
if ((image = images[database->implementation].path) != NULL &&
|
||||
@ -1784,7 +1602,6 @@ STATUS API_ROUTINE GDS_DDL(STATUS * user_status,
|
||||
CHECK_STATUS_SUCCESS(status);
|
||||
return FB_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return error2(status, local);
|
||||
@ -2169,11 +1986,7 @@ STATUS API_ROUTINE isc_dsql_describe(STATUS * user_status,
|
||||
**************************************/
|
||||
STATUS *status, local[ISC_STATUS_LENGTH];
|
||||
USHORT buffer_len;
|
||||
#ifdef STACK_EFFICIENT
|
||||
SCHAR *buffer, local_buffer[1];
|
||||
#else
|
||||
SCHAR *buffer, local_buffer[512];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
GET_STATUS;
|
||||
CHECK_HANDLE(*stmt_handle, HANDLE_statement, isc_bad_stmt_handle);
|
||||
@ -2232,11 +2045,7 @@ STATUS API_ROUTINE isc_dsql_describe_bind(STATUS * user_status,
|
||||
**************************************/
|
||||
STATUS *status, local[ISC_STATUS_LENGTH];
|
||||
USHORT buffer_len;
|
||||
#ifdef STACK_EFFICIENT
|
||||
SCHAR *buffer, local_buffer[1];
|
||||
#else
|
||||
SCHAR *buffer, local_buffer[512];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
GET_STATUS;
|
||||
CHECK_HANDLE(*stmt_handle, HANDLE_statement, isc_bad_stmt_handle);
|
||||
@ -3329,11 +3138,7 @@ STATUS API_ROUTINE GDS_DSQL_PREPARE(STATUS * user_status,
|
||||
**************************************/
|
||||
STATUS *status, local[ISC_STATUS_LENGTH];
|
||||
USHORT buffer_len;
|
||||
#ifdef STACK_EFFICIENT
|
||||
SCHAR *buffer, local_buffer[1];
|
||||
#else
|
||||
SCHAR *buffer, local_buffer[BUFFER_MEDIUM];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
DASUP dasup;
|
||||
|
||||
GET_STATUS;
|
||||
@ -4219,7 +4024,7 @@ SLONG API_ROUTINE isc_reset_fpe(USHORT fpe_status)
|
||||
* Prior setting of the FPE reset flag
|
||||
*
|
||||
**************************************/
|
||||
#if !(defined REQUESTER || defined PIPE_CLIENT || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
#if !(defined REQUESTER || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
SLONG prior;
|
||||
prior = (SLONG) subsystem_FPE_reset;
|
||||
switch (fpe_status) {
|
||||
@ -5353,7 +5158,7 @@ static void exit_handler(EVENT why_event)
|
||||
|
||||
why_initialized = FALSE;
|
||||
why_enabled = 0;
|
||||
#if !(defined REQUESTER || defined PIPE_CLIENT || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
#if !(defined REQUESTER || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
isc_enter_count = 0;
|
||||
subsystem_usage = 0;
|
||||
subsystem_FPE_reset = FPE_RESET_INIT_ONLY;
|
||||
@ -5446,7 +5251,7 @@ static const PTR get_entrypoint(int proc, int implementation)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
#if !defined(PIPE_CLIENT) && !defined(SUPERCLIENT)
|
||||
#if !defined(SUPERCLIENT)
|
||||
const TEXT *name;
|
||||
TEXT *image;
|
||||
#endif
|
||||
@ -5459,16 +5264,7 @@ static const PTR get_entrypoint(int proc, int implementation)
|
||||
return entrypoint;
|
||||
}
|
||||
|
||||
#ifndef PIPE_CLIENT
|
||||
#ifndef SUPERCLIENT
|
||||
#ifdef INITIALIZE_PATHS
|
||||
if (!paths_initialized)
|
||||
{
|
||||
paths_initialized = TRUE;
|
||||
init_paths();
|
||||
}
|
||||
#endif
|
||||
|
||||
image = images[implementation].path;
|
||||
name = ent->name;
|
||||
if (!name)
|
||||
@ -5497,7 +5293,6 @@ static const PTR get_entrypoint(int proc, int implementation)
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return &no_entrypoint;
|
||||
@ -5645,48 +5440,6 @@ static void iterative_sql_info(STATUS * user_status,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef INITIALIZE_PATHS
|
||||
static void init_paths(void)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* i n i t _ p a t h s
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Initialize the paths to use in dynamically
|
||||
* looking up entrypoints.
|
||||
*
|
||||
**************************************/
|
||||
USHORT n;
|
||||
IMAGE *sys;
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *path;
|
||||
#else
|
||||
TEXT path[MAXPATHLEN];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
if (path = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN)))
|
||||
/* if we fail don't try to do the remainder of the function since*/
|
||||
/* we will probably die a horrible death in gds_prefix */
|
||||
#endif /* STACK_EFFICIENT */
|
||||
for (n = 0, sys = images; n < SUBSYSTEMS; n++, sys++)
|
||||
if (sys->path) {
|
||||
gds__prefix(path, sys->path);
|
||||
sys->path = alloc((SLONG) (strlen(path) + 1));
|
||||
strcpy(sys->path, path);
|
||||
}
|
||||
#ifdef STACK_EFFICIENT
|
||||
if (path)
|
||||
gds__free((SLONG *) path);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static STATUS open_blob(STATUS * user_status,
|
||||
WHY_ATT * db_handle,
|
||||
WHY_TRA * tra_handle,
|
||||
@ -6168,7 +5921,7 @@ static void subsystem_enter(void)
|
||||
#endif
|
||||
|
||||
THREAD_ENTER;
|
||||
#if !(defined REQUESTER || defined PIPE_CLIENT || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
#if !(defined REQUESTER || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
isc_enter_count++;
|
||||
if (subsystem_usage == 0 ||
|
||||
(subsystem_FPE_reset &
|
||||
@ -6207,7 +5960,7 @@ static void subsystem_exit(void)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
#if !(defined REQUESTER || defined PIPE_CLIENT || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
#if !(defined REQUESTER || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
if (subsystem_usage == 0 ||
|
||||
(subsystem_FPE_reset &
|
||||
(FPE_RESET_NEXT_API_CALL | FPE_RESET_ALL_API_CALL)))
|
||||
|
@ -36,7 +36,7 @@
|
||||
*
|
||||
*/
|
||||
/*
|
||||
$Id: y-valve.cpp,v 1.22 2003-02-13 10:11:23 dimitr Exp $
|
||||
$Id: y-valve.cpp,v 1.23 2003-02-14 02:24:42 brodsom Exp $
|
||||
*/
|
||||
|
||||
#include "firebird.h"
|
||||
@ -156,12 +156,6 @@ extern int access();
|
||||
#define NO_LOCAL_DSQL
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_CLIENT
|
||||
#define NO_LOCAL_DSQL
|
||||
#define THREAD_ENTER
|
||||
#define THREAD_EXIT
|
||||
#endif
|
||||
|
||||
#ifdef SUPERCLIENT
|
||||
#define NO_LOCAL_DSQL
|
||||
#endif
|
||||
@ -284,7 +278,7 @@ static SLONG why_enabled = 0;
|
||||
#define FPE_RESET_NEXT_API_CALL 0x1 /* Reset FPE on next gds call */
|
||||
#define FPE_RESET_ALL_API_CALL 0x2 /* Reset FPE on all gds call */
|
||||
|
||||
#if !(defined REQUESTER || defined PIPE_CLIENT || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
#if !(defined REQUESTER || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
extern ULONG isc_enter_count;
|
||||
static ULONG subsystem_usage = 0;
|
||||
static USHORT subsystem_FPE_reset = FPE_RESET_INIT_ONLY;
|
||||
@ -478,60 +472,14 @@ typedef struct
|
||||
TEXT *path;
|
||||
} IMAGE;
|
||||
|
||||
#ifdef INITIALIZE_PATHS
|
||||
#define CONST_IMAGE /* nothing */
|
||||
#else
|
||||
#define CONST_IMAGE const
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef PIPE_CLIENT
|
||||
|
||||
/* Define simple table for pipe server client-side */
|
||||
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe, win,winipi) extern STATUS pipe(), bridge_pipe();
|
||||
#include "../jrd/entry.h"
|
||||
|
||||
static CONST_IMAGE IMAGE images[] =
|
||||
{
|
||||
"PIPE", "PIPE", /* Pipe interface */
|
||||
"PIPE5", "PIPE5" /* Pipe interface bridge to V3 */
|
||||
};
|
||||
|
||||
#else /* PIPE_CLIENT */
|
||||
|
||||
/* Define complicated table for multi-subsystem world */
|
||||
|
||||
#ifdef VMS
|
||||
#define V3
|
||||
#define RDB
|
||||
#endif
|
||||
|
||||
#if (defined UNIX) && \
|
||||
!(defined SUPERCLIENT || defined SUPERSERVER || defined linux || defined FREEBSD || defined NETBSD || defined AIX_PPC || defined DARWIN /* platforms without a V3 bridge */)
|
||||
#ifndef PIPE_SERVER_YVALUE
|
||||
#define PIPE_BRIDGE_TO_V3
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_BRIDGE_TO_V3
|
||||
#if !(defined BACKEND) && (defined hpux)
|
||||
#undef PIPE_BRIDGE_TO_V3
|
||||
#define V3
|
||||
#define V3_PATH "lib/bridge5"
|
||||
#define GDS_A_PATH "lib/gds_1"
|
||||
#define GDS_B_PATH "lib/gds_2"
|
||||
#define GDS_C_PATH "lib/gds_3"
|
||||
#define GDS_D_PATH "lib/gds_4"
|
||||
#define INITIALIZE_PATHS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef V3_PATH
|
||||
#define V3_PATH "GDSSHR5"
|
||||
#endif
|
||||
|
||||
#ifndef GDS_A_PATH
|
||||
#define GDS_A_PATH "GDS_A"
|
||||
#define GDS_B_PATH "GDS_B"
|
||||
@ -539,12 +487,6 @@ static CONST_IMAGE IMAGE images[] =
|
||||
#define GDS_D_PATH "GDS_D"
|
||||
#endif
|
||||
|
||||
#ifdef INITIALIZE_PATHS
|
||||
static SSHORT paths_initialized = 0;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifdef CSI
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) extern STATUS rem(), cur(), csi();
|
||||
#else
|
||||
@ -561,16 +503,6 @@ static SSHORT paths_initialized = 0;
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_BRIDGE_TO_V3
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) extern STATUS bridge_pipe();
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef ALTPIPE
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) extern STATUS pipe();
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef IPSERV
|
||||
#ifndef XNET
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) extern STATUS winipi();
|
||||
@ -586,24 +518,12 @@ static CONST_IMAGE IMAGE images[] =
|
||||
{"CSI", "CSI"}, /* Central server interface */
|
||||
#endif
|
||||
|
||||
#ifdef ALTPIPE
|
||||
{"GDSPIPE", "ALTPIPE"}, /* Alternate pipe interface */
|
||||
#endif
|
||||
|
||||
#ifndef REQUESTER
|
||||
#ifndef SUPERCLIENT
|
||||
{"GDSSHR", "GDSSHR"}, /* Primary access method */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef V3
|
||||
{"GDSSHR5", V3_PATH}, /* Previous access method */
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_BRIDGE_TO_V3
|
||||
{"PIPE5", "PIPE5"}, /* Pipe interface bridge to V3 */
|
||||
#endif
|
||||
|
||||
#ifdef RDB
|
||||
{"GDSRDB", "GDSRDB"}, /* Rdb Interface */
|
||||
#endif
|
||||
@ -619,22 +539,12 @@ static CONST_IMAGE IMAGE images[] =
|
||||
#endif
|
||||
|
||||
};
|
||||
#endif /* PIPE_CLIENT */
|
||||
|
||||
|
||||
#define SUBSYSTEMS sizeof (images) / (sizeof (IMAGE))
|
||||
|
||||
static const ENTRY entrypoints[PROC_count * SUBSYSTEMS] =
|
||||
{
|
||||
#ifdef PIPE_CLIENT
|
||||
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, pipe},
|
||||
#include "../jrd/entry.h"
|
||||
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, bridge_pipe},
|
||||
#include "../jrd/entry.h"
|
||||
|
||||
#else
|
||||
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, rem},
|
||||
#include "../jrd/entry.h"
|
||||
@ -644,11 +554,6 @@ static const ENTRY entrypoints[PROC_count * SUBSYSTEMS] =
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef ALTPIPE
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, pipe},
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifndef REQUESTER
|
||||
#ifndef SUPERCLIENT
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, cur},
|
||||
@ -656,16 +561,6 @@ static const ENTRY entrypoints[PROC_count * SUBSYSTEMS] =
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef V3
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {bridge, NULL},
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef PIPE_BRIDGE_TO_V3
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, bridge_pipe},
|
||||
#include "../jrd/entry.h"
|
||||
#endif
|
||||
|
||||
#ifdef RDB
|
||||
#define ENTRYPOINT(gen,cur,bridge,rem,os2_rem,csi,rdb,pipe,bridge_pipe,win,winipi) {NULL, rdb},
|
||||
#include "../jrd/entry.h"
|
||||
@ -678,7 +573,6 @@ static const ENTRY entrypoints[PROC_count * SUBSYSTEMS] =
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
static const TEXT *generic[] = {
|
||||
@ -770,13 +664,9 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
USHORT n, length, org_length, temp_length;
|
||||
DBB database;
|
||||
SCHAR *current_dpb_ptr, *last_dpb_ptr;
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *expanded_filename, *temp_filebuf;
|
||||
#else
|
||||
TEXT expanded_filename[MAXPATHLEN], temp_filebuf[MAXPATHLEN];
|
||||
#endif
|
||||
TEXT *p, *q, *temp_filename;
|
||||
#if defined(UNIX) && !defined(PIPE_CLIENT)
|
||||
#if defined(UNIX)
|
||||
TEXT single_user[5];
|
||||
#endif
|
||||
|
||||
@ -814,28 +704,6 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
subsystem_enter();
|
||||
SUBSYSTEM_USAGE_INCR;
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
expanded_filename =
|
||||
(TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
if (!expanded_filename)
|
||||
{
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = isc_virmemexh;
|
||||
status[2] = isc_arg_end;
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
}
|
||||
temp_filebuf = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
if (!temp_filebuf)
|
||||
{
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = isc_virmemexh;
|
||||
status[2] = isc_arg_end;
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
}
|
||||
#endif
|
||||
temp_filename = temp_filebuf;
|
||||
|
||||
ptr = status;
|
||||
@ -873,7 +741,6 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
|
||||
#ifdef UNIX
|
||||
/* added so that only the pipe_server goes in here */
|
||||
#ifndef PIPE_CLIENT
|
||||
single_user[0] = 0;
|
||||
if (open_marker_file(status, expanded_filename, single_user))
|
||||
{
|
||||
@ -885,7 +752,6 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
isc_set_single_user((UCHAR**)¤t_dpb_ptr, &dpb_length, single_user);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Special handling of dpb pointers to handle multiple extends of the dpb */
|
||||
last_dpb_ptr = current_dpb_ptr;
|
||||
@ -939,10 +805,6 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
gds__free((SLONG *) current_dpb_ptr);
|
||||
}
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
gds__free((SLONG *) temp_filebuf);
|
||||
#endif
|
||||
database->cleanup = NULL;
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = 0;
|
||||
@ -971,11 +833,6 @@ STATUS API_ROUTINE GDS_ATTACH_DATABASE(STATUS* user_status,
|
||||
gds__free((SLONG *) current_dpb_ptr);
|
||||
}
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
gds__free((SLONG *) temp_filebuf);
|
||||
#endif
|
||||
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
}
|
||||
@ -1423,11 +1280,7 @@ STATUS API_ROUTINE GDS_CREATE_DATABASE(STATUS * user_status,
|
||||
STATUS local[ISC_STATUS_LENGTH], *status, temp[ISC_STATUS_LENGTH], *ptr;
|
||||
USHORT n, length, org_length, temp_length;
|
||||
DBB database;
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *expanded_filename, *temp_filebuf;
|
||||
#else
|
||||
TEXT expanded_filename[MAXPATHLEN], temp_filebuf[MAXPATHLEN];
|
||||
#endif
|
||||
TEXT *p, *q, *temp_filename;
|
||||
UCHAR *current_dpb_ptr, *last_dpb_ptr;
|
||||
#ifdef UNIX
|
||||
@ -1467,27 +1320,6 @@ STATUS API_ROUTINE GDS_CREATE_DATABASE(STATUS * user_status,
|
||||
subsystem_enter();
|
||||
SUBSYSTEM_USAGE_INCR;
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
expanded_filename = (TEXT*)gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
if (!expanded_filename)
|
||||
{
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = isc_virmemexh;
|
||||
status[2] = isc_arg_end;
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
}
|
||||
temp_filebuf = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN));
|
||||
if (!temp_filebuf)
|
||||
{
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = isc_virmemexh;
|
||||
status[2] = isc_arg_end;
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
}
|
||||
#endif
|
||||
temp_filename = temp_filebuf;
|
||||
|
||||
ptr = status;
|
||||
@ -1590,10 +1422,6 @@ STATUS API_ROUTINE GDS_CREATE_DATABASE(STATUS * user_status,
|
||||
|
||||
if (current_dpb_ptr != dpb)
|
||||
gds__free((SLONG *) current_dpb_ptr);
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
gds__free((SLONG *) temp_filebuf);
|
||||
#endif
|
||||
database->cleanup = NULL;
|
||||
status[0] = isc_arg_gds;
|
||||
status[1] = 0;
|
||||
@ -1609,10 +1437,6 @@ STATUS API_ROUTINE GDS_CREATE_DATABASE(STATUS * user_status,
|
||||
|
||||
if (current_dpb_ptr != dpb)
|
||||
gds__free((SLONG *) current_dpb_ptr);
|
||||
#ifdef STACK_EFFICIENT
|
||||
gds__free((SLONG *) expanded_filename);
|
||||
gds__free((SLONG *) temp_filebuf);
|
||||
#endif
|
||||
|
||||
SUBSYSTEM_USAGE_DECR;
|
||||
return error(status, local);
|
||||
@ -1719,7 +1543,7 @@ STATUS API_ROUTINE GDS_DDL(STATUS * user_status,
|
||||
ATT database;
|
||||
JRD_TRA transaction;
|
||||
|
||||
#if !defined(PIPE_CLIENT) && !defined(SUPERCLIENT)
|
||||
#if !defined(SUPERCLIENT)
|
||||
TEXT *image;
|
||||
PTR entrypoint;
|
||||
#endif
|
||||
@ -1753,7 +1577,6 @@ STATUS API_ROUTINE GDS_DDL(STATUS * user_status,
|
||||
|
||||
no_entrypoint(status);
|
||||
|
||||
#ifndef PIPE_CLIENT
|
||||
#ifndef SUPERCLIENT
|
||||
if ((image = images[database->implementation].path) != NULL &&
|
||||
((entrypoint = (PTR) ISC_lookup_entrypoint(image, "DYN_ddl", NULL)) !=
|
||||
@ -1763,7 +1586,6 @@ STATUS API_ROUTINE GDS_DDL(STATUS * user_status,
|
||||
CHECK_STATUS_SUCCESS(status);
|
||||
return FB_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return error2(status, local);
|
||||
@ -2142,11 +1964,7 @@ STATUS API_ROUTINE isc_dsql_describe(STATUS * user_status,
|
||||
**************************************/
|
||||
STATUS *status, local[ISC_STATUS_LENGTH];
|
||||
USHORT buffer_len;
|
||||
#ifdef STACK_EFFICIENT
|
||||
SCHAR *buffer, local_buffer[1];
|
||||
#else
|
||||
SCHAR *buffer, local_buffer[512];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
GET_STATUS;
|
||||
CHECK_HANDLE(*stmt_handle, HANDLE_statement, isc_bad_stmt_handle);
|
||||
@ -2205,11 +2023,7 @@ STATUS API_ROUTINE isc_dsql_describe_bind(STATUS * user_status,
|
||||
**************************************/
|
||||
STATUS *status, local[ISC_STATUS_LENGTH];
|
||||
USHORT buffer_len;
|
||||
#ifdef STACK_EFFICIENT
|
||||
SCHAR *buffer, local_buffer[1];
|
||||
#else
|
||||
SCHAR *buffer, local_buffer[512];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
GET_STATUS;
|
||||
CHECK_HANDLE(*stmt_handle, HANDLE_statement, isc_bad_stmt_handle);
|
||||
@ -3300,11 +3114,7 @@ STATUS API_ROUTINE GDS_DSQL_PREPARE(STATUS * user_status,
|
||||
**************************************/
|
||||
STATUS *status, local[ISC_STATUS_LENGTH];
|
||||
USHORT buffer_len;
|
||||
#ifdef STACK_EFFICIENT
|
||||
SCHAR *buffer, local_buffer[1];
|
||||
#else
|
||||
SCHAR *buffer, local_buffer[BUFFER_MEDIUM];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
DASUP dasup;
|
||||
|
||||
GET_STATUS;
|
||||
@ -4189,7 +3999,7 @@ SLONG API_ROUTINE isc_reset_fpe(USHORT fpe_status)
|
||||
* Prior setting of the FPE reset flag
|
||||
*
|
||||
**************************************/
|
||||
#if !(defined REQUESTER || defined PIPE_CLIENT || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
#if !(defined REQUESTER || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
SLONG prior;
|
||||
prior = (SLONG) subsystem_FPE_reset;
|
||||
switch (fpe_status) {
|
||||
@ -5359,7 +5169,7 @@ static void exit_handler(EVENT why_event)
|
||||
|
||||
why_initialized = FALSE;
|
||||
why_enabled = 0;
|
||||
#if !(defined REQUESTER || defined PIPE_CLIENT || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
#if !(defined REQUESTER || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
isc_enter_count = 0;
|
||||
subsystem_usage = 0;
|
||||
subsystem_FPE_reset = FPE_RESET_INIT_ONLY;
|
||||
@ -5455,7 +5265,7 @@ static PTR get_entrypoint(int proc, int implementation)
|
||||
ENTRY *ent;
|
||||
PTR entrypoint;
|
||||
|
||||
#if !defined(PIPE_CLIENT) && !defined(SUPERCLIENT)
|
||||
#if !defined(SUPERCLIENT)
|
||||
TEXT *image, *name;
|
||||
#endif
|
||||
|
||||
@ -5467,15 +5277,7 @@ static PTR get_entrypoint(int proc, int implementation)
|
||||
return entrypoint;
|
||||
}
|
||||
|
||||
#ifndef PIPE_CLIENT
|
||||
#ifndef SUPERCLIENT
|
||||
#ifdef INITIALIZE_PATHS
|
||||
if (!paths_initialized)
|
||||
{
|
||||
paths_initialized = TRUE;
|
||||
init_paths();
|
||||
}
|
||||
#endif
|
||||
|
||||
image = images[implementation].path;
|
||||
name = ent->name;
|
||||
@ -5493,7 +5295,6 @@ static PTR get_entrypoint(int proc, int implementation)
|
||||
return entrypoint;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return &no_entrypoint;
|
||||
@ -5641,48 +5442,6 @@ static void iterative_sql_info(STATUS * user_status,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef INITIALIZE_PATHS
|
||||
static void init_paths(void)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
* i n i t _ p a t h s
|
||||
*
|
||||
**************************************
|
||||
*
|
||||
* Functional description
|
||||
* Initialize the paths to use in dynamically
|
||||
* looking up entrypoints.
|
||||
*
|
||||
**************************************/
|
||||
USHORT n;
|
||||
IMAGE *sys;
|
||||
#ifdef STACK_EFFICIENT
|
||||
TEXT *path;
|
||||
#else
|
||||
TEXT path[MAXPATHLEN];
|
||||
#endif /* STACK_EFFICIENT */
|
||||
|
||||
#ifdef STACK_EFFICIENT
|
||||
if (path = (TEXT *) gds__alloc((SLONG) (sizeof(TEXT) * MAXPATHLEN)))
|
||||
/* if we fail don't try to do the remainder of the function since*/
|
||||
/* we will probably die a horrible death in gds_prefix */
|
||||
#endif /* STACK_EFFICIENT */
|
||||
for (n = 0, sys = images; n < SUBSYSTEMS; n++, sys++)
|
||||
if (sys->path) {
|
||||
gds__prefix(path, sys->path);
|
||||
sys->path = alloc((SLONG) (strlen(path) + 1));
|
||||
strcpy(sys->path, path);
|
||||
}
|
||||
#ifdef STACK_EFFICIENT
|
||||
if (path)
|
||||
gds__free((SLONG *) path);
|
||||
#endif /* STACK_EFFICIENT */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static STATUS open_blob(STATUS * user_status,
|
||||
ATT * db_handle,
|
||||
JRD_TRA * tra_handle,
|
||||
@ -6160,7 +5919,7 @@ static void subsystem_enter(void)
|
||||
**************************************/
|
||||
|
||||
THREAD_ENTER;
|
||||
#if !(defined REQUESTER || defined PIPE_CLIENT || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
#if !(defined REQUESTER || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
isc_enter_count++;
|
||||
if (subsystem_usage == 0 ||
|
||||
(subsystem_FPE_reset &
|
||||
@ -6199,7 +5958,7 @@ static void subsystem_exit(void)
|
||||
*
|
||||
**************************************/
|
||||
|
||||
#if !(defined REQUESTER || defined PIPE_CLIENT || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
#if !(defined REQUESTER || defined SUPERCLIENT || defined SUPERSERVER)
|
||||
if (subsystem_usage == 0 ||
|
||||
(subsystem_FPE_reset &
|
||||
(FPE_RESET_NEXT_API_CALL | FPE_RESET_ALL_API_CALL)))
|
||||
|
@ -37,7 +37,7 @@
|
||||
#include "../jrd/thd.h"
|
||||
#include "../jrd/isc.h"
|
||||
#include "../jrd/license.h"
|
||||
#include "../jrd/time.h"
|
||||
#include "../jrd/jrd_time.h"
|
||||
#include "../remote/merge_proto.h"
|
||||
#include "../remote/parse_proto.h"
|
||||
#include "../remote/remot_proto.h"
|
||||
@ -2301,9 +2301,7 @@ STATUS port::get_segment(P_SGMT* segment, PACKET* send)
|
||||
USHORT length, buffer_length;
|
||||
UCHAR *p;
|
||||
STATUS state, status, status_vector[ISC_STATUS_LENGTH];
|
||||
#ifndef STACK_EFFICIENT
|
||||
UCHAR temp_buffer[BLOB_LENGTH];
|
||||
#endif
|
||||
|
||||
CHECK_HANDLE_MEMBER(blob,
|
||||
RBL,
|
||||
@ -2312,11 +2310,9 @@ STATUS port::get_segment(P_SGMT* segment, PACKET* send)
|
||||
isc_bad_segstr_handle);
|
||||
|
||||
buffer_length = segment->p_sgmt_length;
|
||||
#ifndef STACK_EFFICIENT
|
||||
if (buffer_length <= sizeof(temp_buffer))
|
||||
buffer = temp_buffer;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (buffer_length > blob->rbl_buffer_length) {
|
||||
if (blob->rbl_buffer != blob->rbl_data) {
|
||||
@ -2436,9 +2432,7 @@ STATUS port::get_slice(P_SLC * stuff, PACKET* send)
|
||||
UCHAR *slice;
|
||||
P_SLR *response;
|
||||
STATUS status, status_vector[ISC_STATUS_LENGTH];
|
||||
#ifndef STACK_EFFICIENT
|
||||
UCHAR temp_buffer[4096];
|
||||
#endif
|
||||
|
||||
rdb = this->port_context;
|
||||
CHECK_HANDLE_MEMBER(transaction,
|
||||
@ -2450,11 +2444,9 @@ STATUS port::get_slice(P_SLC * stuff, PACKET* send)
|
||||
if (!stuff->p_slc_length)
|
||||
slice = 0;
|
||||
else {
|
||||
#ifndef STACK_EFFICIENT
|
||||
if (stuff->p_slc_length <= sizeof(temp_buffer))
|
||||
slice = temp_buffer;
|
||||
else
|
||||
#endif
|
||||
slice = ALLR_alloc((SLONG) stuff->p_slc_length);
|
||||
}
|
||||
|
||||
@ -2497,9 +2489,7 @@ STATUS port::get_slice(P_SLC * stuff, PACKET* send)
|
||||
#ifdef DEBUG_REMOTE_MEMORY
|
||||
ib_printf("get_slice(server) free buffer %x\n", slice);
|
||||
#endif
|
||||
#ifndef STACK_EFFICIENT
|
||||
if (slice != temp_buffer)
|
||||
#endif
|
||||
ALLR_free(slice);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user