24 |
#include "include.h" |
#include "include.h" |
25 |
#endif |
#endif |
26 |
|
|
27 |
|
static void |
28 |
|
clrhash(object); |
29 |
|
|
30 |
|
|
31 |
object coerce_stream(); |
object coerce_stream(); |
32 |
object fasd_patch_sharp(object x, int depth); |
static object fasd_patch_sharp(object x, int depth); |
33 |
object make_pathname (); |
object make_pathname (); |
34 |
|
|
35 |
|
|
156 |
FILE *fas_stream; |
FILE *fas_stream; |
157 |
int dump_index; |
int dump_index; |
158 |
struct htent *gethash(); |
struct htent *gethash(); |
159 |
void read_fasd1(int i, object *loc); |
static void read_fasd1(int i, object *loc); |
160 |
object extended_read(); |
object extended_read(); |
161 |
|
|
162 |
/* to enable debugging define the following, |
/* to enable debugging define the following, |
459 |
|
|
460 |
|
|
461 |
|
|
462 |
enum circ_ind |
static enum circ_ind |
463 |
do_hash(object obj, int dot) |
do_hash(object obj, int dot) |
464 |
{ struct htent *e; |
{ struct htent *e; |
465 |
int i; |
int i; |
507 |
return LATER_INDEX; |
return LATER_INDEX; |
508 |
} |
} |
509 |
|
|
510 |
void write_fasd(object obj); |
static void write_fasd(object obj); |
511 |
object |
static object |
512 |
write_fasd_top(object obj, object x) |
write_fasd_top(object obj, object x) |
513 |
{struct fasd *fd = (struct fasd *) x->v.v_self; |
{struct fasd *fd = (struct fasd *) x->v.v_self; |
514 |
if (fd->direction == sKoutput) |
if (fd->direction == sKoutput) |
530 |
#define MAYBE_PATCH(result) \ |
#define MAYBE_PATCH(result) \ |
531 |
if (needs_patching) result =fasd_patch_sharp(result,0) |
if (needs_patching) result =fasd_patch_sharp(result,0) |
532 |
|
|
533 |
object |
static object |
534 |
read_fasd_top(object x) |
read_fasd_top(object x) |
535 |
{ struct fasd *fd = (struct fasd *) x->v.v_self; |
{ struct fasd *fd = (struct fasd *) x->v.v_self; |
536 |
VOL int e=0; |
VOL int e=0; |
576 |
object sSPinit; |
object sSPinit; |
577 |
void Lmake_hash_table(); |
void Lmake_hash_table(); |
578 |
|
|
579 |
object |
static object |
580 |
open_fasd(object stream, object direction, object eof, object tabl) |
open_fasd(object stream, object direction, object eof, object tabl) |
581 |
{ object str=Cnil; |
{ object str=Cnil; |
582 |
object result; |
object result; |
627 |
return result; |
return result; |
628 |
}} |
}} |
629 |
|
|
630 |
object |
static object |
631 |
close_fasd(object ar) |
close_fasd(object ar) |
632 |
{ struct fasd *fd= (struct fasd *)(ar->v.v_self); |
{ struct fasd *fd= (struct fasd *)(ar->v.v_self); |
633 |
check_type(ar,t_vector); |
check_type(ar,t_vector); |
662 |
#define TRY_HASH \ |
#define TRY_HASH \ |
663 |
if(do_hash(obj,0)==LATER_INDEX) return; |
if(do_hash(obj,0)==LATER_INDEX) return; |
664 |
|
|
665 |
void |
static void |
666 |
write_fasd(object obj) |
write_fasd(object obj) |
667 |
{ int j,leng; |
{ int j,leng; |
668 |
|
|
896 |
} |
} |
897 |
} |
} |
898 |
|
|
899 |
object |
static object |
900 |
fasd_patch_sharp(object x, int depth) |
fasd_patch_sharp(object x, int depth) |
901 |
{ |
{ |
902 |
cs_check(x); |
cs_check(x); |
968 |
} |
} |
969 |
|
|
970 |
object sharing_table; |
object sharing_table; |
971 |
enum circ_ind |
static enum circ_ind |
972 |
is_it_there(object x) |
is_it_there(object x) |
973 |
{ struct htent *e; |
{ struct htent *e; |
974 |
object table=sharing_table; |
object table=sharing_table; |
1050 |
return; |
return; |
1051 |
} |
} |
1052 |
|
|
1053 |
object |
static object |
1054 |
find_sharing_top(object x, object table) |
find_sharing_top(object x, object table) |
1055 |
{sharing_table=table; |
{sharing_table=table; |
1056 |
find_sharing(x); |
find_sharing(x); |
1061 |
|
|
1062 |
|
|
1063 |
|
|
1064 |
object |
/* static object */ |
1065 |
read_fasd(int i) |
/* read_fasd(int i) */ |
1066 |
{object tem; |
/* {object tem; */ |
1067 |
read_fasd1(i,&tem); |
/* read_fasd1(i,&tem); */ |
1068 |
return tem;} |
/* return tem;} */ |
1069 |
|
|
1070 |
|
|
1071 |
/* I am not sure if saving vs_top,vs_base is necessary */ |
/* I am not sure if saving vs_top,vs_base is necessary */ |
1072 |
object |
static object |
1073 |
lisp_eval(object x) |
lisp_eval(object x) |
1074 |
{ object *b,*t; |
{ object *b,*t; |
1075 |
SAVE_CURRENT_FASD; |
SAVE_CURRENT_FASD; |
1110 |
|
|
1111 |
|
|
1112 |
/* read one starting with byte i into location loc */ |
/* read one starting with byte i into location loc */ |
1113 |
void |
static void |
1114 |
read_fasd1(int i, object *loc) |
read_fasd1(int i, object *loc) |
1115 |
{ object tem; |
{ object tem; |
1116 |
int leng; |
int leng; |
1470 |
|
|
1471 |
}} |
}} |
1472 |
|
|
1473 |
void |
static void |
1474 |
clrhash(object table) |
clrhash(object table) |
1475 |
{int i; |
{int i; |
1476 |
if (table->ht.ht_nent > 0 ) |
if (table->ht.ht_nent > 0 ) |
1542 |
}} |
}} |
1543 |
|
|
1544 |
object IfaslInStream; |
object IfaslInStream; |
1545 |
void |
/* static void */ |
1546 |
IreadFasdData(void) |
/* IreadFasdData(void) */ |
1547 |
|
|
1548 |
/* While executing this the siPMemory should be bound to the cfdata |
/* While executing this the siPMemory should be bound to the cfdata |
1549 |
and the sSPinit to a vector of addresses. */ |
and the sSPinit to a vector of addresses. */ |
1550 |
{object ar=open_fasd(IfaslInStream,sKinput,0,Cnil); |
/* {object ar=open_fasd(IfaslInStream,sKinput,0,Cnil); */ |
1551 |
int n=fix(current_fasd.table_length); |
/* int n=fix(current_fasd.table_length); */ |
1552 |
object result; |
/* object result; */ |
1553 |
{BEGIN_NO_INTERRUPT; |
/* {BEGIN_NO_INTERRUPT; */ |
1554 |
#ifdef HAVE_ALLOCA |
/* #ifdef HAVE_ALLOCA */ |
1555 |
current_fasd.table->v.v_self |
/* current_fasd.table->v.v_self */ |
1556 |
= (object *)alloca(n*sizeof(object)); |
/* = (object *)alloca(n*sizeof(object)); */ |
1557 |
#else |
/* #else */ |
1558 |
current_fasd.table->v.v_self |
/* current_fasd.table->v.v_self */ |
1559 |
= (object *)alloc_relblock(n*sizeof(object)); |
/* = (object *)alloc_relblock(n*sizeof(object)); */ |
1560 |
#endif |
/* #endif */ |
1561 |
current_fasd.table->v.v_dim=n; |
/* current_fasd.table->v.v_dim=n; */ |
1562 |
current_fasd.table->v.v_fillp=n; |
/* current_fasd.table->v.v_fillp=n; */ |
1563 |
gset( current_fasd.table->v.v_self,0,n,aet_object); |
/* gset( current_fasd.table->v.v_self,0,n,aet_object); */ |
1564 |
END_NO_INTERRUPT; |
/* END_NO_INTERRUPT; */ |
1565 |
} |
/* } */ |
1566 |
result=read_fasd_top(ar); |
/* result=read_fasd_top(ar); */ |
1567 |
/* make sure there is nothing still pointing into the stack */ |
/* make sure there is nothing still pointing into the stack */ |
1568 |
current_fasd.table->v.v_self = 0; |
/* current_fasd.table->v.v_self = 0; */ |
1569 |
current_fasd.table->v.v_dim=0; |
/* current_fasd.table->v.v_dim=0; */ |
1570 |
current_fasd.table->v.v_fillp=0; |
/* current_fasd.table->v.v_fillp=0; */ |
1571 |
|
|
1572 |
} |
/* } */ |
1573 |
|
|
1574 |
|
|
1575 |
|
|
1576 |
|
|
1577 |
void |
static void |
1578 |
init_fasdump(void) |
init_fasdump(void) |
1579 |
{ |
{ |
1580 |
make_si_sfun("READ-FASD-TOP",read_fasd_top,1); |
make_si_sfun("READ-FASD-TOP",read_fasd_top,1); |