279 lines
6.6 KiB
C
279 lines
6.6 KiB
C
|
#ifndef h_execute
|
||
|
#define h_execute
|
||
|
/******************************************************************************
|
||
|
*
|
||
|
* Run-machine declarations
|
||
|
*
|
||
|
* Module %M% Version %I% Date %H%
|
||
|
*
|
||
|
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
|
||
|
* This is unpublished proprietary source code of Ardent Software Inc.
|
||
|
* The copyright notice above does not evidence any actual or intented
|
||
|
* publication of such source code.
|
||
|
*
|
||
|
*******************************************************************************
|
||
|
*
|
||
|
* Maintenence log - insert most recent change descriptions at top
|
||
|
* Date.... GTAR# WHO Description.........................................
|
||
|
* 08/11/99 24446 SAP Port Linux to 9.5.1
|
||
|
* 10/14/98 23801 SAP Change copyrights.
|
||
|
* 04/30/97 20049 SAP Declare time() as time_t on HPUX
|
||
|
* 05/07/96 18242 DTM Code Cleanup, Phase I
|
||
|
* 05/06/96 18242 DTM Code Cleanup, Phase I
|
||
|
* 08/23/95 17242 AGM Replace COMPUTER==WINNT test by MSWIN test
|
||
|
* 05/01/95 16244 GMM taken out INCLUDED_SY_STAT_H
|
||
|
* 04/12/95 16318 AGM Fix compiler warnings on WINNT
|
||
|
* 11/30/94 15166 GMM Added initial changes for NT work.
|
||
|
* 11/17/94 15335 FRA Port Release 8 to RS6000 Mnabort only if OURMALLOC.
|
||
|
* 03/08/94 12297 JSW Added PIraise() and PIlower()
|
||
|
* 08/18/93 11392 TMC fix problem of multiple include SYS_STAT_H (execute.h)
|
||
|
* 08/02/93 10978 SHK Port to DEC AXP
|
||
|
* 06/17/93 8357 JWT Changed RAID to stack debug environments between
|
||
|
* execute layers
|
||
|
* 04/07/92 9144 WLC Added declaration of bconvert as STRING.
|
||
|
* 01/28/92 9086 MAA port of uvnet to pyramips at 6.3.2
|
||
|
* 12/13/91 8657 JSM Minimum() returns an int not a double
|
||
|
* 01/22/91 7868 TMC Change order of includes to port for networking
|
||
|
* 11/15/89 6143 JSM Moved EXESEL, EXESTUF and EXESAVE to exesave.h
|
||
|
* 10/03/89 6153 FAI Changed raise() to UVraise().
|
||
|
* 06/05/89 6035 JWT Fix chanistr problem
|
||
|
* 05/03/89 5996 JWT call speed up
|
||
|
* 03/22/89 5874 JWT rtncode no longer stacked
|
||
|
* 03/15/89 5865 TJR cleaned up typedefs
|
||
|
* 01/28/89 5739 JWT New include file mapping scheme
|
||
|
* 01/06/89 5633 PHH Make SET.TERM.TYPE work underneath EXECUTE
|
||
|
* 01/04/89 4332 PHH Don't stack STATUS()
|
||
|
* 10/21/88 5526 TJR new bull release
|
||
|
* 07/25/88 - - Maintenence log purged at 5.2.1, see release 5.1.10.
|
||
|
*
|
||
|
*****************************************************************************/
|
||
|
|
||
|
#include FCNTL_H
|
||
|
#if POSIX_conform == 1 && NETwork
|
||
|
# include SY_FILE_H
|
||
|
# include "MTU.h"
|
||
|
#else
|
||
|
# include "MTU.h"
|
||
|
# include SY_FILE_H
|
||
|
#endif
|
||
|
#include "type.h"
|
||
|
#include "COMMON.h"
|
||
|
#include "DBFILE.h"
|
||
|
#include "LAYER.h"
|
||
|
#include "PROMPT.h"
|
||
|
#include "RUNDATA.h"
|
||
|
#include "atvars.h"
|
||
|
#include "compare.h"
|
||
|
#include "date.h"
|
||
|
#include "dynamic.h"
|
||
|
#include "exesave.h"
|
||
|
#include "extern.h"
|
||
|
#include "filenams.h"
|
||
|
#include "opcodes.h"
|
||
|
#include "optable.h"
|
||
|
#include "print.h"
|
||
|
#if RAID
|
||
|
#include "raid.h"
|
||
|
#endif
|
||
|
#include "scratch.h"
|
||
|
#include "term.h"
|
||
|
#include "vector.h"
|
||
|
#include "sinput.h"
|
||
|
#include "tinfo_sh.h"
|
||
|
#if TIMEucb
|
||
|
# include SY_TIME_H
|
||
|
#else
|
||
|
# include TIME_H
|
||
|
#endif
|
||
|
#include "LEVEL.h"
|
||
|
#if TIMEucb
|
||
|
#include <sys/timeb.h>
|
||
|
#endif
|
||
|
#include MATH_H
|
||
|
#include SY_TIMES_H
|
||
|
#include ERRNO_H
|
||
|
#include SY_IOCTL_H
|
||
|
#include TERMIO_H
|
||
|
#include SY_STAT_H
|
||
|
|
||
|
/* run machine macros */
|
||
|
#include "getput.h"
|
||
|
|
||
|
#define true 1
|
||
|
#define false 0
|
||
|
#define LOCKOP(op) (op | 0x01)
|
||
|
#define ISLOCK(op) (op & 0x01)
|
||
|
#define RTN(n) { rtncode = (n); UVLONGJMP(layer->env, RM_EXIT);}
|
||
|
#define ALIGNPC(x) pc = (ushort*)(((UVADDR)pc + (sizeof(x)-1)) & ~(sizeof(x)-1))
|
||
|
#define FLOAT(n) ((n)+0.0)
|
||
|
#define PI 3.141592653589793238462643
|
||
|
#define DEG(n) ((n/PI)*180)
|
||
|
#define RAD(n) ((n/180)*PI)
|
||
|
|
||
|
#define OPCASE(op) case op:
|
||
|
|
||
|
#define FARRAY(xmax, ymax, xsub, ysub, offset) \
|
||
|
{ \
|
||
|
if(xsub <= 0 || xsub > xmax || \
|
||
|
ysub <= 0 || ysub > ymax) \
|
||
|
{ \
|
||
|
fatal(40005); \
|
||
|
/* NOTREACHED */ \
|
||
|
} \
|
||
|
offset = ((xsub - 1) * ymax) + ysub - 1; \
|
||
|
}
|
||
|
|
||
|
#define ARRAY(mat, xsub, ysub, offset) \
|
||
|
{ \
|
||
|
if(mat->td_type == Tmatrix) \
|
||
|
{ \
|
||
|
reg int ymax; \
|
||
|
\
|
||
|
ymax = mat->td_ymax; \
|
||
|
if(xsub) \
|
||
|
{ \
|
||
|
if(xsub < 0 || \
|
||
|
xsub > mat->td_xmax || \
|
||
|
ysub <= 0 || ysub > ymax) \
|
||
|
{ \
|
||
|
fatal(40005); \
|
||
|
/* NOTREACHED */ \
|
||
|
} \
|
||
|
offset = ((xsub - 1) * ymax) + ysub; \
|
||
|
} \
|
||
|
else \
|
||
|
offset = 0; \
|
||
|
} \
|
||
|
else \
|
||
|
if(mat->td_type == Tfmatrix) \
|
||
|
{ \
|
||
|
FARRAY(mat->td_xmax, \
|
||
|
mat->td_ymax, \
|
||
|
xsub, ysub, offset); \
|
||
|
} \
|
||
|
else \
|
||
|
{ \
|
||
|
fatal(40022); \
|
||
|
/* NOTREACHED */ \
|
||
|
} \
|
||
|
}
|
||
|
|
||
|
|
||
|
EXTERN void RMreset(), RMstart();
|
||
|
EXTERN char *mktnam(),
|
||
|
*res_list();
|
||
|
|
||
|
EXTERN void timeset();
|
||
|
EXTERN int conv_status,/* from vector oconv/iconv */
|
||
|
minimum(),
|
||
|
#if OURMALLOC
|
||
|
Mnabort, /* malloc no abort flag */
|
||
|
#endif
|
||
|
do_sleep();
|
||
|
EXTERN STRING itype(),
|
||
|
bconvert(),
|
||
|
cursor(),
|
||
|
date_oc(),
|
||
|
time_oc(),
|
||
|
fold(),
|
||
|
format(),
|
||
|
iconv(),
|
||
|
oconv(),
|
||
|
input(),
|
||
|
SOUNDEX(),
|
||
|
sum(),
|
||
|
ptrim(),
|
||
|
timedate(),
|
||
|
UVraise(),
|
||
|
pattern(),
|
||
|
lower(),
|
||
|
fieldstore(),
|
||
|
groupstore(),
|
||
|
field(),
|
||
|
atoe(),
|
||
|
utl(),
|
||
|
convert(),
|
||
|
etoa(),
|
||
|
vecif(),
|
||
|
vector(),
|
||
|
vec1(),
|
||
|
vec2(),
|
||
|
ltu(),
|
||
|
strrep(),
|
||
|
change(),
|
||
|
DBstatus(),
|
||
|
PIraise(),
|
||
|
PIlower();
|
||
|
|
||
|
EXTERN void appendbuf(),
|
||
|
SELinit(),
|
||
|
keyset(),
|
||
|
exe_term();
|
||
|
|
||
|
#ifndef MSWIN
|
||
|
#if COMPUTER == HP
|
||
|
EXTERN time_t time();
|
||
|
#else
|
||
|
EXTERN UVLONG time();
|
||
|
#endif
|
||
|
EXTERN double modf();
|
||
|
#endif
|
||
|
|
||
|
EXTERN UVLONG now();
|
||
|
|
||
|
EXTERN double maximum(),
|
||
|
summation(), stf();
|
||
|
|
||
|
EXTERN FILE *Echo_file;
|
||
|
|
||
|
EXTERN STRING IB[];/* proc machine interface */
|
||
|
EXTERN int IS[];
|
||
|
EXTERN uchar *IP;
|
||
|
|
||
|
EXTERN LAYER *layer;
|
||
|
EXTERN int g_col1,
|
||
|
g_col2,
|
||
|
g_inmat,
|
||
|
g_status,
|
||
|
g_tab,
|
||
|
printon;
|
||
|
EXTERN int rtncode;
|
||
|
EXTERN int errcode;
|
||
|
EXTERN double holdstart;
|
||
|
EXTERN ushort **gsbstack;
|
||
|
EXTERN int ssptr;
|
||
|
EXTERN RUNDATA Domain;
|
||
|
EXTERN ushort *trap_stat;
|
||
|
EXTERN ushort *trap_char;
|
||
|
EXTERN ushort *pc;
|
||
|
EXTERN int dim_flag;
|
||
|
EXTERN int svlock;
|
||
|
EXTERN int for_flag;
|
||
|
EXTERN int psw,
|
||
|
lsw;
|
||
|
EXTERN EXESTUF exe_master;
|
||
|
EXTERN PROGRAM *prog;
|
||
|
EXTERN int totmode;
|
||
|
EXTERN STRING **chainstr;
|
||
|
EXTERN DATUM **args;
|
||
|
EXTERN int toplevel;
|
||
|
EXTERN DATUM **Vartab;
|
||
|
EXTERN ushort *Code;
|
||
|
EXTERN ushort Opcode;
|
||
|
EXTERN int Getflag;
|
||
|
EXTERN STRING chainresult;
|
||
|
|
||
|
#define RMfunct int
|
||
|
#define RMop(x) RMfunct x()
|
||
|
#define RMreturn() return(0)
|
||
|
#define RMcall(x) x()
|
||
|
#define RM_EXIT -1000
|
||
|
|
||
|
EXTERN RMfunct (*dispatch[])();
|
||
|
|
||
|
EXTERN struct ULchn *MFulchn;
|
||
|
|
||
|
#include "dispatch.h"
|
||
|
|
||
|
#endif /* end of execute.h */
|