mirror of
https://github.com/Interlisp/maiko.git
synced 2026-02-04 07:33:07 +00:00
Create car-cdr.h to declare functions defined in car-cdr.c
Update files that depend on car-cdr functions to include car-cdr.h.
Add dependencies to makefile.
modified: makefile-darwin.386-x
modified: makefile-init.386
modified: makefile-tail
new file: ../inc/car-cdr.h
modified: ../src/bbtsub.c
modified: ../src/car-cdr.c
modified: ../src/dsk.c
modified: ../src/gcarray.c
modified: ../src/gcrcell.c
modified: ../src/kprint.c
modified: ../src/loopsops.c
modified: ../src/lsthandl.c
modified: ../src/mvs.c
modified: ../src/storage.c
modified: ../src/sxhash.c
modified: ../src/vars3.c
modified: ../src/xc.c
modified: ../src/z2.c
This commit is contained in:
@@ -72,6 +72,7 @@ static char *id = "$Id: bbtsub.c,v 1.3 2001/12/24 01:08:59 sybalsky Exp $ Copyri
|
||||
#include "arith.h"
|
||||
#include "stack.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
#include "gc.h"
|
||||
#include "iopage.h"
|
||||
extern IOPAGE *IOPage68K;
|
||||
|
||||
@@ -44,6 +44,7 @@ static char *id = "$Id: car-cdr.c,v 1.3 1999/05/31 23:35:25 sybalsky Exp $ Copyr
|
||||
#include "adr68k.h"
|
||||
#include "gc.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
@@ -191,7 +192,8 @@ LispPTR rplaca(register LispPTR x, register LispPTR y)
|
||||
*/
|
||||
/**********************************************************************/
|
||||
#ifdef NEWCDRCODING
|
||||
ConsCell *find_cdrable_pair(LispPTR carpart, LispPTR cdrpart); /* below... */
|
||||
static ConsCell *find_cdrable_pair(LispPTR carpart, LispPTR cdrpart); /* below... */
|
||||
static ConsCell *find_close_cell(struct conspage *page, LispPTR oldcell);
|
||||
#endif
|
||||
extern struct conspage *next_conspage(void); /* conspage.c */
|
||||
|
||||
@@ -206,7 +208,6 @@ LispPTR rplacd(LispPTR x, register LispPTR y)
|
||||
LispPTR rp_page;
|
||||
DLword cdr_code;
|
||||
register struct conspage *cons68k;
|
||||
ConsCell *find_close_cell(struct conspage * page, LispPTR oldcell);
|
||||
|
||||
if (Listp(x) == NIL) {
|
||||
if (x == NIL_PTR) {
|
||||
@@ -475,42 +476,6 @@ LispPTR N_OP_rplacd(register LispPTR tosm1, register LispPTR tos) {
|
||||
|
||||
} /* end of N_OP_rplacd */
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
/* f i n d _ c l o s e _ c e l l */
|
||||
/* */
|
||||
/* Given the real address of a CONS page and an existing cell */
|
||||
/* on that page, return another cell that is close enough to */
|
||||
/* be used as the CDR of the existing cell (i.e., within 7 */
|
||||
/* cells. If no such cell exists, return 0. */
|
||||
/* */
|
||||
/* If a cell is found, it is taken off the free chain before */
|
||||
/* being returned. */
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
ConsCell *find_close_cell(struct conspage *page, LispPTR oldcell) {
|
||||
unsigned oldoffset = oldcell & 0xFF;
|
||||
unsigned offset = page->next_cell;
|
||||
unsigned prior = 0;
|
||||
|
||||
while (offset) {
|
||||
if ((offset > oldoffset) && (offset <= (oldoffset + 14))) {
|
||||
if (prior)
|
||||
((freecons *)((DLword *)page + prior))->next_free =
|
||||
((freecons *)((DLword *)page + offset))->next_free;
|
||||
else
|
||||
page->next_cell = ((freecons *)((DLword *)page + offset))->next_free;
|
||||
page->count -= 1;
|
||||
return (ConsCell *)((DLword *)page + offset);
|
||||
}
|
||||
|
||||
prior = offset;
|
||||
offset = ((freecons *)((DLword *)page + offset))->next_free;
|
||||
}
|
||||
return ((ConsCell *)0); /* No cell close enough */
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
/* f i n d _ c l o s e _ p r i o r _ c e l l */
|
||||
@@ -559,15 +524,52 @@ ConsCell *find_close_prior_cell(struct conspage *page, LispPTR oldcell) {
|
||||
return ((ConsCell *)0); /* No cell close enough */
|
||||
}
|
||||
|
||||
#ifdef NEWCDRCODING
|
||||
/************************************************************************/
|
||||
/* */
|
||||
/* f i n d _ c l o s e _ c e l l */
|
||||
/* */
|
||||
/* Given the real address of a CONS page and an existing cell */
|
||||
/* on that page, return another cell that is close enough to */
|
||||
/* be used as the CDR of the existing cell (i.e., within 7 */
|
||||
/* cells. If no such cell exists, return 0. */
|
||||
/* */
|
||||
/* If a cell is found, it is taken off the free chain before */
|
||||
/* being returned. */
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
static ConsCell *find_close_cell(struct conspage *page, LispPTR oldcell) {
|
||||
unsigned oldoffset = oldcell & 0xFF;
|
||||
unsigned offset = page->next_cell;
|
||||
unsigned prior = 0;
|
||||
|
||||
while (offset) {
|
||||
if ((offset > oldoffset) && (offset <= (oldoffset + 14))) {
|
||||
if (prior)
|
||||
((freecons *)((DLword *)page + prior))->next_free =
|
||||
((freecons *)((DLword *)page + offset))->next_free;
|
||||
else
|
||||
page->next_cell = ((freecons *)((DLword *)page + offset))->next_free;
|
||||
page->count -= 1;
|
||||
return (ConsCell *)((DLword *)page + offset);
|
||||
}
|
||||
|
||||
prior = offset;
|
||||
offset = ((freecons *)((DLword *)page + offset))->next_free;
|
||||
}
|
||||
return ((ConsCell *)0); /* No cell close enough */
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
/* f i n d _ c d r p a i r _ i n _ p a g e */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
ConsCell *find_cdrpair_in_page(struct conspage *pg, LispPTR carpart, LispPTR cdrpart) {
|
||||
static ConsCell *find_cdrpair_in_page(struct conspage *pg, LispPTR carpart, LispPTR cdrpart) {
|
||||
ConsCell *cell;
|
||||
unsigned offset, prior, priorprior, nprior, poffset, noffset;
|
||||
|
||||
@@ -634,13 +636,13 @@ ConsCell *find_cdrpair_in_page(struct conspage *pg, LispPTR carpart, LispPTR cdr
|
||||
|
||||
/************************************************************************/
|
||||
/* */
|
||||
/* */
|
||||
/* f i n d _ c d r a b l e _ p a i r */
|
||||
/* */
|
||||
/* */
|
||||
/* */
|
||||
/************************************************************************/
|
||||
|
||||
ConsCell *find_cdrable_pair(LispPTR carpart, LispPTR cdrpart) {
|
||||
static ConsCell *find_cdrable_pair(LispPTR carpart, LispPTR cdrpart) {
|
||||
unsigned offset, prior, priorprior, pgno;
|
||||
struct conspage *pg;
|
||||
ConsCell *cell;
|
||||
@@ -652,3 +654,5 @@ ConsCell *find_cdrable_pair(LispPTR carpart, LispPTR cdrpart) {
|
||||
|
||||
return (find_cdrpair_in_page(next_conspage(), carpart, cdrpart));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -110,6 +110,7 @@ static char *id = "$Id: dsk.c,v 1.4 2001/12/24 01:09:01 sybalsky Exp $ Copyright
|
||||
#include "locfile.h"
|
||||
#include "osmsg.h"
|
||||
#include "dbprint.h"
|
||||
#include "car-cdr.h"
|
||||
|
||||
#if defined(ULTRIX) || defined(MACOSX) || defined(FREEBSD)
|
||||
#include <sys/mount.h>
|
||||
|
||||
@@ -55,6 +55,7 @@ static char *id = "$Id: gcarray.c,v 1.3 1999/05/31 23:35:30 sybalsky Exp $ Copyr
|
||||
#include "lspglob.h"
|
||||
#include "stack.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
#include "ifpage.h"
|
||||
#include "gc.h"
|
||||
#include "array.h"
|
||||
|
||||
@@ -77,6 +77,7 @@ static char *id = "$Id: gcrcell.c,v 1.3 1999/05/31 23:35:32 sybalsky Exp $ Copyr
|
||||
#include "lspglob.h"
|
||||
#include "stack.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
#include "ifpage.h"
|
||||
#include "gc.h"
|
||||
#include "dbprint.h"
|
||||
|
||||
@@ -24,6 +24,7 @@ static char *id = "$Id: kprint.c,v 1.2 1999/05/31 23:35:36 sybalsky Exp $ Copyri
|
||||
#include "lspglob.h"
|
||||
#include "initatms.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
#include "emlglob.h"
|
||||
#include "lispmap.h"
|
||||
#include "adr68k.h"
|
||||
|
||||
@@ -28,6 +28,7 @@ static char *id = "$Id: loopsops.c,v 1.3 1999/05/31 23:35:37 sybalsky Exp $ Copy
|
||||
#include "lispemul.h"
|
||||
#include "lsptypes.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
#include "lispmap.h"
|
||||
#include "lspglob.h"
|
||||
#include "adr68k.h"
|
||||
|
||||
@@ -31,6 +31,7 @@ static char *id = "$Id: lsthandl.c,v 1.4 1999/05/31 23:35:38 sybalsky Exp $ Copy
|
||||
#include "address.h"
|
||||
#include "adr68k.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
|
||||
/***********************************************************************/
|
||||
/* N_OP_fmemb */
|
||||
|
||||
@@ -34,6 +34,7 @@ static char *id = "$Id: mvs.c,v 1.3 1999/05/31 23:35:40 sybalsky Exp $ Copyright
|
||||
#include "lsptypes.h"
|
||||
#include "stack.h"
|
||||
#include "opcodes.h"
|
||||
#include "car-cdr.h"
|
||||
|
||||
#ifdef AIXPS2
|
||||
#include "inlnPS2.h"
|
||||
|
||||
@@ -32,6 +32,7 @@ static const char *id =
|
||||
#include "stack.h"
|
||||
#include "lspglob.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
#include "lsptypes.h"
|
||||
#include "ifpage.h"
|
||||
#include "gc.h"
|
||||
|
||||
@@ -27,6 +27,7 @@ static char *id = "$Id: sxhash.c,v 1.4 2001/12/24 01:09:06 sybalsky Exp $ Copyri
|
||||
#include "address.h"
|
||||
#include "stack.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
#include "array.h"
|
||||
|
||||
#include "arith.h"
|
||||
|
||||
@@ -22,6 +22,7 @@ static char *id = "$Id: vars3.c,v 1.4 2001/12/24 01:09:07 sybalsky Exp $ Copyrig
|
||||
#include "adr68k.h"
|
||||
#include "emlglob.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
#include "lsptypes.h"
|
||||
#include "stack.h"
|
||||
|
||||
|
||||
1
src/xc.c
1
src/xc.c
@@ -51,6 +51,7 @@ static char *id = "$Id: xc.c,v 1.4 2001/12/26 22:17:06 sybalsky Exp $ Copyright
|
||||
#include "lsptypes.h"
|
||||
#include "lispmap.h"
|
||||
#include "cell.h"
|
||||
#include "car-cdr.h"
|
||||
#include "initatms.h"
|
||||
#include "gc.h"
|
||||
#include "arith.h"
|
||||
|
||||
Reference in New Issue
Block a user