From fd5f104f287427fee885583bc398c137674e6af0 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 3 Mar 2017 00:56:40 -0800 Subject: New upstream version 5f2 --- scm.h | 115 ++++++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 60 insertions(+), 55 deletions(-) mode change 100644 => 100755 scm.h (limited to 'scm.h') diff --git a/scm.h b/scm.h old mode 100644 new mode 100755 index 763f2b2..e759d7d --- a/scm.h +++ b/scm.h @@ -100,8 +100,6 @@ typedef struct { int (*print)P((SCM exp, SCM port, int writing)); SCM (*equalp)P((SCM, SCM)); int (*fputc)P((int c, FILE *p)); -/* int (*fputs)P((char *s, FILE *p)); */ -/* sizet (*fwrite)P((char *s, sizet siz, sizet num, FILE *p)); */ int (*fputs)P((const char *s, FILE *p)); sizet (*fwrite)P((const void *s, sizet siz, sizet num, FILE *p)); int (*fflush)P((FILE *stream)); @@ -339,14 +337,14 @@ SCM_EXPORT long tc16_env, tc16_ident; /* markers for various static environment frame types */ /* FIXME these need to be exported somehow to Scheme */ #ifdef CAUTIOUS -# define SCM_ENV_FILENAME MAKINUM(1) -# define SCM_ENV_PROCNAME MAKINUM(2) +# define SCM_ENV_FILENAME MAKINUM(1L) +# define SCM_ENV_PROCNAME MAKINUM(2L) #endif -#define SCM_ENV_DOC MAKINUM(3) -#define SCM_ENV_ANNOTATION MAKINUM(4) -#define SCM_ENV_CONSTANT MAKINUM(5) -#define SCM_ENV_SYNTAX MAKINUM(6) -#define SCM_ENV_END MAKINUM(7) +#define SCM_ENV_DOC MAKINUM(3L) +#define SCM_ENV_ANNOTATION MAKINUM(4L) +#define SCM_ENV_CONSTANT MAKINUM(5L) +#define SCM_ENV_SYNTAX MAKINUM(6L) +#define SCM_ENV_END MAKINUM(7L) #define PORTP(x) (TYP7(x)==tc7_port) #define OPPORTP(x) (((0x7f | OPN) & CAR(x))==(tc7_port | OPN)) @@ -497,9 +495,11 @@ SCM_EXPORT long tc16_array; case tc7_subr_2o:case tc7_lsubr_2:case tc7_lsubr #define tcs_symbols tc7_ssymbol:case tc7_msymbol #define tcs_bignums tc16_bigpos:case tc16_bigneg -#define tcs_uves tc7_string:case tc7_Vbool:case tc7_VfixN8:case tc7_VfixZ8:\ - case tc7_VfixN16:case tc7_VfixZ16:case tc7_VfixN32:case tc7_VfixZ32:\ - case tc7_VfloR32:case tc7_VfloC32:case tc7_VfloR64:case tc7_VfloC64 +#define tcs_uves tc7_string:\ + case tc7_VfixN8:case tc7_VfixZ8:case tc7_VfixN16:case tc7_VfixZ16:\ + case tc7_VfixN32:case tc7_VfixZ32:case tc7_VfixN64:case tc7_VfixZ64:\ + case tc7_VfloR32:case tc7_VfloC32:case tc7_VfloR64:case tc7_VfloC64:\ + case tc7_Vbool #define tc3_cons_nimcar 0 #define tc3_cons_imcar 2:case 4:case 6 @@ -511,23 +511,20 @@ SCM_EXPORT long tc16_array; #define tc7_msymbol 7 #define tc7_string 13 #define tc7_vector 15 -#define tc7_Vbool 21 - -/* 23 */ - -#define tc7_VfixN8 29 -#define tc7_VfixZ8 31 -#define tc7_VfixN16 37 -#define tc7_VfixZ16 39 -#define tc7_VfixN32 45 -#define tc7_VfixZ32 47 +#define tc7_VfixN8 21 +#define tc7_VfixZ8 23 +#define tc7_VfixN16 29 +#define tc7_VfixZ16 31 +#define tc7_VfixN32 37 +#define tc7_VfixZ32 39 +#define tc7_VfixN64 45 +#define tc7_VfixZ64 47 #define tc7_VfloR32 53 #define tc7_VfloC32 55 #define tc7_VfloR64 61 #define tc7_VfloC64 63 - -/* 69 */ +#define tc7_Vbool 69 #define tc7_port 71 #define tc7_contin 77 @@ -625,7 +622,8 @@ SCM_EXPORT SCM sys_protects[]; #define flo0 sys_protects[20] #define scm_uprotects sys_protects[21] #define scm_narn sys_protects[22] -#define NUM_PROTECTS 23 +#define pows5 sys_protects[23] +#define NUM_PROTECTS 24 /* now for connects between source files */ @@ -639,6 +637,7 @@ SCM_EXPORT scm_gra finals_gra; SCM_EXPORT unsigned char upcase[], downcase[]; SCM_EXPORT SCM symhash; SCM_EXPORT int symhash_dim; +SCM_EXPORT int no_symhash_gc; /* Set when linking code produced by Hobbit compiler. */ SCM_EXPORT long heap_cells; SCM_EXPORT CELLPTR heap_org; SCM_EXPORT VOLATILE SCM freelist; @@ -844,6 +843,7 @@ SCM_EXPORT SCM numberp P((SCM x)); SCM_EXPORT SCM exactp P((SCM x)); SCM_EXPORT SCM inexactp P((SCM x)); SCM_EXPORT SCM eqp P((SCM x, SCM y)); +SCM_EXPORT SCM eqv P((SCM x, SCM y)); SCM_EXPORT SCM lessp P((SCM x, SCM y)); SCM_EXPORT SCM greaterp P((SCM x, SCM y)); SCM_EXPORT SCM leqp P((SCM x, SCM y)); @@ -853,12 +853,13 @@ SCM_EXPORT SCM positivep P((SCM x)); SCM_EXPORT SCM negativep P((SCM x)); SCM_EXPORT SCM oddp P((SCM n)); SCM_EXPORT SCM evenp P((SCM n)); -SCM_EXPORT SCM lmax P((SCM x, SCM y)); -SCM_EXPORT SCM lmin P((SCM x, SCM y)); +SCM_EXPORT SCM scm_max P((SCM x, SCM y)); +SCM_EXPORT SCM scm_min P((SCM x, SCM y)); SCM_EXPORT SCM sum P((SCM x, SCM y)); SCM_EXPORT SCM difference P((SCM x, SCM y)); SCM_EXPORT SCM product P((SCM x, SCM y)); SCM_EXPORT SCM divide P((SCM x, SCM y)); +SCM_EXPORT SCM scm_round_quotient P((SCM x, SCM y)); SCM_EXPORT SCM lquotient P((SCM x, SCM y)); SCM_EXPORT SCM scm_iabs P((SCM x)); SCM_EXPORT SCM scm_abs P((SCM x)); @@ -871,13 +872,15 @@ SCM_EXPORT SCM istring2number P((char *str, long len, long radix)); SCM_EXPORT SCM string2number P((SCM str, SCM radix)); SCM_EXPORT SCM istr2flo P((char *str, long len, long radix)); SCM_EXPORT SCM mkbig P((sizet nlen, int sign)); +SCM_EXPORT void bigrecy P((SCM bgnm)); SCM_EXPORT SCM mkstrport P((SCM pos, SCM str, long modes, char *caller)); SCM_EXPORT SCM mksafeport P((int maxlen, SCM port)); SCM_EXPORT int reset_safeport P((SCM sfp, int maxlen, SCM port)); SCM_EXPORT SCM long2big P((long n)); SCM_EXPORT SCM ulong2big P((unsigned long n)); SCM_EXPORT SCM big2inum P((SCM b, sizet l)); -SCM_EXPORT sizet iint2str P((long num, int rad, char *p)); +SCM_EXPORT sizet ilong2str P((long num, int rad, char *p)); +SCM_EXPORT sizet iulong2str P((unsigned long num, int rad, char *p)); SCM_EXPORT SCM floequal P((SCM x, SCM y)); SCM_EXPORT SCM uve_equal P((SCM u, SCM v)); SCM_EXPORT SCM uve_read P((SCM v, SCM port)); @@ -893,7 +896,7 @@ SCM_EXPORT SCM array_rank P((SCM ra)); SCM_EXPORT SCM array_contents P((SCM ra, SCM strict)); SCM_EXPORT int bigprint P((SCM exp, SCM port, int writing)); SCM_EXPORT int floprint P((SCM sexp, SCM port, int writing)); -SCM_EXPORT SCM istr2int P((char *str, long len, long radix)); +SCM_EXPORT SCM istr2int P((char *str, long len, int radix)); SCM_EXPORT SCM istr2bve P((char *str, long len)); SCM_EXPORT void scm_ipruk P((char *hdr, SCM ptr, SCM port)); SCM_EXPORT SCM charp P((SCM x)); @@ -973,7 +976,7 @@ SCM_EXPORT SCM scm_port_line P((SCM port)); SCM_EXPORT SCM scm_port_col P((SCM port)); SCM_EXPORT void scm_line_msg P((SCM file, SCM linum, SCM port)); SCM_EXPORT void scm_err_line P((const char *what, SCM file, SCM linum, SCM port)); -SCM_EXPORT SCM lgetenv P((SCM nam)); +SCM_EXPORT SCM scm_getenv P((SCM nam)); SCM_EXPORT SCM prog_args P((void)); SCM_EXPORT SCM makacro P((SCM code)); SCM_EXPORT SCM makmacro P((SCM code)); @@ -1010,6 +1013,8 @@ SCM_EXPORT SCM scm_logand P((SCM x, SCM y)); SCM_EXPORT SCM scm_logior P((SCM x, SCM y)); SCM_EXPORT SCM scm_lognot P((SCM n)); SCM_EXPORT SCM scm_intexpt P((SCM z1, SCM z2)); +SCM_EXPORT SCM scm_intlog P((SCM base, SCM k)); +SCM_EXPORT SCM scm_cintlog P((SCM base, SCM k)); SCM_EXPORT SCM scm_ash P((SCM n, SCM cnt)); SCM_EXPORT SCM scm_bitfield P((SCM n, SCM start, SCM end)); SCM_EXPORT SCM scm_logcount P((SCM n)); @@ -1037,14 +1042,14 @@ SCM_EXPORT SCM scm_evstr P((char *str)); SCM_EXPORT void scm_ldstr P((char *str)); SCM_EXPORT int scm_ldfile P((char *path)); SCM_EXPORT int scm_ldprog P((char *path)); -SCM_EXPORT unsigned long scm_addr P((SCM args, const char *name)); -SCM_EXPORT unsigned long scm_base_addr P((SCM v, const char *name)); +SCM_EXPORT void* scm_addr P((SCM args, const char *name)); +SCM_EXPORT void* scm_base_addr P((SCM v, const char *name)); SCM_EXPORT int scm_cell_p P((SCM x)); #ifdef FLOATS SCM_EXPORT SCM makdbl P((double x, double y)); SCM_EXPORT SCM dbl2big P((double d)); -SCM_EXPORT double big2dbl P((SCM b)); +SCM_EXPORT double int2dbl P((SCM b)); SCM_EXPORT double scm_truncate P((double x)); SCM_EXPORT double scm_round P((double x)); SCM_EXPORT double floident P((double x)); @@ -1057,10 +1062,10 @@ SCM_EXPORT SCM normbig P((SCM b)); SCM_EXPORT SCM copybig P((SCM b, int sign)); SCM_EXPORT SCM addbig P((BIGDIG *x, sizet nx, int xsgn, SCM bigy, int sgny)); SCM_EXPORT SCM mulbig P((BIGDIG *x, sizet nx, BIGDIG *y, sizet ny, int sgn)); -SCM_EXPORT unsigned int divbigdig P((BIGDIG *ds, sizet h, BIGDIG div)); +SCM_EXPORT UBIGLONG divbigdig P((BIGDIG *ds, sizet h, BIGDIG div)); SCM_EXPORT SCM divbigint P((SCM x, long z, int sgn, int mode)); SCM_EXPORT SCM divbigbig P((BIGDIG *x, sizet nx, BIGDIG *y, sizet ny, int sgn, - int modes)); + int mode)); SCM_EXPORT long pseudolong P((long x)); #endif SCM_EXPORT int bigcomp P((SCM x, SCM y)); @@ -1107,27 +1112,27 @@ SCM_EXPORT SCM scm_trace, scm_trace_env; # define ASRTGO(_cond, _label) if (SCM_EXPECT_FALSE(!(_cond))) goto _label; #endif -#define ARGn 1 -#define ARG1 2 -#define ARG2 3 -#define ARG3 4 -#define ARG4 5 -#define ARG5 6 +#define ARGn 1L +#define ARG1 2L +#define ARG2 3L +#define ARG3 4L +#define ARG4 5L +#define ARG5 6L /* following must match entry indexes in errmsgs[] */ -#define WNA 7 -#define OVFLOW 8 -#define OUTOFRANGE 9 -#define NALLOC 10 -#define THRASH 11 -#define EXIT 12 -#define HUP_SIGNAL 13 -#define INT_SIGNAL 14 -#define FPE_SIGNAL 15 -#define BUS_SIGNAL 16 -#define SEGV_SIGNAL 17 -#define ALRM_SIGNAL 18 -#define VTALRM_SIGNAL 19 -#define PROF_SIGNAL 20 +#define WNA 7L +#define OVFLOW 8L +#define OUTOFRANGE 9L +#define NALLOC 10L +#define THRASH 11L +#define EXIT 12L +#define HUP_SIGNAL 13L +#define INT_SIGNAL 14L +#define FPE_SIGNAL 15L +#define BUS_SIGNAL 16L +#define SEGV_SIGNAL 17L +#define ALRM_SIGNAL 18L +#define VTALRM_SIGNAL 19L +#define PROF_SIGNAL 20L #define EVAL(x, env, venv) (IMP(x)?(x):ceval((x), (SCM)(env), (SCM)(venv))) #define SIDEVAL(x, env, venv) if (NIMP(x)) ceval((x), (SCM)(env), (SCM)(venv)) -- cgit v1.2.3