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

Changes to bring FB2 to c++ on *nix.

This commit is contained in:
bellardo 2001-07-12 05:46:06 +00:00
parent baa3485651
commit 747d13c0d5
156 changed files with 3368 additions and 2839 deletions

View File

@ -24,7 +24,7 @@
//
//____________________________________________________________
//
// $Id: alice.cpp,v 1.2 2001-07-10 17:35:12 awharrison Exp $
// $Id: alice.cpp,v 1.3 2001-07-12 05:46:03 bellardo Exp $
//
// 2001.07.06 Sean Leyne - Code Cleanup, removed "#ifdef READONLY_DATABASE"
// conditionals, as the engine now fully supports
@ -54,6 +54,10 @@
#include "../jrd/svc_proto.h"
#include "../jrd/thd_proto.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef SUPERSERVER
#include "../utilities/cmd_util_proto.h"
#endif
@ -707,7 +711,7 @@ static void alice_output(CONST SCHAR * format, ...)
if (tdgbl->sw_redirect == NOOUTPUT || format[0] == '\0') {
exit_code =
tdgbl->output_proc(tdgbl->output_data,
reinterpret_cast < UCHAR * >(""));
(UCHAR *)(""));
}
else if (tdgbl->sw_redirect == TRUE && tdgbl->output_file != NULL) {
VA_START(arglist, format);
@ -715,7 +719,7 @@ static void alice_output(CONST SCHAR * format, ...)
va_end(arglist);
exit_code =
tdgbl->output_proc(tdgbl->output_data,
reinterpret_cast < UCHAR * >(""));
(UCHAR *)(""));
}
else {
VA_START(arglist, format);

View File

@ -212,7 +212,7 @@ extern struct tgbl *gdgbl;
#if defined(__cplusplus)
#define EXIT(code) { tdgbl->exit_code = (code); \
if (tdgbl->alice_env != NULL) \
LONGJMP(reinterpret_cast<jmp_buf&>(const_cast<UCHAR*>(tdgbl->alice_env)), 1); }
LONGJMP((jmp_buf)(tdgbl->alice_env), 1); }
#else
#define EXIT(code) { tdgbl->exit_code = (code); \
if (tdgbl->alice_env != NULL) \

View File

@ -66,6 +66,10 @@
#include "../jrd/why_proto.h"
#include "../jrd/gdsassert.h"
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef SUPERSERVER
#include "../utilities/cmd_util_proto.h"
#endif
@ -686,7 +690,7 @@ int DLL_EXPORT BURP_gbak(int argc,
for (in_sw_tab = burp_in_sw_table; in_sw_tab->in_sw;
in_sw_tab++)
if (in_sw_tab->in_sw_msg) {
BURP_msg_put(in_sw_tab->in_sw_msg, SWITCH_CHAR, 0, 0,
BURP_msg_put(in_sw_tab->in_sw_msg, (void*)SWITCH_CHAR, 0, 0,
0, 0);
}
@ -979,7 +983,7 @@ int DLL_EXPORT BURP_gbak(int argc,
break;
case (IN_SW_BURP_Z):
BURP_print(91, GDS_VERSION, 0, 0, 0, 0); /* msg 91 gbak version %s */
BURP_print(91, (void*) GDS_VERSION, 0, 0, 0, 0); /* msg 91 gbak version %s */
tdgbl->gbl_sw_version = TRUE;
break;
@ -1559,7 +1563,7 @@ static SSHORT open_files(TEXT * file1,
BURP_print(139, file1, 0, 0, 0, 0);
isc_version(&tdgbl->db_handle,
reinterpret_cast<void (*)()>(BURP_output_version),
"\t%s\n");
(void*) "\t%s\n");
}
if (sw_verbose)
BURP_print(166, file1, 0, 0, 0, 0); /* msg 166: readied database %s for backup */
@ -1627,7 +1631,7 @@ static SSHORT open_files(TEXT * file1,
#ifndef WIN_NT
signal(SIGPIPE, SIG_IGN);
#endif
fil->fil_fd = reinterpret_cast<void*>(GBAK_STDOUT_DESC);
fil->fil_fd = reinterpret_cast<DESC>(GBAK_STDOUT_DESC);
break;
}
else
@ -1745,7 +1749,7 @@ static SSHORT open_files(TEXT * file1,
tdgbl->action->act_action = ACT_restore;
if (!strcmp(fil->fil_name, "stdin")) {
fil->fil_fd = reinterpret_cast<void*>(GBAK_STDIN_DESC);
fil->fil_fd = reinterpret_cast<DESC>(GBAK_STDIN_DESC);
tdgbl->file_desc = fil->fil_fd;
tdgbl->gbl_sw_files = fil->fil_next;
}
@ -1936,7 +1940,7 @@ static void burp_output( CONST SCHAR * format, ...)
if (tdgbl->sw_redirect == NOOUTPUT || format[0] == '\0') {
exit_code =
tdgbl->output_proc(tdgbl->output_data,
reinterpret_cast<UCHAR*>(""));
(UCHAR*)(""));
}
else if (tdgbl->sw_redirect == TRUE && tdgbl->output_file != NULL) {
VA_START(arglist, format);
@ -1944,7 +1948,7 @@ static void burp_output( CONST SCHAR * format, ...)
va_end(arglist);
exit_code =
tdgbl->output_proc(tdgbl->output_data,
reinterpret_cast<UCHAR*>(""));
(UCHAR*)(""));
}
else {
VA_START(arglist, format);

View File

@ -33,6 +33,10 @@
#include "../jrd/gds_proto.h"
#include "../jrd/thd.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
@ -858,9 +862,10 @@ extern struct tgbl *gdgbl;
#endif
#if defined(__cplusplus)
// I had funnies with this cast
#define EXIT(code) { tdgbl->exit_code = ((volatile int)code); \
if (tdgbl->burp_env != NULL) \
LONGJMP(reinterpret_cast<jmp_buf&>(const_cast<UCHAR*>(tdgbl->burp_env)), 1); }
LONGJMP((jmp_buf)(const_cast<UCHAR*>(tdgbl->burp_env)), 1); }
#else
#define EXIT(code) { tdgbl->exit_code = ((volatile int)code); \
if (tdgbl->burp_env != NULL) \

View File

@ -262,7 +262,7 @@ void MVOL_init_write(UCHAR* database_name,
BURP_error(269, tdgbl->action->act_file->fil_name, 0, 0, 0, 0);
/* msg 269 can't write a header record to file %s */
}
tdgbl->file_desc = next_volume(tdgbl->file_desc, MODE_WRITE, FALSE);
tdgbl->file_desc = (DESC) next_volume(tdgbl->file_desc, MODE_WRITE, FALSE);
}
tdgbl->mvol_actual_buffer_size = temp_buffer_size;
@ -298,7 +298,7 @@ int MVOL_read(int* cnt, UCHAR** ptr)
{
if (!tdgbl->mvol_io_cnt || errno == EIO)
{
tdgbl->file_desc = next_volume(tdgbl->file_desc, MODE_READ, FALSE);
tdgbl->file_desc = (DESC) next_volume(tdgbl->file_desc, MODE_READ, FALSE);
if (tdgbl->mvol_io_cnt > 0)
{
break;
@ -678,7 +678,7 @@ UCHAR MVOL_write(UCHAR c, int *io_cnt, UCHAR ** io_ptr)
else
full_buffer = FALSE;
tdgbl->file_desc =
next_volume(tdgbl->file_desc, MODE_WRITE, full_buffer);
(DESC) next_volume(tdgbl->file_desc, MODE_WRITE, full_buffer);
if (full_buffer)
{
left -= tdgbl->mvol_io_buffer_size;
@ -886,7 +886,7 @@ static void* next_volume( DESC handle, int mode, USHORT full_buffer)
(tdgbl->action->act_file = tdgbl->action->act_file->fil_next) &&
(tdgbl->action->act_file->fil_fd != INVALID_HANDLE_VALUE))
{
return tdgbl->action->act_file->fil_fd;
return (void*) tdgbl->action->act_file->fil_fd;
}
BURP_error_redirect(0, 50, NULL, NULL); /* msg 50 unexpected end of file on backup file */

View File

@ -40,6 +40,10 @@
#include "../burp/spit.h"
#include "../burp/burpswi.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef WIN_NT
#include <io.h> /* usage of non-ANSI open/read/write/close functions */
#endif

View File

@ -20,7 +20,7 @@
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* $Id: ddl.cpp,v 1.2 2001-07-10 17:35:13 awharrison Exp $
* $Id: ddl.cpp,v 1.3 2001-07-12 05:46:04 bellardo Exp $
* 2001.5.20 Claudio Valderrama: Stop null pointer that leads to a crash,
* caused by incomplete yacc syntax that allows ALTER DOMAIN dom SET;
*
@ -379,7 +379,7 @@ void DDL_resolve_intl_type( REQ request, FLD field, STR collation_name)
{
if (!METD_get_type(request,
reinterpret_cast<STR>(field->fld_sub_type_name),
reinterpret_cast < UCHAR * >("RDB$FIELD_SUB_TYPE"),
(UCHAR *)("RDB$FIELD_SUB_TYPE"),
&blob_sub_type))
{
ERRD_post( gds__sqlerr,
@ -1213,7 +1213,7 @@ TEXT * prim_rel_name, TEXT * for_rel_name)
return;
/* stuff a trigger_name of size 0. So the dyn-parser will make one up. */
put_string(request, gds_dyn_def_trigger, reinterpret_cast < UCHAR * >(""),
put_string(request, gds_dyn_def_trigger, (UCHAR *)(""),
(USHORT) 0);
put_number(request, gds_dyn_trg_type, (SSHORT) POST_ERASE_TRIGGER);
@ -1283,7 +1283,7 @@ TEXT * prim_rel_name, TEXT * for_rel_name, BOOLEAN on_upd_trg)
return;
/* stuff a trigger_name of size 0. So the dyn-parser will make one up. */
put_string(request, gds_dyn_def_trigger, reinterpret_cast < UCHAR * >(""),
put_string(request, gds_dyn_def_trigger, (UCHAR *)(""),
(USHORT) 0);
put_number(request, gds_dyn_trg_type,
@ -2414,7 +2414,7 @@ TEXT * prim_rel_name, TEXT * for_rel_name, BOOLEAN on_upd_trg)
assert(prim_columns->nod_count != 0);
/* no trigger name. It is generated by the engine */
put_string(request, gds_dyn_def_trigger, reinterpret_cast < UCHAR * >(""),
put_string(request, gds_dyn_def_trigger, (UCHAR *)(""),
(USHORT) 0);
put_number(request, gds_dyn_trg_type,
@ -3050,7 +3050,7 @@ TEXT * prim_rel_name, TEXT * for_rel_name)
assert(prim_columns->nod_count != 0);
/* no trigger name is generated here. Let the engine make one up */
put_string(request, gds_dyn_def_trigger, reinterpret_cast < UCHAR * >(""),
put_string(request, gds_dyn_def_trigger, (UCHAR *)(""),
(USHORT) 0);
put_number(request, gds_dyn_trg_type, (SSHORT) POST_MODIFY_TRIGGER);
@ -4514,7 +4514,7 @@ static SCHAR modify_privileges(REQ request,
case nod_references:
case nod_update:
p = (privs->nod_type == nod_references) ? "R" : "U";
p = (privs->nod_type == nod_references) ? (SCHAR*) "R" : (SCHAR*) "U";
if (!(fields = privs->nod_arg[0]))
return *p;

View File

@ -24,7 +24,7 @@
* readonly databases.
*/
/*
$Id: dsql.cpp,v 1.3 2001-07-10 17:35:13 awharrison Exp $
$Id: dsql.cpp,v 1.4 2001-07-12 05:46:04 bellardo Exp $
*/
/**************************************************************
V4 Multi-threading changes.
@ -3150,7 +3150,7 @@ static void map_in_out( REQ request,
flag = NULL;
if ((null = parameter->par_null) != NULL) {
null_offset = reinterpret_cast<USHORT>(null->par_user_desc.dsc_address);
null_offset = (USHORT)(null->par_user_desc.dsc_address);
length = null_offset + sizeof(SSHORT);
if (length > msg_length)
break;

View File

@ -24,7 +24,9 @@
#include "../jrd/ib_stdio.h"
#include <string.h>
#include "../jrd/common.h"
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#include "../dsql/dsql.h"
#include "../dsql/sqlda.h"

View File

@ -24,6 +24,8 @@
#ifndef _DSQL_NODE_H_
#define _DSQL_NODE_H_
#include "../dsql/dsql.h"
/* an enumeration of the possible node types in a syntax tree */
typedef ENUM nod_t

View File

@ -17,6 +17,9 @@ s/yychar/DSQL_yychar/g
s/yyerrflag/DSQL_yyerrflag/g
s/yyparse/dsql_yyparse/g
s/static int dsql_yyparse/int dsql_yyparse/g
s/yyssp/DSQL_yyssp/g
s/yysslim/DSQL_yysslim/g
s/yyss/DSQL_yyss/g
/^#ident/d
s/^static TOK tokens/static CONST TOK FAR_VARIABLE tokens/
s/^__YYSCLASS yytabelem/__YYSCLASS CONST yytabelem FAR_VARIABLE/
@ -26,6 +29,7 @@ s/^#include *<values.h> *$//g
s/yylex(void)/yylex(USHORT, USHORT, USHORT, BOOLEAN *)/g
s/yylex()/yylex(client_dialect, db_dialect, parser_version, stmt_ambiguous)/g
s/dsql_yyparse(void);/dsql_yyparse(USHORT, USHORT, USHORT, BOOLEAN *);/g
s/dsql_yyparse __P((void));/dsql_yyparse __P((USHORT, USHORT, USHORT, BOOLEAN *));/g
s/dsql_yyparse(void)/dsql_yyparse(USHORT client_dialect, USHORT db_dialect, USHORT parser_version, BOOLEAN *stmt_ambiguous)/g
s/dsql_yyparse()/dsql_yyparse(USHORT client_dialect, USHORT db_dialect, USHORT parser_version, BOOLEAN *stmt_ambiguous)/g
s/YYLEX()/YYLEX(client_dialect, db_dialect, parser_version, stmt_ambiguous)/g

View File

@ -28,7 +28,7 @@
#include "../jrd/common.h"
#include <stdarg.h>
#include "../jrd/iberror.h"
#include "../include/iberror.h"
#include "../dsql/dsql.h"
#include "../dsql/node.h"
#include "../dsql/sym.h"
@ -46,6 +46,8 @@
#include "../wal/wal.h"
#endif
extern "C" TEXT *DLL_EXPORT ERR_string(CONST TEXT*, int);
ASSERT_FILENAME
static void yyerror (TEXT *);
@ -1854,13 +1856,13 @@ non_charset_simple_type : national_character_type
| TIME
{
if (client_dialect < SQL_DIALECT_V6_TRANSITION)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, isc_sql_dialect_datatype_unsupport,
gds_arg_number, client_dialect,
gds_arg_string, "TIME",
0);
if (db_dialect < SQL_DIALECT_V6_TRANSITION)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, isc_sql_db_dialect_dtype_unsupport,
gds_arg_number, db_dialect,
gds_arg_string, "TIME",
@ -2037,7 +2039,7 @@ prec_scale :
(db_dialect > SQL_DIALECT_V5) ) ||
( (client_dialect > SQL_DIALECT_V5) &&
(db_dialect <= SQL_DIALECT_V5) ) )
ERRD_post (gds__sqlerr,
ERRD_post (gds_sqlerr,
gds_arg_number, (SLONG) -817,
gds_arg_gds,
isc_ddl_not_allowed_by_db_sql_dial,
@ -2094,7 +2096,7 @@ prec_scale :
(db_dialect > SQL_DIALECT_V5) ) ||
( (client_dialect > SQL_DIALECT_V5) &&
(db_dialect <= SQL_DIALECT_V5) ) )
ERRD_post (gds__sqlerr,
ERRD_post (gds_sqlerr,
gds_arg_number, (SLONG) -817,
gds_arg_gds,
isc_ddl_not_allowed_by_db_sql_dial,
@ -2989,13 +2991,13 @@ value : column_name
datetime_value_expression : CURRENT_DATE
{
if (client_dialect < SQL_DIALECT_V6_TRANSITION)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, isc_sql_dialect_datatype_unsupport,
gds_arg_number, client_dialect,
gds_arg_string, "DATE",
0);
if (db_dialect < SQL_DIALECT_V6_TRANSITION)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, isc_sql_db_dialect_dtype_unsupport,
gds_arg_number, db_dialect,
gds_arg_string, "DATE",
@ -3005,13 +3007,13 @@ datetime_value_expression : CURRENT_DATE
| CURRENT_TIME
{
if (client_dialect < SQL_DIALECT_V6_TRANSITION)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, isc_sql_dialect_datatype_unsupport,
gds_arg_number, client_dialect,
gds_arg_string, "TIME",
0);
if (db_dialect < SQL_DIALECT_V6_TRANSITION)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, isc_sql_db_dialect_dtype_unsupport,
gds_arg_number, db_dialect,
gds_arg_string, "TIME",
@ -3054,13 +3056,13 @@ u_constant : u_numeric_constant
| DATE STRING
{
if (client_dialect < SQL_DIALECT_V6_TRANSITION)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, isc_sql_dialect_datatype_unsupport,
gds_arg_number, client_dialect,
gds_arg_string, "DATE",
0);
if (db_dialect < SQL_DIALECT_V6_TRANSITION)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, isc_sql_db_dialect_dtype_unsupport,
gds_arg_number, db_dialect,
gds_arg_string, "DATE",
@ -3070,13 +3072,13 @@ u_constant : u_numeric_constant
| TIME STRING
{
if (client_dialect < SQL_DIALECT_V6_TRANSITION)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, isc_sql_dialect_datatype_unsupport,
gds_arg_number, client_dialect,
gds_arg_string, "TIME",
0);
if (db_dialect < SQL_DIALECT_V6_TRANSITION)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, isc_sql_db_dialect_dtype_unsupport,
gds_arg_number, db_dialect,
gds_arg_string, "TIME",
@ -3400,7 +3402,7 @@ for (token = tokens; token->tok_string; ++token)
symbol->sym_version = token->tok_version;
str = (STR) ALLOCPV (type_str, symbol->sym_length);
str->str_length = symbol->sym_length;
strncpy (str->str_data, symbol->sym_string, symbol->sym_length);
strncpy ((char*)str->str_data, (char*)symbol->sym_string, symbol->sym_length);
symbol->sym_object = (void *) str;
HSHD_insert (symbol);
}
@ -3838,7 +3840,7 @@ static int yylex (
* Functional description
*
**************************************/
UCHAR *p, class, string [MAX_TOKEN_LEN], *buffer, *buffer_end, *new_buffer;
UCHAR *p, tok_class, string [MAX_TOKEN_LEN], *buffer, *buffer_end, *new_buffer;
SYM sym;
SSHORT c;
USHORT buffer_len;
@ -3883,21 +3885,21 @@ for (;;)
}
#if (! ( defined JPN_SJIS || defined JPN_EUC) )
class = classes [c];
tok_class = classes [c];
#else
c = c & 0xff;
class = (JPN1_CHAR(c) ? CHR_LETTER : classes[c]);
tok_class = (JPN1_CHAR(c) ? CHR_LETTER : classes[c]);
#endif /*JPN_SJIS || JPN_EUC */
if (!(class & CHR_WHITE))
if (!(tok_class & CHR_WHITE))
break;
}
/* Depending on class of token, parse token */
/* Depending on tok_class of token, parse token */
last_token = ptr - 1;
if (class & CHR_INTRODUCER)
if (tok_class & CHR_INTRODUCER)
{
/* The Introducer (_) is skipped, all other idents are copied
* to become the name of the character set
@ -3923,7 +3925,7 @@ if (class & CHR_INTRODUCER)
/* parse a quoted string, being sure to look for double quotes */
if (class & CHR_QUOTE)
if (tok_class & CHR_QUOTE)
{
buffer = string;
buffer_len = sizeof (string);
@ -4021,7 +4023,7 @@ if (class & CHR_QUOTE)
assert(ptr <= end);
if ((class & CHR_DIGIT) ||
if ((tok_class & CHR_DIGIT) ||
((c == '.') && (ptr < end) && (classes [*ptr] & CHR_DIGIT)))
{
/* The following variables are used to recognize kinds of numbers. */
@ -4168,12 +4170,12 @@ if ((class & CHR_DIGIT) ||
attempt to recognize a number. */
ptr = last_token;
c = *ptr++;
/* We never touched class, so it doesn't need to be restored. */
/* We never touched tok_class, so it doesn't need to be restored. */
/* end of number-recognition code */
if (class & CHR_LETTER)
if (tok_class & CHR_LETTER)
{
#if (! ( defined JPN_SJIS || defined JPN_EUC) )
p = string;
@ -4269,17 +4271,17 @@ static void yyerror (
**************************************/
if (yychar < 1)
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, gds__command_end_err, /* Unexpected end of command */
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, gds_command_end_err, /* Unexpected end of command */
0);
else
{
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, gds__dsql_token_unk_err,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) -104,
gds_arg_gds, gds_dsql_token_unk_err,
gds_arg_number, (SLONG) lines,
gds_arg_number, (SLONG) (last_token - line_start),
/* Token unknown - line %d, char %d */
gds_arg_gds, gds__random,
gds_arg_gds, gds_random,
gds_arg_cstring, (int) (ptr - last_token), last_token,
0);
}
@ -4301,6 +4303,6 @@ static void yyabandon (
*
**************************************/
ERRD_post (gds__sqlerr, gds_arg_number, (SLONG) sql_code,
ERRD_post (gds_sqlerr, gds_arg_number, (SLONG) sql_code,
gds_arg_gds, error_symbol, 0);
}

View File

@ -39,6 +39,10 @@
#include "../jrd/gds_proto.h"
#include "../jrd/why_proto.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#if defined(WIN_NT)
#include <io.h>
#endif
@ -483,7 +487,7 @@ UCHAR *DDL_alloc(register int size)
**************************************/
register UCHAR *block, *p;
p = block = gds__alloc((SLONG) size);
p = block = (UCHAR*) gds__alloc((SLONG) size);
#ifdef DEBUG_GDS_ALLOC
/* For V4.0 we don't care about gdef specific memory leaks */

View File

@ -55,7 +55,7 @@ static GDS__QUAD null_blob;
static LLS request_context;
static jmp_buf exp_env;
static TEXT alloc_info[] = { gds__info_allocation, gds__info_end };
static TEXT alloc_info[] = { gds_info_allocation, gds_info_end };
#define CMP_SYMBOL(sym1, sym2) strcmp (sym1->sym_string, sym2->sym_string)
#define MOVE_SYMBOL(symbol, field) move_symbol (symbol, field, sizeof (field))
@ -109,12 +109,12 @@ static void expand_action( ACT action)
switch (action->act_type) {
case act_a_field:
expand_field(action->act_object);
expand_field((FLD) action->act_object);
break;
case act_m_field:
case act_d_field:
lookup_field(action->act_object);
lookup_field((FLD) action->act_object);
break;
case act_d_filter:
@ -130,41 +130,41 @@ static void expand_action( ACT action)
*/ break;
case act_a_gfield:
expand_global_field(action->act_object);
expand_global_field((FLD) action->act_object);
break;
case act_m_gfield:
lookup_global_field(action->act_object);
expand_global_field(action->act_object);
lookup_global_field((FLD) action->act_object);
expand_global_field((FLD) action->act_object);
break;
case act_d_gfield:
lookup_global_field(action->act_object);
lookup_global_field((FLD) action->act_object);
break;
case act_a_index:
expand_index(action->act_object);
expand_index((ACT) action->act_object);
break;
case act_m_relation:
lookup_relation(action->act_object);
lookup_relation((REL) action->act_object);
case act_a_relation:
expand_relation(action->act_object);
expand_relation((REL) action->act_object);
break;
case act_d_relation:
lookup_relation(action->act_object);
lookup_relation((REL) action->act_object);
break;
case act_d_trigger:
lookup_trigger(action->act_object);
lookup_trigger((TRG) action->act_object);
break;
case act_m_trigger:
lookup_trigger(action->act_object);
lookup_trigger((TRG) action->act_object);
case act_a_trigger:
expand_trigger(action->act_object);
expand_trigger((TRG) action->act_object);
break;
case act_c_database:
@ -359,12 +359,12 @@ static void expand_trigger( TRG trigger)
*
**************************************/
LLS contexts, update;
CTX old, new;
CTX old, new_ctx;
REL relation;
USHORT old_id;
context_id = 2;
old = new = NULL;
old = new_ctx = NULL;
request_context = contexts = update = NULL;
relation = trigger->trg_relation;
@ -378,10 +378,10 @@ static void expand_trigger( TRG trigger)
if ((trigger->trg_type != trg_erase)
&& (trigger->trg_type != trg_pre_erase)) {
if (!new)
new = make_context("NEW", relation, 1);
LLS_PUSH(new, &contexts);
LLS_PUSH(new, &update);
if (!new_ctx)
new_ctx = make_context("NEW", relation, 1);
LLS_PUSH(new_ctx, &contexts);
LLS_PUSH(new_ctx, &update);
}
resolve(trigger->trg_statement, contexts, update);
@ -418,7 +418,7 @@ static FLD field_context( NOD node, LLS contexts, CTX * output_context)
name = (SYM) node->nod_arg[0];
}
else if (node->nod_count == 2) {
context = lookup_context(node->nod_arg[0], contexts);
context = lookup_context((SYM) node->nod_arg[0], contexts);
name = (SYM) node->nod_arg[1];
}
else

View File

@ -303,7 +303,7 @@ NOD EXPR_value(USHORT * paren_count, USHORT * bool_flag)
*
**************************************/
NOD node, arg;
enum nod_t operator;
enum nod_t operatr;
USHORT local_count, local_flag;
if (!paren_count) {
@ -431,19 +431,19 @@ static NOD parse_add( USHORT * paren_count, USHORT * bool_flag)
*
**************************************/
NOD node, arg;
enum nod_t operator;
enum nod_t operatr;
node = parse_multiply(paren_count, bool_flag);
while (TRUE) {
if (MATCH(KW_PLUS))
operator = nod_add;
operatr = nod_add;
else if (MATCH(KW_MINUS))
operator = nod_subtract;
operatr = nod_subtract;
else
return node;
arg = node;
node = SYNTAX_NODE(operator, 2);
node = SYNTAX_NODE(operatr, 2);
node->nod_arg[0] = arg;
node->nod_arg[1] = parse_multiply(paren_count, bool_flag);
}
@ -688,7 +688,7 @@ static CON parse_literal(void)
}
static parse_matching_paren(void)
static int parse_matching_paren(void)
{
/**************************************
*
@ -719,19 +719,19 @@ static NOD parse_multiply( USHORT * paren_count, USHORT * bool_flag)
*
**************************************/
NOD node, arg;
enum nod_t operator;
enum nod_t operatr;
node = parse_from(paren_count, bool_flag);
while (TRUE) {
if (MATCH(KW_ASTERISK))
operator = nod_multiply;
operatr = nod_multiply;
else if (MATCH(KW_SLASH))
operator = nod_divide;
operatr = nod_divide;
else
return node;
arg = node;
node = SYNTAX_NODE(operator, 2);
node = SYNTAX_NODE(operatr, 2);
node->nod_arg[0] = arg;
node->nod_arg[1] = parse_from(paren_count, bool_flag);
}
@ -909,7 +909,7 @@ static NOD parse_relational( USHORT * paren_count)
NOD node, expr1, expr2, or_node;
LLS stack;
USHORT count, negation;
enum nod_t operator, *rel_ops;
enum nod_t operatr, *rel_ops;
USHORT local_flag;
local_flag = TRUE;
@ -942,50 +942,50 @@ static NOD parse_relational( USHORT * paren_count)
switch (PARSE_keyword()) {
case KW_EQUALS:
case KW_EQ:
operator = (negation) ? nod_neq : nod_eql;
operatr = (negation) ? nod_neq : nod_eql;
negation = FALSE;
break;
case KW_NE:
operator = (negation) ? nod_eql : nod_neq;
operatr = (negation) ? nod_eql : nod_neq;
negation = FALSE;
break;
case KW_GT:
operator = (negation) ? nod_leq : nod_gtr;
operatr = (negation) ? nod_leq : nod_gtr;
negation = FALSE;
break;
case KW_GE:
operator = (negation) ? nod_lss : nod_geq;
operatr = (negation) ? nod_lss : nod_geq;
negation = FALSE;
break;
case KW_LE:
operator = (negation) ? nod_gtr : nod_leq;
operatr = (negation) ? nod_gtr : nod_leq;
negation = FALSE;
break;
case KW_LT:
operator = (negation) ? nod_geq : nod_lss;
operatr = (negation) ? nod_geq : nod_lss;
negation = FALSE;
break;
case KW_CONTAINING:
operator = nod_containing;
operatr = nod_containing;
break;
case KW_MATCHES:
LEX_token();
expr2 = EXPR_value(0, 0);
if (MATCH(KW_USING)) {
operator = nod_sleuth;
node = SYNTAX_NODE(operator, 3);
operatr = nod_sleuth;
node = SYNTAX_NODE(operatr, 3);
node->nod_arg[2] = EXPR_value(0, 0);
}
else {
operator = nod_matches;
node = SYNTAX_NODE(operator, 2);
operatr = nod_matches;
node = SYNTAX_NODE(operatr, 2);
}
node->nod_arg[0] = expr1;
node->nod_arg[1] = expr2;
@ -1026,7 +1026,7 @@ static NOD parse_relational( USHORT * paren_count)
if (!node) {
LEX_token();
node = SYNTAX_NODE(operator, 2);
node = SYNTAX_NODE(operatr, 2);
node->nod_arg[0] = expr1;
node->nod_arg[1] = EXPR_value(paren_count, &local_flag);
}
@ -1042,7 +1042,7 @@ static NOD parse_relational( USHORT * paren_count)
/* If the node isn't an equality, we've done. Since equalities can be structured
as implicit ORs, build them here. */
if (operator != nod_eql)
if (operatr != nod_eql)
return node;
/* We have an equality operation, which can take a number of values. Generate

View File

@ -69,7 +69,7 @@ int GENERATE_acl( SCL class_, UCHAR * buffer)
for (i = 0, id = item->sce_idents; i < id_max; id++, i++)
if (q = *id) {
*p++ = i;
*p++ = strlen(q);
*p++ = strlen((char*) q);
while (c = *q++)
*p++ = UPPER(c);
}
@ -126,7 +126,7 @@ static void generate( STR blr, NOD node)
CON constant;
NOD sub, *arg, *end;
CTX context;
SCHAR operator, *p;
SCHAR operatr, *p;
SLONG value;
USHORT l;
@ -375,26 +375,26 @@ static void generate( STR blr, NOD node)
case nod_from:
switch (node->nod_type) {
case nod_count:
operator = blr_count;
operatr = blr_count;
break;
case nod_max:
operator = blr_maximum;
operatr = blr_maximum;
break;
case nod_min:
operator = blr_minimum;
operatr = blr_minimum;
break;
case nod_total:
operator = blr_total;
operatr = blr_total;
break;
case nod_average:
operator = blr_average;
operatr = blr_average;
break;
case nod_from:
operator = (node->nod_arg[s_stt_default]) ? blr_via : blr_from;
operatr = (node->nod_arg[s_stt_default]) ? blr_via : blr_from;
break;
}
CHECK_BLR(1);
STUFF(operator);
STUFF(operatr);
generate(blr, node->nod_arg[s_stt_rse]);
if (sub = node->nod_arg[s_stt_value])
generate(blr, sub);
@ -460,84 +460,84 @@ static void generate( STR blr, NOD node)
return;
case nod_eql:
operator = blr_eql;
operatr = blr_eql;
break;
case nod_neq:
operator = blr_neq;
operatr = blr_neq;
break;
case nod_gtr:
operator = blr_gtr;
operatr = blr_gtr;
break;
case nod_geq:
operator = blr_geq;
operatr = blr_geq;
break;
case nod_leq:
operator = blr_leq;
operatr = blr_leq;
break;
case nod_lss:
operator = blr_lss;
operatr = blr_lss;
break;
case nod_between:
operator = blr_between;
operatr = blr_between;
break;
case nod_matches:
operator = blr_matching;
operatr = blr_matching;
break;
case nod_containing:
operator = blr_containing;
operatr = blr_containing;
break;
case nod_starts:
operator = blr_starting;
operatr = blr_starting;
break;
case nod_missing:
operator = blr_missing;
operatr = blr_missing;
break;
case nod_and:
operator = blr_and;
operatr = blr_and;
break;
case nod_or:
operator = blr_or;
operatr = blr_or;
break;
case nod_not:
operator = blr_not;
operatr = blr_not;
break;
case nod_add:
operator = blr_add;
operatr = blr_add;
break;
case nod_subtract:
operator = blr_subtract;
operatr = blr_subtract;
break;
case nod_multiply:
operator = blr_multiply;
operatr = blr_multiply;
break;
case nod_divide:
operator = blr_divide;
operatr = blr_divide;
break;
case nod_negate:
operator = blr_negate;
operatr = blr_negate;
break;
case nod_concatenate:
operator = blr_concatenate;
operatr = blr_concatenate;
break;
case nod_for:
operator = blr_for;
operatr = blr_for;
break;
case nod_assignment:
operator = blr_assignment;
operatr = blr_assignment;
break;
case nod_store:
operator = blr_store;
operatr = blr_store;
break;
case nod_post:
operator = blr_post;
operatr = blr_post;
break;
case nod_uppercase:
operator = blr_upcase;
operatr = blr_upcase;
break;
case nod_sleuth:
operator = blr_matching2;
operatr = blr_matching2;
break;
/*case nod_substr: operator = blr_substring; break; */
/*case nod_substr: operatr = blr_substring; break; */
default:
DDL_err(96, NULL, NULL, NULL, NULL, NULL); /* msg 96: GENERATE_blr: node not supported */
@ -553,13 +553,13 @@ static void generate( STR blr, NOD node)
field [NOT] MISSING */
if ((operator == blr_eql || operator == blr_neq) &&
if ((operatr == blr_eql || operatr == blr_neq) &&
(arg[0]->nod_type == nod_null || arg[1]->nod_type == nod_null)) {
if (operator == blr_neq) {
if (operatr == blr_neq) {
CHECK_BLR(1);
STUFF(blr_not);
}
operator = blr_missing;
operatr = blr_missing;
if (arg[0]->nod_type == nod_null)
arg++;
end = arg + 1;
@ -568,7 +568,7 @@ static void generate( STR blr, NOD node)
/* Fall thru on reasonable stuff */
CHECK_BLR(1);
STUFF(operator);
STUFF(operatr);
for (; arg < end; arg++)
generate(blr, *arg);
}

View File

@ -34,6 +34,10 @@
#include "../dudley/lex_proto.h"
#include "../jrd/gds_proto.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef PC_PLATFORM
#ifndef NETWARE_386
#define SCRATCH "I"

View File

@ -924,7 +924,7 @@ static void define_filter(void)
#endif
parse_end();
make_action(act_a_filter, filter);
make_action(act_a_filter, (DBB) filter);
}
@ -974,9 +974,9 @@ static void define_function(void)
while (TRUE) {
if (KEYWORD(KW_SEMI))
break;
function_arg = parse_function_arg(function, &position);
function_arg = parse_function_arg(function, (USHORT*) &position);
function_arg->funcarg_funcname = function->func_name;
make_action(act_a_function_arg, function_arg);
make_action(act_a_function_arg, (DBB) function_arg);
if (!MATCH(KW_COMMA))
break;
}
@ -984,7 +984,7 @@ static void define_function(void)
if (!KEYWORD(KW_SEMI))
PARSE_error(132, DDL_token.tok_string, 0); /* msg 132: expected comma or semi-colon, encountered \"%s\" */
make_action(act_a_function, function);
make_action(act_a_function, (DBB) function);
}
@ -1007,7 +1007,7 @@ static void define_generator(void)
symbol = PARSE_symbol(tok_ident);
parse_end();
make_action(act_a_generator, symbol);
make_action(act_a_generator, (DBB) symbol);
}
@ -1082,7 +1082,7 @@ static void define_index(void)
while (stack)
*--ptr = (SYM) LLS_POP(&stack);
make_action(act_a_index, index);
make_action(act_a_index, (DBB) index);
}
@ -1182,7 +1182,7 @@ static void define_old_trigger(void)
trigger->trg_statement = EXPR_statement();
end_text(trigger->trg_source);
make_action(act_a_trigger, trigger);
make_action(act_a_trigger, (DBB) trigger);
}
parse_end();
@ -1226,7 +1226,7 @@ static void define_relation(void)
PARSE_error(298, 0, 0); /* msg 298: A non-Decnet node name is not permitted in an external file name */
}
rel_actions = action = make_action(act_a_relation, relation);
rel_actions = action = make_action(act_a_relation, (DBB) relation);
action->act_flags |= ACT_ignore;
position = 1;
@ -1270,7 +1270,7 @@ static void define_relation(void)
field->fld_flags |= fld_explicit_position;
field->fld_name->sym_type = SYM_field;
HSH_insert(field->fld_name);
action = make_action(act_a_field, field);
action = make_action(act_a_field, (DBB) field);
action->act_flags |= ACT_ignore;
if (!MATCH(KW_COMMA))
break;
@ -1332,7 +1332,7 @@ static void define_security_class(void)
parse_end();
make_action(act_a_security, class_);
make_action(act_a_security, (DBB) class_);
}
@ -1400,7 +1400,7 @@ static void define_shadow(void)
for (file = shadow; file; file = file->fil_next)
file->fil_shadow_number = number;
make_action(act_a_shadow, shadow);
make_action(act_a_shadow, (DBB) shadow);
}
@ -1465,7 +1465,7 @@ static void define_trigger(void)
PARSE_error(142, (TEXT *) (trigmsg->trgmsg_number), 0); /* msg 142: message number %d exceeds 255 */
MATCH(KW_COLON);
trigmsg->trgmsg_text = PARSE_symbol(tok_quoted);
make_action(act_a_trigger_msg, trigmsg);
make_action(act_a_trigger_msg, (DBB) trigmsg);
MATCH(KW_COMMA);
}
else {
@ -1482,7 +1482,7 @@ static void define_trigger(void)
parse_end();
make_action(act_a_trigger, trigger);
make_action(act_a_trigger, (DBB) trigger);
trigger->trg_name->sym_type = SYM_trigger;
trigger->trg_name->sym_object = (CTX) trigger;
HSH_insert(trigger->trg_name);
@ -1515,7 +1515,7 @@ static ACT define_type(void)
fldtype->typ_type = PARSE_number();
if (KEYWORD(KW_DESCRIPTION))
fldtype->typ_description = parse_description();
make_action(act_a_type, fldtype);
make_action(act_a_type, (DBB) fldtype);
if (!MATCH(KW_COMMA))
break;
}
@ -1568,7 +1568,7 @@ static ACT define_view(void)
LLS_PUSH(my_context, &contexts);
relation->rel_rse->nod_arg[s_rse_contexts] = (NOD) contexts;
rel_actions = action = make_action(act_a_relation, relation);
rel_actions = action = make_action(act_a_relation, (DBB) relation);
action->act_flags |= ACT_ignore;
/* Pick up various fields and clauses */
@ -1690,7 +1690,7 @@ static void drop_filter(void)
filter->filter_name = PARSE_symbol(tok_ident);
parse_end();
make_action(act_d_filter, filter);
make_action(act_d_filter, (DBB) filter);
}
@ -1712,7 +1712,7 @@ static void drop_function(void)
function->func_name = PARSE_symbol(tok_ident);
parse_end();
make_action(act_d_function, function);
make_action(act_d_function, (DBB) function);
}
@ -1734,7 +1734,7 @@ static void drop_gfield(void)
field->fld_name = PARSE_symbol(tok_ident);
parse_end();
make_action(act_d_gfield, field);
make_action(act_d_gfield, (DBB) field);
}
@ -1757,7 +1757,7 @@ static void drop_index(void)
index->idx_name = PARSE_symbol(tok_ident);
parse_end();
make_action(act_d_index, index);
make_action(act_d_index, (DBB) index);
}
@ -1784,7 +1784,7 @@ static void drop_relation(void)
relation->rel_flags |= rel_marked_for_delete;
make_action(act_d_relation, relation);
make_action(act_d_relation, (DBB) relation);
}
@ -1806,7 +1806,7 @@ static void drop_security_class(void)
class_->scl_name = PARSE_symbol(tok_ident);
parse_end();
make_action(act_d_security, class_);
make_action(act_d_security, (DBB) class_);
}
@ -1873,13 +1873,13 @@ static void drop_trigger(void)
trigger->trg_name = name =
gen_trigger_name(trigger->trg_type, relation);
trigger->trg_relation = relation;
make_action(act_d_trigger, trigger);
make_action(act_d_trigger, (DBB) trigger);
}
}
else {
trigger = (TRG) DDL_alloc(TRG_LEN);
trigger->trg_name = name;
make_action(act_d_trigger, trigger);
make_action(act_d_trigger, (DBB) trigger);
}
parse_end();
@ -1907,7 +1907,7 @@ static void drop_type(void)
fldtype->typ_field_name = PARSE_symbol(tok_ident);
fldtype->typ_name->sym_length = 3;
strncpy(fldtype->typ_name->sym_string, "ALL", 3);
make_action(act_d_type, fldtype);
make_action(act_d_type, (DBB) fldtype);
}
else {
fldname = PARSE_symbol(tok_ident);
@ -1915,7 +1915,7 @@ static void drop_type(void)
fldtype = (TYP) DDL_alloc(sizeof(struct typ));
fldtype->typ_field_name = fldname;
fldtype->typ_name = PARSE_symbol(tok_ident);
make_action(act_d_type, fldtype);
make_action(act_d_type,(DBB) fldtype);
if (!MATCH(KW_COMMA))
break;
}
@ -2203,7 +2203,7 @@ static void grant_user_privilege(void)
parse_end();
make_action(act_grant, upriv);
make_action(act_grant, (DBB) upriv);
}
@ -2394,7 +2394,7 @@ static ACT make_global_field( FLD field)
HSH_insert(field->fld_name);
return make_action(act_a_gfield, field);
return make_action(act_a_gfield, (DBB) field);
}
@ -2436,7 +2436,7 @@ static void mod_old_trigger(void)
SYM_trigger))) PARSE_error(166,
name->sym_string, 0); /* msg 166: Trigger %s does not exist */
modify_trigger_action(trigger, relation);
make_action(act_m_trigger, trigger);
make_action(act_m_trigger, (DBB) trigger);
}
parse_end();
}
@ -2485,7 +2485,7 @@ static void modify_field(void)
parse_end();
make_action(act_m_gfield, field);
make_action(act_m_gfield, (DBB) field);
}
@ -2550,7 +2550,7 @@ static void modify_index(void)
break;
}
make_action(act_m_index, index);
make_action(act_m_index, (DBB) index);
}
@ -2571,7 +2571,7 @@ static void modify_relation(void)
TEXT modify_relation;
relation = PARSE_relation();
make_action(act_m_relation, relation);
make_action(act_m_relation, (DBB) relation);
if (MATCH(KW_EXTERNAL_FILE)) {
relation->rel_filename = PARSE_symbol(tok_quoted);
@ -2628,7 +2628,7 @@ static void modify_relation(void)
field->fld_position = ++relation->rel_field_position;
field->fld_name->sym_type = SYM_field;
HSH_insert(field->fld_name);
make_action(act_a_field, field);
make_action(act_a_field, (DBB) field);
}
}
else if (MATCH(KW_MODIFY)) {
@ -2640,7 +2640,7 @@ static void modify_relation(void)
field->fld_database = database;
if (field->fld_computed)
PARSE_error(173, 0, 0); /* msg 173: A computed expression can not be changed or added */
make_action(act_m_field, field);
make_action(act_m_field, (DBB) field);
}
else if (MATCH(KW_DROP)) {
if (MATCH(KW_SECURITY_CLASS)) {
@ -2668,7 +2668,7 @@ static void modify_relation(void)
field->fld_relation = relation;
field->fld_database = database;
field->fld_name = PARSE_symbol(tok_ident);
make_action(act_d_field, field);
make_action(act_d_field, (DBB) field);
}
}
else
@ -2726,7 +2726,7 @@ static void modify_security_class(void)
}
parse_end();
make_action(act_m_security, class_);
make_action(act_m_security, (DBB) class_);
}
@ -2779,7 +2779,7 @@ static void modify_trigger(void)
relation = trigger->trg_relation;
flags = type = sequence = NULL;
get_trigger_attributes(&flags, &type, &sequence);
get_trigger_attributes((int*) &flags, (int*) &type, (int*) &sequence);
while (!KEYWORD(KW_SEMI)) {
if ((MATCH(KW_MESSAGE)) || (MATCH(KW_MSGADD)) ||
@ -2795,11 +2795,11 @@ static void modify_trigger(void)
if (trigmsg->trgmsg_number > 255)
PARSE_error(178, (TEXT *) trigmsg->trgmsg_number, 0); /* msg 178: message number %d exceeds 255 */
if (msg_type == trgmsg_drop)
make_action(act_d_trigger_msg, trigmsg);
make_action(act_d_trigger_msg, (DBB) trigmsg);
else if (msg_type == trgmsg_modify) {
MATCH(KW_COLON);
trigmsg->trgmsg_text = PARSE_symbol(tok_quoted);
make_action(act_m_trigger_msg, trigmsg);
make_action(act_m_trigger_msg, (DBB) trigmsg);
}
MATCH(KW_COMMA);
msg_type = trgmsg_none;
@ -2819,7 +2819,7 @@ static void modify_trigger(void)
if (flags || type || sequence)
sort_out_attributes(trigger, flags, type, sequence);
make_action(act_m_trigger, trigger);
make_action(act_m_trigger, (DBB) trigger);
}
@ -2868,7 +2868,7 @@ static void modify_type(void)
fldtype->typ_type = PARSE_number();
if (KEYWORD(KW_DESCRIPTION))
fldtype->typ_description = parse_description();
make_action(act_m_type, fldtype);
make_action(act_m_type, (DBB) fldtype);
if (!MATCH(KW_COMMA))
break;
}
@ -2893,7 +2893,7 @@ static void modify_view(void)
USHORT view_modify;
relation = PARSE_relation();
make_action(act_m_relation, relation);
make_action(act_m_relation, (DBB) relation);
view_modify = FALSE;
while (TRUE) {
@ -2927,7 +2927,7 @@ static void modify_view(void)
field->fld_database = database;
if (field->fld_computed)
PARSE_error(181, 0, 0); /* msg 181: A computed expression can not be changed or added */
make_action(act_m_field, field);
make_action(act_m_field, (DBB) field);
}
else if (MATCH(KW_DROP)) {
if (MATCH(KW_DESCRIP)) {
@ -2955,7 +2955,7 @@ static void modify_view(void)
field->fld_relation = relation;
field->fld_database = database;
field->fld_name = PARSE_symbol(tok_ident);
make_action(act_d_field, field);
make_action(act_d_field, (DBB) field);
}
}
else
@ -4020,7 +4020,7 @@ static void revoke_user_privilege(void)
}
parse_end();
make_action(act_revoke, upriv);
make_action(act_revoke, (DBB) upriv);
}
@ -4080,7 +4080,7 @@ static NOD set_generator(void)
node->nod_arg[0] = EXPR_value(0, 0);
parse_end();
make_action(act_s_generator, node);
make_action(act_s_generator, (DBB) node);
}

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@
//
//____________________________________________________________
//
// $Id: ada.cpp,v 1.1.1.1 2001-05-23 13:25:33 tamlin Exp $
// $Id: ada.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
//
#include "../jrd/ib_stdio.h"
@ -41,6 +41,10 @@
#include "../gpre/prett_proto.h"
#include "../jrd/gds_proto.h"
#ifdef HAVE_STRING_H
#include <string.h>
#endif
static int align(int);
static int asgn_from(ACT, REF, int);
static int asgn_sqlda_from(REF, int, TEXT *, int);
@ -528,12 +532,12 @@ void ADA_print_buffer( TEXT * output_buffer, int column)
// Align output to a specific column for output.
//
static align( int column)
static int align( int column)
{
int i;
if (column < 0)
return;
return 0;
ib_putc('\n', out_file);
@ -551,7 +555,7 @@ static align( int column)
// a port variable.
//
static asgn_from( ACT action, REF reference, int column)
static int asgn_from( ACT action, REF reference, int column)
{
FLD field;
TEXT *value, name[64], variable[20], temp[20];
@ -620,7 +624,7 @@ static void asgn_sqlda_from(
// a port variable.
//
static asgn_to( ACT action, REF reference, int column)
static int asgn_to( ACT action, REF reference, int column)
{
FLD field;
REF source;
@ -632,7 +636,7 @@ static asgn_to( ACT action, REF reference, int column)
if (field->fld_array_info) {
source->ref_value = reference->ref_value;
gen_get_or_put_slice(action, source, TRUE, column);
return;
return 0;
}
//
//if (field && (field->fld_flags & FLD_text))
@ -659,7 +663,7 @@ static asgn_to( ACT action, REF reference, int column)
// a port variable.
//
static asgn_to_proc( REF reference, int column)
static int asgn_to_proc( REF reference, int column)
{
SCHAR s[64];
@ -719,7 +723,7 @@ static int gen_at_end( ACT action, int column)
// Substitute for a BASED ON <field name> clause.
//
static gen_based( ACT action, int column)
static int gen_based( ACT action, int column)
{
BAS based_on;
FLD field;
@ -795,7 +799,7 @@ static gen_based( ACT action, int column)
default:
sprintf(s2, "datatype %d unknown\n", field->fld_dtype);
return;
return 0;
}
for (p = s2; *p; p++, q++)
*q = *p;
@ -811,7 +815,7 @@ static gen_based( ACT action, int column)
// Make a blob FOR loop.
//
static gen_blob_close( ACT action, USHORT column)
static int gen_blob_close( ACT action, USHORT column)
{
TEXT *command;
BLB blob;
@ -823,7 +827,8 @@ static gen_blob_close( ACT action, USHORT column)
else
blob = (BLB) action->act_object;
command = (action->act_type == ACT_blob_cancel) ? "CANCEL" : "CLOSE";
command = (action->act_type == ACT_blob_cancel) ? (TEXT*)"CANCEL" :
(TEXT*)"CLOSE";
printa(column, "interbase.%s_BLOB (%s isc_%d);",
command, status_vector(action), blob->blb_ident);
@ -841,7 +846,7 @@ static gen_blob_close( ACT action, USHORT column)
// End a blob FOR loop.
//
static gen_blob_end( ACT action, USHORT column)
static int gen_blob_end( ACT action, USHORT column)
{
BLB blob;
@ -862,7 +867,7 @@ static gen_blob_end( ACT action, USHORT column)
// Make a blob FOR loop.
//
static gen_blob_for( ACT action, USHORT column)
static int gen_blob_for( ACT action, USHORT column)
{
gen_blob_open(action, column);
@ -947,7 +952,7 @@ static gen_blob_open( ACT action, USHORT column)
// Generate the call to open (or create) a blob.
//
static gen_blob_open( ACT action, USHORT column)
static int gen_blob_open( ACT action, USHORT column)
{
TEXT *command;
BLB blob;
@ -981,7 +986,7 @@ static gen_blob_open( ACT action, USHORT column)
// Callback routine for BLR pretty printer.
//
static gen_blr( int *user_arg, int offset, TEXT * string)
static int gen_blr( int *user_arg, int offset, TEXT * string)
{
int from, to, len, c_len;
SCHAR c;
@ -1051,7 +1056,7 @@ static void gen_compatibility_symbol(
// Generate text to compile a request.
//
static gen_compile( ACT action, int column)
static int gen_compile( ACT action, int column)
{
REQ request;
DBB db;
@ -1108,7 +1113,7 @@ static gen_compile( ACT action, int column)
// Generate a call to create a database.
//
static gen_create_database( ACT action, int column)
static int gen_create_database( ACT action, int column)
{
REQ request;
DBB db;
@ -1207,7 +1212,7 @@ static gen_create_database( ACT action, int column)
// Generate substitution text for END_STREAM.
//
static gen_cursor_close( ACT action, REQ request, int column)
static int gen_cursor_close( ACT action, REQ request, int column)
{
return column;
@ -1219,7 +1224,7 @@ static gen_cursor_close( ACT action, REQ request, int column)
// Generate text to initialize a cursor.
//
static gen_cursor_init( ACT action, int column)
static int gen_cursor_init( ACT action, int column)
{
// If blobs are present, zero out all of the blob handles. After this
@ -1239,7 +1244,7 @@ static gen_cursor_init( ACT action, int column)
// Generate text to open an embedded SQL cursor.
//
static gen_cursor_open( ACT action, REQ request, int column)
static int gen_cursor_open( ACT action, REQ request, int column)
{
return column;
@ -1253,7 +1258,7 @@ static gen_cursor_open( ACT action, REQ request, int column)
// and port declarations for requests in the main routine.
//
static gen_database( ACT action, int column)
static int gen_database( ACT action, int column)
{
DBB db;
REQ request;
@ -1270,7 +1275,7 @@ static gen_database( ACT action, int column)
BOOLEAN array_flag;
if (first_flag++ != 0)
return;
return 0;
ib_fprintf(out_file, "\n----- GPRE Preprocessor Definitions -----\n");
@ -1320,7 +1325,7 @@ static gen_database( ACT action, int column)
max_count = 0;
for (stack_ptr = events; stack_ptr; stack_ptr = stack_ptr->lls_next) {
event_count = gen_event_block(stack_ptr->lls_object);
event_count = gen_event_block((ACT) stack_ptr->lls_object);
max_count = MAX(event_count, max_count);
}
@ -1399,7 +1404,7 @@ static gen_database( ACT action, int column)
// Generate a call to update metadata.
//
static gen_ddl( ACT action, int column)
static int gen_ddl( ACT action, int column)
{
REQ request;
@ -1443,7 +1448,7 @@ static gen_ddl( ACT action, int column)
// Generate a call to create a database.
//
static gen_drop_database( ACT action, int column)
static int gen_drop_database( ACT action, int column)
{
REQ request;
DBB db;
@ -1464,7 +1469,7 @@ static gen_drop_database( ACT action, int column)
// Generate a dynamic SQL statement.
//
static gen_dyn_close( ACT action, int column)
static int gen_dyn_close( ACT action, int column)
{
DYN statement;
TEXT s[64];
@ -1482,7 +1487,7 @@ static gen_dyn_close( ACT action, int column)
// Generate a dynamic SQL statement.
//
static gen_dyn_declare( ACT action, int column)
static int gen_dyn_declare( ACT action, int column)
{
DYN statement;
TEXT s1[64], s2[64];
@ -1502,7 +1507,7 @@ static gen_dyn_declare( ACT action, int column)
// Generate a dynamic SQL statement.
//
static gen_dyn_describe( ACT action, int column, BOOLEAN input_flag)
static int gen_dyn_describe( ACT action, int column, BOOLEAN input_flag)
{
DYN statement;
TEXT s[64];
@ -1523,7 +1528,7 @@ static gen_dyn_describe( ACT action, int column, BOOLEAN input_flag)
// Generate a dynamic SQL statement.
//
static gen_dyn_execute( ACT action, int column)
static int gen_dyn_execute( ACT action, int column)
{
DYN statement;
TEXT *transaction, s[64];
@ -1584,7 +1589,7 @@ static gen_dyn_execute( ACT action, int column)
// Generate a dynamic SQL statement.
//
static gen_dyn_fetch( ACT action, int column)
static int gen_dyn_fetch( ACT action, int column)
{
DYN statement;
TEXT s[64];
@ -1611,7 +1616,7 @@ static gen_dyn_fetch( ACT action, int column)
// Generate code for an EXECUTE IMMEDIATE dynamic SQL statement.
//
static gen_dyn_immediate( ACT action, int column)
static int gen_dyn_immediate( ACT action, int column)
{
DYN statement;
DBB database;
@ -1657,7 +1662,7 @@ static gen_dyn_immediate( ACT action, int column)
// Generate a dynamic SQL statement.
//
static gen_dyn_insert( ACT action, int column)
static int gen_dyn_insert( ACT action, int column)
{
DYN statement;
TEXT s[64];
@ -1682,7 +1687,7 @@ static gen_dyn_insert( ACT action, int column)
// Generate a dynamic SQL statement.
//
static gen_dyn_open( ACT action, int column)
static int gen_dyn_open( ACT action, int column)
{
DYN statement;
TEXT *transaction, s[64];
@ -1732,7 +1737,7 @@ static gen_dyn_open( ACT action, int column)
// Generate a dynamic SQL statement.
//
static gen_dyn_prepare( ACT action, int column)
static int gen_dyn_prepare( ACT action, int column)
{
DYN statement;
DBB database;
@ -1786,7 +1791,7 @@ static gen_dyn_prepare( ACT action, int column)
// Generate substitution text for END_MODIFY.
//
static gen_emodify( ACT action, int column)
static int gen_emodify( ACT action, int column)
{
UPD modify;
REF reference, source;
@ -1815,7 +1820,7 @@ static gen_emodify( ACT action, int column)
// Generate substitution text for END_STORE.
//
static gen_estore( ACT action, int column)
static int gen_estore( ACT action, int column)
{
REQ request;
@ -1826,7 +1831,7 @@ static gen_estore( ACT action, int column)
if (request->req_type == REQ_store2) {
if (action->act_error)
ENDIF;
return;
return 0;
}
gen_start(action, request->req_primary, column);
@ -1840,7 +1845,7 @@ static gen_estore( ACT action, int column)
// Generate definitions associated with a single request.
//
static gen_endfor( ACT action, int column)
static int gen_endfor( ACT action, int column)
{
REQ request;
@ -1861,7 +1866,7 @@ static gen_endfor( ACT action, int column)
// Generate substitution text for ERASE.
//
static gen_erase( ACT action, int column)
static int gen_erase( ACT action, int column)
{
UPD erase;
@ -1914,7 +1919,7 @@ static SSHORT gen_event_block( ACT action)
// Generate substitution text for EVENT_INIT.
//
static gen_event_init( ACT action, int column)
static int gen_event_init( ACT action, int column)
{
NOD init, event_list, *ptr, *end, node;
REF reference;
@ -1979,7 +1984,7 @@ static gen_event_init( ACT action, int column)
// Generate substitution text for EVENT_WAIT.
//
static gen_event_wait( ACT action, int column)
static int gen_event_wait( ACT action, int column)
{
PAT args;
NOD event_init;
@ -2042,7 +2047,7 @@ static gen_event_wait( ACT action, int column)
// stream fetch).
//
static gen_fetch( ACT action, int column)
static int gen_fetch( ACT action, int column)
{
REQ request;
NOD var_list;
@ -2112,7 +2117,7 @@ static gen_fetch( ACT action, int column)
if (var_list = (NOD) action->act_object) {
for (i = 0; i < var_list->nod_count; i++)
asgn_to(action, var_list->nod_arg[i], column);
asgn_to(action, (REF) var_list->nod_arg[i], column);
}
else { /* No WITH clause on the FETCH, so no assignments generated; fix
for bug#940. mao 6/20/89 */
@ -2144,7 +2149,7 @@ static gen_fetch( ACT action, int column)
// Generate substitution text for FINISH.
//
static gen_finish( ACT action, int column)
static int gen_finish( ACT action, int column)
{
DBB db;
REQ request;
@ -2214,7 +2219,7 @@ static gen_finish( ACT action, int column)
// Generate substitution text for FOR statement.
//
static gen_for( ACT action, int column)
static int gen_for( ACT action, int column)
{
POR port;
REQ request;
@ -2252,7 +2257,7 @@ static gen_for( ACT action, int column)
// Generate code for a form interaction.
//
static gen_form_display( ACT action, int column)
static int gen_form_display( ACT action, int column)
{
FINT display;
REQ request;
@ -2294,7 +2299,7 @@ static gen_form_display( ACT action, int column)
// Generate code for a form block.
//
static gen_form_end( ACT action, int column)
static int gen_form_end( ACT action, int column)
{
REQ request;
FORM form;
@ -2311,7 +2316,7 @@ static gen_form_end( ACT action, int column)
// Generate code for a form block.
//
static gen_form_for( ACT action, int column)
static int gen_form_for( ACT action, int column)
{
REQ request;
FORM form;
@ -2375,7 +2380,7 @@ static int gen_function( ACT function, int column)
if (action->act_type != ACT_any) {
IBERROR("can't generate function");
return;
return 0;
}
request = action->act_request;
@ -2429,7 +2434,7 @@ static int gen_function( ACT function, int column)
default:
IBERROR("gen_function: unsupported datatype");
return;
return 0;
}
ib_fprintf(out_file, " %s\t%s;\n", dtype,
gen_name(s, reference->ref_source, TRUE));
@ -2462,7 +2467,7 @@ static int gen_function( ACT function, int column)
// or isc_put_slice for an array.
//
static gen_get_or_put_slice(
static int gen_get_or_put_slice(
ACT action,
REF reference, BOOLEAN get, int column)
{
@ -2474,7 +2479,7 @@ static gen_get_or_put_slice(
"interbase.PUT_SLICE (%V1 %RF%DH%RE, %RF%S1%RE, %S2, %N1, %S3, %N2, %S4, %L1, %S5);";
if (!(reference->ref_flags & REF_fetch_array))
return;
return 0;
args.pat_vector1 = status_vector(action); /* status vector */
args.pat_database = action->act_request->req_database; /* database handle */
@ -2519,7 +2524,7 @@ static gen_get_or_put_slice(
// Generate the code to do a get segment.
//
static gen_get_segment( ACT action, int column)
static int gen_get_segment( ACT action, int column)
{
BLB blob;
REF into;
@ -2561,7 +2566,7 @@ static gen_get_segment( ACT action, int column)
// Generate end of block for PUT_ITEM and FOR_ITEM.
//
static gen_item_end( ACT action, int column)
static int gen_item_end( ACT action, int column)
{
ACT org_action;
FINT display;
@ -2576,7 +2581,7 @@ static gen_item_end( ACT action, int column)
request = action->act_request;
if (request->req_type == REQ_menu) {
gen_menu_item_end(action, column);
return;
return 0;
}
if (action->act_pair->act_type == ACT_item_for) {
@ -2584,7 +2589,7 @@ static gen_item_end( ACT action, int column)
gen_name(index, request->req_index, TRUE);
printa(column, "%s := %s + 1;", index, index);
printa(column, "end loop");
return;
return 0;
}
dbb = request->req_database;
@ -2595,7 +2600,7 @@ static gen_item_end( ACT action, int column)
for (reference = port->por_references; reference;
reference = reference->ref_next) if (master = reference->ref_master)
printa(column, "%s := %d;", gen_name(s, reference, TRUE),
PYXIS__OPT_DISPLAY);
PYXIS_OPT_DISPLAY);
printa(column,
"interbase.insert_sub_form (%s %s%s, %s%s, %s, isc_%d'address)",
@ -2611,7 +2616,7 @@ static gen_item_end( ACT action, int column)
// Generate insert text for FOR_ITEM and PUT_ITEM.
//
static gen_item_for( ACT action, int column)
static int gen_item_for( ACT action, int column)
{
REQ request, parent;
FORM form;
@ -2620,7 +2625,7 @@ static gen_item_for( ACT action, int column)
request = action->act_request;
if (request->req_type == REQ_menu) {
gen_menu_item_for(action, column);
return;
return 0;
}
column += INDENT;
@ -2639,7 +2644,7 @@ static gen_item_for( ACT action, int column)
printa(column, "end if;");
if (action->act_type != ACT_item_for)
return;
return 0;
// Build stuff for item loop
@ -2663,7 +2668,7 @@ static gen_item_for( ACT action, int column)
// and get the result.
//
static gen_loop( ACT action, int column)
static int gen_loop( ACT action, int column)
{
REQ request;
POR port;
@ -2688,7 +2693,7 @@ static gen_loop( ACT action, int column)
//
//
static gen_menu( ACT action, int column)
static int gen_menu( ACT action, int column)
{
REQ request;
@ -2704,7 +2709,7 @@ static gen_menu( ACT action, int column)
// Generate code for a menu interaction.
//
static gen_menu_display( ACT action, int column)
static int gen_menu_display( ACT action, int column)
{
MENU menu;
REQ request, display_request;
@ -2739,14 +2744,14 @@ static gen_menu_display( ACT action, int column)
//
//
static gen_menu_end( ACT action, int column)
static int gen_menu_end( ACT action, int column)
{
REQ request;
request = action->act_request;
if (request->req_flags & REQ_menu_for)
return;
return 0;
printa(column, "when others =>");
printa(column + INDENT, "null ;");
@ -2758,7 +2763,7 @@ static gen_menu_end( ACT action, int column)
//
//
static gen_menu_entree( ACT action, int column)
static int gen_menu_entree( ACT action, int column)
{
REQ request;
@ -2773,7 +2778,7 @@ static gen_menu_entree( ACT action, int column)
// Generate code for a reference to a menu or entree attribute.
//
static gen_menu_entree_att( ACT action, int column)
static int gen_menu_entree_att( ACT action, int column)
{
MENU menu;
SSHORT ident, length;
@ -2819,7 +2824,7 @@ static gen_menu_entree_att( ACT action, int column)
// Generate code for a menu block.
//
static gen_menu_for( ACT action, int column)
static int gen_menu_for( ACT action, int column)
{
REQ request;
@ -2839,7 +2844,7 @@ static gen_menu_for( ACT action, int column)
// for a dynamic menu.
//
static gen_menu_item_end( ACT action, int column)
static int gen_menu_item_end( ACT action, int column)
{
REQ request;
ENTREE entree;
@ -2847,7 +2852,7 @@ static gen_menu_item_end( ACT action, int column)
if (action->act_pair->act_type == ACT_item_for) {
column += INDENT;
printa(column, "end loop");
return;
return 0;
}
entree = (ENTREE) action->act_pair->act_object;
@ -2869,13 +2874,13 @@ static gen_menu_item_end( ACT action, int column)
// for a dynamic menu.
//
static gen_menu_item_for( ACT action, int column)
static int gen_menu_item_for( ACT action, int column)
{
ENTREE entree;
REQ request;
if (action->act_type != ACT_item_for)
return;
return 0;
// Build stuff for item loop
@ -2901,7 +2906,7 @@ static gen_menu_item_for( ACT action, int column)
// Generate definitions associated with a dynamic menu request.
//
static gen_menu_request( REQ request, int column)
static int gen_menu_request( REQ request, int column)
{
ACT action;
MENU menu;
@ -2983,7 +2988,7 @@ static TEXT *gen_name( TEXT * string, REF reference, BOOLEAN as_blob)
// Generate a block to handle errors.
//
static gen_on_error( ACT action, USHORT column)
static int gen_on_error( ACT action, USHORT column)
{
ACT err_action;
@ -3003,7 +3008,7 @@ static gen_on_error( ACT action, USHORT column)
// Generate code for an EXECUTE PROCEDURE.
//
static gen_procedure( ACT action, int column)
static int gen_procedure( ACT action, int column)
{
PAT args;
TEXT *pattern;
@ -3062,7 +3067,7 @@ static gen_procedure( ACT action, int column)
// Generate the code to do a put segment.
//
static gen_put_segment( ACT action, int column)
static int gen_put_segment( ACT action, int column)
{
BLB blob;
REF from;
@ -3092,7 +3097,7 @@ static gen_put_segment( ACT action, int column)
// Generate BLR in raw, numeric form. Ughly but dense.
//
static gen_raw(
static int gen_raw(
UCHAR * blr,
enum req_t request_type, int request_length, int column)
{
@ -3127,7 +3132,7 @@ static gen_raw(
// Generate substitution text for READY
//
static gen_ready( ACT action, int column)
static int gen_ready( ACT action, int column)
{
RDY ready;
DBB db;
@ -3156,7 +3161,7 @@ static gen_ready( ACT action, int column)
// Generate receive call for a port.
//
static gen_receive( ACT action, int column, POR port)
static int gen_receive( ACT action, int column, POR port)
{
REQ request;
@ -3182,7 +3187,7 @@ static gen_receive( ACT action, int column, POR port)
// a serious error, it will be caught on the next statement.
//
static gen_release( ACT action, int column)
static int gen_release( ACT action, int column)
{
DBB db, exp_db;
REQ request;
@ -3211,7 +3216,7 @@ static gen_release( ACT action, int column)
// Generate definitions associated with a single request.
//
static gen_request( REQ request, int column)
static int gen_request( REQ request, int column)
{
ACT action;
UPD modify;
@ -3302,37 +3307,43 @@ static gen_request( REQ request, int column)
case REQ_create_database:
case REQ_ready:
string_type = "DPB";
if (PRETTY_print_cdb(request->req_blr, gen_blr, 0, 0))
if (PRETTY_print_cdb((SCHAR*) request->req_blr,
(int (*)()) gen_blr, 0, 0))
IBERROR("internal error during parameter generation");
break;
case REQ_ddl:
string_type = "DYN";
if (PRETTY_print_dyn(request->req_blr, gen_blr, 0, 0))
if (PRETTY_print_dyn((SCHAR*) request->req_blr,
( int (*)()) gen_blr, 0, 0))
IBERROR("internal error during dynamic DDL generation");
break;
case REQ_form:
string_type = "form map";
if (PRETTY_print_form_map(request->req_blr, gen_blr, 0, 0))
if (PRETTY_print_form_map((SCHAR*) request->req_blr,
( int (*)()) gen_blr, 0, 0))
IBERROR("internal error during form map generation");
break;
case REQ_menu:
string_type = "menu";
if (PRETTY_print_menu(request->req_blr, gen_blr, 0, 1))
if (PRETTY_print_menu((SCHAR*) request->req_blr,
(int (*)()) gen_blr, 0, 1))
IBERROR("internal error during menu generation");
break;
case REQ_slice:
string_type = "SDL";
if (PRETTY_print_sdl(request->req_blr, gen_blr, 0, 0))
if (PRETTY_print_sdl((SCHAR*) request->req_blr,
( int (*)() ) gen_blr, 0, 0))
IBERROR("internal error during SDL generation");
break;
default:
string_type = "BLR";
if (isc_print_blr(request->req_blr, gen_blr, 0, 0))
if (isc_print_blr((SCHAR*) request->req_blr,
( void (*)() ) gen_blr, 0, 0))
IBERROR("internal error during BLR generation");
}
}
@ -3374,7 +3385,7 @@ static gen_request( REQ request, int column)
printa(column,
"isc_%d\t: CONSTANT interbase.blr (1..%d) := (",
reference->ref_sdl_ident, reference->ref_sdl_length);
gen_raw(reference->ref_sdl, REQ_slice,
gen_raw((UCHAR*) reference->ref_sdl, REQ_slice,
reference->ref_sdl_length, column);
printa(column, "); \t--- end of SDL string for isc_%d\n",
reference->ref_sdl_ident);
@ -3383,7 +3394,8 @@ static gen_request( REQ request, int column)
printa(column,
"--- FORMATTED REQUEST SDL FOR GDS_%d = \n",
reference->ref_sdl_ident);
if (PRETTY_print_sdl(reference->ref_sdl, gen_blr, 0, 1))
if (PRETTY_print_sdl(reference->ref_sdl,
( int(*)() ) gen_blr, 0, 1))
IBERROR("internal error during SDL generation");
}
}
@ -3418,7 +3430,7 @@ static gen_request( REQ request, int column)
// in a store2 statement.
//
static gen_return_value( ACT action, int column)
static int gen_return_value( ACT action, int column)
{
UPD update;
REF reference;
@ -3442,7 +3454,7 @@ static gen_return_value( ACT action, int column)
// routine, insert local definitions.
//
static gen_routine( ACT action, int column)
static int gen_routine( ACT action, int column)
{
BLB blob;
REQ request;
@ -3490,7 +3502,7 @@ static gen_routine( ACT action, int column)
// Generate substitution text for END_STREAM.
//
static gen_s_end( ACT action, int column)
static int gen_s_end( ACT action, int column)
{
REQ request;
@ -3522,7 +3534,7 @@ static gen_s_end( ACT action, int column)
// Generate substitution text for FETCH.
//
static gen_s_fetch( ACT action, int column)
static int gen_s_fetch( ACT action, int column)
{
REQ request;
@ -3540,7 +3552,7 @@ static gen_s_fetch( ACT action, int column)
// used both by START_STREAM and FOR
//
static gen_s_start( ACT action, int column)
static int gen_s_start( ACT action, int column)
{
REQ request;
POR port;
@ -3580,7 +3592,7 @@ static gen_s_start( ACT action, int column)
// Substitute for a segment, segment length, or blob handle.
//
static gen_segment( ACT action, int column)
static int gen_segment( ACT action, int column)
{
BLB blob;
@ -3598,7 +3610,7 @@ static gen_segment( ACT action, int column)
// Generate code for standalone SELECT statement.
//
static gen_select( ACT action, int column)
static int gen_select( ACT action, int column)
{
REQ request;
POR port;
@ -3619,7 +3631,7 @@ static gen_select( ACT action, int column)
if (var_list = (NOD) action->act_object)
for (i = 0; i < var_list->nod_count; i++)
asgn_to(action, var_list->nod_arg[i], column);
asgn_to(action, (REF) var_list->nod_arg[i], column);
if (request->req_database->dbb_flags & DBB_v3) {
gen_receive(action, column, port);
printa(column, "if (SQLCODE = 0) AND (%s /= 0) then", name);
@ -3641,7 +3653,7 @@ static gen_select( ACT action, int column)
// Generate a send or receive call for a port.
//
static gen_send( ACT action, POR port, int column)
static int gen_send( ACT action, POR port, int column)
{
REQ request;
@ -3661,13 +3673,13 @@ static gen_send( ACT action, POR port, int column)
// Generate support for get/put slice statement.
//
static gen_slice( ACT action, int column)
static int gen_slice( ACT action, int column)
{
REQ request, parent_request;
REF reference, upper, lower;
SLC slice;
PAT args;
struct slc_repeat *tail, *end;
slc::slc_repeat *tail, *end;
TEXT *pattern1 =
"interbase.GET_SLICE (%V1 %RF%DH%RE, %RF%RT%RE, %RF%FR%RE, %N1, \
%I1, %N2, %I1v, %I1s, %RF%S5'address%RE, %RF%S6%RE);";
@ -3731,7 +3743,7 @@ static gen_slice( ACT action, int column)
// on whether or a not a port is present.
//
static gen_start( ACT action, POR port, int column)
static int gen_start( ACT action, POR port, int column)
{
REQ request;
TEXT *vector;
@ -3772,7 +3784,7 @@ static gen_start( ACT action, POR port, int column)
// call and any variable initialization required.
//
static gen_store( ACT action, int column)
static int gen_store( ACT action, int column)
{
REQ request;
REF reference;
@ -3803,7 +3815,7 @@ static gen_store( ACT action, int column)
// Generate substitution text for START_TRANSACTION.
//
static gen_t_start( ACT action, int column)
static int gen_t_start( ACT action, int column)
{
DBB db;
TRA trans;
@ -3818,7 +3830,7 @@ static gen_t_start( ACT action, int column)
if (!action || !(trans = (TRA) action->act_object)) {
t_start_auto(action, 0, status_vector(action), column, FALSE);
return;
return 0;
}
// build a complete statement, including tpb's.
@ -3861,7 +3873,7 @@ static gen_t_start( ACT action, int column)
// Generate a TPB in the output file
//
static gen_tpb( TPB tpb, int column)
static int gen_tpb( TPB tpb, int column)
{
TEXT *text, buffer[80], c, *p;
int length;
@ -3899,7 +3911,7 @@ static gen_tpb( TPB tpb, int column)
// Generate substitution text for COMMIT, ROLLBACK, PREPARE, and SAVE
//
static gen_trans( ACT action, int column)
static int gen_trans( ACT action, int column)
{
if (action->act_type == ACT_commit_retain_context)
@ -3946,7 +3958,7 @@ static int gen_type( ACT action, int column)
// Generate substitution text for UPDATE ... WHERE CURRENT OF ...
//
static gen_update( ACT action, int column)
static int gen_update( ACT action, int column)
{
POR port;
UPD modify;
@ -3963,7 +3975,7 @@ static gen_update( ACT action, int column)
// Substitute for a variable reference.
//
static gen_variable( ACT action, int column)
static int gen_variable( ACT action, int column)
{
TEXT s[20];
@ -3976,7 +3988,7 @@ static gen_variable( ACT action, int column)
// Generate tests for any WHENEVER clauses that may have been declared.
//
static gen_whenever( SWE label, int column)
static int gen_whenever( SWE label, int column)
{
TEXT *condition;
@ -4006,7 +4018,7 @@ static gen_whenever( SWE label, int column)
// Create a new window.
//
static gen_window_create( ACT action, int column)
static int gen_window_create( ACT action, int column)
{
printa(column,
@ -4020,7 +4032,7 @@ static gen_window_create( ACT action, int column)
// Delete a window.
//
static gen_window_delete( ACT action, int column)
static int gen_window_delete( ACT action, int column)
{
printa(column, "interbase.delete_window (%sisc_window)",
@ -4033,7 +4045,7 @@ static gen_window_delete( ACT action, int column)
// Suspend a window.
//
static gen_window_suspend( ACT action, int column)
static int gen_window_suspend( ACT action, int column)
{
printa(column, "interbase.suspend_window (%sisc_window)",
@ -4047,7 +4059,7 @@ static gen_window_suspend( ACT action, int column)
// output file.
//
static make_array_declaration( REF reference, int column)
static int make_array_declaration( REF reference, int column)
{
FLD field;
SCHAR *name;
@ -4061,7 +4073,7 @@ static make_array_declaration( REF reference, int column)
// Don't generate multiple declarations for the array. V3 Bug 569.
if (field->fld_array_info->ary_declared)
return;
return 0;
field->fld_array_info->ary_declared = TRUE;
@ -4134,7 +4146,7 @@ static make_array_declaration( REF reference, int column)
default:
printa(column, "datatype %d unknown for field %s",
field->fld_array_info->ary_dtype, name);
return;
return 0;
}
ib_fprintf(out_file, ";\n");
@ -4155,7 +4167,7 @@ static make_array_declaration( REF reference, int column)
// if type == ACT_close && !isc_nl, error
//
static make_cursor_open_test( enum act_t type, REQ request, int column)
static int make_cursor_open_test( enum act_t type, REQ request, int column)
{
if (type == ACT_open) {
@ -4191,7 +4203,7 @@ static TEXT *make_name( TEXT * string, SYM symbol)
// compiled request with active transaction.
//
static make_ok_test( ACT action, REQ request, int column)
static int make_ok_test( ACT action, REQ request, int column)
{
if (sw_auto)
@ -4208,7 +4220,7 @@ static make_ok_test( ACT action, REQ request, int column)
// Insert a port record description in output.
//
static make_port( POR port, int column)
static int make_port( POR port, int column)
{
FLD field;
REF reference;
@ -4284,7 +4296,7 @@ static make_port( POR port, int column)
sprintf(s, "datatype %d unknown for field %s, msg %d",
field->fld_dtype, name, port->por_msg_number);
IBERROR(s);
return;
return 0;
}
}
@ -4313,7 +4325,7 @@ static make_port( POR port, int column)
// ready;
//
static make_ready(
static int make_ready(
DBB db,
TEXT * filename, TEXT * vector, USHORT column, REQ request)
{
@ -4404,7 +4416,7 @@ static make_ready(
// Print a fixed string at a particular column.
//
static printa( int column, TEXT * string, ...)
static int printa( int column, TEXT * string, ...)
{
va_list ptr;
@ -4430,7 +4442,7 @@ static TEXT *request_trans( ACT action, REQ request)
return trname;
}
else
return (request) ? request->req_trans : "gds_trans";
return (request) ? request->req_trans : (TEXT*) "gds_trans";
}
@ -4455,7 +4467,7 @@ static TEXT *status_vector( ACT action)
// Generate substitution text for START_TRANSACTION.
//
static t_start_auto(
static int t_start_auto(
ACT action,
REQ request, TEXT * vector, int column, SSHORT test)
{

View File

@ -25,7 +25,7 @@
//
//____________________________________________________________
//
// $Id: c_cxx.cpp,v 1.1.1.1 2001-05-23 13:25:32 tamlin Exp $
// $Id: c_cxx.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
//
#include "../jrd/ib_stdio.h"
@ -149,7 +149,7 @@ static TEXT *make_name(TEXT *, SYM);
static void make_ok_test(ACT, REQ, int);
static void make_port(POR, int);
static void make_ready(DBB, TEXT *, TEXT *, USHORT, REQ);
static void printa(int, TEXT *, ...);
static void printa(int, const char *, ...);
static void printb(TEXT *, ...);
static TEXT *request_trans(ACT, REQ);
static TEXT *status_vector(ACT);
@ -171,6 +171,10 @@ static TEXT *status_name;
#define GDS_INCLUDE "\"interbase:[syslib]gds.h\""
#endif
#ifdef DARWIN
#define GDS_INCLUDE "<Firebird/ibase.h>"
#endif
#ifndef GDS_INCLUDE
#define GDS_INCLUDE "<ibase.h>"
#endif
@ -680,7 +684,7 @@ static void asgn_from( ACT action, REF reference, int column)
ib_fprintf(out_file, "isc_ftof (%s, %d, %s, %d);", value,
field->fld_length, variable, field->fld_length);
else if (sw_cstring)
ib_fprintf(out_file, "isc_vtov (%s, %s, %d);", value,
ib_fprintf(out_file, "isc_vtov ((char*)%s, (char*)%s, %d);", value,
variable, field->fld_length);
else if (reference->ref_source)
ib_fprintf(out_file, "isc_ftof (%s, sizeof (%s), %s, %d);",
@ -812,7 +816,7 @@ static void asgn_to( ACT action, REF reference, int column)
field->fld_length, reference->ref_value,
reference->ref_value);
else
ib_fprintf(out_file, "isc_vtov (%s, %s, sizeof (%s));", s,
ib_fprintf(out_file, "isc_vtov ((char*)%s, (char*)%s, sizeof (%s));", s,
reference->ref_value, reference->ref_value);
#else
/* To avoid chopping off a double byte kanji character in between
@ -875,7 +879,7 @@ static void asgn_to_proc( REF reference, int column)
field->fld_length, reference->ref_value,
reference->ref_value);
else
ib_fprintf(out_file, "isc_vtov (%s, %s, sizeof (%s));", s,
ib_fprintf(out_file, "isc_vtov ((char*)%s, (char*)%s, sizeof (%s));", s,
reference->ref_value, reference->ref_value);
#else
/* To avoid chopping off a double byte kanji character in between
@ -1167,7 +1171,7 @@ static void gen_blob_open( ACT action, USHORT column)
TEXT *pattern1 =
"isc_%IFcreate%ELopen%EN_blob2 (%V1, &%DH, &%RT, &%BH, &%FR, (short) %N1, %I1);",
*pattern2 =
"isc_%IFcreate%ELopen%EN_blob2 (%V1, &%DH, &%RT, &%BH, &%FR, (short) 0, (char*) 0);";
"isc_%IFcreate%ELopen%EN_blob2 (%V1, &%DH, &%RT, &%BH, &%FR, (short) 0, (%IFchar%ELunsigned char%EN*) 0);";
if (sw_auto && (action->act_flags & ACT_sql)) {
t_start_auto(action, action->act_request, status_vector(action),
@ -1234,7 +1238,7 @@ static void gen_blob_open( ACT action, USHORT column)
// Callback routine for BLR pretty printer.
//
static gen_blr( int *user_arg, int offset, TEXT * string)
static int gen_blr( int *user_arg, int offset, TEXT * string)
{
int indent, length;
TEXT *p, *q, *p1, *q1, c, d, line[256];
@ -1326,7 +1330,7 @@ static void gen_compatibility_symbol(
TEXT * symbol,
TEXT * v4_prefix, TEXT * trailer)
{
TEXT *v3_prefix;
const char *v3_prefix;
v3_prefix = (sw_language == lang_cxx) ? "gds_" : "gds__";
@ -1347,7 +1351,7 @@ static void gen_compile( ACT action, int column)
BLB blob;
PAT args;
TEXT *pattern1 =
"isc_compile_request%IF2%EN (%V1, &%DH, &%RH, (short) sizeof (%RI), (char ISC_FAR *) %RI);",
"isc_compile_request%IF2%EN (%V1, (void**) &%DH, (void**) &%RH, (short) sizeof (%RI), (char ISC_FAR *) %RI);",
*pattern2 = "if (!%RH%IF && %S1%EN)";
args.pat_request = request = action->act_request;
@ -1435,7 +1439,7 @@ static void gen_create_database( ACT action, int column)
if (request->req_flags & REQ_extend_dpb) {
if (request->req_length)
printa(column, "if (%s != isc_%d)", s2, request->req_ident);
printa(column + (request->req_length ? INDENT : 0), "isc_free (%s);",
printa(column + (request->req_length ? INDENT : 0), "isc_free ((char*) %s);",
s2);
/* reset the length of the dpb */
@ -1448,7 +1452,7 @@ static void gen_create_database( ACT action, int column)
column += INDENT;
BEGIN;
printa(column,
"isc_start_transaction (%s, &%s, (short) 1, &%s, (short) 0, (char*) 0);",
"isc_start_transaction (%s, (void**) &%s, (short) 1, &%s, (short) 0, (char*) 0);",
status_vector(action), trname, db->dbb_name->sym_string);
printa(column, "if (%s)", trname);
column += INDENT;
@ -1459,10 +1463,10 @@ static void gen_create_database( ACT action, int column)
trname, request->req_length, request->req_ident);
column -= INDENT;
printa(column, "if (!%s [1])", status_name);
printa(column + INDENT, "isc_commit_transaction (%s, &%s);",
printa(column + INDENT, "isc_commit_transaction (%s, (void**) &%s);",
status_vector(action), trname);
printa(column, "if (%s [1])", status_name);
printa(column + INDENT, "isc_rollback_transaction (%s, &%s);",
printa(column + INDENT, "isc_rollback_transaction (%s, (void**) &%s);",
status_vector(NULL), trname);
SET_SQLCODE;
END;
@ -1477,7 +1481,7 @@ static void gen_create_database( ACT action, int column)
// Generate substitution text for END_STREAM.
//
static gen_cursor_close( ACT action, REQ request, int column)
static int gen_cursor_close( ACT action, REQ request, int column)
{
PAT args;
TEXT *pattern1 =
@ -1521,7 +1525,7 @@ static void gen_cursor_init( ACT action, int column)
// Generate text to open an embedded SQL cursor.
//
static gen_cursor_open( ACT action, REQ request, int column)
static int gen_cursor_open( ACT action, REQ request, int column)
{
PAT args;
TEXT s[64];
@ -1770,10 +1774,10 @@ static void gen_ddl( ACT action, int column)
if (sw_auto) {
column -= INDENT;
printa(column, "if (!%s [1])", status_name);
printa(column + INDENT, "isc_commit_transaction (%s, &%s);",
printa(column + INDENT, "isc_commit_transaction (%s, (void**) &%s);",
status_vector(action), transaction_name);
printa(column, "if (%s [1])", status_name);
printa(column + INDENT, "isc_rollback_transaction (%s, &%s);",
printa(column + INDENT, "isc_rollback_transaction (%s, (void**) &%s);",
status_vector(NULL), transaction_name);
}
@ -2129,7 +2133,7 @@ static void gen_emodify( ACT action, int column)
ib_fprintf(out_file, "%s = %s;", s2, s1);
#if (! (defined JPN_SJIS || defined JPN_EUC) )
else if (sw_cstring && !field->fld_sub_type)
ib_fprintf(out_file, "isc_vtov (%s, %s, %d);",
ib_fprintf(out_file, "isc_vtov ((char*)%s, (char*)%s, %d);",
s1, s2, field->fld_length);
else
ib_fprintf(out_file, "isc_ftof (%s, %d, %s, %d);",
@ -2499,15 +2503,15 @@ static void gen_finish( ACT action, int column)
RDY ready;
PAT args;
TEXT *pattern1 = "if (%S2)\n\
isc_%S1_transaction (%V1, &%S2);";
isc_%S1_transaction (%V1, (void**) &%S2);";
args.pat_vector1 = status_vector(action);
args.pat_string2 = transaction_name;
if (sw_auto || ((action->act_flags & ACT_sql) &&
(action->act_type != ACT_disconnect))) {
args.pat_string1 =
(action->act_type != ACT_rfinish) ? "commit" : "rollback";
args.pat_string1 = (TEXT*)
((action->act_type != ACT_rfinish) ? "commit" : "rollback");
PATTERN_expand((USHORT) column, pattern1, &args);
}
@ -2590,7 +2594,8 @@ static void gen_form_display( ACT action, int column)
REF reference, master;
POR port;
DBB dbb;
TEXT s[32], *status, out[16];
TEXT s[32], out[16];
const char *status;
int code;
display = (FINT) action->act_object;
@ -2643,7 +2648,7 @@ static void gen_form_for( ACT action, int column)
{
REQ request;
FORM form;
TEXT *status;
const char *status;
DBB dbb;
column += INDENT;
@ -2909,7 +2914,8 @@ static void gen_item_end( ACT action, int column)
REF reference, master;
POR port;
DBB dbb;
TEXT s[32], *status;
TEXT s[32];
const char *status;
request = action->act_request;
if (request->req_type == REQ_menu) {
@ -3519,7 +3525,7 @@ static void gen_receive( ACT action, int column, POR port)
{
PAT args;
TEXT *pattern =
"isc_receive (%V1, &%RH, (short) %PN, (short) %PL, &%PI, (short) %RL);";
"isc_receive (%V1, (void**) &%RH, (short) %PN, (short) %PL, &%PI, (short) %RL);";
args.pat_request = action->act_request;
args.pat_vector1 = status_vector(action);
@ -3977,7 +3983,7 @@ static void gen_send( ACT action, POR port, int column)
{
PAT args;
TEXT *pattern =
"isc_send (%V1, &%RH, (short) %PN, (short) %PL, &%PI, (short) %RL);";
"isc_send (%V1, (void**) &%RH, (short) %PN, (short) %PL, &%PI, (short) %RL);";
args.pat_request = action->act_request;
args.pat_vector1 = status_vector(action);
@ -4072,8 +4078,8 @@ static void gen_start( ACT action, POR port, int column, BOOLEAN sending)
{
PAT args;
TEXT *pattern1 =
"isc_start_and_send (%V1, &%RH, &%S1, (short) %PN, (short) %PL, &%PI, (short) %RL);";
TEXT *pattern2 = "isc_start_request (%V1, &%RH, &%S1, (short) %RL);";
"isc_start_and_send (%V1, (void**) &%RH, (void**) &%S1, (short) %PN, (short) %PL, &%PI, (short) %RL);";
TEXT *pattern2 = "isc_start_request (%V1, (void**) &%RH, (void**) &%S1, (short) %RL);";
REF reference;
if (port && sending) {
@ -4165,7 +4171,7 @@ static void gen_t_start( ACT action, int column)
}
}
printa(column, "isc_start_transaction (%s, &%s, (short) %d",
printa(column, "isc_start_transaction (%s, (void**) &%s, (short) %d",
vector,
(trans->tra_handle) ? trans->tra_handle : transaction_name,
trans->tra_db_count);
@ -4251,13 +4257,13 @@ static void gen_trans( ACT action, int column)
{
if (action->act_type == ACT_commit_retain_context)
printa(column, "isc_commit_retaining (%s, &%s);",
printa(column, "isc_commit_retaining (%s, (void**) &%s);",
status_vector(action),
(action->act_object) ? (TEXT *) (action->
act_object) :
transaction_name);
else
printa(column, "isc_%s_transaction (%s, &%s);",
printa(column, "isc_%s_transaction (%s, (void**) &%s);",
(action->act_type ==
ACT_commit) ? "commit" : (action->act_type ==
ACT_rollback) ? "rollback" :
@ -4688,7 +4694,7 @@ static void make_ready(
if (request && request->req_flags & REQ_extend_dpb) {
if (request->req_length)
printa(column, "if (%s != isc_%d)", s2, request->req_ident);
printa(column + (request->req_length ? INDENT : 0), "isc_free (%s);",
printa(column + (request->req_length ? INDENT : 0), "isc_free ((char*) %s);",
s2);
/* reset the length of the dpb */
@ -4703,7 +4709,7 @@ static void make_ready(
// Print a fixed string at a particular column.
//
static void printa( int column, TEXT * string, ...)
static void printa( int column, const char * string, ...)
{
va_list ptr;
@ -4815,7 +4821,7 @@ static void t_start_auto(
else
for (count = 0, db = isc_databases; db; db = db->dbb_next, count++);
printa(column, "isc_start_transaction (%s, &%s, (short) %d",
printa(column, "isc_start_transaction (%s, (void**) &%s, (short) %d",
vector, trname, count);
// Some systems don't like infinitely long lines. Limit them to 256.

View File

@ -25,7 +25,7 @@
//
//____________________________________________________________
//
// $Id: cmd.cpp,v 1.1.1.1 2001-05-23 13:25:29 tamlin Exp $
// $Id: cmd.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
//
#include <string.h>
@ -110,6 +110,7 @@ static void set_statistics(REQ, ACT);
// numbers, and internal idents. Compute length of request.
//
int
CMD_compile_ddl(register REQ request)
{
ACT action;

View File

@ -25,7 +25,7 @@
//
//____________________________________________________________
//
// $Id: cmp.cpp,v 1.1.1.1 2001-05-23 13:25:30 tamlin Exp $
// $Id: cmp.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
//
#include <stdlib.h>
@ -329,6 +329,7 @@ void CMP_compile_request( register REQ request)
// override of the field, -1 is returned.
//
int
CMP_display_code(FINT display, REF reference)
{
int code;

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,7 @@
//
//____________________________________________________________
//
// $Id: exp.cpp,v 1.1.1.1 2001-05-23 13:25:30 tamlin Exp $
// $Id: exp.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
//
#include <stdlib.h>
@ -406,7 +406,7 @@ void EXP_left_paren( TEXT * string)
{
if (!MATCH(KW_LEFT_PAREN))
SYNTAX_ERROR((string) ? string : "left parenthesis");
SYNTAX_ERROR((string) ? string : (char*)"left parenthesis");
}

View File

@ -20,7 +20,7 @@
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// $Id: form.cpp,v 1.1.1.1 2001-05-23 13:25:31 tamlin Exp $
// $Id: form.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
// Revision 1.2 2000/11/27 09:26:13 fsg
// Fixed bugs in gpre to handle PYXIS forms
// and allow edit.e and fred.e to go through
@ -35,7 +35,7 @@
//
//____________________________________________________________
//
// $Id: form.cpp,v 1.1.1.1 2001-05-23 13:25:31 tamlin Exp $
// $Id: form.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
//
#include "../gpre/gpre.h"
@ -48,7 +48,10 @@
typedef int *HANDLE;
extern HANDLE PYXIS_find_field(), PYXIS_get_attribute_value();
extern "C" HANDLE PYXIS_find_field(HANDLE , TEXT *);
extern "C" HANDLE PYXIS_get_attribute_value(HANDLE , ATT_N );
extern int pyxis__load_form(STATUS *, SLONG *, SLONG *, SLONG *, SSHORT *,
SCHAR *);
extern USHORT sw_cstring;
@ -74,13 +77,13 @@ FLD FORM_lookup_field( FORM form, HANDLE object, char *string)
for (field = form->form_fields; field; field = field->fld_next) {
symbol = field->fld_symbol;
if (!strcmp(name, symbol->sym_string))
if (!strcmp((char*)name, symbol->sym_string))
return field;
}
// Haven't seen it before -- look it up on form
if (!(handle = PYXIS_find_field(object, name)))
if (!(handle = PYXIS_find_field(object, (TEXT*) name)))
return NULL;
// Make field block and decrypt data type
@ -88,7 +91,7 @@ FLD FORM_lookup_field( FORM form, HANDLE object, char *string)
field->fld_next = form->form_fields;
form->form_fields = field;
field->fld_handle = handle;
field->fld_prototype = GET_VALUE(handle, att_prototype);
field->fld_prototype = (int*) GET_VALUE(handle, att_prototype);
field->fld_dtype = FORM_TRN_dtype((USHORT) GET_VALUE(handle, att_dtype));
field->fld_length = (int) GET_VALUE(handle, att_length);
field->fld_scale = (int) GET_VALUE(handle, att_scale);
@ -109,7 +112,7 @@ FLD FORM_lookup_field( FORM form, HANDLE object, char *string)
// Make up symbol block
l = p - name;
field->fld_symbol = symbol = MSC_symbol(SYM_form_field, name, l, 0);
field->fld_symbol = symbol = MSC_symbol(SYM_form_field, (TEXT*) name, l, 0);
return field;
}
@ -138,7 +141,7 @@ FORM FORM_lookup_form(DBB dbb, UCHAR * string)
l = p - name;
for (symbol = HSH_lookup(name); symbol; symbol = symbol->sym_homonym)
for (symbol = HSH_lookup((SCHAR*) name); symbol; symbol = symbol->sym_homonym)
if (symbol->sym_type == SYM_form &&
(form = (FORM) symbol->sym_object) && form->form_dbb == dbb)
return form;
@ -147,8 +150,8 @@ FORM FORM_lookup_form(DBB dbb, UCHAR * string)
form = (FORM) ALLOC(sizeof(struct form));
pyxis__load_form(status,
&dbb->dbb_handle, &dbb->dbb_transaction,
&form->form_object, 0, name);
(SLONG*)&dbb->dbb_handle, (SLONG*)&dbb->dbb_transaction,
(SLONG*)&form->form_object, 0, (SCHAR*)name);
if (!form->form_object)
return NULL;
@ -159,7 +162,7 @@ FORM FORM_lookup_form(DBB dbb, UCHAR * string)
// Make up form block, etc
form->form_name = symbol = MSC_symbol(SYM_form, name, l, (CTX) form);
form->form_name = symbol = MSC_symbol(SYM_form, (TEXT*) name, l, (CTX) form);
HSH_insert(symbol);
return form;

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// $Id: gpre.cpp,v 1.2 2001-05-24 14:54:26 tamlin Exp $
// $Id: gpre.cpp,v 1.3 2001-07-12 05:46:04 bellardo Exp $
// Revision 1.2 2000/11/16 15:54:29 fsg
// Added new switch -verbose to gpre that will dump
// parsed lines to stderr
@ -38,7 +38,7 @@
//
//____________________________________________________________
//
// $Id: gpre.cpp,v 1.2 2001-05-24 14:54:26 tamlin Exp $
// $Id: gpre.cpp,v 1.3 2001-07-12 05:46:04 bellardo Exp $
//
#define GPRE_MAIN
@ -60,6 +60,10 @@
#include "../jrd/gds_proto.h"
#include "../gpre/gpreswi.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef VMS
#include <descrip.h>
extern "C" {
@ -647,6 +651,32 @@ int main(int argc, char* argv[])
sw_interp = ttype_metadata;
break;
case IN_SW_GPRE_GXX:
/* When we get executed here the IN_SW_GPRE_G case
* has already been executed. So we just set the
* gen_routine to point to the C++ action, and be
* done with it.
*/
gen_routine = INT_CXX_action;
break;
case IN_SW_GPRE_LANG_INTERNAL:
/* We need to reset all the variables (except sw_language) to the
* default values because the IN_SW_GPRE_G case was already
* executed in the for the very first switch.
**/
sw_language = lang_internal;
gen_routine = C_CXX_action;
sw_cstring = TRUE;
transaction_name = "gds__trans";
sw_know_interp = FALSE;
sw_interp = 0;
ident_pattern = "isc_%d";
utility_name = "isc_utility";
count_name = "isc_count";
slack_name = "isc_slack";
break;
case IN_SW_GPRE_I:
sw_ids = TRUE;
break;
@ -1285,7 +1315,7 @@ static BOOLEAN all_digits(char *str1)
// If there is a problem, explain and return.
//
static arg_is_string( SLONG argc, TEXT ** argvstring, TEXT * errstring)
static int arg_is_string( SLONG argc, TEXT ** argvstring, TEXT * errstring)
{
TEXT *str;
@ -1609,7 +1639,7 @@ static void finish_based( ACT action)
// Return a character to the input stream.
//
static get_char( IB_FILE * file)
static int get_char( IB_FILE * file)
{
if (input_char != input_buffer) {
return (int) *--input_char;
@ -1745,6 +1775,17 @@ static BOOLEAN get_switches(int argc,
sw_tab--;
break;
case IN_SW_GPRE_GXX:
/* If we decrement sw_tab the switch is removed
* from the table and not processed in the main
* switch statement. Since IN_SW_GPRE_G will always
* be processed for lang_internal, we leave our
* switch in so we can clean up the mess left behind
* by IN_SW_GPRE_G
*/
sw_language = lang_internal;
break;
case IN_SW_GPRE_G:
sw_language = lang_internal;
sw_tab--;
@ -1780,6 +1821,11 @@ static BOOLEAN get_switches(int argc,
sw_tab--;
break;
case IN_SW_GPRE_LANG_INTERNAL :
sw_language = lang_internal;
/*sw_tab--;*/
break;
case IN_SW_GPRE_D:
if (!arg_is_string
(--argc, argv,
@ -2299,7 +2345,7 @@ static TOK get_token()
// Also, for Fortran, mark the beginning of a statement
//
static nextchar()
static int nextchar()
{
SSHORT c;

View File

@ -25,7 +25,7 @@
#define GPRE_GPRE_META_H
#ifdef __cplusplus
extern "C" {
//extern "C" {
#endif
extern FLD MET_context_field(CTX, char *);
@ -53,7 +53,7 @@ extern BOOLEAN MET_type(FLD, TEXT *, SSHORT *);
extern BOOLEAN MET_trigger_exists(DBB, TEXT *);
#ifdef __cplusplus
} /* extern "C" */
//} /* extern "C" */
#endif
#endif /* GPRE_GPRE_META_H */

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: gpreswi.h,v 1.1.1.1 2001-05-23 13:25:31 tamlin Exp $
* $Id: gpreswi.h,v 1.2 2001-07-12 05:46:04 bellardo Exp $
* Revision 1.2 2000/11/16 15:54:29 fsg
* Added new switch -verbose to gpre that will dump
* parsed lines to stderr
@ -51,6 +51,7 @@ enum gpre_cmd_switch
IN_SW_GPRE_E, /* accept either case */
IN_SW_GPRE_F, /* source is FORTRAN */
IN_SW_GPRE_G, /* internal GDS module */
IN_SW_GPRE_GXX, /* internal GDS C++ module */
IN_SW_GPRE_I, /* use ID's rather than names */
IN_SW_GPRE_M, /* don't generate READY/START_TRANS */
IN_SW_GPRE_N, /* don't generate debug lines */
@ -84,6 +85,12 @@ enum gpre_cmd_switch
*/
IN_SW_GPRE_VERBOSE,
/* Added this to allow boot version of gpre to only resolve queries
* against internal metadata
*/
IN_SW_GPRE_LANG_INTERNAL,
/* As mentioned above: This should always be one larger than the largest
switch value.
FSG 14.Nov.2000
@ -125,10 +132,12 @@ static struct in_sw_tab_t gpre_in_sw_table[] =
IN_SW_GPRE_F , 0, "FORTRAN" , 0, 0, 0, FALSE, 0, 0, "\t\textended FORTRAN program",
#endif
IN_SW_GPRE_G , 0, "GDS" , 0, 0, 0, FALSE, 0, 0, NULL,
IN_SW_GPRE_GXX , 0, "GDS_CXX" , 0, 0, 0, FALSE, 0, 0, NULL,
IN_SW_GPRE_I , 0, "IDENTIFIERS" , 0, 0, 0, FALSE, 0, 0, NULL,
IN_SW_GPRE_I , 0, "IDS" , 0, 0, 0, FALSE, 0, 0, NULL,
IN_SW_GPRE_INTERP , 0, "CHARSET" , 0, 0, 0, FALSE, 0, 0, "\t\tDefault character set & format",
IN_SW_GPRE_INTERP , 0, "INTERPRETATION",0, 0, 0, FALSE, 0, 0, NULL,
IN_SW_GPRE_LANG_INTERNAL , 0, "LANG_INTERNAL" , 0, 0, 0, FALSE, 0, 0, "\tinternal language only",
IN_SW_GPRE_M , 0, "MANUAL" , 0, 0, 0, FALSE, 0, 0, "\t\tdo not automatically ATTACH to a database",
IN_SW_GPRE_N , 0, "NO_LINES" , 0, 0, 0, FALSE, 0, 0, "\tdo not generate C debug lines",
IN_SW_GPRE_O , 0, "OUTPUT" , 0, 0, 0, FALSE, 0, 0, "\t\tsend output to standard out",

View File

@ -25,7 +25,7 @@
//
//____________________________________________________________
//
// $Id: hsh.cpp,v 1.1.1.1 2001-05-23 13:25:31 tamlin Exp $
// $Id: hsh.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
//
#include "../gpre/gpre.h"
@ -227,7 +227,7 @@ void HSH_remove( register SYM symbol)
// Returns the hash function of a string.
//
static hash( register SCHAR * string)
static int hash( register SCHAR * string)
{
register SLONG value;
SCHAR c;

View File

@ -39,6 +39,7 @@ extern void FTN_action(ACT, int);
extern void FTN_fini(void);
extern void FTN_print_buffer(TEXT *);
extern void INT_action(ACT, int);
extern void INT_CXX_action(ACT, int);
extern void PAS_action(ACT, int);
extern int PLI_action(ACT, int);

View File

@ -20,7 +20,7 @@
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// $Id: par.cpp,v 1.1.1.1 2001-05-23 13:25:29 tamlin Exp $
// $Id: par.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
// Revision 1.2 2000/11/27 09:26:13 fsg
// Fixed bugs in gpre to handle PYXIS forms
// and allow edit.e and fred.e to go through
@ -37,7 +37,7 @@
//
//____________________________________________________________
//
// $Id: par.cpp,v 1.1.1.1 2001-05-23 13:25:29 tamlin Exp $
// $Id: par.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
//
#include <setjmp.h>
@ -2522,11 +2522,11 @@ static ACT par_form_for()
if (!MATCH(KW_DOT))
SYNTAX_ERROR(".");
dbb = (DBB) dbb_symbol->sym_object;
form = FORM_lookup_form(dbb, token.tok_string);
form = FORM_lookup_form(dbb, (UCHAR*)token.tok_string);
}
else
for (dbb = isc_databases; dbb; dbb = dbb->dbb_next)
if ((form = FORM_lookup_form(dbb, token.tok_string)))
if ((form = FORM_lookup_form(dbb, (UCHAR*)token.tok_string)))
break;
// Pick up form

View File

@ -30,6 +30,8 @@ typedef enum kwwords {
KW_max
} KWWORDS;
#include "../gpre/gpre.h"
#define MATCH(keyword) MSC_match(keyword)
#define KEYWORD(kw) ((int) token.tok_keyword == (int) kw)
#define ADVANCE_TOKEN PAR_get_token ()

View File

@ -67,7 +67,7 @@ Substitution codes:
*/
typedef struct pat {
struct pat {
DBB pat_database;
REQ pat_request;
TRA pat_transaction;
@ -93,6 +93,8 @@ typedef struct pat {
SLONG pat_long2;
BOOLEAN pat_condition;
REF pat_reference;
} PAT;
};
typedef pat PAT;
#endif /* _GPRE_PAT_H_ */

View File

@ -25,7 +25,7 @@
//
//____________________________________________________________
//
// $Id: pretty.cpp,v 1.1.1.1 2001-05-23 13:25:32 tamlin Exp $
// $Id: pretty.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
//
#include "../jrd/ib_stdio.h"
@ -237,6 +237,7 @@ int PRETTY_print_dyn(
}
int
PRETTY_print_form_map(SCHAR * blr,
//____________________________________________________________
//
@ -346,6 +347,7 @@ int PRETTY_print_mblr(
}
int
PRETTY_print_menu(SCHAR * blr,
//____________________________________________________________
//
@ -416,6 +418,7 @@ PRETTY_print_menu(SCHAR * blr,
}
int
PRETTY_print_sdl(SCHAR * blr,
//____________________________________________________________
//
@ -520,7 +523,7 @@ static int indent( CTL control, SSHORT level)
// data described.
//
static print_blr_dtype( CTL control, BOOLEAN print_object)
static int print_blr_dtype( CTL control, BOOLEAN print_object)
{
unsigned short dtype;
SCHAR *string;
@ -993,7 +996,7 @@ static SLONG print_long( CTL control, SSHORT offset)
// Primary recursive routine to print slice description language.
//
static print_sdl_verb( CTL control, SSHORT level)
static int print_sdl_verb( CTL control, SSHORT level)
{
int offset, n;
const char *p;
@ -1119,7 +1122,7 @@ static int print_string( CTL control, SSHORT offset)
// Print a VAX word as a numeric value an return same.
//
static print_word( CTL control, SSHORT offset)
static int print_word( CTL control, SSHORT offset)
{
UCHAR v1, v2;

View File

@ -1,7 +1,7 @@
#ifndef INCLUDE_JRD_GDS_H
#define INCLUDE_JRD_GDS_H
#include "../../jrd/ibase.h"
#include "../../jrd/gdsold.h"
#include "../jrd/ibase.h"
#include "../jrd/gdsold.h"
#endif

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: isql.h,v 1.1.1.1 2001-05-23 13:26:02 tamlin Exp $
* $Id: isql.h,v 1.2 2001-07-12 05:46:04 bellardo Exp $
* Revision 1.2 2000/11/18 16:49:24 fsg
* Increased PRINT_BUFFER_LENGTH to 2048 to show larger plans
* Fixed Bug #122563 in extract.e get_procedure_args
@ -352,7 +352,7 @@ typedef struct sqltypes {
#endif
#else
#ifndef ISQL_FREE
#define ISQL_FREE(x) {isc_free (x); x = NULL;}
#define ISQL_FREE(x) {isc_free ((char*) x); x = NULL;}
#endif
#endif /* GUI_TOOLS */

View File

@ -58,6 +58,10 @@
#include "../wal/walc_proto.h"
#include "../wal/walf_proto.h"
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
extern "C" {

View File

@ -893,6 +893,9 @@ int API_ROUTINE isc_add_user(STATUS * status, USER_SEC_DATA * user_data)
* Return > 0 if any error occurs.
*
**************************************/
#ifdef PHASE_1
return 1;
#else
USHORT retval = 0, l;
struct user_data userInfo;
void *db_handle;
@ -1030,6 +1033,7 @@ int API_ROUTINE isc_add_user(STATUS * status, USER_SEC_DATA * user_data)
isc_detach_database(user_status, &db_handle);
}
return status[1]; /* security database not opened */
#endif
}
int API_ROUTINE isc_blob_load(
@ -1074,6 +1078,9 @@ int API_ROUTINE isc_delete_user(STATUS * status, USER_SEC_DATA * user_data)
* Return > 0 if any error occurs.
*
**************************************/
#ifdef PHASE_1
return 1;
#else
USHORT retval = 0, l;
void *db_handle;
struct user_data userInfo;
@ -1117,6 +1124,7 @@ int API_ROUTINE isc_delete_user(STATUS * status, USER_SEC_DATA * user_data)
isc_detach_database(user_status, &db_handle);
}
return status[1]; /* security database not opened */
#endif
}
int API_ROUTINE isc_modify_user(STATUS * status, USER_SEC_DATA * user_data)
@ -1135,6 +1143,9 @@ int API_ROUTINE isc_modify_user(STATUS * status, USER_SEC_DATA * user_data)
* Return > 0 if any error occurs.
*
**************************************/
#ifdef PHASE_1
return 1;
#else
USHORT retval = 0, l;
struct user_data userInfo;
void *db_handle;
@ -1268,6 +1279,7 @@ int API_ROUTINE isc_modify_user(STATUS * status, USER_SEC_DATA * user_data)
isc_detach_database(user_status, &db_handle);
}
return status[1]; /* security database not opened */
#endif
}
void *open_security_db(
@ -1288,6 +1300,9 @@ void *open_security_db(
* Returns NULL otherwise
*
**************************************/
#ifdef PHASE_1
return 0;
#else
short dpb_length, l = 0;
char dpb_buffer[256], *dpb, *p;
TEXT default_security_db[512], connect_string[1024], *database;
@ -1355,6 +1370,7 @@ void *open_security_db(
NULL;
return db_handle;
#endif
}
void get_security_error(STATUS * status, int gsec_err)

View File

@ -24,7 +24,7 @@
* readonly databases.
*/
/*
$Id: blb.cpp,v 1.2 2001-07-10 17:35:13 awharrison Exp $
$Id: blb.cpp,v 1.3 2001-07-12 05:46:04 bellardo Exp $
*/
#include <string.h>
@ -198,8 +198,8 @@ BLB BLB_create2(TDBB tdbb,
type = gds__parse_bpb2(bpb_length,
bpb,
reinterpret_cast < USHORT * >(&from),
reinterpret_cast < USHORT * >(&to),
reinterpret_cast < SSHORT * >(&from),
reinterpret_cast < SSHORT * >(&to),
reinterpret_cast < USHORT * >(&from_charset),
reinterpret_cast < USHORT * >(&to_charset));
blob = allocate_blob(tdbb, transaction);
@ -224,7 +224,7 @@ BLB BLB_create2(TDBB tdbb,
if ((to_charset != CS_NONE) && (from_charset != to_charset)) {
filter = (BLF) ALLOCP(type_blf);
filter->blf_filter =
reinterpret_cast < long (*) () > (filter_transliterate_text);
reinterpret_cast < STATUS (*) (USHORT, CTL) > (filter_transliterate_text);
filter_required = TRUE;
}
}
@ -995,8 +995,8 @@ BLB BLB_open2(TDBB tdbb,
gds__parse_bpb2(bpb_length,
bpb,
reinterpret_cast < USHORT * >(&from),
reinterpret_cast < USHORT * >(&to),
reinterpret_cast < SSHORT * >(&from),
reinterpret_cast < SSHORT * >(&to),
reinterpret_cast < USHORT * >(&from_charset),
reinterpret_cast < USHORT * >(&to_charset));
@ -1024,7 +1024,7 @@ BLB BLB_open2(TDBB tdbb,
if ((to_charset != CS_NONE) && (from_charset != to_charset)) {
filter = (BLF) ALLOCP(type_blf);
filter->blf_filter =
reinterpret_cast < long (*) () > (filter_transliterate_text);
reinterpret_cast < STATUS (*) (USHORT, CTL) > (filter_transliterate_text);
filter_required = TRUE;
}
}

View File

@ -25,7 +25,7 @@
#define _JRD_BLF_PROTO_H_
#ifdef __cplusplus
extern "C" {
//extern "C" {
#endif
extern STATUS DLL_EXPORT BLF_close_blob(TDBB, struct ctl **);
@ -40,7 +40,7 @@ extern STATUS DLL_EXPORT BLF_put_segment(TDBB, struct ctl **, USHORT,
UCHAR *);
#ifdef __cplusplus
} /* extern "C" */
//} /* extern "C" */
#endif
#endif /* _JRD_BLF_PROTO_H_ */

View File

@ -32,14 +32,14 @@
typedef struct ctl
{
STATUS (*ctl_source)(); /* Source filter */
STATUS (*ctl_source)(USHORT, struct ctl*); /* Source filter */
struct ctl* ctl_source_handle; /* Argument to pass to source filter */
SSHORT ctl_to_sub_type; /* Target type */
SSHORT ctl_from_sub_type; /* Source type */
USHORT ctl_buffer_length; /* Length of buffer */
USHORT ctl_segment_length; /* Length of current segment */
USHORT ctl_bpb_length; /* Length of blob parameter block */
SCHAR* ctl_bpb; /* Address of blob parameter block */
UCHAR* ctl_bpb; /* Address of blob parameter block */
UCHAR* ctl_buffer; /* Address of segment buffer */
SLONG ctl_max_segment; /* Length of longest segment */
SLONG ctl_number_segments; /* Total number of segments */
@ -50,7 +50,7 @@ typedef struct ctl
UCHAR* ctl_exception_message; /* Message to use in case of filter exception */
} *CTL;
typedef STATUS(*PTR) ();
typedef STATUS(*PTR) (USHORT, CTL);
/* Blob filter management */
@ -60,7 +60,7 @@ typedef struct blf
struct blf* blf_next; /* Next known filter */
SSHORT blf_from; /* Source sub-type */
SSHORT blf_to; /* Target sub-type */
STATUS (*blf_filter) (); /* Entrypoint of filter */
PTR blf_filter; /* Entrypoint of filter */
STR blf_exception_message; /* message to be used in case of filter exception */
} *BLF;

View File

@ -71,7 +71,7 @@ extern "C" {
static BDB alloc_bdb(TDBB, BCB, UCHAR **);
static void blocking_ast_bdb(BDB);
static int blocking_ast_bdb(BDB);
static void btc_flush(TDBB, SLONG, BOOLEAN, STATUS *);
static void btc_insert(DBB, BDB);
static void btc_remove(BDB);
@ -2575,7 +2575,7 @@ static BDB alloc_bdb(TDBB tdbb, BCB bcb, UCHAR ** memory)
#ifndef PAGE_LATCHING
if (!(bdb->bdb_lock = lock = CCH_page_lock(tdbb, ERR_val))) {
ALL_release(bdb);
ALL_release((FRB)bdb);
return 0;
}
lock->lck_ast = blocking_ast_bdb;
@ -2595,7 +2595,7 @@ static BDB alloc_bdb(TDBB tdbb, BCB bcb, UCHAR ** memory)
#ifndef PAGE_LATCHING
static void blocking_ast_bdb(BDB bdb)
static int blocking_ast_bdb(BDB bdb)
{
/**************************************
*
@ -3482,7 +3482,7 @@ static BDB dealloc_bdb(BDB bdb)
if (bdb) {
#ifndef PAGE_LATCHING
if (bdb->bdb_lock)
ALL_release(bdb->bdb_lock);
ALL_release((FRB)bdb->bdb_lock);
#endif
QUE_DELETE(bdb->bdb_que);
ALL_release(reinterpret_cast < frb * >(bdb));

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________.
*/
/*
$Id: cmp.cpp,v 1.1.1.1 2001-05-23 13:26:14 tamlin Exp $
$Id: cmp.cpp,v 1.2 2001-07-12 05:46:04 bellardo Exp $
*/
#include "../jrd/ibsetjmp.h"
@ -3683,14 +3683,14 @@ static RSE pass1_rse(
if (boolean) {
if (rse->rse_boolean) {
NOD and;
NOD additional;
and = PAR_make_node(tdbb, 2);
and->nod_type = nod_and;
and->nod_arg[0] = boolean;
and->nod_arg[1] =
additional = PAR_make_node(tdbb, 2);
additional->nod_type = nod_and;
additional->nod_arg[0] = boolean;
additional->nod_arg[1] =
pass1(tdbb, csb, rse->rse_boolean, view, view_stream, FALSE);
rse->rse_boolean = and;
rse->rse_boolean = additional;
}
else
rse->rse_boolean = boolean;
@ -3791,13 +3791,13 @@ static void pass1_source(
pass1(tdbb, csb, sub_rse->rse_boolean, parent_view,
view_stream, FALSE);
if (*boolean) {
NOD and;
NOD additional;
and = PAR_make_node(tdbb, 2);
and->nod_type = nod_and;
and->nod_arg[0] = node;
and->nod_arg[1] = *boolean;
*boolean = and;
additional = PAR_make_node(tdbb, 2);
additional->nod_type = nod_and;
additional->nod_arg[0] = node;
additional->nod_arg[1] = *boolean;
*boolean = additional;
}
else
*boolean = node;
@ -3948,17 +3948,17 @@ static void pass1_source(
copy(tdbb, csb, view_rse->rse_boolean, map, 0, FALSE), view,
stream, FALSE);
if (*boolean) {
NOD and;
NOD additional;
/* The order of the nodes here is important! The
boolean from the view must appear first so that
it gets expanded first in pass1. */
and = PAR_make_node(tdbb, 2);
and->nod_type = nod_and;
and->nod_arg[0] = node;
and->nod_arg[1] = *boolean;
*boolean = and;
additional = PAR_make_node(tdbb, 2);
additional->nod_type = nod_and;
additional->nod_arg[0] = node;
additional->nod_arg[1] = *boolean;
*boolean = additional;
}
else
*boolean = node;

View File

@ -27,12 +27,14 @@
* readonly databases.
*/
/*
$Id: common.h,v 1.2 2001-07-10 17:35:13 awharrison Exp $
$Id: common.h,v 1.3 2001-07-12 05:46:05 bellardo Exp $
*/
#ifndef JRD_COMMON_H
#define JRD_COMMON_H
#include "objs/jrd/autoconfig.h"
#ifndef INCLUDE_FB_MACROS_H
#include "../include/fb_macros.h"
#endif
@ -55,6 +57,10 @@ $Id: common.h,v 1.2 2001-07-10 17:35:13 awharrison Exp $
#define CANCEL_OPERATION
#endif
#ifndef GDS_FAR
#define GDS_FAR
#endif
/* Linux for Intel platforms*/
#ifdef LINUX
@ -90,6 +96,39 @@ $Id: common.h,v 1.2 2001-07-10 17:35:13 awharrison Exp $
#define VOLATILE volatile
#endif /* LINUX */
/* Darwin Platforms */
#ifdef DARWIN
#define ALIGNMENT 4
#define DOUBLE_ALIGN 4
#define FB_ALIGN(n,b) ((n + b - 1) & ~(b - 1))
#define SETPGRP setpgrp (0, 0)
#define BSD_UNIX 1
#define UNIX 1
#define ATEXIT(c) atexit (c)
#define IMPLEMENTATION 63
#define IEEE
#define QUADCONST(n) (n##LL)
#define QUADFORMAT "q"
#define NON_MNTENT
#define MMAP_SUPPORTED
#define MAP_ANONYMOUS
#define MAP_ANNON
#define LSEEK_OFFSET_CAST (off_t)
#define INTL
#define SIGACTION_SUPPORTED
#define MEMMOVE(from,to,length) memmove ((void *)to, (void *)from, (size_t)length)
#define MOVE_FAST(from,to,length) memcpy (to, from, (int) (length))
#define MOVE_FASTER(from,to,length) memcpy (to, from, (int) (length))
#define MOVE_CLEAR(to,length) memset (to, 0, (int) (length))
#define _PPC_PARAM_H_
#ifndef MAXPATHLEN
#include <sys/param.h>
#endif
#endif /* Darwin Platforms */
/* FreeBSD for Intel platforms */
#ifdef FREEBSD
@ -1098,8 +1137,12 @@ typedef unsigned long DWORD;
#endif
#define NULL_PTR ((void*) 0)
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#define SUCCESS 0
#define FAILURE 1
@ -1179,10 +1222,10 @@ typedef char SBYTE; /* Signed byte - rare usage */
typedef long STATUS;
typedef long IPTR;
typedef unsigned long U_IPTR;
typedef void (*FPTR_VOID) ();
typedef void (*FPTR_VOID_PTR) (void *);
typedef int (*FPTR_INT) ();
typedef int (*FPTR_INT_VOID_PTR) (void *);
typedef void (GDS_FAR *FPTR_VOID) ();
typedef void (GDS_FAR *FPTR_VOID_PTR) (void *);
typedef int (GDS_FAR *FPTR_INT) ();
typedef int (GDS_FAR *FPTR_INT_VOID_PTR) (void *);
typedef ULONG RCRD_OFFSET;
typedef USHORT FLD_LENGTH;
@ -1402,6 +1445,10 @@ void GDS_breakpoint(int);
#define BUFFER_SMALL 256
#define BUFFER_TINY 128
#ifndef LSEEK_OFFSET_CAST
#define LSEEK_OFFSET_CAST
#endif
#ifndef DOUBLE_MULTIPLY
#define DOUBLE_MULTIPLY(a,b) (((double) (a)) * ((double) (b)))
#endif

View File

@ -44,6 +44,15 @@
#include "../jrd/intl_proto.h"
#include "../jrd/thd_proto.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif
#if !(defined REQUESTER && defined SUPERCLIENT)
#include "../jrd/intlobj.h"
#endif
@ -204,7 +213,6 @@ static CONST TEXT *CONST months[] = {
#include "../jrd/quad.cpp"
#endif
#pragma FB_COMPILER_MESSAGE("Fix this! Ugly function pointer cast!")
typedef void (*pfn_cvt_private_cludge) (int, int);
typedef void (*pfn_cvt_private_cludge2) (int, int, ...);

View File

@ -40,6 +40,7 @@
#include "../jrd/que.h"
#include "../jrd/cch_proto.h"
#include "../jrd/dbg_proto.h"
#include "../jrd/err_proto.h"
#ifdef SUPERSERVER
#include "../jrd/thd_proto.h"
@ -882,7 +883,7 @@ int DBG_pretty(register NOD node, register int column)
return TRUE;
}
extern "C"
int DBG_supervisor(int arg)
{
/**************************************

View File

@ -68,6 +68,14 @@
#include <sys/param.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifndef NOFILE
#define NOFILE 20
#endif

View File

@ -39,9 +39,9 @@
#define CHECK_CNSTRT "CHECK"
#define NOT_NULL_CNSTRT "NOT NULL"
#define GET_STRING(from,to) DYN_get_string (from, to, sizeof (to), TRUE)
#define GET_STRING(from,to) DYN_get_string ((TEXT**)from, (TEXT*)to, sizeof (to), TRUE)
#define GET_STRING_2(from,to) DYN_get_string (from, to, sizeof (to), FALSE)
#define GET_STRING_2(from,to) DYN_get_string ((TEXT**)from, (TEXT*)to, sizeof (to), FALSE)
#define PROC_NAME_SIZE 32
#define FLD_SRC_LEN 32

View File

@ -33,5 +33,7 @@ extern void DYN_modify_procedure(GBL, UCHAR **);
extern void DYN_modify_relation(GBL, UCHAR **);
extern void DYN_modify_trigger(GBL, UCHAR **);
extern void DYN_modify_trigger_msg(GBL, UCHAR **, TEXT *);
extern void DYN_modify_sql_field(GBL, UCHAR**, TEXT*, TEXT*);
#endif /* _JRD_DYN_MD_PROTO_H_ */

View File

@ -8,10 +8,15 @@
static TEXT *local_crypt(TEXT *, TEXT *);
#endif
#if defined(HAVE_UNISTD_H) && !defined(NO_CRYPT)
#include <unistd.h>
#define CRYPT_FUNC crypt
#else
#ifndef NO_CRYPT
extern TEXT *crypt();
#define CRYPT_FUNC crypt
#endif
#endif
extern "C" {

View File

@ -519,7 +519,7 @@ void DLL_EXPORT ERR_punt(void)
gds__log_status(dbname, tdbb->tdbb_status_vector);
}
LONGJMP(reinterpret_cast < jmp_buf & >(tdbb->tdbb_setjmp),
LONGJMP( (JMP_BUF) tdbb->tdbb_setjmp,
(int) tdbb->tdbb_status_vector[1]);
}
#endif

View File

@ -45,13 +45,20 @@ extern void DLL_EXPORT ERR_post(STATUS, ...);
extern void DLL_EXPORT ERR_punt(void);
extern void DLL_EXPORT ERR_warning(STATUS, ...);
extern void DLL_EXPORT ERR_log(int, int, CONST TEXT *);
#endif /* REQUESTER */
extern TEXT *DLL_EXPORT ERR_cstring(CONST TEXT*);
extern TEXT *DLL_EXPORT ERR_string(CONST TEXT*, int);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* REQUESTER */
#ifdef __cplusplus
extern "C" {
#endif
extern TEXT *DLL_EXPORT ERR_cstring(CONST TEXT*);
extern TEXT *DLL_EXPORT ERR_string(CONST TEXT*, int);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* JRD_ERR_PROTO_H */

View File

@ -36,6 +36,15 @@
#include "../jrd/isc_s_proto.h"
#include "../jrd/sch_proto.h"
#include "../jrd/thd_proto.h"
#include "../jrd/isc_i_proto.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#pragma FB_COMPILER_MESSAGE("FIXFIXFIX!!! - DANGER!")
// We currently can't include jrd/err_proto.h to get the function
@ -62,7 +71,7 @@ extern void DLL_EXPORT ERR_bugcheck_msg(CONST TEXT *);
#endif
#ifndef AST_TYPE
#define AST_TYPE
#define AST_TYPE void
#endif
#ifndef MUTEX
@ -373,7 +382,7 @@ SLONG EVENT_que(STATUS * status_vector,
USHORT string_length,
TEXT * string,
USHORT events_length,
UCHAR * events, void (*ast_routine) (), void *ast_arg)
UCHAR * events, FPTR_VOID ast_routine, void *ast_arg)
{
/**************************************
*
@ -550,7 +559,7 @@ static EVH acquire(void)
#if (!(defined SUPERSERVER) && (defined MMAP_SUPPORTED))
STATUS status_vector[20];
header = ISC_remap_file(status_vector, &EVENT_data, length, FALSE);
header = (evh*) ISC_remap_file(status_vector, &EVENT_data, length, FALSE);
#endif
if (!header) {
RELEASE;

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: evl.cpp,v 1.2 2001-05-24 14:54:26 tamlin Exp $
* $Id: evl.cpp,v 1.3 2001-07-12 05:46:05 bellardo Exp $
*/
/*
@ -3805,7 +3805,7 @@ static SSHORT init_agg_distinct(TDBB tdbb, NOD node)
handle =
SORT_init(tdbb->tdbb_status_vector,
ROUNDUP_LONG(sort_key->skd_length), 1, sort_key,
reinterpret_cast < UCHAR(*)() > (reject_duplicate), 0,
reinterpret_cast < BOOLEAN(*)() > (reject_duplicate), 0,
tdbb->tdbb_attachment);
if (!(asb_impure->iasb_sort_handle = (SLONG *) handle))

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________.
*/
/*
$Id: exe.cpp,v 1.1.1.1 2001-05-23 13:26:17 tamlin Exp $
$Id: exe.cpp,v 1.2 2001-07-12 05:46:05 bellardo Exp $
*/
#include <time.h>
@ -3208,8 +3208,9 @@ static void set_error(TDBB tdbb, XCP condition)
if (condition->xcp_rpt[0].xcp_code == gds__check_constraint) {
MET_lookup_cnstrt_for_trigger(tdbb, name, relation_name,
request->req_trg_name);
s = (name[0]) ? name : "";
r = (relation_name[0]) ? relation_name : "";
// CONST CAST
s = (name[0]) ? name : (TEXT*)"";
r = (relation_name[0]) ? relation_name : (TEXT*)"";
ERR_post(condition->xcp_rpt[0].xcp_code,
gds_arg_string, ERR_cstring(s),
gds_arg_string, ERR_cstring(r), 0);

View File

@ -126,9 +126,15 @@
#ifdef LINUX
#define ISC_PREFIX "/opt/interbase/"
#else
#ifdef DARWIN
#define ISC_PREFIX "/all/files/are/in/framework/resources"
#define DARWIN_GEN_DIR "var"
#define DARWIN_FRAMEWORK_ID "com.firebird.Firebird2"
#else
#define ISC_PREFIX "/usr/interbase/"
#endif
#endif
#endif
/* keep MSG_FILE_LANG in sync with build_file.e */

View File

@ -753,7 +753,7 @@ STATUS filter_transliterate_text(USHORT action, CTL control)
control->ctl_source_handle = aux->ctlaux_subfilter;
control->ctl_source =
reinterpret_cast < long (*) () > (filter_transliterate_text);
reinterpret_cast < STATUS (*) (USHORT, CTL) > (filter_transliterate_text);
source = control->ctl_source_handle;
if (action == ACTION_open) {

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________.
*/
/*
$Id: flu.cpp,v 1.2 2001-05-24 14:54:26 tamlin Exp $
$Id: flu.cpp,v 1.3 2001-07-12 05:46:05 bellardo Exp $
*/
#include "../jrd/common.h"
@ -80,11 +80,20 @@ static int condition_handler(int *, int *, int *);
#define IB_UDF_DIR "UDF/"
#endif
#ifdef DARWIN
#include <unistd.h>
#include <mach-o/dyld.h>
#define IB_UDF_DIR "UDF/"
#endif
#if defined FREEBSD || defined NETBSD
#include <dlfcn.h>
#define DYNAMIC_SHARED_LIBRARIES
#include <unistd.h>
#define IB_UDF_DIR "UDF/"
#endif
#if defined FREEBSD || defined NETBSD || defined DARWIN
/*
* Define our own dirname(), because we don't have a syscall for it.
* !! WARNING !! WARNING !! WARNING !!
@ -225,6 +234,11 @@ void FLU_unregister_module(MOD module)
*
**************************************/
MOD *mod;
#ifdef DARWIN
NSSymbol symbol;
void (*fini)(void);
#endif
/* Module is in-use by other databases.*/
@ -253,6 +267,17 @@ void FLU_unregister_module(MOD module)
FreeLibrary(module->mod_handle);
#endif
#ifdef DARWIN
/* Make sure the fini function gets called, if there is one */
symbol = NSLookupSymbolInModule(module->mod_handle, "__fini");
if (symbol != NULL)
{
fini = (void (*)(void)) NSAddressOfSymbol(symbol);
fini();
}
NSUnLinkModule (module->mod_handle, 0);
#endif
gds__free(module);
}
@ -1240,6 +1265,311 @@ static void adjust_loadlib_name(TEXT * access_path, TEXT * load_path)
}
#endif
#ifdef DARWIN
#define LOOKUP
NSModule ISC_link_with_module (TEXT*);
FPTR_INT ISC_lookup_entrypoint (
TEXT *module,
TEXT *name,
TEXT *ib_path_env_var)
{
/**************************************
*
* I S C _ l o o k u p _ e n t r y p o i n t ( D A R W I N )
*
**************************************
*
* Functional description
* Lookup entrypoint of function.
*
**************************************/
FPTR_INT function;
int lastSpace, i, len;
MOD mod;
TEXT absolute_module[MAXPATHLEN];
NSSymbol symbol;
if (function = FUNCTIONS_entrypoint (module, name))
return function;
/* Remove TRAILING spaces from path names; spaces within the path are valid */
for (i = strlen(module) - 1, lastSpace = 0; i >= 0; i--)
if (module[i] == ' ')
lastSpace = i;
else
break;
if (module[lastSpace] == ' ')
module[lastSpace] = 0;
for (i = strlen(name) - 1, lastSpace = 0; i >= 0; i--)
if (name[i] == ' ')
lastSpace = i;
else
break;
if (name[lastSpace] == ' ')
name[lastSpace] = 0;
if (!*module || !*name)
return NULL;
/*printf("names truncated: %s, function %s.\n", module, name);*/
/* Check if external function module has already been loaded */
if (!(mod = FLU_lookup_module (module)))
{
USHORT length ;
#ifdef EXT_LIB_PATH
if (ib_path_env_var == NULL)
strcpy (absolute_module, module);
else if (!gds__validate_lib_path (module, ib_path_env_var, absolute_module, sizeof(absolute_module)))
return NULL;
#else
strcpy (absolute_module, module);
#endif /* EXT_LIB_PATH */
length = strlen (absolute_module);
/* call search_for_module with the supplied name,
and if unsuccessful, then with <name>.so . */
mod = search_for_module (absolute_module, name);
if (!mod)
{
strcat (absolute_module, ".so");
mod = search_for_module (absolute_module, name);
}
if (!mod)
{
/*printf("Couldn't find module: %s\n", absolute_module);*/
return NULL;
}
assert (mod->mod_handle); /* assert that we found the module */
mod->mod_use_count = 0;
mod->mod_length = length;
strcpy (mod->mod_name, module);
mod->mod_next = FLU_modules;
FLU_modules = mod;
}
/* Look for the symbol and return a pointer to the function if found */
mod->mod_use_count++;
symbol = NSLookupSymbolInModule(mod->mod_handle, name);
if (symbol == NULL)
{
/*printf("Failed to find function: %s in module %s, trying _%s\n", name, module, name);*/
strcpy(absolute_module, "_");
strncat(absolute_module, name, sizeof(absolute_module) - 2);
symbol = NSLookupSymbolInModule(mod->mod_handle, absolute_module);
if (symbol == NULL)
{
/*printf("Failed to find symbol %s. Giving up.\n", absolute_module);*/
return NULL;
}
}
return (FPTR_INT) NSAddressOfSymbol(symbol);
}
static MOD search_for_module ( TEXT *module,
TEXT *name )
{
/**************************************
*
* s e a r c h _ f o r _ m o d u l e ( D A R W I N )
*
**************************************
*
* Functional description
* Look for a module (as named in a 'DECLARE EXTERNAL FUNCTION'
* statement.
*
**************************************/
MOD mod;
char *dirp;
TEXT ib_lib_path[MAXPATHLEN];
TEXT absolute_module[MAXPATHLEN]; /* for _access() ??? */
FDLS *dir_list;
BOOLEAN found_module;
strcpy (absolute_module, module);
if (!(mod = (MOD) gds__alloc (sizeof (struct mod) +
strlen (absolute_module))))
return NULL;
dirp = (char*) dirname (absolute_module);
if (('.' == dirp[0]) && ('\0' == dirp[1]))
{
/* We have a simple module name without a directory. */
gds__prefix (ib_lib_path, IB_UDF_DIR);
strncat (ib_lib_path, module,
MAXPATHLEN - strlen (ib_lib_path) - 1);
if (!access (ib_lib_path, R_OK))
{
/* Module is in the standard UDF directory: load it. */
if (!(mod->mod_handle = ISC_link_with_module (ib_lib_path)))
{
gds__free (mod);
return NULL;
}
}
else
{
gds__prefix (ib_lib_path, IB_INTL_DIR);
strncat (ib_lib_path, module,
MAXPATHLEN - strlen (ib_lib_path) - 1);
/*printf("intl file: %s\n", ib_lib_path);*/
if (!access (ib_lib_path, R_OK))
{
/* Module is in the default directory: load it. */
if (!(mod->mod_handle = ISC_link_with_module (ib_lib_path)))
{
gds__free (mod);
return NULL;
}
}
else
{
/* The module is not in the default directory, so ...
* use the EXTERNAL_FUNCTION_DIRECTORY lines from isc_config.
*/
dir_list = DLS_get_func_dirs();
found_module = FALSE;
while (dir_list && !found_module)
{
strcpy (ib_lib_path, dir_list->fdls_directory);
strcat (ib_lib_path, "/");
strncat (ib_lib_path, module,
MAXPATHLEN - strlen (ib_lib_path) - 1);
if (!access (ib_lib_path, R_OK))
{
if (!(mod->mod_handle = ISC_link_with_module (ib_lib_path)))
{
gds__free (mod);
return NULL;
}
found_module = TRUE;
}
dir_list = dir_list->fdls_next;
}
if (!found_module)
{
gds__free (mod);
return NULL;
}
} /* else module is not in the INTL directory */
} /* else module is not in the default directory, so ... */
} /* if *dirp is "." */
else
{
/* The module name includes a directory path.
* The directory must be the standard UDF directory, or the
* standard international directory, or listed in
* an EXTERNAL_FUNCTION_DIRECTORY line in isc_config,
* and the module must be accessible in that directory.
*/
gds__prefix (ib_lib_path, IB_UDF_DIR);
ib_lib_path [strlen(ib_lib_path) - 1] = '\0'; /* drop trailing "/" */
found_module = ! strcmp (ib_lib_path, dirp);
if (!found_module)
{
gds__prefix (ib_lib_path, IB_INTL_DIR);
ib_lib_path [strlen(ib_lib_path) - 1] = '\0'; /* drop trailing / */
found_module = ! strcmp (ib_lib_path, dirp);
}
if (!found_module)
{
/* It's not the default directory, so try the ones listed
* in EXTERNAL_FUNCTION_DIRECTORY lines in isc_config.
*/
dir_list = DLS_get_func_dirs();
while (dir_list && !found_module)
{
if (! strcmp (dir_list->fdls_directory, dirp))
found_module = TRUE;
dir_list = dir_list->fdls_next;
}
}
if (found_module)
found_module = (!access (module, R_OK)) &&
(0 != (mod->mod_handle = ISC_link_with_module (module)));
if (!found_module)
{
gds__free (mod);
return NULL;
}
} /* else module name includes a directory path, so ... */
return mod;
}
NSModule ISC_link_with_module (
TEXT *fileName)
{
/**************************************
*
* I S C _ l i n k _ w i t h _ m o d u l e ( D A R W I N )
*
**************************************
*
* Functional description
* Given the file system path to a module, load it and link it into
* our address space. Assumes all security checks have been
* performed.
*
**************************************/
NSObjectFileImage image;
NSObjectFileImageReturnCode retVal;
NSModule mod_handle;
NSSymbol initSym;
void (*init)(void);
/* Create an object file image from the given path */
retVal = NSCreateObjectFileImageFromFile(fileName, &image);
if(retVal != NSObjectFileImageSuccess)
{
switch(retVal)
{
case NSObjectFileImageFailure:
/*printf("object file setup failure");*/
return NULL;
case NSObjectFileImageInappropriateFile:
/*printf("not a Mach-O MH_BUNDLE file type");*/
return NULL;
case NSObjectFileImageArch:
/*printf("no object for this architecture");*/
return NULL;
case NSObjectFileImageFormat:
/*printf("bad object file format");*/
return NULL;
case NSObjectFileImageAccess:
/*printf("can't read object file");*/
return NULL;
default:
/*printf("unknown error from NSCreateObjectFileImageFromFile()");*/
return NULL;
}
}
/* link the image */
mod_handle = NSLinkModule(image, fileName, NSLINKMODULE_OPTION_PRIVATE);
NSDestroyObjectFileImage(image) ;
if(mod_handle == NULL)
{
/*printf("NSLinkModule() failed for dlopen()");*/
return NULL;
}
initSym = NSLookupSymbolInModule(mod_handle, "__init");
if (initSym != NULL)
{
init = ( void (*)(void)) NSAddressOfSymbol(initSym);
init();
}
return mod_handle;
}
#endif
#ifndef LOOKUP
FPTR_INT ISC_lookup_entrypoint(TEXT* module,

View File

@ -23,6 +23,7 @@
#include "../jrd/ib_stdio.h"
#include <string.h>
#include "../jrd/jrd.h" /* For MAX_PATH_LENGTH Bug #126614 */
/* defined in common.h, which is included by ib_stdio.h: typedef int (*FPTR_INT)(); */
@ -72,7 +73,7 @@ FPTR_INT FUNCTIONS_entrypoint(char *module, char *entrypoint)
*
**************************************/
FN *function;
char *p, temp[128], *ep;
char *p, temp[MAX_PATH_LENGTH + 128], *ep; /* Bug #126614 Fix */
p = temp;

View File

@ -49,6 +49,11 @@
#include "../jrd/time.h"
#include "../jrd/misc.h"
#ifdef DARWIN
#include <CoreFoundation/CFBundle.h>
#include <CoreFoundation/CFURL.h>
#endif
#if (defined PC_PLATFORM && !defined NETWARE_386)
#include <io.h>
#endif
@ -159,7 +164,7 @@ extern int ib_printf();
#endif
#endif
#if !(defined VMS || defined PC_PLATFORM || defined WIN_NT || defined linux || defined FREEBSD || defined NETBSD)
#if !(defined VMS || defined PC_PLATFORM || defined WIN_NT || defined linux || defined FREEBSD || defined NETBSD || defined DARWIN )
extern int errno;
extern SCHAR *sys_errlist[];
extern int sys_nerr;
@ -196,7 +201,7 @@ typedef int pid_t;
#endif
#ifndef GETTIMEOFDAY
#define GETTIMEOFDAY(time,tz) gettimeofday (time, tz)
#define GETTIMEOFDAY(time,tz) gettimeofday ((struct timeval*)time, (struct timezone*)tz)
#define TIMEOFDAY_TZ
#endif
@ -389,7 +394,7 @@ void GDS_breakpoint(int);
static void blr_error(CTL, TEXT *, TEXT *);
static void blr_format(CTL, TEXT *, ...);
static void blr_format(CTL, const char *, ...);
static void blr_indent(CTL, SSHORT);
static void blr_print_blr(CTL, UCHAR);
static SCHAR blr_print_byte(CTL);
@ -1773,7 +1778,7 @@ SLONG API_ROUTINE gds__interprete(char *s, STATUS ** vector)
break;
case gds_arg_netware:
if (code > 0 && code < sys_nerr && (p = sys_errlist[code]))
if (code > 0 && code < sys_nerr && (p = (TEXT*)sys_errlist[code]))
strcpy(s, p);
else if (code == 60)
strcpy(s, "connection timed out");
@ -1797,7 +1802,7 @@ SLONG API_ROUTINE gds__interprete(char *s, STATUS ** vector)
#ifndef NETWARE_386
#ifndef PC_PLATFORM
if (code > 0 && code < sys_nerr && (p = sys_errlist[code]))
if (code > 0 && code < sys_nerr && (p = (TEXT*)sys_errlist[code]))
strcpy(s, p);
else if (code == 60)
strcpy(s, "connection timed out");
@ -2178,7 +2183,7 @@ SSHORT API_ROUTINE gds__msg_lookup(void *handle,
position = message->msg_top_tree;
for (n = 1, status = 0; !status; n++) {
if (lseek(message->msg_file, position, 0) < 0)
if (lseek(message->msg_file, LSEEK_OFFSET_CAST position, 0) < 0)
status = -6;
else if (read(message->msg_file, message->msg_bucket,
message->msg_bucket_size) < 0)
@ -2392,11 +2397,16 @@ void API_ROUTINE gds__prefix(TEXT * string, TEXT * root)
* the enviroment variable INTERBASE if it is set.
*
**************************************/
#ifdef DARWIN /* Variables needed for Darwin specific code */
CFBundleRef ibaseBundle;
CFURLRef msgFileUrl;
CFStringRef msgFilePath;
#endif
string[0] = 0;
if (ib_prefix == NULL) {
if (!(ib_prefix = getenv(ISC_ENV)))
if ( !(ib_prefix = getenv(ISC_ENV)) || ib_prefix[0] == 0)
{
#if defined(WIN_NT)
ib_prefix = ib_prefix_val;
@ -2428,8 +2438,22 @@ void API_ROUTINE gds__prefix(TEXT * string, TEXT * root)
}
}
#else // WIN_NT
#ifdef DARWIN
if ( (ibaseBundle = CFBundleGetBundleWithIdentifier(
CFSTR(DARWIN_FRAMEWORK_ID)) ) &&
(msgFileUrl = CFBundleCopyResourceURL(ibaseBundle,
CFSTR(DARWIN_GEN_DIR), NULL, NULL)) &&
(msgFilePath = CFURLCopyFileSystemPath(msgFileUrl,
kCFURLPOSIXPathStyle)) &&
(CFStringGetCString(msgFilePath, ib_prefix_val,
MAXPATHLEN, kCFStringEncodingMacRoman ))
) { }
else
#endif
{
ib_prefix = ISC_PREFIX;
strcat(ib_prefix_val, ib_prefix);
}
#endif
ib_prefix = ib_prefix_val;
}
@ -2731,14 +2755,16 @@ USHORT API_ROUTINE gds__parse_bpb(USHORT bpb_length,
*
**************************************/
return gds__parse_bpb2(bpb_length, bpb, source, target, NULL, NULL);
/* SIGN ERROR */
return gds__parse_bpb2(bpb_length, bpb, (SSHORT*)source, (SSHORT*)target, NULL, NULL);
}
USHORT API_ROUTINE gds__parse_bpb2(USHORT bpb_length,
UCHAR * bpb,
USHORT * source,
USHORT * target,
SSHORT * source,
SSHORT * target,
USHORT * source_interp,
USHORT * target_interp)
{
@ -2847,7 +2873,7 @@ SLONG API_ROUTINE gds__ftof(register SCHAR * string,
int API_ROUTINE gds__print_blr(
UCHAR * blr,
void (*routine) (),
FPTR_VOID routine,
SCHAR * user_arg, SSHORT language)
{
/**************************************
@ -3131,9 +3157,13 @@ void* API_ROUTINE gds__sys_alloc(SLONG size)
#ifdef UNIX
#ifdef MAP_ANONYMOUS
memory = mmap(NULL, size, (PROT_READ | PROT_WRITE),
#ifdef MAP_ANONYMOUS
(MAP_ANONYMOUS |
#ifndef LINUX
/* In LINUX, there is no such thing as MAP_VARIABLE. Hence, it gives
#else
(MAP_ANON |
#endif
#if (!defined(LINUX) && !defined(DARWIN))
/* In LINUX and Darwin there is no such thing as MAP_VARIABLE. Hence, it gives
compilation error. The equivalent functionality is default,
if you do not specify MAP_FIXED */
MAP_VARIABLE |
@ -3811,7 +3841,7 @@ static void blr_error(CTL control, TEXT * string, TEXT * arg1)
}
static void blr_format(CTL control, TEXT * string, ...)
static void blr_format(CTL control, const char * string, ...)
{
/**************************************
*
@ -3897,7 +3927,7 @@ static SCHAR blr_print_byte(CTL control)
}
static blr_print_char(CTL control)
static int blr_print_char(CTL control)
{
/**************************************
*
@ -3978,7 +4008,7 @@ static void blr_print_cond(CTL control)
}
static blr_print_dtype(CTL control)
static int blr_print_dtype(CTL control)
{
/**************************************
*

View File

@ -106,7 +106,7 @@ void API_ROUTINE gds__prefix_msg(TEXT*, TEXT*);
SLONG API_ROUTINE gds__get_prefix(SSHORT, TEXT*);
STATUS API_ROUTINE gds__print_status(STATUS*);
USHORT API_ROUTINE gds__parse_bpb(USHORT, UCHAR*, USHORT*, USHORT*);
USHORT API_ROUTINE gds__parse_bpb2(USHORT, UCHAR*, USHORT*, USHORT*,
USHORT API_ROUTINE gds__parse_bpb2(USHORT, UCHAR*, SSHORT*, SSHORT*,
USHORT*, USHORT*);
SLONG API_ROUTINE gds__ftof(SCHAR*, USHORT GDS_VAL(length1), SCHAR*,
USHORT GDS_VAL(length2));

View File

@ -21,6 +21,7 @@
* Contributor(s): ______________________________________.
*/
#ifndef _JRD_GDSOLD_H_
#define _JRD_GDSOLD_H_
@ -55,7 +56,9 @@
/* define type, export and other stuff based on c/c++ and Windows */
/******************************************************************/
#ifndef GDS_FAR
#define GDS_FAR ISC_FAR
#endif
#define GDS_EXPORT ISC_EXPORT
typedef void GDS_FAR *gds_db_handle;
@ -279,7 +282,7 @@ void GDS_EXPORT gds__vtov(CONST SCHAR GDS_FAR*,
SSHORT);
int GDS_EXPORT gds__version(void GDS_FAR * GDS_FAR *,
void (GDS_FAR *) (),
FPTR_VOID,
void GDS_FAR *);
int GDS_EXPORT gds__disable_subsystem(char GDS_FAR *);
@ -1301,6 +1304,7 @@ const char gds_info_sql_stmt_select_for_upd = 12;
#define gds_arg_next_mach 15
#define gds_arg_netware 16
#define gds_arg_win32 17
#define gds_arg_warning 18
#else /* c++ definitions */
@ -1322,6 +1326,7 @@ const GDS_LONG gds_arg_mpexl_ipc = 11;
const GDS_LONG gds_arg_next_mach = 15;
const GDS_LONG gds_arg_netware = 16;
const GDS_LONG gds_arg_win32 = 17;
const GDS_LONG gds_arg_warning = 18;
#endif
@ -2413,7 +2418,10 @@ const unsigned char gds_dyn_last_dyn_value = 210;
#else /* c++ definitions */
const unsigned char gds_sdl_version1 = 1;
const unsigned char gds_sdl_eoc = -1;
/* Opps, can't set an unsigned value to -1. Used to be:
* const unsigned char gds_sdl_eoc = -1;
*/
const unsigned char gds_sdl_eoc = 0xFF;
const unsigned char gds_sdl_relation = 2;
const unsigned char gds_sdl_rid = 3;
const unsigned char gds_sdl_field = 4;
@ -2628,7 +2636,10 @@ const unsigned char PYXIS_MENU_OPAQUE = 4;
const unsigned char PYXIS_MENU_TRANSPARENT = 5;
const unsigned char PYXIS_MENU_HORIZONTAL = 6;
const unsigned char PYXIS_MENU_VERTICAL = 7;
const unsigned char PYXIS_MENU_END = -1;
/* Opps, can't set an unsigned value to -1. Used to be:
* const unsigned char PYXIS_MENU_END = -1;
*/
const unsigned char PYXIS_MENU_END = 0xFF;
#endif

View File

@ -22,7 +22,7 @@
* FSG 16.03.2001
*/
/*
$Id: ibase.h,v 1.1.1.1 2001-05-23 13:26:15 tamlin Exp $
$Id: ibase.h,v 1.2 2001-07-12 05:46:05 bellardo Exp $
*/
#ifndef JRD_IBASE_H
@ -132,7 +132,8 @@ typedef GDS_QUAD GDS__QUAD;
/* TMN: What *is* really the right definition of these structs?! */
/* Is e.g a GDS_QUAD to be signed or unsigned?! */
#ifndef ISC_QUAD
#if !defined(ISC_QUAD) && !defined(DEFINED_GDS_QUAD)
#define DEFINED_GDS_QUAD
typedef struct {
unsigned long uquad_high;

View File

@ -25,7 +25,7 @@
#define JRD_IBERR_H
#include "../jrd/gdsassert.h"
#include "../misc/status.h"
#include "../jrd/status.h"
/*
* TMN: Leave INIT_STATUS as macro for now. At least "why.c" (what

View File

@ -234,7 +234,7 @@ void IDX_create_index(
key_length + sizeof(struct isr),
1,
&key_desc,
reinterpret_cast < UCHAR(*)() > (duplicate_key),
reinterpret_cast < BOOLEAN(*)() > (duplicate_key),
&ifl_data, tdbb->tdbb_attachment);
if (!sort_handle)

View File

@ -24,7 +24,7 @@
* Solaris x86 changes - Konstantin Kuznetsov, Neil McCalden
*/
/*
$Id: isc.cpp,v 1.1.1.1 2001-05-23 13:26:11 tamlin Exp $
$Id: isc.cpp,v 1.2 2001-07-12 05:46:05 bellardo Exp $
*/
#include "../jrd/ib_stdio.h"
@ -1444,6 +1444,14 @@ void isc_internal_set_config_value(UCHAR key, ULONG * value1, ULONG * value2)
#ifdef UNIX
#ifdef AIX_PPC
#define _UNIX95
#endif
#include <grp.h>
#ifdef AIX_PPC
#undef _UNIX95
#endif
SLONG ISC_get_user_group_id(TEXT * user_group_name)
{
/**************************************
@ -1460,14 +1468,9 @@ SLONG ISC_get_user_group_id(TEXT * user_group_name)
* --- for UNIX platform ---
*
**************************************/
#ifdef AIX_PPC
#define _UNIX95
#endif
#include <grp.h>
#ifdef AIX_PPC
#undef _UNIX95
#endif
#ifndef DARWIN
extern struct group *getgrnam();
#endif
struct group *user_group;
SLONG n;

View File

@ -101,6 +101,12 @@ typedef struct itm {
#define MTAB_CLOSE(stream) ib_fclose (stream)
#endif
#ifdef DARWIN
#define MTAB "/etc/fstab.hd"
#define MTAB_OPEN(path,type) ib_fopen (path, type)
#define MTAB_CLOSE(stream) ib_fclose (stream)
#endif
#ifdef SCO_UNIX
#define NON_MNTENT
#define MTAB "/etc/mount"
@ -135,7 +141,7 @@ typedef struct itm {
#include <sys/vmount.h>
#endif
#if (defined SOLARIS || defined UNIXWARE || defined NCR3000 || defined linux || defined M88K || defined FREEBSD || defined NETBSD)
#if (defined SOLARIS || defined UNIXWARE || defined NCR3000 || defined linux || defined M88K || defined FREEBSD || defined NETBSD || defined DARWIN)
#define GETWD(buf) getcwd (buf, MAXPATHLEN)
#endif
@ -1474,7 +1480,7 @@ int ISC_strip_extension(TEXT * file_name)
#if (defined NFS || defined FREEBSD || defined NETBSD)
static expand_filename2(TEXT * from_buff, USHORT length, TEXT * to_buff)
static int expand_filename2(TEXT * from_buff, USHORT length, TEXT * to_buff)
{
/**************************************
*

View File

@ -24,9 +24,18 @@
#ifndef _JRD_ISC_I_PROTO_H_
#define _JRD_ISC_I_PROTO_H_
#ifdef __cplusplus
extern "C" {
#endif
void DLL_EXPORT ISC_enter(void);
void DLL_EXPORT ISC_enable(void);
void DLL_EXPORT ISC_exit(void);
#ifdef __cplusplus
}
#endif
void DLL_EXPORT ISC_enable(void);
void DLL_EXPORT ISC_inhibit(void);
#ifdef WIN_NT

View File

@ -22,7 +22,7 @@
* Solaris x86 changes - Konstantin Kuznetsov, Neil McCalden
*/
/* $Id: isc_ipc.cpp,v 1.1.1.1 2001-05-23 13:26:10 tamlin Exp $ */
/* $Id: isc_ipc.cpp,v 1.2 2001-07-12 05:46:05 bellardo Exp $ */
#ifdef SHLIB_DEFS
#define LOCAL_SHLIB_DEFS
@ -47,6 +47,10 @@
#endif
#endif
#ifdef DARWIN
#include <string.h>
#endif
#ifdef SOLX86
#define HANDLER_ADDR_ARG
#endif
@ -77,9 +81,13 @@ typedef int (*CLIB_ROUTINE SIG_FPTR) ();
#if ((defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER))
typedef void (CLIB_ROUTINE * SIG_FPTR) ();
#else
#if (defined(DARWIN))
typedef void (*CLIB_ROUTINE SIG_FPTR) (int);
#else
typedef void (*CLIB_ROUTINE SIG_FPTR) ();
#endif
#endif
#endif
#ifdef DGUX
#define GT_32_SIGNALS
@ -320,6 +328,7 @@ extern int ib_fprintf();
extern int close();
#endif
extern "C" {
void DLL_EXPORT ISC_enter(void)
{
@ -354,6 +363,8 @@ void DLL_EXPORT ISC_enter(void)
#endif
}
} // extern "C"
#ifndef REQUESTER
void DLL_EXPORT ISC_enable(void)
@ -412,6 +423,7 @@ void DLL_EXPORT ISC_enable(void)
#endif
extern "C" {
void DLL_EXPORT ISC_exit(void)
{
/**************************************
@ -435,6 +447,7 @@ void DLL_EXPORT ISC_exit(void)
ISC_signal_cancel(SIGFPE, (void (*)()) overflow_handler, 0);
#endif
}
} // Extern "C"
#ifndef REQUESTER

View File

@ -55,7 +55,7 @@ extern void *ISC_make_signal(BOOLEAN, BOOLEAN, int, int);
extern UCHAR *DLL_EXPORT ISC_map_file(STATUS *,
TEXT *,
FPTR_VOID,
void (*)(void *, struct sh_mem *, int),
void *, SLONG, struct sh_mem *);
#ifndef NETWARE_386
@ -79,6 +79,11 @@ void ISC_semaphore_close(ULONG);
void ISC_sync_init(void);
#endif
#ifdef MMAP_SUPPORTED
extern UCHAR *ISC_map_object(STATUS *, SH_MEM, SLONG, SLONG);
extern BOOLEAN ISC_unmap_object(STATUS *, SH_MEM, UCHAR **, SLONG);
#endif
#ifdef SUPERSERVER
#ifdef UNIX
extern void ISC_exception_post(ULONG, TEXT *);

View File

@ -68,9 +68,13 @@ typedef int (*CLIB_ROUTINE SIG_FPTR) ();
#if ((defined(WIN32) || defined(_WIN32)) && defined(_MSC_VER))
typedef void (CLIB_ROUTINE * SIG_FPTR) ();
#else
#if (defined(DARWIN))
typedef void (*CLIB_ROUTINE SIG_FPTR) (int);
#else
typedef void (*CLIB_ROUTINE SIG_FPTR) ();
#endif
#endif
#endif
#ifndef REQUESTER
static USHORT inhibit_restart;
@ -128,18 +132,6 @@ static UCHAR *next_shared_memory;
#include <fcntl.h>
#endif
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024
#endif
#define ISC_MUTEX &isc_mutex
#define ISC_EVENT &isc_condition
static struct mutex isc_mutex = MUTEX_INITIALIZER;
static struct condition isc_condition = CONDITION_INITIALIZER;
#endif // UNIX
#define FTOK_KEY 15
#define PRIV 0666
#define LOCAL_SEMAPHORES 4
@ -182,6 +174,10 @@ typedef int pid_t;
#define SEMUN
#endif
#ifdef DARWIN
#define SEMUN
#endif
#ifdef LINUX
/*
* NOTE: this definition is copied from linux/sem.h: if we do ...
@ -272,7 +268,7 @@ static SLONG init_semaphores(STATUS *, SLONG, int);
static void longjmp_sig_handler(int);
#endif // UNIX && SUPERSERVER
static BOOLEAN semaphore_wait(int, int, int *);
static BOOLEAN semaphore_wait_isc_sync(int, int, int *);
#ifdef NETWARE_386
static void cleanup_semaphores(ULONG);
@ -895,7 +891,7 @@ int ISC_event_wait(
#ifdef HP10
if (micro_seconds > 0 && (ret == -1) && (errno == EAGAIN))
#else
#ifdef linux
#if (defined linux || defined DARWIN)
if (micro_seconds > 0 && (ret == ETIMEDOUT))
#else
if (micro_seconds > 0 && (ret == ETIME))
@ -1095,7 +1091,7 @@ int ISC_event_wait(
EVENT * events,
SLONG * values,
SLONG micro_seconds,
void (*timeout_handler) (), void *handler_arg)
FPTR_VOID timeout_handler, void *handler_arg)
{
/**************************************
*
@ -1194,7 +1190,7 @@ int ISC_event_wait(
timeout_handler = alarm_handler;
ISC_set_timer(micro_seconds, timeout_handler, handler_arg,
&user_timer, &user_handler);
(SLONG*)&user_timer, (void**)&user_handler);
}
/* Go into wait loop */
@ -1206,9 +1202,9 @@ int ISC_event_wait(
ret = SUCCESS;
break;
}
(void) semaphore_wait(count, semid, semnums);
(void) semaphore_wait_isc_sync(count, semid, semnums);
if (micro_seconds > 0) {
/* semaphore_wait() routine may return SUCCESS if our timeout
/* semaphore_wait_isc_sync() routine may return SUCCESS if our timeout
handler poked the semaphore. So make sure that the event
actually happened. If it didn't, indicate failure. */
@ -1222,7 +1218,7 @@ int ISC_event_wait(
/* Cancel the handler. We only get here if a timeout was specified. */
ISC_reset_timer(timeout_handler, handler_arg, &user_timer, &user_handler);
ISC_reset_timer(timeout_handler, handler_arg, (SLONG*)&user_timer, (void**)&user_handler);
return ret;
#endif /* PIPE_IS_SHRLIB */
@ -2655,7 +2651,7 @@ UCHAR *ISC_map_file(STATUS * status_vector,
/* Get an exclusive lock on the file until the initialization process
is complete. That way potential race conditions are avoided. */
#ifndef sun
#if !(defined sun || defined DARWIN)
if (lockf(ib_fileno(fp), F_LOCK, 0)) {
error(status_vector, "lockf", errno);
#else
@ -4311,7 +4307,7 @@ UCHAR *DLL_EXPORT ISC_remap_file(STATUS * status_vector,
#if (defined UNIX)
void ISC_reset_timer(
void (*timeout_handler) (),
FPTR_VOID timeout_handler,
void *timeout_arg,
SLONG * client_timer, void **client_handler)
{
@ -4345,9 +4341,9 @@ void ISC_reset_timer(
#ifndef SIGACTION_SUPPORTED
sigvector(SIGALRM, client_handler, NULL);
#else
sigaction(SIGALRM, client_handler, NULL);
sigaction(SIGALRM, (struct sigaction*)client_handler, NULL);
#endif
setitimer(ITIMER_REAL, client_timer, NULL);
setitimer(ITIMER_REAL, (itimerval*)client_timer, NULL);
#endif
}
#endif
@ -4356,7 +4352,7 @@ void ISC_reset_timer(
#if (defined UNIX)
void ISC_set_timer(
SLONG micro_seconds,
void (*timeout_handler) (),
FPTR_VOID timeout_handler,
void *timeout_arg,
SLONG * client_timer, void **client_handler)
{
@ -4936,11 +4932,13 @@ static void make_object_name(
#ifdef UNIX
static BOOLEAN semaphore_wait(int count, int semid, int *semnums)
static BOOLEAN semaphore_wait_isc_sync(int count, int semid, int *semnums)
{
/**************************************
*
* s e m a p h o r e _ w a i t
* s e m a p h o r e _ w a i t _ i s c _ s y n c
*
* (formerly known as: s e m a p h o r e _ w a i t)
*
**************************************
*

View File

@ -1288,7 +1288,7 @@ static position_and_read(journal, block, buffer, length)
SLONG position;
position = (SLONG) (block * BLOCK_SIZE);
n = lseek((int) journal->jrn_channel, position, 0);
n = lseek((int) journal->jrn_channel, LSEEK_OFFSET_CAST position, 0);
if (n == -1)
error(journal, errno, "lseek", isc_io_read_err);
@ -1366,7 +1366,7 @@ static position_and_write(journal, block, buffer, length)
int position, n;
position = block * BLOCK_SIZE;
n = lseek((int) journal->jrn_channel, position, 0);
n = lseek((int) journal->jrn_channel, LSEEK_OFFSET_CAST position, 0);
if (n == -1)
error(journal, errno, "lseek", isc_io_write_err);

View File

@ -601,7 +601,7 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status,
/* Initialize special error handling */
tdbb->tdbb_setjmp = (UCHAR *) env;
tdbb->tdbb_setjmp = env;
tdbb->tdbb_status_vector = status = user_status;
tdbb->tdbb_attachment = attachment = NULL;
tdbb->tdbb_request = NULL;
@ -625,7 +625,7 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status,
if (SETJMP(env))
{
#ifdef _PPC_
tdbb->tdbb_setjmp = (UCHAR *) env1;
tdbb->tdbb_setjmp = env1;
if (!SETJMP(env1))
#else
if (!SETJMP(env))
@ -821,6 +821,10 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status,
INI_update_database();
}
/* Attachments to a ReadOnly database need NOT do garbage collection */
if (dbb->dbb_flags & DBB_read_only)
attachment->att_flags |= ATT_no_cleanup;
if (options.dpb_disable_wal)
{
ERR_post(gds_lock_timeout, gds_arg_gds, gds_obj_in_use,
@ -1201,6 +1205,17 @@ STATUS DLL_EXPORT GDS_ATTACH_DATABASE(STATUS* user_status,
PAG_set_page_buffers(options.dpb_page_buffers);
}
if (options.dpb_set_db_readonly)
{
if (!CCH_exclusive(tdbb, LCK_EX, WAIT_PERIOD))
{
ERR_post(gds_lock_timeout, gds_arg_gds, gds_obj_in_use,
gds_arg_string, ERR_string(file_name, fl), 0);
}
PAG_set_db_readonly(dbb, options.dpb_db_readonly);
}
#ifdef REPLAY_OSRI_API_CALLS_SUBSYSTEM
/* don't record the attach until now in case the log is added during the attach */
@ -2670,7 +2685,7 @@ STATUS DLL_EXPORT GDS_QUE_EVENTS(STATUS * user_status,
ATT * handle,
SLONG * id,
SSHORT length,
UCHAR * items, void (*ast) (), void *arg)
UCHAR * items, FPTR_VOID ast, void *arg)
{
/**************************************
*
@ -4640,7 +4655,7 @@ static STATUS error(STATUS * user_status)
dbb->dbb_use_count = 0;
p = user_status;
*p++ = gds_arg_gds;
*p++ = gds__random;
*p++ = gds_random;
*p++ = gds_arg_string;
*p++ = (STATUS) "database use count set on error return";
*p = gds_arg_end;
@ -5059,6 +5074,11 @@ static void get_options(UCHAR* dpb,
options->dpb_set_db_sql_dialect = (USHORT) get_parameter(&p);
break;
case isc_dpb_set_db_readonly:
options->dpb_set_db_readonly = TRUE;
options->dpb_db_readonly = (SSHORT) get_parameter(&p);
break;
default:
l = *p++;
p += l;
@ -5572,7 +5592,7 @@ static STATUS return_success(TDBB tdbb)
dbb->dbb_use_count = 0;
p = user_status;
*p++ = gds_arg_gds;
*p++ = gds__random;
*p++ = gds_random;
*p++ = gds_arg_string;
*p++ = (STATUS) "database use count set on success return";
*p = gds_arg_end;

View File

@ -705,7 +705,7 @@ typedef struct tdbb
struct req* tdbb_request;
struct plb* tdbb_default;
STATUS* tdbb_status_vector;
UCHAR* tdbb_setjmp;
void* tdbb_setjmp;
USHORT tdbb_inhibit; /* Inhibit context switch if non-zero */
SSHORT tdbb_quantum; /* Cycles remaining until voluntary schedule */
USHORT tdbb_flags;
@ -741,7 +741,7 @@ typedef struct ihndl
#ifdef MULTI_THREAD
#if (defined DECOSF || defined NETWARE_386 || \
defined SOLARIS_MT || defined WIN_NT || \
defined HP10 || defined LINUX)
defined HP10 || defined LINUX || defined DARWIN )
#define PLATFORM_GET_THREAD_DATA ((TDBB) THD_get_specific())
#endif
#endif

View File

@ -30,6 +30,10 @@
#include <string.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef UNIX
#define UNIX_JOURNALLING
#define BSD_SOCKETS
@ -857,7 +861,7 @@ USHORT control_length, UCHAR * data, USHORT d_length, USHORT retry)
return ret_val;
}
if (!connect((int) journal->jrn_channel, &address, sizeof(address)))
if (!connect((int) journal->jrn_channel, (sockaddr*)&address, sizeof(address)))
break;
sleep(3);

View File

@ -41,6 +41,14 @@
#include "../jrd/thd_proto.h"
#include "../jrd/gdsassert.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef WIN_NT
#include <process.h>
#endif

View File

@ -71,7 +71,7 @@ typedef struct lck {
struct blk *lck_compatible2; /* Sub-level for internal compatibility */
struct att *lck_attachment; /* Attachment that owns lock */
struct btb *lck_blocked_threads; /* Threads blocked by lock */
int (*lck_ast)(); /* Blocking AST routine */
int (*lck_ast)(void*); /* Blocking AST routine */
SLONG lck_id; /* Lock id from lock manager */
SLONG lck_owner_handle; /* Lock owner handle from the lock manager's point of view */
USHORT lck_count; /* count of locks taken out by attachment */

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: license.h,v 1.1.1.1 2001-05-23 13:26:19 tamlin Exp $
* $Id: license.h,v 1.2 2001-07-12 05:46:05 bellardo Exp $
* Revision 1.5 2000/12/08 16:18:21 fsg
* Preliminary changes to get IB_BUILD_NO automatically
* increased on commits.
@ -207,6 +207,11 @@
#define FB_PLATFORM "NB" /* NetBSD */
#endif
#ifdef DARWIN
#define FB_PLATFORM "UP" /* Darwin/PowerPC */
#endif
#ifndef GDS_VERSION
#define GDS_VERSION FB_PLATFORM "-" FB_BUILD_TYPE FB_MAJOR_VER "." FB_MINOR_VER "." FB_REV_NO "." FB_BUILD_NO " " FB_BUILD_SUFFIX
#endif

View File

@ -30,6 +30,18 @@
#include "../jrd/iberr_proto.h"
#include "../jrd/llio_proto.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef NETWARE_386
#include <fcntl.h>
#include <share.h>
@ -617,7 +629,12 @@ int LLIO_seek(
whence = SEEK_END;
break;
}
if (lseek((int) file_desc, offset, (int) whence) == -1) {
/* Darwin - Add the offset cast because the types are different
* between the implicit declaration and the actual declaration,
* causing problems with the stack frame, etc. Bad.
*/
if (lseek((int) file_desc, LSEEK_OFFSET_CAST offset, (int) whence) == -1) {
if (status_vector)
io_error(status_vector, "lseek", filename, isc_io_access_err);
return FAILURE;

View File

@ -47,6 +47,10 @@
#include "../jrd/pag_proto.h"
#include "../jrd/thd_proto.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
static int close_cur_file(OLD, USHORT);
static int create_file(OLD, SLONG *);
static void get_wal_offset(USHORT, ULONG *, ULONG *, USHORT);

View File

@ -109,6 +109,7 @@ static BOOLEAN find_type(SLONG, WIN *, PAG *, USHORT, USHORT, UCHAR **,
20 LINUX on sparc systems
21 FreeBSD/i386
22 NetBSD/i386
23 Darwin/PowerPC
*/
@ -235,6 +236,9 @@ static BOOLEAN find_type(SLONG, WIN *, PAG *, USHORT, USHORT, UCHAR **,
#define CLASS 22
#endif
#ifdef DARWIN
#define CLASS 23
#endif
int PAG_add_clump(

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________.
*/
/*
$Id: par.cpp,v 1.1.1.1 2001-05-23 13:26:13 tamlin Exp $
$Id: par.cpp,v 1.2 2001-07-12 05:46:05 bellardo Exp $
*/
#include "../jrd/ib_stdio.h"
@ -2057,9 +2057,9 @@ static NOD par_rse(TDBB tdbb, CSB * csb, SSHORT rse_op)
(rse->rse_count == 2 && rse->rse_boolean))
return (NOD) rse;
}
syntax_error(*csb, (rse_op == blr_rs_stream) ?
syntax_error(*csb, (TEXT*)((rse_op == blr_rs_stream) ?
"rse stream clause" :
"record selection expression clause");
"record selection expression clause"));
}
}

View File

@ -91,7 +91,7 @@ extern clock_t times();
#endif
API_ROUTINE perf_format(
API_ROUTINE int perf_format(
PERF * before,
PERF * after,
SCHAR * string, SCHAR * buffer, SSHORT * buf_len)

View File

@ -95,6 +95,7 @@ typedef struct perf {
struct tms perf_times;
} PERF;
/* Letter codes controlling printing of statistics:
!f - fetches
@ -112,10 +113,11 @@ typedef struct perf {
*/
#include "../jrd/perf_proto.h"
#ifdef __cplusplus
#if defined(__cplusplus) && defined(NOTIME)
} /* extern "C" */
#endif
#include "../jrd/perf_proto.h"
#endif /* JRD_PERF_H */

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________.
*/
/*
$Id: pwd.cpp,v 1.1.1.1 2001-05-23 13:26:09 tamlin Exp $
$Id: pwd.cpp,v 1.2 2001-07-12 05:46:05 bellardo Exp $
*/
#include <string.h>
@ -124,7 +124,7 @@ void PWD_get_user_dbpath(TEXT* path_buffer)
**************************************/
#pragma FB_COMPILER_MESSAGE("TMN: What wierdness is this?")
#if (defined VMS || defined WIN_NT || defined LINUX || defined FREEBSD || defined NETBSD || defined SUPERSERVER || defined AIX_PPC)
#if (defined VMS || defined WIN_NT || defined LINUX || defined FREEBSD || defined NETBSD || defined SUPERSERVER || defined AIX_PPC || defined DARWIN )
gds__prefix(path_buffer, USER_INFO_NAME);
#else
strcpy(path_buffer, USER_INFO_NAME);

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________.
*/
/*
$Id: pwd.h,v 1.1.1.1 2001-05-23 13:26:07 tamlin Exp $
$Id: pwd.h,v 1.2 2001-07-12 05:46:05 bellardo Exp $
*/
#ifndef _JRD_PWD_H_
@ -51,6 +51,10 @@ $Id: pwd.h,v 1.1.1.1 2001-05-23 13:26:07 tamlin Exp $
#define USER_INFO_NAME "isc4.gdb"
#endif
#ifdef DARWIN
#define USER_INFO_NAME "isc4.gdb"
#endif
#ifdef AIX_PPC
#define USER_INFO_NAME "isc4.gdb"
#endif

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________.
*/
/*
$Id: rse.cpp,v 1.1.1.1 2001-05-23 13:26:16 tamlin Exp $
$Id: rse.cpp,v 1.2 2001-07-12 05:46:05 bellardo Exp $
*/
#include <errno.h>
@ -66,6 +66,10 @@ $Id: rse.cpp,v 1.1.1.1 2001-05-23 13:26:16 tamlin Exp $
#include "../jrd/thd_proto.h"
#include "../jrd/vio_proto.h"
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#if defined(WIN_NT)
#include <io.h>
#endif
@ -3101,7 +3105,7 @@ static void open_sort(TDBB tdbb, RSB rsb, IRSB_SORT impure)
map->smb_length,
map->smb_keys,
map->smb_key_desc,
reinterpret_cast < UCHAR(*)() >
reinterpret_cast < BOOLEAN(*)() >
((map->smb_flags & SMB_project) ? reject : NULL), 0,
tdbb->tdbb_attachment);

View File

@ -25,6 +25,7 @@
#define _JRD_SBM_PROTO_H_
#include "../jrd/sbm.h"
#include "../jrd/rse.h"
#ifdef DEV_BUILD
#include "../jrd/ib_stdio.h"

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: sort.cpp,v 1.1.1.1 2001-05-23 13:26:21 tamlin Exp $
* $Id: sort.cpp,v 1.2 2001-07-12 05:46:05 bellardo Exp $
*/
#include <errno.h>
@ -42,6 +42,18 @@
#include "../jrd/all_proto.h"
#include "../jrd/sch_proto.h"
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef SOLARIS
#include "../jrd/ib_stdio.h"
#endif
@ -936,7 +948,7 @@ ULONG SORT_read_block(
while (length) {
len = MIN(length, 32768);
for (i = 0; i < IO_RETRY; i++) {
if (lseek(sfb->sfb_file, seek, SEEK_SET) == -1) {
if (lseek(sfb->sfb_file, LSEEK_OFFSET_CAST seek, SEEK_SET) == -1) {
THREAD_ENTER;
SORT_error(status_vector, sfb, "lseek", isc_io_read_err,
errno);
@ -1228,7 +1240,7 @@ ULONG SORT_write_block(STATUS * status_vector,
while (length) {
len = MIN(length, 32768);
for (i = 0; i < IO_RETRY; i++) {
if (lseek(sfb->sfb_file, seek, SEEK_SET) == -1) {
if (lseek(sfb->sfb_file, LSEEK_OFFSET_CAST seek, SEEK_SET) == -1) {
THREAD_ENTER;
SORT_error(status_vector, sfb, "lseek", isc_io_write_err,
errno);
@ -1370,7 +1382,7 @@ static void diddle_key(UCHAR * record, SCB scb, USHORT direction)
fill_char = (key->skd_flags & SKD_binary) ? 0 : ASCII_SPACE;
if (!(scb->scb_flags & scb_sorted)) {
*((USHORT *) (record + key->skd_vary_offset)) = l =
strlen(p);
strlen((char*)p);
fill_pos = p + l;
fill = n - l;
if (fill)
@ -2717,7 +2729,7 @@ static ULONG order(SCB scb)
if (((SORTP *) output) + scb->scb_longs - 1 <= (SORTP *) lower_limit) {
/* null the bckptr for this record */
record->sr_bckptr =
reinterpret_cast < sort_record ** >((struct SR **) NULL);
reinterpret_cast < sort_record ** >((SR **) NULL);
MOVE_32(length, record->sr_sort_record.sort_record_key, output);
output =
reinterpret_cast < sort_record * >((SORTP *) output + length);

View File

@ -55,6 +55,18 @@
#include "../jrd/jrd_proto.h"
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef sparc
#ifdef SOLARIS
#include <fcntl.h>
@ -302,7 +314,7 @@ typedef CONST void (*PFN_SERV_t) ();
static const serv services[] =
{
#if !defined(LINUX) && !(defined FREEBSD || defined NETBSD)
#if !(defined LINUX || defined FREEBSD || defined NETBSD)
#ifndef NETWARE386
#ifdef WIN_NT
isc_action_max, "print_cache", "-svc", "bin/ibcachpr", NULL, 0,
@ -489,7 +501,7 @@ SVC SVC_attach(
/* Find the service by looking for an exact match. */
for (serv = services; serv->serv_name; serv++)
for (serv = (struct serv*)services; serv->serv_name; serv++)
if (!strcmp(misc_buf, serv->serv_name))
break;
@ -1851,7 +1863,7 @@ void *SVC_start(SVC service, USHORT spb_length, SCHAR * spb)
/* The name of the service is the first element of the buffer */
svc_id = *spb;
for (serv = services; serv->serv_action; serv++)
for (serv = (struct serv*)services; serv->serv_action; serv++)
if (serv->serv_action == svc_id)
break;
@ -3206,8 +3218,8 @@ static void service_get(
buf = buffer;
if (timeout) {
ISC_set_timer((SLONG) (timeout * 100000), timeout_handler, service,
&sv_timr, &sv_hndlr);
ISC_set_timer((SLONG) (timeout * 100000), (void(*)())timeout_handler, service,
(SLONG*)&sv_timr, (void**)&sv_hndlr);
iter = timeout * 10;
}
@ -3231,15 +3243,15 @@ static void service_get(
else {
errno_save = errno;
if (timeout)
ISC_reset_timer(timeout_handler, service, &sv_timr,
&sv_hndlr);
ISC_reset_timer((void(*)())timeout_handler, service, (SLONG*)&sv_timr,
(void**)&sv_hndlr);
io_error("ib_getc", errno_save, "service pipe", isc_io_read_err,
TRUE);
}
}
if (timeout) {
ISC_reset_timer(timeout_handler, service, &sv_timr, &sv_hndlr);
ISC_reset_timer((void(*)())timeout_handler, service, (SLONG*)&sv_timr, (void**)&sv_hndlr);
if (!iter)
service->svc_flags |= SVC_timeout;
}

View File

@ -1661,9 +1661,10 @@ void THD_yield(void)
discovered it was redundant with sched_yield() and dropped it.
So, just use sched_yield() instead. POSIX systems on which
sched_yield() is available define _POSIX_PRIORITY_SCHEDULING
in <unistd.h>.
in <unistd.h>. Darwin defined _POSIX_THREAD_PRIORITY_SCHEDULING
instead of _POSIX_PRIORITY_SCHEDULING.
*/
#ifdef _POSIX_PRIORITY_SCHEDULING
#if (defined _POSIX_PRIORITY_SCHEDULING || defined _POSIX_THREAD_PRIORITY_SCHEDULING)
sched_yield();
#else
pthread_yield();

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________.
*/
/*
$Id: thd.h,v 1.1.1.1 2001-05-23 13:26:19 tamlin Exp $
$Id: thd.h,v 1.2 2001-07-12 05:46:05 bellardo Exp $
*/
#ifndef _JRD_THD_H_
@ -58,6 +58,11 @@ $Id: thd.h,v 1.1.1.1 2001-05-23 13:26:19 tamlin Exp $
#define MULTI_THREAD 1
#endif
#if (defined(DARWIN) && defined(SUPERSERVER))
#define POSIX_THREADS 1
#define MULTI_THREAD 1
#endif
#ifdef VMS
#ifndef GATEWAY
#define MULTI_THREAD 1

View File

@ -62,7 +62,7 @@
#endif
#if defined(_AIX) || defined(IMP) || defined(DELTA) || defined(sgi) || \
defined(MAC) || defined(M_I386)
defined(MAC) || defined(M_I386) || defined(DARWIN)
#include <time.h>
#endif

View File

@ -42,6 +42,10 @@
#include <unistd.h>
#endif
#ifdef HAVE_UNISTD_
#include <unistd.h>
#endif
#include "../jrd/jrd.h"
#include "../jrd/pio.h"
#include "../jrd/ods.h"
@ -449,7 +453,7 @@ void PIO_header(DBB dbb, SCHAR * address, int length)
#ifndef PREAD_PWRITE
THD_MUTEX_LOCK(file->fil_mutex);
if ((lseek(file->fil_desc, 0, 0)) == -1) {
if ((lseek(file->fil_desc, LSEEK_OFFSET_CAST 0, 0)) == -1) {
THD_MUTEX_UNLOCK(file->fil_mutex);
unix_error("lseek", file, isc_io_read_err, 0);
}
@ -934,7 +938,7 @@ static FIL seek_file(
#else
THD_MUTEX_LOCK(file->fil_mutex);
if ((lseek(file->fil_desc, (SLONG) (page * dbb->dbb_page_size), 0)) == -1) {
if ((lseek(file->fil_desc, LSEEK_OFFSET_CAST (page * dbb->dbb_page_size), 0)) == -1) {
THD_MUTEX_UNLOCK(file->fil_mutex);
return (FIL) unix_error("lseek", file, isc_io_access_err,
status_vector);
@ -1006,7 +1010,7 @@ static FIL setup_file(
lock->lck_object = (BLK) dbb;
lock->lck_length = l;
lock->lck_dbb = dbb;
lock->lck_ast = CCH_down_grade_dbb;
lock->lck_ast = (int (*)(void*)) CCH_down_grade_dbb;
MOVE_FAST(lock_string, lock->lck_key.lck_string, l);
/* Try to get an exclusive lock on database. If this fails, insist

View File

@ -43,6 +43,10 @@
#include "../jrd/blb_proto.h"
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef VMS
#include <file.h>
#include <ib_perror.h>
@ -245,7 +249,8 @@ static const TEXT *const impl_class[] = {
"InterBase/SCO_SV Intel", /* 59 *//* 5.5 SCO Port */
"InterBase/linux Intel", /* 60 */
"InterBase/FreeBSD/i386", /* 61 */
"InterBase/NetBSD/i386" /* 62 */
"InterBase/NetBSD/i386", /* 62 */
"Firebird/Darwin/PowerPC" /* 63 */
};
@ -1196,7 +1201,7 @@ void API_ROUTINE isc_set_single_user(
int API_ROUTINE gds__version(
void **handle,
void (*routine) (), void *user_arg)
FPTR_VOID routine, void *user_arg)
{
/**************************************
*
@ -1217,8 +1222,8 @@ int API_ROUTINE gds__version(
BOOLEAN redo;
if (!routine) {
routine = (void (*)()) ib_printf;
user_arg = "\t%s\n";
routine = (FPTR_VOID) ib_printf;
user_arg = (void*)"\t%s\n";
}
buf = buffer;

View File

@ -1907,8 +1907,8 @@ static RTN walk_relation(TDBB tdbb, VDR control, REL relation)
TEXT s[64], *msg;
tdbb->tdbb_setjmp = (UCHAR *) old_env;
msg = (relation->rel_name) ?
"bugcheck during scan of table %d (%s)" :
"bugcheck during scan of table %d";
(TEXT*)"bugcheck during scan of table %d (%s)" :
(TEXT*)"bugcheck during scan of table %d";
sprintf(s, msg, relation->rel_id, relation->rel_name);
gds__log(s);
#ifdef VAL_VERBOSE

View File

@ -32,6 +32,6 @@
#define DEBUG_TRACE_ALL 7
#define DEBUG_TRACE_ALL_INFO 8
static debug_flag;
static int debug_flag;
#endif /* _JRD_VIO_DEBUG_H_ */

View File

@ -21,7 +21,7 @@
* Contributor(s): ______________________________________.
*/
/*
$Id: why.c,v 1.1.1.1 2001-05-23 13:26:06 tamlin Exp $
$Id: why.c,v 1.2 2001-07-12 05:46:05 bellardo Exp $
*/
#include <stdlib.h>
@ -484,7 +484,7 @@ static CONST_IMAGE IMAGE images[] =
#endif
#if (defined UNIX) && \
!(defined SUPERCLIENT || defined SUPERSERVER || defined DECOSF || defined NCR3000 || defined DG_X86 || defined linux || defined FREEBSD || defined NETBSD || defined AIX_PPC /* platforms without a V3 bridge */)
!(defined SUPERCLIENT || defined SUPERSERVER || defined DECOSF || defined NCR3000 || defined DG_X86 || 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
@ -5812,8 +5812,11 @@ static STATUS open_marker_file(STATUS * status,
}
/* Place an advisory lock on the marker file. */
#ifdef DARWIN
if (flock(fd, LOCK_EX ) != -1) {
#else
if (lockf(fd, F_TLOCK, 0) != -1) {
#endif
size = sizeof(marker_contents);
for (j = 0; j < IO_RETRY; j++) {
if ((bytes = read(fd, marker_contents, size)) != -1)
@ -5835,7 +5838,7 @@ static STATUS open_marker_file(STATUS * status,
strcpy(single_user, "YES");
size = strlen(fildes_str);
for (j = 0; j < IO_RETRY; j++) {
if (lseek(fd, 0L, SEEK_END) == -1) {
if (lseek(fd, LSEEK_OFFSET_CAST 0L, SEEK_END) == -1) {
err_routine = "lseek";
close(fd);
fd = -1;

Some files were not shown because too many files have changed in this diff Show More