mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-17 08:33:48 +00:00
Remove duplicate external function definitions from gcdata.h renamed: inc/gc.h -> inc/gcdata.h modified: src/array2.c modified: src/array4.c modified: src/array6.c modified: src/asmbbt.c modified: src/asmbitblt.c modified: src/bbtsub.c modified: src/car-cdr.c modified: src/conspage.c modified: src/fvar.c modified: src/gc.c modified: src/gcarray.c modified: src/gccode.c modified: src/gcfinal.c modified: src/gchtfind.c modified: src/gcmain3.c modified: src/gcoflow.c modified: src/gcr.c modified: src/gcrcell.c modified: src/gcscan.c modified: src/gvar2.c modified: src/initsout.c modified: src/loopsops.c modified: src/mkcell.c modified: src/rplcons.c modified: src/storage.c modified: src/xc.c modified: src/z2.c
96 lines
4.4 KiB
C
96 lines
4.4 KiB
C
/* $Id: gcscan.c,v 1.3 1999/05/31 23:35:33 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved
|
|
*/
|
|
static char *id = "$Id: gcscan.c,v 1.3 1999/05/31 23:35:33 sybalsky Exp $ Copyright (C) Venue";
|
|
|
|
/************************************************************************/
|
|
/* */
|
|
/* (C) Copyright 1989-95 Venue. All Rights Reserved. */
|
|
/* Manufactured in the United States of America. */
|
|
/* */
|
|
/************************************************************************/
|
|
|
|
#include "version.h"
|
|
|
|
/*************************************************************************/
|
|
/* */
|
|
/* File Name : gcscan.c */
|
|
/* */
|
|
/*************************************************************************/
|
|
/* */
|
|
/* Creation Date : July-7-1987 */
|
|
/* Written by Tomoru Teruuchi */
|
|
/* */
|
|
/*************************************************************************/
|
|
/* */
|
|
/* Functions : */
|
|
/* gcscan1(probe) */
|
|
/* gcscan2(probe) */
|
|
/* */
|
|
/*************************************************************************/
|
|
/* Descreption : */
|
|
/* */
|
|
/* The functions "gcscan1" and "gcscan2" are the translated functions */
|
|
/* from the Lisp Functions "\GCSCAN1" & "\GCSCAN2". */
|
|
/* These functions' role is to scan the HTmain Table and return the */
|
|
/* existing entry(by "gcscan1") & the entry whose STKBIT field is ON */
|
|
/* (by "gcscan2").These functions are the UFN functions that are called */
|
|
/* by OPCODES "GCSCAN1" & "GCSCAN2". */
|
|
/* */
|
|
/* gcscan1 */
|
|
/* INPUT : probe (the startng offset in the HTmain table) */
|
|
/* OUTPUT : the entry's offset or NIL (no more entry existing) */
|
|
/* */
|
|
/* gcscan2 */
|
|
/* INPUT : probe (the starting offset in the HTmain table) */
|
|
/* OUTPUT : the entry's offset or NIL (no more entry existing) */
|
|
/*************************************************************************/
|
|
/* \Tomtom */
|
|
/*************************************************************************/
|
|
|
|
#include "lispemul.h"
|
|
#include "lspglob.h"
|
|
#include "gcdata.h"
|
|
#include "lsptypes.h"
|
|
|
|
#include "gcscandefs.h"
|
|
|
|
#ifdef BIGVM
|
|
#define HTSTKBIT 0x10000 /* = 512 */
|
|
#define HTENDS ((struct hashentry *)htlptr)
|
|
#define GetStkCnt(entry1) (entry1 >> 16)
|
|
#else
|
|
#define HTSTKBIT 0x200 /* = 512 */
|
|
#define HTENDS ((struct hashentry *)htlptr)
|
|
#define GetStkCnt(entry1) (entry1 >> 9)
|
|
#endif /* BIGVM */
|
|
|
|
DLword gcscan1(register int probe)
|
|
/* probe is offset */
|
|
{
|
|
register struct htlinkptr *htlptr; /* overlay access method */
|
|
register int contents;
|
|
while (--probe >= 0) /* End of HTmain Table ? */
|
|
{
|
|
/* Start addr. of scanning */
|
|
htlptr = (struct htlinkptr *)(HTmain + probe);
|
|
contents = ((struct htlinkptr *)GCPTR(htlptr))->contents;
|
|
if (contents && (((struct hashentry *)GCPTR(HTENDS))->collision || (GetStkCnt(contents) == 0)))
|
|
return (probe);
|
|
}
|
|
return (NIL);
|
|
}
|
|
|
|
DLword gcscan2(register int probe)
|
|
/* probe is offset */
|
|
{
|
|
register struct htlinkptr *htlptr; /* overlay access method */
|
|
while (--probe >= 0) /* End of HTmain Table ? */
|
|
{
|
|
htlptr = (struct htlinkptr *)(HTmain + probe);
|
|
/* Start addr. of scanning */
|
|
if (((HTSTKBIT | 1) & ((struct htlinkptr *)GCPTR(htlptr))->contents) != 0)
|
|
return (probe); /* stackref or collision ON */
|
|
}
|
|
return (NIL);
|
|
}
|