summaryrefslogtreecommitdiff
path: root/src/runtime/imisc.r
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/imisc.r')
-rw-r--r--src/runtime/imisc.r91
1 files changed, 1 insertions, 90 deletions
diff --git a/src/runtime/imisc.r b/src/runtime/imisc.r
index cde8a90..758a0ab 100644
--- a/src/runtime/imisc.r
+++ b/src/runtime/imisc.r
@@ -1,4 +1,3 @@
-#if !COMPILER
/*
* File: imisc.r
* Contents: field, mkrec, limit, llist, bscan, escan
@@ -14,18 +13,8 @@ LibDcl(field,2,".")
register struct b_record *rp;
register dptr dp;
-#ifdef MultiThread
- register union block *bptr;
-#else /* MultiThread */
extern int *ftabp;
- #ifdef FieldTableCompression
- extern int *fo;
- extern unsigned char *focp;
- extern short *fosp;
- extern char *bm;
- #endif /* FieldTableCompression */
extern word *records;
-#endif /* MultiThread */
Deref(Arg1);
@@ -41,74 +30,14 @@ LibDcl(field,2,".")
* Map the field number into a field number for the record x.
*/
rp = (struct b_record *) BlkLoc(Arg1);
-
-#ifdef MultiThread
- bptr = rp->recdesc;
- if (!InRange(curpstate->Records, bptr, curpstate->Ftabp)) {
- int i;
- int nfields = bptr->proc.nfields;
- /*
- * Look up the field number by a brute force search through
- * the record constructor's field names.
- */
- Arg0 = fnames[IntVal(Arg2)];
- fprintf(stderr,"looking up interprogram field %.*s\n", StrLen(Arg0),
- StrLoc(Arg0));
- for (i=0;i<nfields;i++){
- if ((StrLen(Arg0) == StrLen(bptr->proc.lnames[i])) &&
- !strncmp(StrLoc(Arg0), StrLoc(bptr->proc.lnames[i]),StrLen(Arg0)))
- break;
- }
- if (i<nfields) fnum = i;
- else fnum = -1;
- }
- else
-#endif /* MultiThread */
-
-#ifdef FieldTableCompression
-#define FO(i) ((foffwidth==1)?focp[i]:((foffwidth==2)?fosp[i]:fo[i]))
-#define FTAB(i) ((ftabwidth==1)?ftabcp[i]:((ftabwidth==2)?ftabsp[i]:ftabp[i]))
-#else /* FieldTableCompression */
-#define FO(i) fo[i]
-#define FTAB(i) ftabp[i]
-#endif /* FieldTableCompression */
-
-#ifdef FieldTableCompression
- fnum = FTAB(FO(IntVal(Arg2)) + (rp->recdesc->proc.recnum - 1));
-#else /* FieldTableCompression */
- fnum = FTAB(IntVal(Arg2) * *records + rp->recdesc->proc.recnum - 1);
-#endif /* FieldTableCompression */
+ fnum = ftabp[IntVal(Arg2) * *records + rp->recdesc->proc.recnum - 1];
/*
* If fnum < 0, x doesn't contain the specified field.
*/
-
-#ifdef FieldTableCompression
-{
- int bytes, index;
- unsigned char this_bit = 0200;
-
- bytes = *records >> 3;
- if ((*records & 07) != 0)
- bytes++;
- index = IntVal(Arg2) * bytes + (rp->recdesc->proc.recnum - 1) / 8;
- this_bit = this_bit >> (rp->recdesc->proc.recnum - 1) % 8;
- if ((bm[index] | this_bit) != bm[index])
- RunErr(207, &Arg1);
-}
-
- if (ftabwidth == 1) {
- if (fnum == 255)
- RunErr(207, &Arg1);
- }
- else
-#endif /* FieldTableCompression */
if (fnum < 0)
RunErr(207, &Arg1);
- EVValD(&Arg1, E_Rref);
- EVVal(fnum + 1, E_Rsub);
-
/*
* Return a pointer to the descriptor for the appropriate field.
*/
@@ -156,7 +85,6 @@ LibDcl(mkrec,-1,"mkrec")
ArgType(0) = D_Record;
Arg0.vword.bptr = (union block *)rp;
- EVValD(&Arg0, E_Rcreate);
Return;
}
@@ -215,8 +143,6 @@ LibDcl(bscan,2,"?")
if (!cnv:string(Arg0,Arg0))
RunErr(103, &Arg0);
- EVValD(&Arg0, E_Snew);
-
/*
* Establish a new &subject value and set &pos to 1.
*/
@@ -238,13 +164,6 @@ LibDcl(bscan,2,"?")
rc = interp(G_Csusp,cargp);
-#ifdef EventMon
- if (rc != A_Resume)
- EVValD(&Arg1, E_Srem);
- else
- EVValD(&Arg1, E_Sfail);
-#endif /* EventMon */
-
if (pfp != cur_pfp)
return rc;
@@ -326,8 +245,6 @@ LibDcl(escan,1,"escan")
* Suspend with the value of the scanning expression.
*/
- EVValD(&k_subject, E_Ssusp);
-
rc = interp(G_Csusp,cargp);
if (pfp != cur_pfp)
return rc;
@@ -340,11 +257,6 @@ LibDcl(escan,1,"escan")
k_subject = *VarLoc(Arg1);
*VarLoc(Arg1) = tmp;
-#ifdef EventMon
- if (rc == A_Resume)
- EVValD(&k_subject, E_Sresum);
-#endif /* EventMon */
-
tmp = *(VarLoc(Arg1) + 1);
IntVal(*(VarLoc(Arg1) + 1)) = k_pos;
k_pos = IntVal(tmp);
@@ -354,4 +266,3 @@ LibDcl(escan,1,"escan")
return rc;
}
-#endif /* !COMPILER */