summaryrefslogtreecommitdiff
path: root/src/h/rstructs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/h/rstructs.h')
-rw-r--r--src/h/rstructs.h207
1 files changed, 26 insertions, 181 deletions
diff --git a/src/h/rstructs.h b/src/h/rstructs.h
index 5ee3fbb..9b32dd5 100644
--- a/src/h/rstructs.h
+++ b/src/h/rstructs.h
@@ -17,7 +17,6 @@ struct errtab {
/*
* Descriptor
*/
-
struct descrip { /* descriptor */
word dword; /* type field */
union {
@@ -33,7 +32,10 @@ struct sdescrip {
char *string; /* pointer to string */
};
-#ifdef LargeInts
+/*
+ * Heap Blocks
+ */
+
struct b_bignum { /* large integer block */
word title; /* T_Lrgint */
word blksize; /* block size */
@@ -41,7 +43,6 @@ struct b_bignum { /* large integer block */
int sign; /* sign; 0 positive, 1 negative */
DIGIT digits[1]; /* digits */
};
-#endif /* LargeInts */
struct b_real { /* real block */
word title; /* T_Real */
@@ -83,16 +84,11 @@ struct b_list { /* list-header block */
struct b_proc { /* procedure block */
word title; /* T_Proc */
word blksize; /* size of block */
-
- #if COMPILER
- int (*ccode)();
- #else /* COMPILER */
- union { /* entry points for */
- int (*ccode)(); /* C routines */
- uword ioff; /* and icode as offset */
- pointer icode; /* and icode as absolute pointer */
- } entryp;
- #endif /* COMPILER */
+ union { /* entry points for */
+ int (*ccode)(); /* C routines */
+ uword ioff; /* and icode as offset */
+ pointer icode; /* and icode as absolute pointer */
+ } entryp;
word nparam; /* number of parameters */
word ndynam; /* number of dynamic locals */
@@ -178,7 +174,9 @@ struct b_tvtbl { /* table element trapped variable block */
struct b_external { /* external block */
word title; /* T_External */
word blksize; /* size of block */
- word exdata[1]; /* words of external data */
+ word id; /* identification number */
+ struct b_extlfuns *funcs; /* dispatch table; distinguishes extl types */
+ word data[]; /* actual external data */
};
struct astkblk { /* co-expression activator-stack block */
@@ -225,6 +223,17 @@ struct dpair {
};
/*
+ * Structure for dispatching to user-provided C functions
+ * associated with external data. Any entry can be null.
+ */
+struct b_extlfuns {
+ int (*extlcmp) (int argc, dptr argv);
+ int (*extlcopy) (int argc, dptr argv);
+ int (*extlname) (int argc, dptr argv);
+ int (*extlimage)(int argc, dptr argv);
+ };
+
+/*
* Allocated memory region structure. Each program has linked lists of
* string and block regions.
*/
@@ -246,20 +255,6 @@ struct region {
};
#endif /* Double */
-#if COMPILER
-
-/*
- * Structures for the compiler.
- */
- struct p_frame {
- struct p_frame *old_pfp;
- struct descrip *old_argp;
- struct descrip *rslt;
- continuation succ_cont;
- struct tend_desc tend;
- };
- #endif /* COMPILER */
-
/*
* when debugging is enabled a debug struct is placed after the tended
* descriptors in the procedure frame.
@@ -273,46 +268,9 @@ struct debug {
union numeric { /* long integers or real numbers */
long integer;
double real;
- #ifdef LargeInts
- struct b_bignum *big;
- #endif /* LargeInts */
- };
-
-#if COMPILER
-struct b_coexpr { /* co-expression stack block */
- word title; /* T_Coexpr */
- word size; /* number of results produced */
- word id; /* identification number */
- struct b_coexpr *nextstk; /* pointer to next allocated stack */
- continuation fnc; /* function containing co-expression code */
- struct p_frame *es_pfp; /* current procedure frame pointer */
- dptr es_argp; /* current argument pointer */
- struct tend_desc *es_tend; /* current tended pointer */
- char *file_name; /* current file name */
- word line_num; /* current line_number */
- dptr tvalloc; /* where to place transmitted value */
- struct descrip freshblk; /* refresh block pointer */
- struct astkblk *es_actstk; /* pointer to activation stack structure */
- word cstate[CStateSize]; /* C state information */
- struct p_frame pf; /* initial procedure frame */
- };
-
-struct b_refresh { /* co-expression block */
- word title; /* T_Refresh */
- word blksize; /* size of block */
- word nlocals; /* number of local variables */
- word nargs; /* number of arguments */
- word ntemps; /* number of temporary descriptors */
- word wrk_size; /* size of non-descriptor work area */
- struct descrip elems[1]; /* locals and arguments */
+ struct b_bignum *big;
};
-#else /* COMPILER */
-
-/*
- * Structures for the interpreter.
- */
-
/*
* Declarations for entries in tables associating icode location with
* source program location.
@@ -327,105 +285,6 @@ struct ipc_line {
int line; /* line number */
};
-#ifdef MultiThread
-/*
- * Program state encapsulation. This consists of the VARIABLE parts of
- * many global structures.
- */
-struct progstate {
- long hsize; /* size of the icode */
- struct progstate *parent;
- struct descrip parentdesc; /* implicit "&parent" */
- struct descrip eventmask; /* implicit "&eventmask" */
- struct descrip opcodemask; /* implicit "&opcodemask" */
- struct descrip eventcode; /* &eventcode */
- struct descrip eventval; /* &eventval */
- struct descrip eventsource; /* &eventsource */
- dptr Glbl_argp; /* global argp */
-
- /*
- * trapped variable keywords' values
- */
- struct descrip Kywd_err;
- struct descrip Kywd_pos;
- struct descrip ksub;
- struct descrip Kywd_prog;
- struct descrip Kywd_ran;
- struct descrip Kywd_trc;
- struct b_coexpr *Mainhead;
- char *Code;
- char *Ecode;
- word *Records;
- int *Ftabp;
- #ifdef FieldTableCompression
- short Ftabwidth, Foffwidth;
- unsigned char *Ftabcp, *Focp;
- short *Ftabsp, *Fosp;
- int *Fo;
- char *Bm;
- #endif /* FieldTableCompression */
- dptr Fnames, Efnames;
- dptr Globals, Eglobals;
- dptr Gnames, Egnames;
- dptr Statics, Estatics;
- int NGlobals, NStatics;
- char *Strcons;
- struct ipc_fname *Filenms, *Efilenms;
- struct ipc_line *Ilines, *Elines;
- struct ipc_line * Current_line_ptr;
-
- #ifdef Graphics
- struct descrip AmperX, AmperY, AmperRow, AmperCol;/* &x, &y, &row, &col */
- struct descrip AmperInterval; /* &interval */
- struct descrip LastEventWin; /* last Event() win */
- int LastEvFWidth;
- int LastEvLeading;
- int LastEvAscent;
- uword PrevTimeStamp; /* previous timestamp */
- uword Xmod_Control, Xmod_Shift, Xmod_Meta; /* control,shift,meta */
- struct descrip Kywd_xwin[2]; /* &window + ... */
- #endif /* Graphics */
-
- #ifdef EventMon
- word Linenum, Column, Lastline, Lastcol;
- #endif /* EventMon */
-
- word Coexp_ser; /* this program's serial numbers */
- word List_ser;
- word Set_ser;
- word Table_ser;
-
- uword stringtotal; /* cumulative total allocation */
- uword blocktotal; /* cumulative total allocation */
- word colltot; /* total number of collections */
- word collstat; /* number of static collect requests */
- word collstr; /* number of string collect requests */
- word collblk; /* number of block collect requests */
- struct region *stringregion;
- struct region *blockregion;
-
- word Lastop;
-
- dptr Xargp;
- word Xnargs;
-
- struct descrip K_current;
- int K_errornumber;
- char *K_errortext;
- struct descrip K_errorvalue;
- int Have_errval;
- int T_errornumber;
- int T_have_val;
- struct descrip T_errorvalue;
-
- struct descrip K_main;
- struct b_file K_errout;
- struct b_file K_input;
- struct b_file K_output;
- };
-
-#endif /* MultiThread */
-
/*
* Frame markers
*/
@@ -445,11 +304,6 @@ struct pf_marker { /* procedure frame marker */
inst pf_ipc; /* saved ipc */
word pf_ilevel; /* saved ilevel */
dptr pf_scan; /* saved scanning environment */
-
- #ifdef MultiThread
- struct progstate *pf_prog;/* saved program state pointer */
- #endif /* MultiThread */
-
struct descrip pf_locals[1]; /* descriptors for locals */
};
@@ -511,12 +365,7 @@ struct b_coexpr { /* co-expression stack block */
dptr tvalloc; /* where to place transmitted value */
struct descrip freshblk; /* refresh block pointer */
struct astkblk *es_actstk; /* pointer to activation stack structure */
-
- #ifdef MultiThread
- struct progstate *program;
- #endif /* MultiThread */
-
- word cstate[CStateSize]; /* C state information */
+ word cstate[2]; /* was C state, now rswitch data */
};
struct b_refresh { /* co-expression block */
@@ -528,7 +377,6 @@ struct b_refresh { /* co-expression block */
struct descrip elems[1]; /* arguments and locals, including Arg0 */
};
-#endif /* COMPILER */
union block { /* general block */
struct b_real realblk;
@@ -548,8 +396,5 @@ union block { /* general block */
struct b_coexpr coexpr;
struct b_external externl;
struct b_slots slots;
-
- #ifdef LargeInts
- struct b_bignum bignumblk;
- #endif /* LargeInts */
+ struct b_bignum bignumblk;
};