1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-15 08:10:17 +02:00

replace "scm_*_t" with "scm_t_*".

This commit is contained in:
Marius Vollmer 2001-06-14 19:50:43 +00:00
parent 51fa276692
commit 92c2555f69
91 changed files with 718 additions and 718 deletions

View file

@ -59,7 +59,7 @@
* SCM_DEFER_INTS). * SCM_DEFER_INTS).
*/ */
static scm_bits_t scm_tc16_arbiter; static scm_t_bits scm_tc16_arbiter;
#define SCM_ARB_LOCKED(arb) ((SCM_CELL_WORD_0 (arb)) & (1L << 16)) #define SCM_ARB_LOCKED(arb) ((SCM_CELL_WORD_0 (arb)) & (1L << 16))

View file

@ -109,7 +109,7 @@ static unsigned int scm_desired_switch_rate = 0;
int scm_asyncs_pending_p = 0; int scm_asyncs_pending_p = 0;
#endif #endif
static scm_bits_t tc16_async; static scm_t_bits tc16_async;

View file

@ -247,8 +247,8 @@ scm_i_display_error (SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM r
data.mode = "error"; data.mode = "error";
data.port = port; data.port = port;
scm_internal_catch (SCM_BOOL_T, scm_internal_catch (SCM_BOOL_T,
(scm_catch_body_t) display_error_body, &a, (scm_t_catch_body) display_error_body, &a,
(scm_catch_handler_t) display_error_handler, &data); (scm_t_catch_handler) display_error_handler, &data);
} }
@ -339,7 +339,7 @@ display_frame_expr (char *hdr,SCM exp,char *tlr,int indentation,SCM sport,SCM po
{ {
SCM string; SCM string;
int i = 0, n; int i = 0, n;
scm_ptob_descriptor_t *ptob = scm_ptobs + SCM_PTOBNUM (sport); scm_t_ptob_descriptor *ptob = scm_ptobs + SCM_PTOBNUM (sport);
do do
{ {
pstate->length = print_params[i].length; pstate->length = print_params[i].length;
@ -720,8 +720,8 @@ SCM_DEFINE (scm_display_backtrace, "display-backtrace", 2, 2, 0,
data.mode = "backtrace"; data.mode = "backtrace";
data.port = port; data.port = port;
scm_internal_catch (SCM_BOOL_T, scm_internal_catch (SCM_BOOL_T,
(scm_catch_body_t) display_backtrace_body, &a, (scm_t_catch_body) display_backtrace_body, &a,
(scm_catch_handler_t) display_error_handler, &data); (scm_t_catch_handler) display_error_handler, &data);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -66,12 +66,12 @@
/* {Continuations} /* {Continuations}
*/ */
scm_bits_t scm_tc16_continuation; scm_t_bits scm_tc16_continuation;
static SCM static SCM
continuation_mark (SCM obj) continuation_mark (SCM obj)
{ {
scm_contregs_t *continuation = SCM_CONTREGS (obj); scm_t_contregs *continuation = SCM_CONTREGS (obj);
scm_gc_mark (continuation->throw_value); scm_gc_mark (continuation->throw_value);
scm_mark_locations (continuation->stack, continuation->num_stack_items); scm_mark_locations (continuation->stack, continuation->num_stack_items);
@ -81,12 +81,12 @@ continuation_mark (SCM obj)
static size_t static size_t
continuation_free (SCM obj) continuation_free (SCM obj)
{ {
scm_contregs_t *continuation = SCM_CONTREGS (obj); scm_t_contregs *continuation = SCM_CONTREGS (obj);
/* stack array size is 1 if num_stack_items is 0 (rootcont). */ /* stack array size is 1 if num_stack_items is 0 (rootcont). */
size_t extra_items = (continuation->num_stack_items > 0) size_t extra_items = (continuation->num_stack_items > 0)
? (continuation->num_stack_items - 1) ? (continuation->num_stack_items - 1)
: 0; : 0;
size_t bytes_free = sizeof (scm_contregs_t) size_t bytes_free = sizeof (scm_t_contregs)
+ extra_items * sizeof (SCM_STACKITEM); + extra_items * sizeof (SCM_STACKITEM);
scm_must_free (continuation); scm_must_free (continuation);
@ -96,7 +96,7 @@ continuation_free (SCM obj)
static int static int
continuation_print (SCM obj, SCM port, scm_print_state *state SCM_UNUSED) continuation_print (SCM obj, SCM port, scm_print_state *state SCM_UNUSED)
{ {
scm_contregs_t *continuation = SCM_CONTREGS (obj); scm_t_contregs *continuation = SCM_CONTREGS (obj);
scm_puts ("#<continuation ", port); scm_puts ("#<continuation ", port);
scm_intprint (continuation->num_stack_items, 10, port); scm_intprint (continuation->num_stack_items, 10, port);
@ -114,15 +114,15 @@ SCM
scm_make_continuation (int *first) scm_make_continuation (int *first)
{ {
volatile SCM cont; volatile SCM cont;
scm_contregs_t *continuation; scm_t_contregs *continuation;
scm_contregs_t *rootcont = SCM_CONTREGS (scm_rootcont); scm_t_contregs *rootcont = SCM_CONTREGS (scm_rootcont);
long stack_size; long stack_size;
SCM_STACKITEM * src; SCM_STACKITEM * src;
SCM_ENTER_A_SECTION; SCM_ENTER_A_SECTION;
SCM_FLUSH_REGISTER_WINDOWS; SCM_FLUSH_REGISTER_WINDOWS;
stack_size = scm_stack_size (rootcont->base); stack_size = scm_stack_size (rootcont->base);
continuation = scm_must_malloc (sizeof (scm_contregs_t) continuation = scm_must_malloc (sizeof (scm_t_contregs)
+ (stack_size - 1) * sizeof (SCM_STACKITEM), + (stack_size - 1) * sizeof (SCM_STACKITEM),
FUNC_NAME); FUNC_NAME);
continuation->num_stack_items = stack_size; continuation->num_stack_items = stack_size;
@ -163,14 +163,14 @@ static void scm_dynthrow (SCM, SCM);
* variable. * variable.
*/ */
scm_bits_t scm_i_dummy; scm_t_bits scm_i_dummy;
static void static void
grow_stack (SCM cont, SCM val) grow_stack (SCM cont, SCM val)
{ {
scm_bits_t growth[100]; scm_t_bits growth[100];
scm_i_dummy = (scm_bits_t) growth; scm_i_dummy = (scm_t_bits) growth;
scm_dynthrow (cont, val); scm_dynthrow (cont, val);
} }
@ -180,7 +180,7 @@ grow_stack (SCM cont, SCM val)
* own frame are overwritten. Thus, memcpy can be used for best performance. * own frame are overwritten. Thus, memcpy can be used for best performance.
*/ */
static void static void
copy_stack_and_call (scm_contregs_t *continuation, SCM val, copy_stack_and_call (scm_t_contregs *continuation, SCM val,
SCM_STACKITEM * dst) SCM_STACKITEM * dst)
{ {
memcpy (dst, continuation->stack, memcpy (dst, continuation->stack,
@ -202,7 +202,7 @@ copy_stack_and_call (scm_contregs_t *continuation, SCM val,
static void static void
scm_dynthrow (SCM cont, SCM val) scm_dynthrow (SCM cont, SCM val)
{ {
scm_contregs_t *continuation = SCM_CONTREGS (cont); scm_t_contregs *continuation = SCM_CONTREGS (cont);
SCM_STACKITEM * dst = SCM_BASE (scm_rootcont); SCM_STACKITEM * dst = SCM_BASE (scm_rootcont);
SCM_STACKITEM stack_top_element; SCM_STACKITEM stack_top_element;
@ -224,8 +224,8 @@ static SCM
continuation_apply (SCM cont, SCM args) continuation_apply (SCM cont, SCM args)
#define FUNC_NAME "continuation_apply" #define FUNC_NAME "continuation_apply"
{ {
scm_contregs_t *continuation = SCM_CONTREGS (cont); scm_t_contregs *continuation = SCM_CONTREGS (cont);
scm_contregs_t *rootcont = SCM_CONTREGS (scm_rootcont); scm_t_contregs *rootcont = SCM_CONTREGS (scm_rootcont);
if (continuation->seq != rootcont->seq if (continuation->seq != rootcont->seq
/* this base comparison isn't needed */ /* this base comparison isn't needed */

View file

@ -50,12 +50,12 @@
/* a continuation SCM is a non-immediate pointing to a heap cell with: /* a continuation SCM is a non-immediate pointing to a heap cell with:
word 0: bits 0-15: unused. word 0: bits 0-15: unused.
bits 16-31: smob type tag: scm_tc16_continuation. bits 16-31: smob type tag: scm_tc16_continuation.
word 1: malloc block containing an scm_contregs_t structure with a word 1: malloc block containing an scm_t_contregs structure with a
tail array of SCM_STACKITEM. the size of the array is stored tail array of SCM_STACKITEM. the size of the array is stored
in the num_stack_items field of the structure. in the num_stack_items field of the structure.
*/ */
extern scm_bits_t scm_tc16_continuation; extern scm_t_bits scm_tc16_continuation;
typedef struct typedef struct
{ {
@ -69,18 +69,18 @@ typedef struct
#ifdef DEBUG_EXTENSIONS #ifdef DEBUG_EXTENSIONS
/* the most recently created debug frame on the live stack, before /* the most recently created debug frame on the live stack, before
it was saved. */ it was saved. */
struct scm_debug_frame_t *dframe; struct scm_t_debug_frame *dframe;
#endif #endif
SCM_STACKITEM stack[1]; /* copied stack of size num_stack_items. */ SCM_STACKITEM stack[1]; /* copied stack of size num_stack_items. */
} scm_contregs_t; } scm_t_contregs;
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
# define scm_contregs scm_contregs_t # define scm_contregs scm_t_contregs
#endif #endif
#define SCM_CONTINUATIONP(x) SCM_TYP16_PREDICATE (scm_tc16_continuation, x) #define SCM_CONTINUATIONP(x) SCM_TYP16_PREDICATE (scm_tc16_continuation, x)
#define SCM_CONTREGS(x) ((scm_contregs_t *) SCM_CELL_WORD_1 (x)) #define SCM_CONTREGS(x) ((scm_t_contregs *) SCM_CELL_WORD_1 (x))
#define SCM_CONTINUATION_LENGTH(x) (SCM_CONTREGS (x)->num_stack_items) #define SCM_CONTINUATION_LENGTH(x) (SCM_CONTREGS (x)->num_stack_items)
#define SCM_SET_CONTINUATION_LENGTH(x,n)\ #define SCM_SET_CONTINUATION_LENGTH(x,n)\

View file

@ -143,7 +143,7 @@ typedef struct coop_m {
typedef int coop_mattr; typedef int coop_mattr;
typedef coop_m scm_mutex_t; typedef coop_m scm_t_mutex;
extern int coop_mutex_init (coop_m*); extern int coop_mutex_init (coop_m*);
extern int coop_new_mutex_init (coop_m*, coop_mattr*); extern int coop_new_mutex_init (coop_m*, coop_mattr*);
@ -153,7 +153,7 @@ extern int coop_mutex_unlock (coop_m*);
extern int coop_mutex_destroy (coop_m*); extern int coop_mutex_destroy (coop_m*);
#define scm_mutex_init coop_mutex_init #define scm_mutex_init coop_mutex_init
#define scm_mutex_lock coop_mutex_lock #define scm_mutex_lock coop_mutex_lock
#define scm_mutex_trylock coop_mutex_lock #define scm_t_mutexrylock coop_mutex_lock
#define scm_mutex_unlock coop_mutex_unlock #define scm_mutex_unlock coop_mutex_unlock
#define scm_mutex_destroy coop_mutex_destroy #define scm_mutex_destroy coop_mutex_destroy
@ -166,7 +166,7 @@ typedef struct coop_c {
typedef int coop_cattr; typedef int coop_cattr;
typedef coop_c scm_cond_t; typedef coop_c scm_t_cond;
#ifndef HAVE_STRUCT_TIMESPEC #ifndef HAVE_STRUCT_TIMESPEC
/* POSIX.4 structure for a time value. This is like a `struct timeval' but /* POSIX.4 structure for a time value. This is like a `struct timeval' but
@ -188,14 +188,14 @@ extern int coop_condition_variable_signal (coop_c*);
extern int coop_condition_variable_destroy (coop_c*); extern int coop_condition_variable_destroy (coop_c*);
#define scm_cond_init coop_new_condition_variable_init #define scm_cond_init coop_new_condition_variable_init
#define scm_cond_wait coop_condition_variable_wait_mutex #define scm_cond_wait coop_condition_variable_wait_mutex
#define scm_cond_timedwait coop_condition_variable_timed_wait_mutex #define scm_t_condimedwait coop_condition_variable_timed_wait_mutex
#define scm_cond_signal coop_condition_variable_signal #define scm_cond_signal coop_condition_variable_signal
#define scm_cond_broadcast coop_condition_variable_signal /* yes */ #define scm_cond_broadcast coop_condition_variable_signal /* yes */
#define scm_cond_destroy coop_condition_variable_destroy #define scm_cond_destroy coop_condition_variable_destroy
typedef int coop_k; typedef int coop_k;
typedef coop_k scm_key_t; typedef coop_k scm_t_key;
extern int coop_key_create (coop_k *keyp, void (*destruktor) (void *value)); extern int coop_key_create (coop_k *keyp, void (*destruktor) (void *value));
extern int coop_setspecific (coop_k key, const void *value); extern int coop_setspecific (coop_k key, const void *value);

View file

@ -209,9 +209,9 @@ scheme_launch_thread (void *p)
data.rootcont = SCM_BOOL_F; data.rootcont = SCM_BOOL_F;
data.body = SCM_CADR (argl); data.body = SCM_CADR (argl);
data.handler = SCM_CADDR (argl); data.handler = SCM_CADDR (argl);
scm_internal_cwdr ((scm_catch_body_t) scheme_body_bootstrip, scm_internal_cwdr ((scm_t_catch_body) scheme_body_bootstrip,
&data, &data,
(scm_catch_handler_t) scheme_handler_bootstrip, (scm_t_catch_handler) scheme_handler_bootstrip,
&data, &data,
(SCM_STACKITEM *) &thread); (SCM_STACKITEM *) &thread);
SCM_SET_CELL_WORD_1 (thread, 0); SCM_SET_CELL_WORD_1 (thread, 0);
@ -269,7 +269,7 @@ scm_call_with_new_thread (SCM argl)
argl variable may not exist in memory when the thread starts. */ argl variable may not exist in memory when the thread starts. */
t = coop_create (scheme_launch_thread, (void *) argl); t = coop_create (scheme_launch_thread, (void *) argl);
t->data = SCM_ROOT_STATE (root); t->data = SCM_ROOT_STATE (root);
SCM_SET_CELL_WORD_1 (thread, (scm_bits_t) t); SCM_SET_CELL_WORD_1 (thread, (scm_t_bits) t);
scm_thread_count++; scm_thread_count++;
/* Note that the following statement also could cause coop_yield.*/ /* Note that the following statement also could cause coop_yield.*/
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
@ -293,9 +293,9 @@ typedef struct c_launch_data {
SCM thread; SCM thread;
SCM rootcont; SCM rootcont;
} u; } u;
scm_catch_body_t body; scm_t_catch_body body;
void *body_data; void *body_data;
scm_catch_handler_t handler; scm_t_catch_handler handler;
void *handler_data; void *handler_data;
} c_launch_data; } c_launch_data;
@ -323,9 +323,9 @@ c_launch_thread (void *p)
/* We must use the address of `thread', otherwise the compiler will /* We must use the address of `thread', otherwise the compiler will
optimize it away. This is OK since the longest SCM_STACKITEM optimize it away. This is OK since the longest SCM_STACKITEM
also is a long. */ also is a long. */
scm_internal_cwdr ((scm_catch_body_t) c_body_bootstrip, scm_internal_cwdr ((scm_t_catch_body) c_body_bootstrip,
data, data,
(scm_catch_handler_t) c_handler_bootstrip, (scm_t_catch_handler) c_handler_bootstrip,
data, data,
(SCM_STACKITEM *) &thread); (SCM_STACKITEM *) &thread);
scm_thread_count--; scm_thread_count--;
@ -333,8 +333,8 @@ c_launch_thread (void *p)
} }
SCM SCM
scm_spawn_thread (scm_catch_body_t body, void *body_data, scm_spawn_thread (scm_t_catch_body body, void *body_data,
scm_catch_handler_t handler, void *handler_data) scm_t_catch_handler handler, void *handler_data)
{ {
SCM thread; SCM thread;
coop_t *t; coop_t *t;
@ -362,7 +362,7 @@ scm_spawn_thread (scm_catch_body_t body, void *body_data,
t = coop_create (c_launch_thread, (void *) data); t = coop_create (c_launch_thread, (void *) data);
t->data = SCM_ROOT_STATE (root); t->data = SCM_ROOT_STATE (root);
SCM_SET_CELL_WORD_1 (thread, (scm_bits_t) t); SCM_SET_CELL_WORD_1 (thread, (scm_t_bits) t);
scm_thread_count++; scm_thread_count++;
/* Note that the following statement also could cause coop_yield.*/ /* Note that the following statement also could cause coop_yield.*/
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
@ -423,7 +423,7 @@ scm_make_mutex (void)
SCM m; SCM m;
coop_m *data = (coop_m *) scm_must_malloc (sizeof (coop_m), "mutex"); coop_m *data = (coop_m *) scm_must_malloc (sizeof (coop_m), "mutex");
SCM_NEWSMOB (m, scm_tc16_mutex, (scm_bits_t) data); SCM_NEWSMOB (m, scm_tc16_mutex, (scm_t_bits) data);
coop_mutex_init (data); coop_mutex_init (data);
return m; return m;
} }
@ -454,7 +454,7 @@ scm_make_condition_variable (void)
{ {
SCM c; SCM c;
coop_c *data = (coop_c *) scm_must_malloc (sizeof (coop_c), "condvar"); coop_c *data = (coop_c *) scm_must_malloc (sizeof (coop_c), "condvar");
SCM_NEWSMOB (c, scm_tc16_condvar, (scm_bits_t) data); SCM_NEWSMOB (c, scm_tc16_condvar, (scm_t_bits) data);
coop_condition_variable_init (SCM_CONDVAR_DATA (c)); coop_condition_variable_init (SCM_CONDVAR_DATA (c));
return c; return c;
} }

View file

@ -147,7 +147,7 @@ SCM_SYMBOL (scm_sym_source, "source");
/* {Memoized Source} /* {Memoized Source}
*/ */
scm_bits_t scm_tc16_memoized; scm_t_bits scm_tc16_memoized;
static int static int
memoized_print (SCM obj, SCM port, scm_print_state *pstate) memoized_print (SCM obj, SCM port, scm_print_state *pstate)
@ -521,8 +521,8 @@ SCM
scm_start_stack (SCM id, SCM exp, SCM env) scm_start_stack (SCM id, SCM exp, SCM env)
{ {
SCM answer; SCM answer;
scm_debug_frame_t vframe; scm_t_debug_frame vframe;
scm_debug_info_t vframe_vect_body; scm_t_debug_info vframe_vect_body;
vframe.prev = scm_last_debug_frame; vframe.prev = scm_last_debug_frame;
vframe.status = SCM_VOIDFRAME; vframe.status = SCM_VOIDFRAME;
vframe.vect = &vframe_vect_body; vframe.vect = &vframe_vect_body;
@ -554,7 +554,7 @@ scm_m_start_stack (SCM exp, SCM env)
* The debugging evaluator throws these on frame traps. * The debugging evaluator throws these on frame traps.
*/ */
scm_bits_t scm_tc16_debugobj; scm_t_bits scm_tc16_debugobj;
static int static int
debugobj_print (SCM obj, SCM port, scm_print_state *pstate SCM_UNUSED) debugobj_print (SCM obj, SCM port, scm_print_state *pstate SCM_UNUSED)
@ -576,7 +576,7 @@ SCM_DEFINE (scm_debug_object_p, "debug-object?", 1, 0, 0,
SCM SCM
scm_make_debugobj (scm_debug_frame_t *frame) scm_make_debugobj (scm_t_debug_frame *frame)
{ {
register SCM z; register SCM z;
SCM_NEWCELL (z); SCM_NEWCELL (z);

View file

@ -69,7 +69,7 @@
/* scm_debug_opts is defined in eval.c. /* scm_debug_opts is defined in eval.c.
*/ */
extern scm_option_t scm_debug_opts[]; extern scm_t_option scm_debug_opts[];
#define SCM_CHEAPTRAPS_P scm_debug_opts[0].val #define SCM_CHEAPTRAPS_P scm_debug_opts[0].val
#define SCM_BREAKPOINTS_P scm_debug_opts[1].val #define SCM_BREAKPOINTS_P scm_debug_opts[1].val
@ -109,30 +109,30 @@ do {\
/* {Evaluator} /* {Evaluator}
*/ */
typedef union scm_debug_info_t typedef union scm_t_debug_info
{ {
struct { SCM exp, env; } e; struct { SCM exp, env; } e;
struct { SCM proc, args; } a; struct { SCM proc, args; } a;
SCM id; SCM id;
} scm_debug_info_t; } scm_t_debug_info;
extern long scm_debug_eframe_size; extern long scm_debug_eframe_size;
typedef struct scm_debug_frame_t typedef struct scm_t_debug_frame
{ {
struct scm_debug_frame_t *prev; struct scm_t_debug_frame *prev;
long status; long status;
scm_debug_info_t *vect; scm_t_debug_info *vect;
scm_debug_info_t *info; scm_t_debug_info *info;
} scm_debug_frame_t; } scm_t_debug_frame;
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
# define scm_debug_info scm_debug_info_t # define scm_debug_info scm_t_debug_info
# define scm_debug_frame scm_debug_frame_t # define scm_debug_frame scm_t_debug_frame
#endif #endif
#ifndef USE_THREADS #ifndef USE_THREADS
extern scm_debug_frame_t *scm_last_debug_frame; extern scm_t_debug_frame *scm_last_debug_frame;
#endif #endif
#define SCM_EVALFRAME (0L << 11) #define SCM_EVALFRAME (0L << 11)
@ -170,7 +170,7 @@ extern scm_debug_frame_t *scm_last_debug_frame;
/* {Debug Objects} /* {Debug Objects}
*/ */
extern scm_bits_t scm_tc16_debugobj; extern scm_t_bits scm_tc16_debugobj;
#define SCM_DEBUGOBJP(x) SCM_TYP16_PREDICATE (scm_tc16_debugobj, x) #define SCM_DEBUGOBJP(x) SCM_TYP16_PREDICATE (scm_tc16_debugobj, x)
#define SCM_DEBUGOBJ_FRAME(x) SCM_CELL_WORD_1 (x) #define SCM_DEBUGOBJ_FRAME(x) SCM_CELL_WORD_1 (x)
@ -179,7 +179,7 @@ extern scm_bits_t scm_tc16_debugobj;
/* {Memoized Source} /* {Memoized Source}
*/ */
extern scm_bits_t scm_tc16_memoized; extern scm_t_bits scm_tc16_memoized;
#define SCM_MEMOIZEDP(x) SCM_TYP16_PREDICATE (scm_tc16_memoized, x) #define SCM_MEMOIZEDP(x) SCM_TYP16_PREDICATE (scm_tc16_memoized, x)
#define SCM_MEMOIZED_EXP(x) SCM_CAR (SCM_CELL_OBJECT_1 (x)) #define SCM_MEMOIZED_EXP(x) SCM_CAR (SCM_CELL_OBJECT_1 (x))
@ -203,7 +203,7 @@ extern SCM scm_with_traps (SCM thunk);
extern SCM scm_evaluator_traps (SCM setting); extern SCM scm_evaluator_traps (SCM setting);
extern SCM scm_debug_options (SCM setting); extern SCM scm_debug_options (SCM setting);
extern SCM scm_unmemoize (SCM memoized); extern SCM scm_unmemoize (SCM memoized);
extern SCM scm_make_debugobj (scm_debug_frame_t *debug); extern SCM scm_make_debugobj (scm_t_debug_frame *debug);
extern void scm_init_debug (void); extern void scm_init_debug (void);
#ifdef GUILE_DEBUG #ifdef GUILE_DEBUG

View file

@ -330,7 +330,7 @@ sysdep_dynl_func (const char *symbol,
#endif #endif
scm_bits_t scm_tc16_dynamic_obj; scm_t_bits scm_tc16_dynamic_obj;
#define DYNL_FILENAME(x) (SCM_CELL_OBJECT_1 (x)) #define DYNL_FILENAME(x) (SCM_CELL_OBJECT_1 (x))
#define DYNL_HANDLE(x) ((void *) SCM_CELL_WORD_2 (x)) #define DYNL_HANDLE(x) ((void *) SCM_CELL_WORD_2 (x))

View file

@ -140,11 +140,11 @@ SCM_DEFINE (scm_dynamic_wind, "dynamic-wind", 3, 0, 0,
*/ */
#define SCM_GUARDSP(obj) SCM_TYP16_PREDICATE (tc16_guards, obj) #define SCM_GUARDSP(obj) SCM_TYP16_PREDICATE (tc16_guards, obj)
#define SCM_BEFORE_GUARD(obj) ((scm_guard_t) SCM_CELL_WORD (obj, 1)) #define SCM_BEFORE_GUARD(obj) ((scm_t_guard) SCM_CELL_WORD (obj, 1))
#define SCM_AFTER_GUARD(obj) ((scm_guard_t) SCM_CELL_WORD (obj, 2)) #define SCM_AFTER_GUARD(obj) ((scm_t_guard) SCM_CELL_WORD (obj, 2))
#define SCM_GUARD_DATA(obj) ((void *) SCM_CELL_WORD (obj, 3)) #define SCM_GUARD_DATA(obj) ((void *) SCM_CELL_WORD (obj, 3))
static scm_bits_t tc16_guards; static scm_t_bits tc16_guards;
static int static int
guards_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) guards_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
@ -156,16 +156,16 @@ guards_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
} }
SCM SCM
scm_internal_dynamic_wind (scm_guard_t before, scm_internal_dynamic_wind (scm_t_guard before,
scm_inner_t inner, scm_t_inner inner,
scm_guard_t after, scm_t_guard after,
void *inner_data, void *inner_data,
void *guard_data) void *guard_data)
{ {
SCM guards, ans; SCM guards, ans;
before (guard_data); before (guard_data);
SCM_NEWSMOB3 (guards, tc16_guards, (scm_bits_t) before, SCM_NEWSMOB3 (guards, tc16_guards, (scm_t_bits) before,
(scm_bits_t) after, (scm_bits_t) guard_data); (scm_t_bits) after, (scm_t_bits) guard_data);
scm_dynwinds = scm_acons (guards, SCM_BOOL_F, scm_dynwinds); scm_dynwinds = scm_acons (guards, SCM_BOOL_F, scm_dynwinds);
ans = inner (inner_data); ans = inner (inner_data);
scm_dynwinds = SCM_CDR (scm_dynwinds); scm_dynwinds = SCM_CDR (scm_dynwinds);

View file

@ -47,13 +47,13 @@
typedef void (*scm_guard_t) (void *); typedef void (*scm_t_guard) (void *);
typedef SCM (*scm_inner_t) (void *); typedef SCM (*scm_t_inner) (void *);
extern SCM scm_dynamic_wind (SCM thunk1, SCM thunk2, SCM thunk3); extern SCM scm_dynamic_wind (SCM thunk1, SCM thunk2, SCM thunk3);
extern SCM scm_internal_dynamic_wind (scm_guard_t before, extern SCM scm_internal_dynamic_wind (scm_t_guard before,
scm_inner_t inner, scm_t_inner inner,
scm_guard_t after, scm_t_guard after,
void *inner_data, void *inner_data,
void *guard_data); void *guard_data);
extern void scm_dowinds (SCM to, long delta); extern void scm_dowinds (SCM to, long delta);

View file

@ -56,8 +56,8 @@
scm_bits_t scm_tc16_environment; scm_t_bits scm_tc16_environment;
scm_bits_t scm_tc16_observer; scm_t_bits scm_tc16_observer;
#define DEFAULT_OBARRAY_SIZE 137 #define DEFAULT_OBARRAY_SIZE 137
SCM scm_system_environment; SCM scm_system_environment;

View file

@ -85,7 +85,7 @@ struct scm_environment_funcs {
#define SCM_ENVIRONMENT_LOCATION_IMMUTABLE SCM_MAKINUM (1) #define SCM_ENVIRONMENT_LOCATION_IMMUTABLE SCM_MAKINUM (1)
#define SCM_ENVIRONMENT_LOCATION_NO_CELL SCM_BOOL_F #define SCM_ENVIRONMENT_LOCATION_NO_CELL SCM_BOOL_F
extern scm_bits_t scm_tc16_environment; extern scm_t_bits scm_tc16_environment;
#define SCM_ENVIRONMENT_P(x) \ #define SCM_ENVIRONMENT_P(x) \
(!SCM_IMP (x) && SCM_CELL_TYPE (x) == scm_tc16_environment) (!SCM_IMP (x) && SCM_CELL_TYPE (x) == scm_tc16_environment)
@ -110,7 +110,7 @@ extern scm_bits_t scm_tc16_environment;
#define SCM_ENVIRONMENT_UNOBSERVE(env, token) \ #define SCM_ENVIRONMENT_UNOBSERVE(env, token) \
((*(SCM_ENVIRONMENT_FUNCS (env)->unobserve)) (env, token)) ((*(SCM_ENVIRONMENT_FUNCS (env)->unobserve)) (env, token))
extern scm_bits_t scm_tc16_observer; extern scm_t_bits scm_tc16_observer;
#define SCM_OBSERVER_P(x) \ #define SCM_OBSERVER_P(x) \
(!SCM_IMP (x) && (SCM_CELL_TYPE (x) == scm_tc16_observer)) (!SCM_IMP (x) && (SCM_CELL_TYPE (x) == scm_tc16_observer))

View file

@ -1044,7 +1044,7 @@ scm_m_cont (SCM xorig, SCM env SCM_UNUSED)
/* Multi-language support */ /* Multi-language support */
SCM_GLOBAL_SYMBOL (scm_lisp_nil, "nil"); SCM_GLOBAL_SYMBOL (scm_lisp_nil, "nil");
SCM_GLOBAL_SYMBOL (scm_lisp_t, "t"); SCM_GLOBAL_SYMBOL (scm_t_lisp, "t");
SCM_SYNTAX (s_nil_cond, "nil-cond", scm_makmmacro, scm_m_nil_cond); SCM_SYNTAX (s_nil_cond, "nil-cond", scm_makmmacro, scm_m_nil_cond);
@ -1532,7 +1532,7 @@ scm_eval_args (SCM l, SCM env, SCM proc)
} }
else if (SCM_TYP3 (l) == scm_tc3_cons_gloc) else if (SCM_TYP3 (l) == scm_tc3_cons_gloc)
{ {
scm_bits_t vcell = scm_t_bits vcell =
SCM_STRUCT_VTABLE_DATA (l) [scm_vtable_index_vcell]; SCM_STRUCT_VTABLE_DATA (l) [scm_vtable_index_vcell];
if (vcell == 0) if (vcell == 0)
res = SCM_CAR (l); /* struct planted in code */ res = SCM_CAR (l); /* struct planted in code */
@ -1659,7 +1659,7 @@ SCM (*scm_ceval_ptr) (SCM x, SCM env);
*/ */
#ifndef USE_THREADS #ifndef USE_THREADS
scm_debug_frame_t *scm_last_debug_frame; scm_t_debug_frame *scm_last_debug_frame;
#endif #endif
/* scm_debug_eframe_size is the number of slots available for pseudo /* scm_debug_eframe_size is the number of slots available for pseudo
@ -1672,11 +1672,11 @@ int scm_debug_mode, scm_check_entry_p, scm_check_apply_p, scm_check_exit_p;
long scm_eval_stack; long scm_eval_stack;
scm_option_t scm_eval_opts[] = { scm_t_option scm_eval_opts[] = {
{ SCM_OPTION_INTEGER, "stack", 22000, "Size of thread stacks (in machine words)." } { SCM_OPTION_INTEGER, "stack", 22000, "Size of thread stacks (in machine words)." }
}; };
scm_option_t scm_debug_opts[] = { scm_t_option scm_debug_opts[] = {
{ SCM_OPTION_BOOLEAN, "cheap", 1, { SCM_OPTION_BOOLEAN, "cheap", 1,
"*Flyweight representation of the stack at traps." }, "*Flyweight representation of the stack at traps." },
{ SCM_OPTION_BOOLEAN, "breakpoints", 0, "*Check for breakpoints." }, { SCM_OPTION_BOOLEAN, "breakpoints", 0, "*Check for breakpoints." },
@ -1698,7 +1698,7 @@ scm_option_t scm_debug_opts[] = {
{ SCM_OPTION_SCM, "show-file-name", SCM_BOOL_T, "Show file names and line numbers in backtraces when not `#f'. A value of `base' displays only base names, while `#t' displays full names."} { SCM_OPTION_SCM, "show-file-name", SCM_BOOL_T, "Show file names and line numbers in backtraces when not `#f'. A value of `base' displays only base names, while `#t' displays full names."}
}; };
scm_option_t scm_evaluator_trap_table[] = { scm_t_option scm_evaluator_trap_table[] = {
{ SCM_OPTION_BOOLEAN, "traps", 0, "Enable evaluator traps." }, { SCM_OPTION_BOOLEAN, "traps", 0, "Enable evaluator traps." },
{ SCM_OPTION_BOOLEAN, "enter-frame", 0, "Trap when eval enters new frame." }, { SCM_OPTION_BOOLEAN, "enter-frame", 0, "Trap when eval enters new frame." },
{ SCM_OPTION_BOOLEAN, "apply-frame", 0, "Trap when entering apply." }, { SCM_OPTION_BOOLEAN, "apply-frame", 0, "Trap when entering apply." },
@ -1757,7 +1757,7 @@ scm_deval_args (SCM l, SCM env, SCM proc, SCM *lloc)
} }
else if (SCM_TYP3 (l) == scm_tc3_cons_gloc) else if (SCM_TYP3 (l) == scm_tc3_cons_gloc)
{ {
scm_bits_t vcell = scm_t_bits vcell =
SCM_STRUCT_VTABLE_DATA (l) [scm_vtable_index_vcell]; SCM_STRUCT_VTABLE_DATA (l) [scm_vtable_index_vcell];
if (vcell == 0) if (vcell == 0)
res = SCM_CAR (l); /* struct planted in code */ res = SCM_CAR (l); /* struct planted in code */
@ -1832,17 +1832,17 @@ SCM_CEVAL (SCM x, SCM env)
} t; } t;
SCM proc, arg2, orig_sym; SCM proc, arg2, orig_sym;
#ifdef DEVAL #ifdef DEVAL
scm_debug_frame_t debug; scm_t_debug_frame debug;
scm_debug_info_t *debug_info_end; scm_t_debug_info *debug_info_end;
debug.prev = scm_last_debug_frame; debug.prev = scm_last_debug_frame;
debug.status = scm_debug_eframe_size; debug.status = scm_debug_eframe_size;
/* /*
* The debug.vect contains twice as much scm_debug_info_t frames as the * The debug.vect contains twice as much scm_t_debug_info frames as the
* user has specified with (debug-set! frames <n>). * user has specified with (debug-set! frames <n>).
* *
* Even frames are eval frames, odd frames are apply frames. * Even frames are eval frames, odd frames are apply frames.
*/ */
debug.vect = (scm_debug_info_t *) alloca (scm_debug_eframe_size debug.vect = (scm_t_debug_info *) alloca (scm_debug_eframe_size
* sizeof (debug.vect[0])); * sizeof (debug.vect[0]));
debug.info = debug.vect; debug.info = debug.vect;
debug_info_end = debug.vect + scm_debug_eframe_size; debug_info_end = debug.vect + scm_debug_eframe_size;
@ -2419,7 +2419,7 @@ dispatch:
case (SCM_ISYMNUM (SCM_IM_T_IFY)): case (SCM_ISYMNUM (SCM_IM_T_IFY)):
x = SCM_CDR (x); x = SCM_CDR (x);
RETURN (SCM_NFALSEP (EVALCAR (x, env)) ? scm_lisp_t : scm_lisp_nil) RETURN (SCM_NFALSEP (EVALCAR (x, env)) ? scm_t_lisp : scm_lisp_nil)
case (SCM_ISYMNUM (SCM_IM_0_COND)): case (SCM_ISYMNUM (SCM_IM_0_COND)):
proc = SCM_CDR (x); proc = SCM_CDR (x);
@ -2554,7 +2554,7 @@ dispatch:
case scm_tcs_cons_gloc: { case scm_tcs_cons_gloc: {
scm_bits_t vcell = SCM_STRUCT_VTABLE_DATA (x) [scm_vtable_index_vcell]; scm_t_bits vcell = SCM_STRUCT_VTABLE_DATA (x) [scm_vtable_index_vcell];
if (vcell == 0) { if (vcell == 0) {
/* This is a struct implanted in the code, not a gloc. */ /* This is a struct implanted in the code, not a gloc. */
RETURN (x); RETURN (x);
@ -2766,7 +2766,7 @@ evapply:
} }
else if (SCM_TYP3 (x) == scm_tc3_cons_gloc) else if (SCM_TYP3 (x) == scm_tc3_cons_gloc)
{ {
scm_bits_t vcell = SCM_STRUCT_VTABLE_DATA (x) [scm_vtable_index_vcell]; scm_t_bits vcell = SCM_STRUCT_VTABLE_DATA (x) [scm_vtable_index_vcell];
if (vcell == 0) if (vcell == 0)
t.arg1 = SCM_CAR (x); /* struct planted in code */ t.arg1 = SCM_CAR (x); /* struct planted in code */
else else
@ -2916,7 +2916,7 @@ evapply:
} }
else if (SCM_TYP3 (x) == scm_tc3_cons_gloc) else if (SCM_TYP3 (x) == scm_tc3_cons_gloc)
{ {
scm_bits_t vcell = SCM_STRUCT_VTABLE_DATA (x) [scm_vtable_index_vcell]; scm_t_bits vcell = SCM_STRUCT_VTABLE_DATA (x) [scm_vtable_index_vcell];
if (vcell == 0) if (vcell == 0)
arg2 = SCM_CAR (x); /* struct planted in code */ arg2 = SCM_CAR (x); /* struct planted in code */
else else
@ -3323,8 +3323,8 @@ SCM_APPLY (SCM proc, SCM arg1, SCM args)
{ {
#ifdef DEBUG_EXTENSIONS #ifdef DEBUG_EXTENSIONS
#ifdef DEVAL #ifdef DEVAL
scm_debug_frame_t debug; scm_t_debug_frame debug;
scm_debug_info_t debug_vect_body; scm_t_debug_info debug_vect_body;
debug.prev = scm_last_debug_frame; debug.prev = scm_last_debug_frame;
debug.status = SCM_APPLYFRAME; debug.status = SCM_APPLYFRAME;
debug.vect = &debug_vect_body; debug.vect = &debug_vect_body;
@ -3779,7 +3779,7 @@ scm_closure (SCM code, SCM env)
} }
scm_bits_t scm_tc16_promise; scm_t_bits scm_tc16_promise;
SCM SCM
scm_makprom (SCM code) scm_makprom (SCM code)
@ -4125,7 +4125,7 @@ scm_init_eval ()
#endif #endif
scm_c_define ("nil", scm_lisp_nil); scm_c_define ("nil", scm_lisp_nil);
scm_c_define ("t", scm_lisp_t); scm_c_define ("t", scm_t_lisp);
scm_add_feature ("delay"); scm_add_feature ("delay");
} }

View file

@ -53,14 +53,14 @@
/* {Options} /* {Options}
*/ */
extern scm_option_t scm_eval_opts[]; extern scm_t_option scm_eval_opts[];
#define SCM_EVAL_STACK scm_eval_opts[0].val #define SCM_EVAL_STACK scm_eval_opts[0].val
#define SCM_N_EVAL_OPTIONS 1 #define SCM_N_EVAL_OPTIONS 1
extern long scm_eval_stack; extern long scm_eval_stack;
extern scm_option_t scm_evaluator_trap_table[]; extern scm_t_option scm_evaluator_trap_table[];
extern SCM scm_eval_options_interface (SCM setting); extern SCM scm_eval_options_interface (SCM setting);

View file

@ -686,7 +686,7 @@ SCM_DEFINE (scm_rmdir, "rmdir", 1, 0, 0,
/* {Examining Directories} /* {Examining Directories}
*/ */
scm_bits_t scm_tc16_dir; scm_t_bits scm_tc16_dir;
SCM_DEFINE (scm_directory_stream_p, "directory-stream?", 1, 0, 0, SCM_DEFINE (scm_directory_stream_p, "directory-stream?", 1, 0, 0,
@ -879,7 +879,7 @@ set_element (SELECT_TYPE *set, SCM *ports_ready, SCM element, int pos)
if (pos == SCM_ARG1) if (pos == SCM_ARG1)
{ {
/* check whether port has buffered input. */ /* check whether port has buffered input. */
scm_port_t *pt = SCM_PTAB_ENTRY (element); scm_t_port *pt = SCM_PTAB_ENTRY (element);
if (pt->read_pos < pt->read_end) if (pt->read_pos < pt->read_end)
use_buf = 1; use_buf = 1;
@ -887,7 +887,7 @@ set_element (SELECT_TYPE *set, SCM *ports_ready, SCM element, int pos)
else if (pos == SCM_ARG2) else if (pos == SCM_ARG2)
{ {
/* check whether port's output buffer has room. */ /* check whether port's output buffer has room. */
scm_port_t *pt = SCM_PTAB_ENTRY (element); scm_t_port *pt = SCM_PTAB_ENTRY (element);
/* > 1 since writing the last byte in the buffer causes flush. */ /* > 1 since writing the last byte in the buffer causes flush. */
if (pt->write_end - pt->write_pos > 1) if (pt->write_end - pt->write_pos > 1)

View file

@ -51,7 +51,7 @@
extern scm_bits_t scm_tc16_dir; extern scm_t_bits scm_tc16_dir;
#define SCM_DIR_FLAG_OPEN (1L << 16) #define SCM_DIR_FLAG_OPEN (1L << 16)

View file

@ -57,7 +57,7 @@
#include "libguile/validate.h" #include "libguile/validate.h"
static volatile long n_fluids; static volatile long n_fluids;
scm_bits_t scm_tc16_fluid; scm_t_bits scm_tc16_fluid;
SCM SCM
scm_make_initial_fluids () scm_make_initial_fluids ()

View file

@ -73,7 +73,7 @@
implement a more lightweight version of fluids on top of this basic implement a more lightweight version of fluids on top of this basic
mechanism. */ mechanism. */
extern scm_bits_t scm_tc16_fluid; extern scm_t_bits scm_tc16_fluid;
#define SCM_FLUIDP(x) (!SCM_IMP (x) && (SCM_CELL_TYPE (x) == scm_tc16_fluid)) #define SCM_FLUIDP(x) (!SCM_IMP (x) && (SCM_CELL_TYPE (x) == scm_tc16_fluid))
#define SCM_FLUID_NUM(x) (SCM_CELL_WORD_1 (x)) #define SCM_FLUID_NUM(x) (SCM_CELL_WORD_1 (x))

View file

@ -70,7 +70,7 @@ size_t fwrite ();
#include "libguile/iselect.h" #include "libguile/iselect.h"
scm_bits_t scm_tc16_fport; scm_t_bits scm_tc16_fport;
/* default buffer size, used if the O/S won't supply a value. */ /* default buffer size, used if the O/S won't supply a value. */
@ -82,8 +82,8 @@ static void
scm_fport_buffer_add (SCM port, long read_size, int write_size) scm_fport_buffer_add (SCM port, long read_size, int write_size)
#define FUNC_NAME "scm_fport_buffer_add" #define FUNC_NAME "scm_fport_buffer_add"
{ {
scm_fport_t *fp = SCM_FSTREAM (port); scm_t_fport *fp = SCM_FSTREAM (port);
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (read_size == -1 || write_size == -1) if (read_size == -1 || write_size == -1)
{ {
@ -150,7 +150,7 @@ SCM_DEFINE (scm_setvbuf, "setvbuf", 2, 1, 0,
{ {
int cmode; int cmode;
long csize; long csize;
scm_port_t *pt; scm_t_port *pt;
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
@ -205,13 +205,13 @@ scm_evict_ports (int fd)
{ {
long i; long i;
for (i = 0; i < scm_port_table_size; i++) for (i = 0; i < scm_t_portable_size; i++)
{ {
SCM port = scm_port_table[i]->port; SCM port = scm_t_portable[i]->port;
if (SCM_FPORTP (port)) if (SCM_FPORTP (port))
{ {
scm_fport_t *fp = SCM_FSTREAM (port); scm_t_fport *fp = SCM_FSTREAM (port);
if (fp->fdes == fd) if (fp->fdes == fd)
{ {
@ -362,7 +362,7 @@ scm_fdes_to_port (int fdes, char *mode, SCM name)
{ {
long mode_bits = scm_mode_bits (mode); long mode_bits = scm_mode_bits (mode);
SCM port; SCM port;
scm_port_t *pt; scm_t_port *pt;
int flags; int flags;
/* test that fdes is valid. */ /* test that fdes is valid. */
@ -384,8 +384,8 @@ scm_fdes_to_port (int fdes, char *mode, SCM name)
SCM_SET_CELL_TYPE (port, (scm_tc16_fport | mode_bits)); SCM_SET_CELL_TYPE (port, (scm_tc16_fport | mode_bits));
{ {
scm_fport_t *fp scm_t_fport *fp
= (scm_fport_t *) scm_must_malloc (sizeof (scm_fport_t), = (scm_t_fport *) scm_must_malloc (sizeof (scm_t_fport),
FUNC_NAME); FUNC_NAME);
fp->fdes = fdes; fp->fdes = fdes;
@ -506,8 +506,8 @@ static int
fport_fill_input (SCM port) fport_fill_input (SCM port)
{ {
long count; long count;
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
scm_fport_t *fp = SCM_FSTREAM (port); scm_t_fport *fp = SCM_FSTREAM (port);
#ifdef GUILE_ISELECT #ifdef GUILE_ISELECT
fport_wait_for_input (port); fport_wait_for_input (port);
@ -528,8 +528,8 @@ fport_fill_input (SCM port)
static off_t static off_t
fport_seek (SCM port, off_t offset, int whence) fport_seek (SCM port, off_t offset, int whence)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
scm_fport_t *fp = SCM_FSTREAM (port); scm_t_fport *fp = SCM_FSTREAM (port);
off_t rv; off_t rv;
off_t result; off_t result;
@ -580,7 +580,7 @@ fport_seek (SCM port, off_t offset, int whence)
static void static void
fport_truncate (SCM port, off_t length) fport_truncate (SCM port, off_t length)
{ {
scm_fport_t *fp = SCM_FSTREAM (port); scm_t_fport *fp = SCM_FSTREAM (port);
if (ftruncate (fp->fdes, length) == -1) if (ftruncate (fp->fdes, length) == -1)
scm_syserror ("ftruncate"); scm_syserror ("ftruncate");
@ -611,7 +611,7 @@ static void
fport_write (SCM port, const void *data, size_t size) fport_write (SCM port, const void *data, size_t size)
{ {
/* this procedure tries to minimize the number of writes/flushes. */ /* this procedure tries to minimize the number of writes/flushes. */
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->write_buf == &pt->shortbuf if (pt->write_buf == &pt->shortbuf
|| (pt->write_pos == pt->write_buf && size >= pt->write_buf_size)) || (pt->write_pos == pt->write_buf && size >= pt->write_buf_size))
@ -672,8 +672,8 @@ extern int terminating;
static void static void
fport_flush (SCM port) fport_flush (SCM port)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
scm_fport_t *fp = SCM_FSTREAM (port); scm_t_fport *fp = SCM_FSTREAM (port);
unsigned char *ptr = pt->write_buf; unsigned char *ptr = pt->write_buf;
long init_size = pt->write_pos - pt->write_buf; long init_size = pt->write_pos - pt->write_buf;
long remaining = init_size; long remaining = init_size;
@ -730,8 +730,8 @@ fport_flush (SCM port)
static void static void
fport_end_input (SCM port, int offset) fport_end_input (SCM port, int offset)
{ {
scm_fport_t *fp = SCM_FSTREAM (port); scm_t_fport *fp = SCM_FSTREAM (port);
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
offset += pt->read_end - pt->read_pos; offset += pt->read_end - pt->read_pos;
@ -749,8 +749,8 @@ fport_end_input (SCM port, int offset)
static int static int
fport_close (SCM port) fport_close (SCM port)
{ {
scm_fport_t *fp = SCM_FSTREAM (port); scm_t_fport *fp = SCM_FSTREAM (port);
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
int rv; int rv;
fport_flush (port); fport_flush (port);
@ -781,10 +781,10 @@ fport_free (SCM port)
return 0; return 0;
} }
static scm_bits_t static scm_t_bits
scm_make_fptob () scm_make_fptob ()
{ {
scm_bits_t tc = scm_make_port_type ("file", fport_fill_input, fport_write); scm_t_bits tc = scm_make_port_type ("file", fport_fill_input, fport_write);
scm_set_port_free (tc, fport_free); scm_set_port_free (tc, fport_free);
scm_set_port_print (tc, fport_print); scm_set_port_print (tc, fport_print);

View file

@ -54,17 +54,17 @@
/* struct allocated for each buffered FPORT. */ /* struct allocated for each buffered FPORT. */
typedef struct scm_fport_t { typedef struct scm_t_fport {
int fdes; /* file descriptor. */ int fdes; /* file descriptor. */
} scm_fport_t; } scm_t_fport;
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
# define scm_fport scm_fport_t # define scm_fport scm_t_fport
#endif #endif
extern scm_bits_t scm_tc16_fport; extern scm_t_bits scm_tc16_fport;
#define SCM_FSTREAM(x) ((scm_fport_t *) SCM_STREAM (x)) #define SCM_FSTREAM(x) ((scm_t_fport *) SCM_STREAM (x))
#define SCM_FPORT_FDES(x) (SCM_FSTREAM (x)->fdes) #define SCM_FPORT_FDES(x) (SCM_FSTREAM (x)->fdes)
#define SCM_FPORTP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_fport)) #define SCM_FPORTP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_fport))

View file

@ -102,7 +102,7 @@ unsigned int scm_gc_running_p = 0;
#if (SCM_DEBUG_CELL_ACCESSES == 1) #if (SCM_DEBUG_CELL_ACCESSES == 1)
scm_bits_t scm_tc16_allocated; scm_t_bits scm_tc16_allocated;
/* Set this to != 0 if every cell that is accessed shall be checked: /* Set this to != 0 if every cell that is accessed shall be checked:
*/ */
@ -311,7 +311,7 @@ size_t scm_default_max_segment_size = 2097000L;/* a little less (adm) than 2 Mb
/* scm_freelists /* scm_freelists
*/ */
typedef struct scm_freelist_t { typedef struct scm_t_freelist {
/* collected cells */ /* collected cells */
SCM cells; SCM cells;
/* number of cells left to collect before cluster is full */ /* number of cells left to collect before cluster is full */
@ -344,14 +344,14 @@ typedef struct scm_freelist_t {
* belonging to this list. * belonging to this list.
*/ */
unsigned long heap_size; unsigned long heap_size;
} scm_freelist_t; } scm_t_freelist;
SCM scm_freelist = SCM_EOL; SCM scm_freelist = SCM_EOL;
scm_freelist_t scm_master_freelist = { scm_t_freelist scm_master_freelist = {
SCM_EOL, 0, 0, SCM_EOL, 0, SCM_CLUSTER_SIZE_1, 0, 0, 0, 1, 0, 0, 0 SCM_EOL, 0, 0, SCM_EOL, 0, SCM_CLUSTER_SIZE_1, 0, 0, 0, 1, 0, 0, 0
}; };
SCM scm_freelist2 = SCM_EOL; SCM scm_freelist2 = SCM_EOL;
scm_freelist_t scm_master_freelist2 = { scm_t_freelist scm_master_freelist2 = {
SCM_EOL, 0, 0, SCM_EOL, 0, SCM_CLUSTER_SIZE_2, 0, 0, 0, 2, 0, 0, 0 SCM_EOL, 0, 0, SCM_EOL, 0, SCM_CLUSTER_SIZE_2, 0, 0, 0, 2, 0, 0, 0
}; };
@ -412,25 +412,25 @@ SCM_SYMBOL (sym_times, "gc-times");
SCM_SYMBOL (sym_cells_marked, "cells-marked"); SCM_SYMBOL (sym_cells_marked, "cells-marked");
SCM_SYMBOL (sym_cells_swept, "cells-swept"); SCM_SYMBOL (sym_cells_swept, "cells-swept");
typedef struct scm_heap_seg_data_t typedef struct scm_t_heap_seg_data
{ {
/* lower and upper bounds of the segment */ /* lower and upper bounds of the segment */
SCM_CELLPTR bounds[2]; SCM_CELLPTR bounds[2];
/* address of the head-of-freelist pointer for this segment's cells. /* address of the head-of-freelist pointer for this segment's cells.
All segments usually point to the same one, scm_freelist. */ All segments usually point to the same one, scm_freelist. */
scm_freelist_t *freelist; scm_t_freelist *freelist;
/* number of cells per object in this segment */ /* number of cells per object in this segment */
int span; int span;
} scm_heap_seg_data_t; } scm_t_heap_seg_data;
static size_t init_heap_seg (SCM_CELLPTR, size_t, scm_freelist_t *); static size_t init_heap_seg (SCM_CELLPTR, size_t, scm_t_freelist *);
typedef enum { return_on_error, abort_on_error } policy_on_error; typedef enum { return_on_error, abort_on_error } policy_on_error;
static void alloc_some_heap (scm_freelist_t *, policy_on_error); static void alloc_some_heap (scm_t_freelist *, policy_on_error);
#define SCM_HEAP_SIZE \ #define SCM_HEAP_SIZE \
@ -439,30 +439,30 @@ static void alloc_some_heap (scm_freelist_t *, policy_on_error);
#define BVEC_GROW_SIZE 256 #define BVEC_GROW_SIZE 256
#define BVEC_GROW_SIZE_IN_LIMBS (SCM_GC_CARD_BVEC_SIZE_IN_LIMBS * BVEC_GROW_SIZE) #define BVEC_GROW_SIZE_IN_LIMBS (SCM_GC_CARD_BVEC_SIZE_IN_LIMBS * BVEC_GROW_SIZE)
#define BVEC_GROW_SIZE_IN_BYTES (BVEC_GROW_SIZE_IN_LIMBS * sizeof (scm_c_bvec_limb_t)) #define BVEC_GROW_SIZE_IN_BYTES (BVEC_GROW_SIZE_IN_LIMBS * sizeof (scm_t_c_bvec_limb))
/* mark space allocation */ /* mark space allocation */
typedef struct scm_mark_space_t typedef struct scm_t_mark_space
{ {
scm_c_bvec_limb_t *bvec_space; scm_t_c_bvec_limb *bvec_space;
struct scm_mark_space_t *next; struct scm_t_mark_space *next;
} scm_mark_space_t; } scm_t_mark_space;
static scm_mark_space_t *current_mark_space; static scm_t_mark_space *current_mark_space;
static scm_mark_space_t **mark_space_ptr; static scm_t_mark_space **mark_space_ptr;
static ptrdiff_t current_mark_space_offset; static ptrdiff_t current_mark_space_offset;
static scm_mark_space_t *mark_space_head; static scm_t_mark_space *mark_space_head;
static scm_c_bvec_limb_t * static scm_t_c_bvec_limb *
get_bvec () get_bvec ()
#define FUNC_NAME "get_bvec" #define FUNC_NAME "get_bvec"
{ {
scm_c_bvec_limb_t *res; scm_t_c_bvec_limb *res;
if (!current_mark_space) if (!current_mark_space)
{ {
SCM_SYSCALL (current_mark_space = (scm_mark_space_t *) malloc (sizeof (scm_mark_space_t))); SCM_SYSCALL (current_mark_space = (scm_t_mark_space *) malloc (sizeof (scm_t_mark_space)));
if (!current_mark_space) if (!current_mark_space)
SCM_MISC_ERROR ("could not grow heap", SCM_EOL); SCM_MISC_ERROR ("could not grow heap", SCM_EOL);
@ -478,7 +478,7 @@ get_bvec ()
if (!(current_mark_space->bvec_space)) if (!(current_mark_space->bvec_space))
{ {
SCM_SYSCALL (current_mark_space->bvec_space = SCM_SYSCALL (current_mark_space->bvec_space =
(scm_c_bvec_limb_t *) calloc (BVEC_GROW_SIZE_IN_BYTES, 1)); (scm_t_c_bvec_limb *) calloc (BVEC_GROW_SIZE_IN_BYTES, 1));
if (!(current_mark_space->bvec_space)) if (!(current_mark_space->bvec_space))
SCM_MISC_ERROR ("could not grow heap", SCM_EOL); SCM_MISC_ERROR ("could not grow heap", SCM_EOL);
@ -505,7 +505,7 @@ get_bvec ()
static void static void
clear_mark_space () clear_mark_space ()
{ {
scm_mark_space_t *ms; scm_t_mark_space *ms;
for (ms = mark_space_head; ms; ms = ms->next) for (ms = mark_space_head; ms; ms = ms->next)
memset (ms->bvec_space, 0, BVEC_GROW_SIZE_IN_BYTES); memset (ms->bvec_space, 0, BVEC_GROW_SIZE_IN_BYTES);
@ -534,7 +534,7 @@ which_seg (SCM cell)
static void static void
map_free_list (scm_freelist_t *master, SCM freelist) map_free_list (scm_t_freelist *master, SCM freelist)
{ {
long last_seg = -1, count = 0; long last_seg = -1, count = 0;
SCM f; SCM f;
@ -619,7 +619,7 @@ free_list_length (char *title, long i, SCM freelist)
} }
static void static void
free_list_lengths (char *title, scm_freelist_t *master, SCM freelist) free_list_lengths (char *title, scm_t_freelist *master, SCM freelist)
{ {
SCM clusters; SCM clusters;
long i = 0, len, n = 0; long i = 0, len, n = 0;
@ -759,7 +759,7 @@ scm_debug_newcell2 (void)
static unsigned long static unsigned long
master_cells_allocated (scm_freelist_t *master) master_cells_allocated (scm_t_freelist *master)
{ {
/* the '- 1' below is to ignore the cluster spine cells. */ /* the '- 1' below is to ignore the cluster spine cells. */
long objects = master->clusters_allocated * (master->cluster_size - 1); long objects = master->clusters_allocated * (master->cluster_size - 1);
@ -917,7 +917,7 @@ SCM_DEFINE (scm_gc, "gc", 0, 0, 0,
*/ */
static void static void
adjust_min_yield (scm_freelist_t *freelist) adjust_min_yield (scm_t_freelist *freelist)
{ {
/* min yield is adjusted upwards so that next predicted total yield /* min yield is adjusted upwards so that next predicted total yield
* (allocated cells actually freed by GC) becomes * (allocated cells actually freed by GC) becomes
@ -954,7 +954,7 @@ adjust_min_yield (scm_freelist_t *freelist)
*/ */
SCM SCM
scm_gc_for_newcell (scm_freelist_t *master, SCM *freelist) scm_gc_for_newcell (scm_t_freelist *master, SCM *freelist)
{ {
SCM cell; SCM cell;
++scm_ints_disabled; ++scm_ints_disabled;
@ -1018,7 +1018,7 @@ scm_gc_for_newcell (scm_freelist_t *master, SCM *freelist)
*/ */
void void
scm_alloc_cluster (scm_freelist_t *master) scm_alloc_cluster (scm_t_freelist *master)
{ {
SCM freelist, cell; SCM freelist, cell;
cell = scm_gc_for_newcell (master, &freelist); cell = scm_gc_for_newcell (master, &freelist);
@ -1028,11 +1028,11 @@ scm_alloc_cluster (scm_freelist_t *master)
#endif #endif
scm_c_hook_t scm_before_gc_c_hook; scm_t_c_hook scm_before_gc_c_hook;
scm_c_hook_t scm_before_mark_c_hook; scm_t_c_hook scm_before_mark_c_hook;
scm_c_hook_t scm_before_sweep_c_hook; scm_t_c_hook scm_before_sweep_c_hook;
scm_c_hook_t scm_after_sweep_c_hook; scm_t_c_hook scm_after_sweep_c_hook;
scm_c_hook_t scm_after_gc_c_hook; scm_t_c_hook scm_after_gc_c_hook;
void void
@ -1174,7 +1174,7 @@ MARK (SCM p)
{ {
register long i; register long i;
register SCM ptr; register SCM ptr;
scm_bits_t cell_type; scm_t_bits cell_type;
#ifndef MARK_DEPENDENCIES #ifndef MARK_DEPENDENCIES
# define RECURSE scm_gc_mark # define RECURSE scm_gc_mark
@ -1267,8 +1267,8 @@ gc_mark_loop_first_time:
* gloc, this location has the CDR of the variable smob, which * gloc, this location has the CDR of the variable smob, which
* is guaranteed to be non-zero. * is guaranteed to be non-zero.
*/ */
scm_bits_t word0 = SCM_CELL_WORD_0 (ptr) - scm_tc3_cons_gloc; scm_t_bits word0 = SCM_CELL_WORD_0 (ptr) - scm_tc3_cons_gloc;
scm_bits_t * vtable_data = (scm_bits_t *) word0; /* access as struct */ scm_t_bits * vtable_data = (scm_t_bits *) word0; /* access as struct */
if (vtable_data [scm_vtable_index_vcell] != 0) if (vtable_data [scm_vtable_index_vcell] != 0)
{ {
/* ptr is a gloc */ /* ptr is a gloc */
@ -1283,7 +1283,7 @@ gc_mark_loop_first_time:
SCM layout = SCM_PACK (vtable_data [scm_vtable_index_layout]); SCM layout = SCM_PACK (vtable_data [scm_vtable_index_layout]);
long len = SCM_SYMBOL_LENGTH (layout); long len = SCM_SYMBOL_LENGTH (layout);
char * fields_desc = SCM_SYMBOL_CHARS (layout); char * fields_desc = SCM_SYMBOL_CHARS (layout);
scm_bits_t * struct_data = (scm_bits_t *) SCM_STRUCT_DATA (ptr); scm_t_bits * struct_data = (scm_t_bits *) SCM_STRUCT_DATA (ptr);
if (vtable_data[scm_struct_i_flags] & SCM_STRUCTF_ENTITY) if (vtable_data[scm_struct_i_flags] & SCM_STRUCTF_ENTITY)
{ {
@ -1600,7 +1600,7 @@ scm_cellp (SCM value)
static void static void
gc_sweep_freelist_start (scm_freelist_t *freelist) gc_sweep_freelist_start (scm_t_freelist *freelist)
{ {
freelist->cells = SCM_EOL; freelist->cells = SCM_EOL;
freelist->left_to_collect = freelist->cluster_size; freelist->left_to_collect = freelist->cluster_size;
@ -1612,7 +1612,7 @@ gc_sweep_freelist_start (scm_freelist_t *freelist)
} }
static void static void
gc_sweep_freelist_finish (scm_freelist_t *freelist) gc_sweep_freelist_finish (scm_t_freelist *freelist)
{ {
long collected; long collected;
*freelist->clustertail = freelist->cells; *freelist->clustertail = freelist->cells;
@ -1651,7 +1651,7 @@ scm_gc_sweep ()
{ {
register SCM_CELLPTR ptr; register SCM_CELLPTR ptr;
register SCM nfreelist; register SCM nfreelist;
register scm_freelist_t *freelist; register scm_t_freelist *freelist;
register unsigned long m; register unsigned long m;
register int span; register int span;
long i; long i;
@ -1716,10 +1716,10 @@ scm_gc_sweep ()
* struct or a gloc. See the corresponding comment in * struct or a gloc. See the corresponding comment in
* scm_gc_mark. * scm_gc_mark.
*/ */
scm_bits_t word0 = (SCM_CELL_WORD_0 (scmptr) scm_t_bits word0 = (SCM_CELL_WORD_0 (scmptr)
- scm_tc3_cons_gloc); - scm_tc3_cons_gloc);
/* access as struct */ /* access as struct */
scm_bits_t * vtable_data = (scm_bits_t *) word0; scm_t_bits * vtable_data = (scm_t_bits *) word0;
if (vtable_data[scm_vtable_index_vcell] == 0) if (vtable_data[scm_vtable_index_vcell] == 0)
{ {
/* Structs need to be freed in a special order. /* Structs need to be freed in a special order.
@ -1746,7 +1746,7 @@ scm_gc_sweep ()
unsigned long int length = SCM_VECTOR_LENGTH (scmptr); unsigned long int length = SCM_VECTOR_LENGTH (scmptr);
if (length > 0) if (length > 0)
{ {
m += length * sizeof (scm_bits_t); m += length * sizeof (scm_t_bits);
scm_must_free (SCM_VECTOR_BASE (scmptr)); scm_must_free (SCM_VECTOR_BASE (scmptr));
} }
break; break;
@ -1829,7 +1829,7 @@ scm_gc_sweep ()
break; break;
#endif /* def SCM_BIGDIG */ #endif /* def SCM_BIGDIG */
case scm_tc16_complex: case scm_tc16_complex:
m += sizeof (scm_complex_t); m += sizeof (scm_t_complex);
scm_must_free (SCM_COMPLEX_MEM (scmptr)); scm_must_free (SCM_COMPLEX_MEM (scmptr));
break; break;
default: default:
@ -2195,7 +2195,7 @@ size_t scm_max_segment_size;
*/ */
SCM_CELLPTR scm_heap_org; SCM_CELLPTR scm_heap_org;
scm_heap_seg_data_t * scm_heap_table = 0; scm_t_heap_seg_data * scm_heap_table = 0;
static size_t heap_segment_table_size = 0; static size_t heap_segment_table_size = 0;
size_t scm_n_heap_segs = 0; size_t scm_n_heap_segs = 0;
@ -2218,7 +2218,7 @@ size_t scm_n_heap_segs = 0;
} while (0) } while (0)
static size_t static size_t
init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_freelist_t *freelist) init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist)
{ {
register SCM_CELLPTR ptr; register SCM_CELLPTR ptr;
SCM_CELLPTR seg_end; SCM_CELLPTR seg_end;
@ -2332,7 +2332,7 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_freelist_t *freelist)
} }
static size_t static size_t
round_to_cluster_size (scm_freelist_t *freelist, size_t len) round_to_cluster_size (scm_t_freelist *freelist, size_t len)
{ {
size_t cluster_size_in_bytes = CLUSTER_SIZE_IN_BYTES (freelist); size_t cluster_size_in_bytes = CLUSTER_SIZE_IN_BYTES (freelist);
@ -2342,7 +2342,7 @@ round_to_cluster_size (scm_freelist_t *freelist, size_t len)
} }
static void static void
alloc_some_heap (scm_freelist_t *freelist, policy_on_error error_policy) alloc_some_heap (scm_t_freelist *freelist, policy_on_error error_policy)
#define FUNC_NAME "alloc_some_heap" #define FUNC_NAME "alloc_some_heap"
{ {
SCM_CELLPTR ptr; SCM_CELLPTR ptr;
@ -2364,10 +2364,10 @@ alloc_some_heap (scm_freelist_t *freelist, policy_on_error error_policy)
* init_heap_seg only if the allocation of the segment itself succeeds. * init_heap_seg only if the allocation of the segment itself succeeds.
*/ */
size_t new_table_size = scm_n_heap_segs + 1; size_t new_table_size = scm_n_heap_segs + 1;
size_t size = new_table_size * sizeof (scm_heap_seg_data_t); size_t size = new_table_size * sizeof (scm_t_heap_seg_data);
scm_heap_seg_data_t *new_heap_table; scm_t_heap_seg_data *new_heap_table;
SCM_SYSCALL (new_heap_table = ((scm_heap_seg_data_t *) SCM_SYSCALL (new_heap_table = ((scm_t_heap_seg_data *)
realloc ((char *)scm_heap_table, size))); realloc ((char *)scm_heap_table, size)));
if (!new_heap_table) if (!new_heap_table)
{ {
@ -2707,7 +2707,7 @@ cleanup (int status, void *arg)
static int static int
make_initial_segment (size_t init_heap_size, scm_freelist_t *freelist) make_initial_segment (size_t init_heap_size, scm_t_freelist *freelist)
{ {
size_t rounded_size = round_to_cluster_size (freelist, init_heap_size); size_t rounded_size = round_to_cluster_size (freelist, init_heap_size);
@ -2734,7 +2734,7 @@ make_initial_segment (size_t init_heap_size, scm_freelist_t *freelist)
static void static void
init_freelist (scm_freelist_t *freelist, init_freelist (scm_t_freelist *freelist,
int span, int span,
long cluster_size, long cluster_size,
int min_yield) int min_yield)
@ -2797,8 +2797,8 @@ scm_init_storage ()
j = SCM_HEAP_SEG_SIZE; j = SCM_HEAP_SEG_SIZE;
scm_mtrigger = SCM_INIT_MALLOC_LIMIT; scm_mtrigger = SCM_INIT_MALLOC_LIMIT;
scm_heap_table = ((scm_heap_seg_data_t *) scm_heap_table = ((scm_t_heap_seg_data *)
scm_must_malloc (sizeof (scm_heap_seg_data_t) * 2, "hplims")); scm_must_malloc (sizeof (scm_t_heap_seg_data) * 2, "hplims"));
heap_segment_table_size = 2; heap_segment_table_size = 2;
mark_space_ptr = &mark_space_head; mark_space_ptr = &mark_space_head;
@ -2819,9 +2819,9 @@ scm_init_storage ()
scm_c_hook_init (&scm_after_gc_c_hook, 0, SCM_C_HOOK_NORMAL); scm_c_hook_init (&scm_after_gc_c_hook, 0, SCM_C_HOOK_NORMAL);
/* Initialise the list of ports. */ /* Initialise the list of ports. */
scm_port_table = (scm_port_t **) scm_t_portable = (scm_t_port **)
malloc (sizeof (scm_port_t *) * scm_port_table_room); malloc (sizeof (scm_t_port *) * scm_t_portable_room);
if (!scm_port_table) if (!scm_t_portable)
return 1; return 1;
#ifdef HAVE_ATEXIT #ifdef HAVE_ATEXIT

View file

@ -55,8 +55,8 @@
typedef struct scm_cell typedef struct scm_cell
{ {
scm_bits_t word_0; scm_t_bits word_0;
scm_bits_t word_1; scm_t_bits word_1;
} scm_cell; } scm_cell;
@ -75,10 +75,10 @@ typedef scm_cell * SCM_CELLPTR;
*/ */
#ifdef _UNICOS #ifdef _UNICOS
# define SCM2PTR(x) ((SCM_CELLPTR) (SCM_UNPACK (x) >> 3)) # define SCM2PTR(x) ((SCM_CELLPTR) (SCM_UNPACK (x) >> 3))
# define PTR2SCM(x) (SCM_PACK (((scm_bits_t) (x)) << 3)) # define PTR2SCM(x) (SCM_PACK (((scm_t_bits) (x)) << 3))
#else #else
# define SCM2PTR(x) ((SCM_CELLPTR) (SCM_UNPACK (x))) # define SCM2PTR(x) ((SCM_CELLPTR) (SCM_UNPACK (x)))
# define PTR2SCM(x) (SCM_PACK ((scm_bits_t) (x))) # define PTR2SCM(x) (SCM_PACK ((scm_t_bits) (x)))
#endif /* def _UNICOS */ #endif /* def _UNICOS */
#define SCM_GC_CARD_N_HEADER_CELLS 1 #define SCM_GC_CARD_N_HEADER_CELLS 1
@ -93,13 +93,13 @@ typedef scm_cell * SCM_CELLPTR;
#define SCM_GC_IN_CARD_HEADERP(x) \ #define SCM_GC_IN_CARD_HEADERP(x) \
SCM_PTR_LT ((scm_cell *) (x), SCM_GC_CELL_CARD (x) + SCM_GC_CARD_N_HEADER_CELLS) SCM_PTR_LT ((scm_cell *) (x), SCM_GC_CELL_CARD (x) + SCM_GC_CARD_N_HEADER_CELLS)
#define SCM_GC_CARD_BVEC(card) ((scm_c_bvec_limb_t *) ((card)->word_0)) #define SCM_GC_CARD_BVEC(card) ((scm_t_c_bvec_limb *) ((card)->word_0))
#define SCM_GC_SET_CARD_BVEC(card, bvec) \ #define SCM_GC_SET_CARD_BVEC(card, bvec) \
((card)->word_0 = (scm_bits_t) (bvec)) ((card)->word_0 = (scm_t_bits) (bvec))
#define SCM_GC_GET_CARD_FLAGS(card) ((long) ((card)->word_1)) #define SCM_GC_GET_CARD_FLAGS(card) ((long) ((card)->word_1))
#define SCM_GC_SET_CARD_FLAGS(card, flags) \ #define SCM_GC_SET_CARD_FLAGS(card, flags) \
((card)->word_1 = (scm_bits_t) (flags)) ((card)->word_1 = (scm_t_bits) (flags))
#define SCM_GC_CLR_CARD_FLAGS(card) (SCM_GC_SET_CARD_FLAGS (card, 0L)) #define SCM_GC_CLR_CARD_FLAGS(card) (SCM_GC_SET_CARD_FLAGS (card, 0L))
#define SCM_GC_GET_CARD_FLAG(card, shift) (SCM_GC_GET_CARD_FLAGS (card) & (1L << (shift))) #define SCM_GC_GET_CARD_FLAG(card, shift) (SCM_GC_GET_CARD_FLAGS (card) & (1L << (shift)))
@ -132,7 +132,7 @@ typedef scm_cell * SCM_CELLPTR;
/* low level bit banging aids */ /* low level bit banging aids */
typedef unsigned long scm_c_bvec_limb_t; typedef unsigned long scm_t_c_bvec_limb;
#if (SIZEOF_LONG == 8) #if (SIZEOF_LONG == 8)
# define SCM_C_BVEC_LIMB_BITS 64 # define SCM_C_BVEC_LIMB_BITS 64
@ -153,7 +153,7 @@ typedef unsigned long scm_c_bvec_limb_t;
#define SCM_C_BVEC_CLR(bvec, pos) (bvec[SCM_C_BVEC_OFFSET (pos)] &= ~(1L << (pos & SCM_C_BVEC_POS_MASK))) #define SCM_C_BVEC_CLR(bvec, pos) (bvec[SCM_C_BVEC_OFFSET (pos)] &= ~(1L << (pos & SCM_C_BVEC_POS_MASK)))
#define SCM_C_BVEC_BITS2BYTES(bits) \ #define SCM_C_BVEC_BITS2BYTES(bits) \
(sizeof (scm_c_bvec_limb_t) * ((((bits) & SCM_C_BVEC_POS_MASK) ? 1L : 0L) + SCM_C_BVEC_OFFSET (bits))) (sizeof (scm_t_c_bvec_limb) * ((((bits) & SCM_C_BVEC_POS_MASK) ? 1L : 0L) + SCM_C_BVEC_OFFSET (bits)))
#define SCM_C_BVEC_SET_BYTES(bvec, bytes) (memset (bvec, 0xff, bytes)) #define SCM_C_BVEC_SET_BYTES(bvec, bytes) (memset (bvec, 0xff, bytes))
#define SCM_C_BVEC_SET_ALL_BITS(bvec, bits) SCM_C_BVEC_SET_BYTES (bvec, SCM_C_BVEC_BITS2BYTES (bits)) #define SCM_C_BVEC_SET_ALL_BITS(bvec, bits) SCM_C_BVEC_SET_BYTES (bvec, SCM_C_BVEC_BITS2BYTES (bits))
@ -177,28 +177,28 @@ typedef unsigned long scm_c_bvec_limb_t;
#endif #endif
#define SCM_CELL_WORD(x, n) \ #define SCM_CELL_WORD(x, n) \
SCM_VALIDATE_CELL ((x), ((const scm_bits_t *) SCM2PTR (x)) [n]) SCM_VALIDATE_CELL ((x), ((const scm_t_bits *) SCM2PTR (x)) [n])
#define SCM_CELL_WORD_0(x) SCM_CELL_WORD (x, 0) #define SCM_CELL_WORD_0(x) SCM_CELL_WORD (x, 0)
#define SCM_CELL_WORD_1(x) SCM_CELL_WORD (x, 1) #define SCM_CELL_WORD_1(x) SCM_CELL_WORD (x, 1)
#define SCM_CELL_WORD_2(x) SCM_CELL_WORD (x, 2) #define SCM_CELL_WORD_2(x) SCM_CELL_WORD (x, 2)
#define SCM_CELL_WORD_3(x) SCM_CELL_WORD (x, 3) #define SCM_CELL_WORD_3(x) SCM_CELL_WORD (x, 3)
#define SCM_CELL_OBJECT(x, n) \ #define SCM_CELL_OBJECT(x, n) \
SCM_VALIDATE_CELL ((x), SCM_PACK (((const scm_bits_t *) SCM2PTR (x)) [n])) SCM_VALIDATE_CELL ((x), SCM_PACK (((const scm_t_bits *) SCM2PTR (x)) [n]))
#define SCM_CELL_OBJECT_0(x) SCM_CELL_OBJECT (x, 0) #define SCM_CELL_OBJECT_0(x) SCM_CELL_OBJECT (x, 0)
#define SCM_CELL_OBJECT_1(x) SCM_CELL_OBJECT (x, 1) #define SCM_CELL_OBJECT_1(x) SCM_CELL_OBJECT (x, 1)
#define SCM_CELL_OBJECT_2(x) SCM_CELL_OBJECT (x, 2) #define SCM_CELL_OBJECT_2(x) SCM_CELL_OBJECT (x, 2)
#define SCM_CELL_OBJECT_3(x) SCM_CELL_OBJECT (x, 3) #define SCM_CELL_OBJECT_3(x) SCM_CELL_OBJECT (x, 3)
#define SCM_SET_CELL_WORD(x, n, v) \ #define SCM_SET_CELL_WORD(x, n, v) \
SCM_VALIDATE_CELL ((x), ((scm_bits_t *) SCM2PTR (x)) [n] = (scm_bits_t) (v)) SCM_VALIDATE_CELL ((x), ((scm_t_bits *) SCM2PTR (x)) [n] = (scm_t_bits) (v))
#define SCM_SET_CELL_WORD_0(x, v) SCM_SET_CELL_WORD (x, 0, v) #define SCM_SET_CELL_WORD_0(x, v) SCM_SET_CELL_WORD (x, 0, v)
#define SCM_SET_CELL_WORD_1(x, v) SCM_SET_CELL_WORD (x, 1, v) #define SCM_SET_CELL_WORD_1(x, v) SCM_SET_CELL_WORD (x, 1, v)
#define SCM_SET_CELL_WORD_2(x, v) SCM_SET_CELL_WORD (x, 2, v) #define SCM_SET_CELL_WORD_2(x, v) SCM_SET_CELL_WORD (x, 2, v)
#define SCM_SET_CELL_WORD_3(x, v) SCM_SET_CELL_WORD (x, 3, v) #define SCM_SET_CELL_WORD_3(x, v) SCM_SET_CELL_WORD (x, 3, v)
#define SCM_SET_CELL_OBJECT(x, n, v) \ #define SCM_SET_CELL_OBJECT(x, n, v) \
SCM_VALIDATE_CELL ((x), ((scm_bits_t *) SCM2PTR (x)) [n] = SCM_UNPACK (v)) SCM_VALIDATE_CELL ((x), ((scm_t_bits *) SCM2PTR (x)) [n] = SCM_UNPACK (v))
#define SCM_SET_CELL_OBJECT_0(x, v) SCM_SET_CELL_OBJECT (x, 0, v) #define SCM_SET_CELL_OBJECT_0(x, v) SCM_SET_CELL_OBJECT (x, 0, v)
#define SCM_SET_CELL_OBJECT_1(x, v) SCM_SET_CELL_OBJECT (x, 1, v) #define SCM_SET_CELL_OBJECT_1(x, v) SCM_SET_CELL_OBJECT (x, 1, v)
#define SCM_SET_CELL_OBJECT_2(x, v) SCM_SET_CELL_OBJECT (x, 2, v) #define SCM_SET_CELL_OBJECT_2(x, v) SCM_SET_CELL_OBJECT (x, 2, v)
@ -215,10 +215,10 @@ typedef unsigned long scm_c_bvec_limb_t;
* result in errors when in debug mode. */ * result in errors when in debug mode. */
#define SCM_GC_CELL_TYPE(x) \ #define SCM_GC_CELL_TYPE(x) \
(((const scm_bits_t *) SCM2PTR (x)) [0]) (((const scm_t_bits *) SCM2PTR (x)) [0])
#define SCM_CELL_WORD_LOC(x, n) ((scm_bits_t *) & SCM_CELL_WORD (x, n)) #define SCM_CELL_WORD_LOC(x, n) ((scm_t_bits *) & SCM_CELL_WORD (x, n))
#define SCM_CARLOC(x) ((SCM *) SCM_CELL_WORD_LOC ((x), 0)) #define SCM_CARLOC(x) ((SCM *) SCM_CELL_WORD_LOC ((x), 0))
#define SCM_CDRLOC(x) ((SCM *) SCM_CELL_WORD_LOC ((x), 1)) #define SCM_CDRLOC(x) ((SCM *) SCM_CELL_WORD_LOC ((x), 1))
@ -239,16 +239,16 @@ typedef unsigned long scm_c_bvec_limb_t;
*/ */
#define SCM_FREE_CELL_P(x) \ #define SCM_FREE_CELL_P(x) \
(!SCM_IMP (x) && (* (const scm_bits_t *) SCM2PTR (x) == scm_tc_free_cell)) (!SCM_IMP (x) && (* (const scm_t_bits *) SCM2PTR (x) == scm_tc_free_cell))
#define SCM_FREE_CELL_CDR(x) \ #define SCM_FREE_CELL_CDR(x) \
(SCM_PACK (((const scm_bits_t *) SCM2PTR (x)) [1])) (SCM_PACK (((const scm_t_bits *) SCM2PTR (x)) [1]))
#define SCM_SET_FREE_CELL_CDR(x, v) \ #define SCM_SET_FREE_CELL_CDR(x, v) \
(((scm_bits_t *) SCM2PTR (x)) [1] = SCM_UNPACK (v)) (((scm_t_bits *) SCM2PTR (x)) [1] = SCM_UNPACK (v))
#if (SCM_DEBUG_CELL_ACCESSES == 1) #if (SCM_DEBUG_CELL_ACCESSES == 1)
# define SCM_GC_SET_ALLOCATED(x) \ # define SCM_GC_SET_ALLOCATED(x) \
(((scm_bits_t *) SCM2PTR (x)) [0] = scm_tc16_allocated) (((scm_t_bits *) SCM2PTR (x)) [0] = scm_tc16_allocated)
#else #else
# define SCM_GC_SET_ALLOCATED(x) # define SCM_GC_SET_ALLOCATED(x)
#endif #endif
@ -296,11 +296,11 @@ typedef unsigned long scm_c_bvec_limb_t;
#define SCM_NMARKEDP(x) (!SCM_MARKEDP (x)) #define SCM_NMARKEDP(x) (!SCM_MARKEDP (x))
#if (SCM_DEBUG_CELL_ACCESSES == 1) #if (SCM_DEBUG_CELL_ACCESSES == 1)
extern scm_bits_t scm_tc16_allocated; extern scm_t_bits scm_tc16_allocated;
extern unsigned int scm_debug_cell_accesses_p; extern unsigned int scm_debug_cell_accesses_p;
#endif #endif
extern struct scm_heap_seg_data_t *scm_heap_table; extern struct scm_t_heap_seg_data *scm_heap_table;
extern size_t scm_n_heap_segs; extern size_t scm_n_heap_segs;
extern int scm_block_gc; extern int scm_block_gc;
extern int scm_gc_heap_lock; extern int scm_gc_heap_lock;
@ -316,9 +316,9 @@ extern size_t scm_default_max_segment_size;
extern size_t scm_max_segment_size; extern size_t scm_max_segment_size;
extern SCM_CELLPTR scm_heap_org; extern SCM_CELLPTR scm_heap_org;
extern SCM scm_freelist; extern SCM scm_freelist;
extern struct scm_freelist_t scm_master_freelist; extern struct scm_t_freelist scm_master_freelist;
extern SCM scm_freelist2; extern SCM scm_freelist2;
extern struct scm_freelist_t scm_master_freelist2; extern struct scm_t_freelist scm_master_freelist2;
extern unsigned long scm_gc_cells_collected; extern unsigned long scm_gc_cells_collected;
extern unsigned long scm_gc_yield; extern unsigned long scm_gc_yield;
extern unsigned long scm_gc_malloc_collected; extern unsigned long scm_gc_malloc_collected;
@ -329,11 +329,11 @@ extern unsigned long scm_mtrigger;
extern SCM scm_after_gc_hook; extern SCM scm_after_gc_hook;
extern scm_c_hook_t scm_before_gc_c_hook; extern scm_t_c_hook scm_before_gc_c_hook;
extern scm_c_hook_t scm_before_mark_c_hook; extern scm_t_c_hook scm_before_mark_c_hook;
extern scm_c_hook_t scm_before_sweep_c_hook; extern scm_t_c_hook scm_before_sweep_c_hook;
extern scm_c_hook_t scm_after_sweep_c_hook; extern scm_t_c_hook scm_after_sweep_c_hook;
extern scm_c_hook_t scm_after_gc_c_hook; extern scm_t_c_hook scm_after_gc_c_hook;
#if defined (GUILE_DEBUG) || defined (GUILE_DEBUG_FREELIST) #if defined (GUILE_DEBUG) || defined (GUILE_DEBUG_FREELIST)
extern SCM scm_map_free_list (void); extern SCM scm_map_free_list (void);
@ -355,10 +355,10 @@ extern SCM scm_object_address (SCM obj);
extern SCM scm_unhash_name (SCM name); extern SCM scm_unhash_name (SCM name);
extern SCM scm_gc_stats (void); extern SCM scm_gc_stats (void);
extern SCM scm_gc (void); extern SCM scm_gc (void);
extern void scm_gc_for_alloc (struct scm_freelist_t *freelist); extern void scm_gc_for_alloc (struct scm_t_freelist *freelist);
extern SCM scm_gc_for_newcell (struct scm_freelist_t *master, SCM *freelist); extern SCM scm_gc_for_newcell (struct scm_t_freelist *master, SCM *freelist);
#if 0 #if 0
extern void scm_alloc_cluster (struct scm_freelist_t *master); extern void scm_alloc_cluster (struct scm_t_freelist *master);
#endif #endif
extern void scm_igc (const char *what); extern void scm_igc (const char *what);
extern void scm_gc_mark (SCM p); extern void scm_gc_mark (SCM p);

View file

@ -277,7 +277,7 @@ gdb_print (SCM obj)
scm_write (obj, gdb_output_port); scm_write (obj, gdb_output_port);
scm_truncate_file (gdb_output_port, SCM_UNDEFINED); scm_truncate_file (gdb_output_port, SCM_UNDEFINED);
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (gdb_output_port); scm_t_port *pt = SCM_PTAB_ENTRY (gdb_output_port);
scm_flush (gdb_output_port); scm_flush (gdb_output_port);
*(pt->write_buf + pt->read_buf_size) = 0; *(pt->write_buf + pt->read_buf_size) = 0;

View file

@ -61,19 +61,19 @@ extern "C" {
void gh_enter(int argc, char *argv[], void (*c_main_prog)(int, char **)); void gh_enter(int argc, char *argv[], void (*c_main_prog)(int, char **));
#define gh_init () scm_init_guile () #define gh_init () scm_init_guile ()
void gh_repl(int argc, char *argv[]); void gh_repl(int argc, char *argv[]);
SCM gh_catch(SCM tag, scm_catch_body_t body, void *body_data, SCM gh_catch(SCM tag, scm_t_catch_body body, void *body_data,
scm_catch_handler_t handler, void *handler_data); scm_t_catch_handler handler, void *handler_data);
SCM gh_standard_handler(void *data, SCM tag, SCM throw_args); SCM gh_standard_handler(void *data, SCM tag, SCM throw_args);
SCM gh_eval_str(const char *scheme_code); SCM gh_eval_str(const char *scheme_code);
SCM gh_eval_str_with_catch(const char *scheme_code, scm_catch_handler_t handler); SCM gh_eval_str_with_catch(const char *scheme_code, scm_t_catch_handler handler);
SCM gh_eval_str_with_standard_handler(const char *scheme_code); SCM gh_eval_str_with_standard_handler(const char *scheme_code);
SCM gh_eval_str_with_stack_saving_handler(const char *scheme_code); SCM gh_eval_str_with_stack_saving_handler(const char *scheme_code);
SCM gh_eval_file(const char *fname); SCM gh_eval_file(const char *fname);
#define gh_load(fname) gh_eval_file(fname) #define gh_load(fname) gh_eval_file(fname)
SCM gh_eval_file_with_catch(const char *scheme_code, scm_catch_handler_t handler); SCM gh_eval_file_with_catch(const char *scheme_code, scm_t_catch_handler handler);
SCM gh_eval_file_with_standard_handler(const char *scheme_code); SCM gh_eval_file_with_standard_handler(const char *scheme_code);
#define gh_defer_ints() SCM_DEFER_INTS #define gh_defer_ints() SCM_DEFER_INTS

View file

@ -70,11 +70,11 @@ eval_str_wrapper (void *data)
} }
SCM SCM
gh_eval_str_with_catch (const char *scheme_code, scm_catch_handler_t handler) gh_eval_str_with_catch (const char *scheme_code, scm_t_catch_handler handler)
{ {
/* FIXME: not there yet */ /* FIXME: not there yet */
return gh_catch (SCM_BOOL_T, (scm_catch_body_t) eval_str_wrapper, (void *) scheme_code, return gh_catch (SCM_BOOL_T, (scm_t_catch_body) eval_str_wrapper, (void *) scheme_code,
(scm_catch_handler_t) handler, (void *) scheme_code); (scm_t_catch_handler) handler, (void *) scheme_code);
} }
SCM SCM
@ -87,9 +87,9 @@ SCM
gh_eval_str_with_stack_saving_handler (const char *scheme_code) gh_eval_str_with_stack_saving_handler (const char *scheme_code)
{ {
return scm_internal_stack_catch (SCM_BOOL_T, return scm_internal_stack_catch (SCM_BOOL_T,
(scm_catch_body_t) eval_str_wrapper, (scm_t_catch_body) eval_str_wrapper,
(void *) scheme_code, (void *) scheme_code,
(scm_catch_handler_t) (scm_t_catch_handler)
gh_standard_handler, gh_standard_handler,
(void *) scheme_code); (void *) scheme_code);
} }
@ -104,11 +104,11 @@ eval_file_wrapper (void *data)
} }
SCM SCM
gh_eval_file_with_catch (const char *scheme_code, scm_catch_handler_t handler) gh_eval_file_with_catch (const char *scheme_code, scm_t_catch_handler handler)
{ {
/* FIXME: not there yet */ /* FIXME: not there yet */
return gh_catch (SCM_BOOL_T, (scm_catch_body_t) eval_file_wrapper, return gh_catch (SCM_BOOL_T, (scm_t_catch_body) eval_file_wrapper,
(void *) scheme_code, (scm_catch_handler_t) handler, (void *) scheme_code, (scm_t_catch_handler) handler,
(void *) scheme_code); (void *) scheme_code);
} }

View file

@ -87,8 +87,8 @@ gh_repl (int argc, char *argv[])
error (or any thrown error if tag is SCM_BOOL_T); see error (or any thrown error if tag is SCM_BOOL_T); see
../libguile/throw.c for the comments explaining scm_internal_catch */ ../libguile/throw.c for the comments explaining scm_internal_catch */
SCM SCM
gh_catch (SCM tag, scm_catch_body_t body, void *body_data, gh_catch (SCM tag, scm_t_catch_body body, void *body_data,
scm_catch_handler_t handler, void *handler_data) scm_t_catch_handler handler, void *handler_data)
{ {
return scm_internal_catch (tag, body, body_data, handler, handler_data); return scm_internal_catch (tag, body, body_data, handler, handler_data);
} }

View file

@ -130,7 +130,7 @@
#define SCM_GOOPS_UNBOUNDP(x) ((x) == SCM_GOOPS_UNBOUND) #define SCM_GOOPS_UNBOUNDP(x) ((x) == SCM_GOOPS_UNBOUND)
static int goops_loaded_p = 0; static int goops_loaded_p = 0;
static scm_rstate_t *goops_rstate; static scm_t_rstate *goops_rstate;
static SCM scm_goops_lookup_closure; static SCM scm_goops_lookup_closure;
@ -1290,7 +1290,7 @@ wrap_init (SCM class, SCM *m, long n)
SCM_NEWCELL2 (z); SCM_NEWCELL2 (z);
SCM_SET_STRUCT_GC_CHAIN (z, 0); SCM_SET_STRUCT_GC_CHAIN (z, 0);
SCM_SET_CELL_WORD_1 (z, m); SCM_SET_CELL_WORD_1 (z, m);
SCM_SET_CELL_WORD_0 (z, (scm_bits_t) SCM_STRUCT_DATA (class) SCM_SET_CELL_WORD_0 (z, (scm_t_bits) SCM_STRUCT_DATA (class)
| scm_tc3_cons_gloc); | scm_tc3_cons_gloc);
return z; return z;
@ -1462,11 +1462,11 @@ SCM_DEFINE (scm_sys_invalidate_class, "%invalidate-class", 1, 0, 0,
* infinite recursions. * infinite recursions.
*/ */
static scm_bits_t **hell; static scm_t_bits **hell;
static long n_hell = 1; /* one place for the evil one himself */ static long n_hell = 1; /* one place for the evil one himself */
static long hell_size = 4; static long hell_size = 4;
#ifdef USE_THREADS #ifdef USE_THREADS
static scm_mutex_t hell_mutex; static scm_t_mutex hell_mutex;
#endif #endif
static long static long

View file

@ -88,13 +88,13 @@
#define scm_si_environment 26 /* The environment in which class is built */ #define scm_si_environment 26 /* The environment in which class is built */
#define SCM_N_CLASS_SLOTS 27 #define SCM_N_CLASS_SLOTS 27
typedef struct scm_method_t { typedef struct scm_t_method {
SCM generic_function; SCM generic_function;
SCM specializers; SCM specializers;
SCM procedure; SCM procedure;
} scm_method_t; } scm_t_method;
#define SCM_METHOD(obj) ((scm_method_t *) SCM_STRUCT_DATA (obj)) #define SCM_METHOD(obj) ((scm_t_method *) SCM_STRUCT_DATA (obj))
#define SCM_CLASSF_SIMPLE_METHOD (0x004 << 20) #define SCM_CLASSF_SIMPLE_METHOD (0x004 << 20)
#define SCM_CLASSF_ACCESSOR_METHOD (0x008 << 20) #define SCM_CLASSF_ACCESSOR_METHOD (0x008 << 20)

View file

@ -102,7 +102,7 @@ do { \
} while (0) } while (0)
static scm_bits_t tc16_guardian; static scm_t_bits tc16_guardian;
typedef struct guardian_t typedef struct guardian_t
{ {

View file

@ -366,17 +366,17 @@ SCM_DEFINE (scm_hash_remove_x, "hash-remove!", 2, 0, 0,
typedef struct scm_ihashx_closure_t typedef struct scm_t_ihashx_closure
{ {
SCM hash; SCM hash;
SCM assoc; SCM assoc;
SCM delete; SCM delete;
} scm_ihashx_closure_t; } scm_t_ihashx_closure;
static unsigned long static unsigned long
scm_ihashx (SCM obj, unsigned long n, scm_ihashx_closure_t *closure) scm_ihashx (SCM obj, unsigned long n, scm_t_ihashx_closure *closure)
{ {
SCM answer; SCM answer;
SCM_DEFER_INTS; SCM_DEFER_INTS;
@ -390,7 +390,7 @@ scm_ihashx (SCM obj, unsigned long n, scm_ihashx_closure_t *closure)
static SCM static SCM
scm_sloppy_assx (SCM obj, SCM alist, scm_ihashx_closure_t *closure) scm_sloppy_assx (SCM obj, SCM alist, scm_t_ihashx_closure *closure)
{ {
SCM answer; SCM answer;
SCM_DEFER_INTS; SCM_DEFER_INTS;
@ -405,7 +405,7 @@ scm_sloppy_assx (SCM obj, SCM alist, scm_ihashx_closure_t *closure)
static SCM static SCM
scm_delx_x (SCM obj, SCM alist, scm_ihashx_closure_t *closure) scm_delx_x (SCM obj, SCM alist, scm_t_ihashx_closure *closure)
{ {
SCM answer; SCM answer;
SCM_DEFER_INTS; SCM_DEFER_INTS;
@ -428,7 +428,7 @@ SCM_DEFINE (scm_hashx_get_handle, "hashx-get-handle", 4, 0, 0,
"@code{assoc}, @code{assq} or @code{assv}.") "@code{assoc}, @code{assq} or @code{assv}.")
#define FUNC_NAME s_scm_hashx_get_handle #define FUNC_NAME s_scm_hashx_get_handle
{ {
scm_ihashx_closure_t closure; scm_t_ihashx_closure closure;
closure.hash = hash; closure.hash = hash;
closure.assoc = assoc; closure.assoc = assoc;
return scm_hash_fn_get_handle (table, key, scm_ihashx, scm_sloppy_assx, return scm_hash_fn_get_handle (table, key, scm_ihashx, scm_sloppy_assx,
@ -447,7 +447,7 @@ SCM_DEFINE (scm_hashx_create_handle_x, "hashx-create-handle!", 5, 0, 0,
"@code{assoc}, @code{assq} or @code{assv}.") "@code{assoc}, @code{assq} or @code{assv}.")
#define FUNC_NAME s_scm_hashx_create_handle_x #define FUNC_NAME s_scm_hashx_create_handle_x
{ {
scm_ihashx_closure_t closure; scm_t_ihashx_closure closure;
closure.hash = hash; closure.hash = hash;
closure.assoc = assoc; closure.assoc = assoc;
return scm_hash_fn_create_handle_x (table, key, init, scm_ihashx, return scm_hash_fn_create_handle_x (table, key, init, scm_ihashx,
@ -470,7 +470,7 @@ SCM_DEFINE (scm_hashx_ref, "hashx-ref", 4, 1, 0,
"equivalent to @code{hashx-ref hashq assq table key}.") "equivalent to @code{hashx-ref hashq assq table key}.")
#define FUNC_NAME s_scm_hashx_ref #define FUNC_NAME s_scm_hashx_ref
{ {
scm_ihashx_closure_t closure; scm_t_ihashx_closure closure;
if (SCM_UNBNDP (dflt)) if (SCM_UNBNDP (dflt))
dflt = SCM_BOOL_F; dflt = SCM_BOOL_F;
closure.hash = hash; closure.hash = hash;
@ -496,7 +496,7 @@ SCM_DEFINE (scm_hashx_set_x, "hashx-set!", 5, 0, 0,
"equivalent to @code{hashx-set! hashq assq table key}.") "equivalent to @code{hashx-set! hashq assq table key}.")
#define FUNC_NAME s_scm_hashx_set_x #define FUNC_NAME s_scm_hashx_set_x
{ {
scm_ihashx_closure_t closure; scm_t_ihashx_closure closure;
closure.hash = hash; closure.hash = hash;
closure.assoc = assoc; closure.assoc = assoc;
return scm_hash_fn_set_x (table, key, val, scm_ihashx, scm_sloppy_assx, return scm_hash_fn_set_x (table, key, val, scm_ihashx, scm_sloppy_assx,
@ -509,7 +509,7 @@ SCM_DEFINE (scm_hashx_set_x, "hashx-set!", 5, 0, 0,
SCM SCM
scm_hashx_remove_x (SCM hash, SCM assoc, SCM delete, SCM table, SCM obj) scm_hashx_remove_x (SCM hash, SCM assoc, SCM delete, SCM table, SCM obj)
{ {
scm_ihashx_closure_t closure; scm_t_ihashx_closure closure;
closure.hash = hash; closure.hash = hash;
closure.assoc = assoc; closure.assoc = assoc;
closure.delete = delete; closure.delete = delete;

View file

@ -48,9 +48,9 @@
#if 0 #if 0
typedef unsigned int scm_hash_fn_t (SCM obj, unsigned int d, void *closure); typedef unsigned int scm_t_hash_fn (SCM obj, unsigned int d, void *closure);
typedef SCM scm_assoc_fn_t (SCM key, SCM alist, void *closure); typedef SCM scm_t_assoc_fn (SCM key, SCM alist, void *closure);
typedef SCM scm_delete_fn_t (SCM elt, SCM list); typedef SCM scm_t_delete_fn (SCM elt, SCM list);
#endif #endif
extern SCM scm_c_make_hash_table (unsigned long k); extern SCM scm_c_make_hash_table (unsigned long k);

View file

@ -66,7 +66,7 @@
*/ */
void void
scm_c_hook_init (scm_c_hook_t *hook, void *hook_data, scm_c_hook_type_t type) scm_c_hook_init (scm_t_c_hook *hook, void *hook_data, scm_t_c_hookype_t type)
{ {
hook->first = 0; hook->first = 0;
hook->type = type; hook->type = type;
@ -74,14 +74,14 @@ scm_c_hook_init (scm_c_hook_t *hook, void *hook_data, scm_c_hook_type_t type)
} }
void void
scm_c_hook_add (scm_c_hook_t *hook, scm_c_hook_add (scm_t_c_hook *hook,
scm_c_hook_function_t func, scm_t_c_hook_function func,
void *func_data, void *func_data,
int appendp) int appendp)
{ {
scm_c_hook_entry_t *entry = scm_must_malloc (sizeof (scm_c_hook_entry_t), scm_t_c_hook_entry *entry = scm_must_malloc (sizeof (scm_t_c_hook_entry),
"C level hook entry"); "C level hook entry");
scm_c_hook_entry_t **loc = &hook->first; scm_t_c_hook_entry **loc = &hook->first;
if (appendp) if (appendp)
while (*loc) while (*loc)
*loc = (*loc)->next; *loc = (*loc)->next;
@ -92,16 +92,16 @@ scm_c_hook_add (scm_c_hook_t *hook,
} }
void void
scm_c_hook_remove (scm_c_hook_t *hook, scm_c_hook_remove (scm_t_c_hook *hook,
scm_c_hook_function_t func, scm_t_c_hook_function func,
void *func_data) void *func_data)
{ {
scm_c_hook_entry_t **loc = &hook->first; scm_t_c_hook_entry **loc = &hook->first;
while (*loc) while (*loc)
{ {
if ((*loc)->func == func && (*loc)->data == func_data) if ((*loc)->func == func && (*loc)->data == func_data)
{ {
scm_c_hook_entry_t *entry = *loc; scm_t_c_hook_entry *entry = *loc;
*loc = (*loc)->next; *loc = (*loc)->next;
scm_must_free (entry); scm_must_free (entry);
return; return;
@ -113,10 +113,10 @@ scm_c_hook_remove (scm_c_hook_t *hook,
} }
void * void *
scm_c_hook_run (scm_c_hook_t *hook, void *data) scm_c_hook_run (scm_t_c_hook *hook, void *data)
{ {
scm_c_hook_entry_t *entry = hook->first; scm_t_c_hook_entry *entry = hook->first;
scm_c_hook_type_t type = hook->type; scm_t_c_hookype_t type = hook->type;
void *res = 0; void *res = 0;
while (entry) while (entry)
{ {
@ -147,7 +147,7 @@ scm_c_hook_run (scm_c_hook_t *hook, void *data)
* programs. * programs.
*/ */
scm_bits_t scm_tc16_hook; scm_t_bits scm_tc16_hook;
static int static int

View file

@ -58,45 +58,45 @@
* both may want to indicate success/failure and return a result. * both may want to indicate success/failure and return a result.
*/ */
typedef enum scm_c_hook_type_t { typedef enum scm_t_c_hookype_t {
SCM_C_HOOK_NORMAL, SCM_C_HOOK_NORMAL,
SCM_C_HOOK_OR, SCM_C_HOOK_OR,
SCM_C_HOOK_AND SCM_C_HOOK_AND
} scm_c_hook_type_t; } scm_t_c_hookype_t;
typedef void *(*scm_c_hook_function_t) (void *hook_data, typedef void *(*scm_t_c_hook_function) (void *hook_data,
void *func_data, void *func_data,
void *data); void *data);
typedef struct scm_c_hook_entry_t { typedef struct scm_t_c_hook_entry {
struct scm_c_hook_entry_t *next; struct scm_t_c_hook_entry *next;
scm_c_hook_function_t func; scm_t_c_hook_function func;
void *data; void *data;
} scm_c_hook_entry_t; } scm_t_c_hook_entry;
typedef struct scm_c_hook_t { typedef struct scm_t_c_hook {
scm_c_hook_entry_t *first; scm_t_c_hook_entry *first;
scm_c_hook_type_t type; scm_t_c_hookype_t type;
void *data; void *data;
} scm_c_hook_t; } scm_t_c_hook;
extern void scm_c_hook_init (scm_c_hook_t *hook, extern void scm_c_hook_init (scm_t_c_hook *hook,
void *hook_data, void *hook_data,
scm_c_hook_type_t type); scm_t_c_hookype_t type);
extern void scm_c_hook_add (scm_c_hook_t *hook, extern void scm_c_hook_add (scm_t_c_hook *hook,
scm_c_hook_function_t func, scm_t_c_hook_function func,
void *func_data, void *func_data,
int appendp); int appendp);
extern void scm_c_hook_remove (scm_c_hook_t *hook, extern void scm_c_hook_remove (scm_t_c_hook *hook,
scm_c_hook_function_t func, scm_t_c_hook_function func,
void *func_data); void *func_data);
extern void *scm_c_hook_run (scm_c_hook_t *hook, void *data); extern void *scm_c_hook_run (scm_t_c_hook *hook, void *data);
/* /*
* Scheme level hooks * Scheme level hooks
*/ */
extern scm_bits_t scm_tc16_hook; extern scm_t_bits scm_tc16_hook;
#define SCM_HOOKP(x) SCM_TYP16_PREDICATE (scm_tc16_hook, x) #define SCM_HOOKP(x) SCM_TYP16_PREDICATE (scm_tc16_hook, x)
#define SCM_HOOK_ARITY(hook) (SCM_CELL_WORD_0 (hook) >> 16) #define SCM_HOOK_ARITY(hook) (SCM_CELL_WORD_0 (hook) >> 16)

View file

@ -189,7 +189,7 @@ start_stack (void *base)
/* Create an object to hold the root continuation. /* Create an object to hold the root continuation.
*/ */
{ {
scm_contregs_t *contregs = scm_must_malloc (sizeof (scm_contregs_t), scm_t_contregs *contregs = scm_must_malloc (sizeof (scm_t_contregs),
"continuation"); "continuation");
contregs->num_stack_items = 0; contregs->num_stack_items = 0;
contregs->seq = 0; contregs->seq = 0;

View file

@ -90,7 +90,7 @@ SCM_DEFINE (scm_redirect_port, "redirect-port", 2, 0, 0,
#define FUNC_NAME s_scm_redirect_port #define FUNC_NAME s_scm_redirect_port
{ {
int ans, oldfd, newfd; int ans, oldfd, newfd;
scm_fport_t *fp; scm_t_fport *fp;
old = SCM_COERCE_OUTPORT (old); old = SCM_COERCE_OUTPORT (old);
new = SCM_COERCE_OUTPORT (new); new = SCM_COERCE_OUTPORT (new);
@ -102,9 +102,9 @@ SCM_DEFINE (scm_redirect_port, "redirect-port", 2, 0, 0,
newfd = fp->fdes; newfd = fp->fdes;
if (oldfd != newfd) if (oldfd != newfd)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (new); scm_t_port *pt = SCM_PTAB_ENTRY (new);
scm_port_t *old_pt = SCM_PTAB_ENTRY (old); scm_t_port *old_pt = SCM_PTAB_ENTRY (old);
scm_ptob_descriptor_t *ptob = &scm_ptobs[SCM_PTOBNUM (new)]; scm_t_ptob_descriptor *ptob = &scm_ptobs[SCM_PTOBNUM (new)];
/* must flush to old fdes. */ /* must flush to old fdes. */
if (pt->rw_active == SCM_PORT_WRITE) if (pt->rw_active == SCM_PORT_WRITE)
@ -261,7 +261,7 @@ SCM_DEFINE (scm_primitive_move_to_fdes, "primitive-move->fdes", 2, 0, 0,
"required value or @code{#t} if it was moved.") "required value or @code{#t} if it was moved.")
#define FUNC_NAME s_scm_primitive_move_to_fdes #define FUNC_NAME s_scm_primitive_move_to_fdes
{ {
scm_fport_t *stream; scm_t_fport *stream;
int old_fd; int old_fd;
int new_fd; int new_fd;
int rv; int rv;
@ -301,11 +301,11 @@ SCM_DEFINE (scm_fdes_to_ports, "fdes->ports", 1, 0, 0,
SCM_VALIDATE_INUM_COPY (1,fd,int_fd); SCM_VALIDATE_INUM_COPY (1,fd,int_fd);
for (i = 0; i < scm_port_table_size; i++) for (i = 0; i < scm_t_portable_size; i++)
{ {
if (SCM_OPFPORTP (scm_port_table[i]->port) if (SCM_OPFPORTP (scm_t_portable[i]->port)
&& ((scm_fport_t *) scm_port_table[i]->stream)->fdes == int_fd) && ((scm_t_fport *) scm_t_portable[i]->stream)->fdes == int_fd)
result = scm_cons (scm_port_table[i]->port, result); result = scm_cons (scm_t_portable[i]->port, result);
} }
return result; return result;
} }

View file

@ -56,7 +56,7 @@
#include "libguile/keywords.h" #include "libguile/keywords.h"
scm_bits_t scm_tc16_keyword; scm_t_bits scm_tc16_keyword;
static int static int
keyword_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED) keyword_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)

View file

@ -51,7 +51,7 @@
extern scm_bits_t scm_tc16_keyword; extern scm_t_bits scm_tc16_keyword;
#define SCM_KEYWORDP(X) (!SCM_IMP (X) && (SCM_CELL_TYPE (X) == scm_tc16_keyword)) #define SCM_KEYWORDP(X) (!SCM_IMP (X) && (SCM_CELL_TYPE (X) == scm_tc16_keyword))
#define SCM_KEYWORDSYM(X) (SCM_CELL_OBJECT_1 (X)) #define SCM_KEYWORDSYM(X) (SCM_CELL_OBJECT_1 (X))

View file

@ -114,7 +114,7 @@ SCM_DEFINE (scm_null, "null", 1, 0, 0,
"return LISP's nil otherwise.") "return LISP's nil otherwise.")
#define FUNC_NAME s_scm_null #define FUNC_NAME s_scm_null
{ {
return (SCM_NILP (x) || SCM_NULLP (x) || SCM_FALSEP (x)) ? scm_lisp_t : scm_lisp_nil; return (SCM_NILP (x) || SCM_NULLP (x) || SCM_FALSEP (x)) ? scm_t_lisp : scm_lisp_nil;
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -146,7 +146,7 @@ SCM_DEFINE1 (scm_nil_eq, "nil-eq", scm_tc7_rpsubr,
return ((SCM_EQ_P (x, y) return ((SCM_EQ_P (x, y)
|| (SCM_NILP (x) && (SCM_NULLP (y) || SCM_FALSEP (y))) || (SCM_NILP (x) && (SCM_NULLP (y) || SCM_FALSEP (y)))
|| (SCM_NILP (y) && (SCM_NULLP (x) || SCM_FALSEP (x)))) || (SCM_NILP (y) && (SCM_NULLP (x) || SCM_FALSEP (x))))
? scm_lisp_t ? scm_t_lisp
: scm_lisp_nil); : scm_lisp_nil);
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -49,7 +49,7 @@
extern SCM scm_lisp_nil; extern SCM scm_lisp_nil;
extern SCM scm_lisp_t; extern SCM scm_t_lisp;
#define SCM_NILP(x) (SCM_EQ_P ((x), scm_lisp_nil)) #define SCM_NILP(x) (SCM_EQ_P ((x), scm_lisp_nil))
#define SCM_NILNULLP(x) (SCM_NILP (x) || SCM_NULLP (x)) #define SCM_NILNULLP(x) (SCM_NILP (x) || SCM_NULLP (x))

View file

@ -55,7 +55,7 @@
#include "libguile/validate.h" #include "libguile/validate.h"
#include "libguile/macros.h" #include "libguile/macros.h"
scm_bits_t scm_tc16_macro; scm_t_bits scm_tc16_macro;
static int static int

View file

@ -55,7 +55,7 @@
#define SCM_MACRO_TYPE(m) (SCM_CELL_WORD_0 (m) >> 16) #define SCM_MACRO_TYPE(m) (SCM_CELL_WORD_0 (m) >> 16)
#define SCM_MACRO_CODE(m) SCM_CELL_OBJECT_1 (m) #define SCM_MACRO_CODE(m) SCM_CELL_OBJECT_1 (m)
extern scm_bits_t scm_tc16_macro; extern scm_t_bits scm_tc16_macro;
extern SCM scm_makacro (SCM code); extern SCM scm_makacro (SCM code);
extern SCM scm_makmacro (SCM code); extern SCM scm_makmacro (SCM code);

View file

@ -61,7 +61,7 @@
scm_bits_t scm_tc16_malloc; scm_t_bits scm_tc16_malloc;
static size_t static size_t
@ -86,7 +86,7 @@ malloc_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
SCM SCM
scm_malloc_obj (size_t n) scm_malloc_obj (size_t n)
{ {
scm_bits_t mem = n ? (scm_bits_t) malloc (n) : 0; scm_t_bits mem = n ? (scm_t_bits) malloc (n) : 0;
if (n && !mem) if (n && !mem)
return SCM_BOOL_F; return SCM_BOOL_F;
SCM_RETURN_NEWSMOB (scm_tc16_malloc, mem); SCM_RETURN_NEWSMOB (scm_tc16_malloc, mem);

View file

@ -46,7 +46,7 @@
#include "libguile/__scm.h" #include "libguile/__scm.h"
extern scm_bits_t scm_tc16_malloc; extern scm_t_bits scm_tc16_malloc;
#define SCM_MALLOCP(X) (SCM_TYP16 (X) == scm_tc16_malloc) #define SCM_MALLOCP(X) (SCM_TYP16 (X) == scm_tc16_malloc)
#define SCM_MALLOCDATA(obj) ((char *) SCM_CELL_WORD_1 (obj)) #define SCM_MALLOCDATA(obj) ((char *) SCM_CELL_WORD_1 (obj))

View file

@ -62,7 +62,7 @@
int scm_module_system_booted_p = 0; int scm_module_system_booted_p = 0;
scm_bits_t scm_module_tag; scm_t_bits scm_module_tag;
static SCM the_module; static SCM the_module;
@ -313,7 +313,7 @@ module_variable (SCM module, SCM sym)
} }
} }
scm_bits_t scm_tc16_eval_closure; scm_t_bits scm_tc16_eval_closure;
#define SCM_F_EVAL_CLOSURE_INTERFACE (1<<16) #define SCM_F_EVAL_CLOSURE_INTERFACE (1<<16)
#define SCM_EVAL_CLOSURE_INTERFACE_P(e) \ #define SCM_EVAL_CLOSURE_INTERFACE_P(e) \

View file

@ -51,7 +51,7 @@
extern int scm_module_system_booted_p; extern int scm_module_system_booted_p;
extern scm_bits_t scm_module_tag; extern scm_t_bits scm_module_tag;
#define SCM_MODULEP(OBJ) \ #define SCM_MODULEP(OBJ) \
(!SCM_IMP (OBJ) && SCM_CELL_TYPE (OBJ) == scm_module_tag) (!SCM_IMP (OBJ) && SCM_CELL_TYPE (OBJ) == scm_module_tag)
@ -79,7 +79,7 @@ extern scm_bits_t scm_module_tag;
#define SCM_MODULE_TRANSFORMER(module) \ #define SCM_MODULE_TRANSFORMER(module) \
SCM_PACK (SCM_STRUCT_DATA (module)[scm_module_index_transformer]) SCM_PACK (SCM_STRUCT_DATA (module)[scm_module_index_transformer])
extern scm_bits_t scm_tc16_eval_closure; extern scm_t_bits scm_tc16_eval_closure;
#define SCM_EVAL_CLOSURE_P(x) SCM_TYP16_PREDICATE (scm_tc16_eval_closure, x) #define SCM_EVAL_CLOSURE_P(x) SCM_TYP16_PREDICATE (scm_tc16_eval_closure, x)

View file

@ -6,22 +6,22 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller)
if (SCM_INUMP (num)) if (SCM_INUMP (num))
{ /* immediate */ { /* immediate */
scm_bits_t n = SCM_INUM (num); scm_t_bits n = SCM_INUM (num);
#ifdef UNSIGNED #ifdef UNSIGNED
if (n < 0) if (n < 0)
scm_out_of_range (s_caller, num); scm_out_of_range (s_caller, num);
#endif #endif
if (sizeof (ITYPE) >= sizeof (scm_bits_t)) if (sizeof (ITYPE) >= sizeof (scm_t_bits))
/* can't fit anything too big for this type in an inum /* can't fit anything too big for this type in an inum
anyway */ anyway */
return (ITYPE) n; return (ITYPE) n;
else else
{ /* an inum can be out of range, so check */ { /* an inum can be out of range, so check */
if (n > (scm_bits_t)MAX_VALUE if (n > (scm_t_bits)MAX_VALUE
#ifndef UNSIGNED #ifndef UNSIGNED
|| n < (scm_bits_t)MIN_VALUE || n < (scm_t_bits)MIN_VALUE
#endif #endif
) )
scm_out_of_range (s_caller, num); scm_out_of_range (s_caller, num);
@ -84,7 +84,7 @@ NUM2INTEGRAL (SCM num, unsigned long int pos, const char *s_caller)
SCM SCM
INTEGRAL2NUM (ITYPE n) INTEGRAL2NUM (ITYPE n)
{ {
if (sizeof (ITYPE) < sizeof (scm_bits_t) if (sizeof (ITYPE) < sizeof (scm_t_bits)
|| ||
#ifndef UNSIGNED #ifndef UNSIGNED
SCM_FIXABLE (n) SCM_FIXABLE (n)

View file

@ -69,7 +69,7 @@
/* SCM_SRS is signed right shift */ /* SCM_SRS is signed right shift */
#if (-1 == (((-1) << 2) + 2) >> 2) #if (-1 == (((-1) << 2) + 2) >> 2)
# define SCM_SRS(x, y) ((scm_signed_bits_t)(x) >> (y)) # define SCM_SRS(x, y) ((scm_t_signed_bits)(x) >> (y))
#else #else
# define SCM_SRS(x, y) ((SCM_UNPACK (x) < 0) ? ~((~SCM_UNPACK (x)) >> (y)) : (SCM_UNPACK (x) >> (y))) # define SCM_SRS(x, y) ((SCM_UNPACK (x) < 0) ? ~((~SCM_UNPACK (x)) >> (y)) : (SCM_UNPACK (x) >> (y)))
#endif /* (-1 == (((-1) << 2) + 2) >> 2) */ #endif /* (-1 == (((-1) << 2) + 2) >> 2) */
@ -78,7 +78,7 @@
#define SCM_INUMP(x) (2 & SCM_UNPACK (x)) #define SCM_INUMP(x) (2 & SCM_UNPACK (x))
#define SCM_NINUMP(x) (!SCM_INUMP (x)) #define SCM_NINUMP(x) (!SCM_INUMP (x))
#define SCM_MAKINUM(x) (SCM_PACK (((x) << 2) + 2L)) #define SCM_MAKINUM(x) (SCM_PACK (((x) << 2) + 2L))
#define SCM_INUM(x) ((scm_signed_bits_t)(SCM_SRS (SCM_UNPACK (x), 2))) #define SCM_INUM(x) ((scm_t_signed_bits)(SCM_SRS (SCM_UNPACK (x), 2)))
/* SCM_FIXABLE is true if its long argument can be encoded in an SCM_INUM. */ /* SCM_FIXABLE is true if its long argument can be encoded in an SCM_INUM. */
@ -129,8 +129,8 @@
#define SCM_REALP(x) (SCM_NIMP (x) && SCM_TYP16 (x) == scm_tc16_real) #define SCM_REALP(x) (SCM_NIMP (x) && SCM_TYP16 (x) == scm_tc16_real)
#define SCM_COMPLEXP(x) (SCM_NIMP (x) && SCM_TYP16 (x) == scm_tc16_complex) #define SCM_COMPLEXP(x) (SCM_NIMP (x) && SCM_TYP16 (x) == scm_tc16_complex)
#define SCM_REAL_VALUE(x) (((scm_double_t *) SCM2PTR (x))->real) #define SCM_REAL_VALUE(x) (((scm_t_double *) SCM2PTR (x))->real)
#define SCM_COMPLEX_MEM(x) ((scm_complex_t *) SCM_CELL_WORD_1 (x)) #define SCM_COMPLEX_MEM(x) ((scm_t_complex *) SCM_CELL_WORD_1 (x))
#define SCM_COMPLEX_REAL(x) (SCM_COMPLEX_MEM (x)->real) #define SCM_COMPLEX_REAL(x) (SCM_COMPLEX_MEM (x)->real)
#define SCM_COMPLEX_IMAG(x) (SCM_COMPLEX_MEM (x)->imag) #define SCM_COMPLEX_IMAG(x) (SCM_COMPLEX_MEM (x)->imag)
@ -186,18 +186,18 @@
typedef struct scm_double_t typedef struct scm_t_double
{ {
SCM type; SCM type;
SCM pad; SCM pad;
double real; double real;
} scm_double_t; } scm_t_double;
typedef struct scm_complex_t typedef struct scm_t_complex
{ {
double real; double real;
double imag; double imag;
} scm_complex_t; } scm_t_complex;

View file

@ -121,7 +121,7 @@ SCM_SYMBOL (scm_no_sym, "no");
static SCM protected_objects; static SCM protected_objects;
SCM SCM
scm_options (SCM arg, scm_option_t options[], int n, const char *s) scm_options (SCM arg, scm_t_option options[], int n, const char *s)
{ {
int i, docp = (!SCM_UNBNDP (arg) && !SCM_NULLP (arg) && !SCM_CONSP (arg)); int i, docp = (!SCM_UNBNDP (arg) && !SCM_NULLP (arg) && !SCM_CONSP (arg));
/* Let `arg' GC protect the arguments */ /* Let `arg' GC protect the arguments */
@ -212,7 +212,7 @@ scm_options (SCM arg, scm_option_t options[], int n, const char *s)
void void
scm_init_opts (SCM (*func) (SCM), scm_option_t options[], int n) scm_init_opts (SCM (*func) (SCM), scm_t_option options[], int n)
{ {
int i; int i;

View file

@ -51,7 +51,7 @@
typedef struct scm_option_t typedef struct scm_t_option
{ {
int type; int type;
char *name; char *name;
@ -62,10 +62,10 @@ typedef struct scm_option_t
unsigned long val; unsigned long val;
/* SCM val */ /* SCM val */
char *doc; char *doc;
} scm_option_t; } scm_t_option;
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
# define scm_option scm_option_t # define scm_option scm_t_option
#endif #endif
#define SCM_OPTION_BOOLEAN 0 #define SCM_OPTION_BOOLEAN 0
@ -73,8 +73,8 @@ typedef struct scm_option_t
#define SCM_OPTION_SCM 2 #define SCM_OPTION_SCM 2
extern SCM scm_options (SCM new_mode, scm_option_t options[], int n, const char *s); extern SCM scm_options (SCM new_mode, scm_t_option options[], int n, const char *s);
extern void scm_init_opts (SCM (*func) (SCM), scm_option_t options[], int n); extern void scm_init_opts (SCM (*func) (SCM), scm_t_option options[], int n);
extern void scm_init_options (void); extern void scm_init_options (void);
#endif /* OPTIONSH */ #endif /* OPTIONSH */

View file

@ -86,7 +86,7 @@
* Indexes into this table are used when generating type * Indexes into this table are used when generating type
* tags for smobjects (if you know a tag you can get an index and conversely). * tags for smobjects (if you know a tag you can get an index and conversely).
*/ */
scm_ptob_descriptor_t *scm_ptobs; scm_t_ptob_descriptor *scm_ptobs;
long scm_numptob; long scm_numptob;
/* GC marker for a port with stream of SCM type. */ /* GC marker for a port with stream of SCM type. */
@ -117,7 +117,7 @@ end_input_default (SCM port SCM_UNUSED, int offset SCM_UNUSED)
{ {
} }
scm_bits_t scm_t_bits
scm_make_port_type (char *name, scm_make_port_type (char *name,
int (*fill_input) (SCM port), int (*fill_input) (SCM port),
void (*write) (SCM port, const void *data, size_t size)) void (*write) (SCM port, const void *data, size_t size))
@ -128,10 +128,10 @@ scm_make_port_type (char *name,
SCM_DEFER_INTS; SCM_DEFER_INTS;
SCM_SYSCALL (tmp = (char *) realloc ((char *) scm_ptobs, SCM_SYSCALL (tmp = (char *) realloc ((char *) scm_ptobs,
(1 + scm_numptob) (1 + scm_numptob)
* sizeof (scm_ptob_descriptor_t))); * sizeof (scm_t_ptob_descriptor)));
if (tmp) if (tmp)
{ {
scm_ptobs = (scm_ptob_descriptor_t *) tmp; scm_ptobs = (scm_t_ptob_descriptor *) tmp;
scm_ptobs[scm_numptob].name = name; scm_ptobs[scm_numptob].name = name;
scm_ptobs[scm_numptob].mark = 0; scm_ptobs[scm_numptob].mark = 0;
@ -246,7 +246,7 @@ SCM_DEFINE (scm_char_ready_p, "char-ready?", 0, 1, 0,
"interactive port that has no ready characters.}") "interactive port that has no ready characters.}")
#define FUNC_NAME s_scm_char_ready_p #define FUNC_NAME s_scm_char_ready_p
{ {
scm_port_t *pt; scm_t_port *pt;
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_inp; port = scm_cur_inp;
@ -264,7 +264,7 @@ SCM_DEFINE (scm_char_ready_p, "char-ready?", 0, 1, 0,
return SCM_BOOL_T; return SCM_BOOL_T;
else else
{ {
scm_ptob_descriptor_t *ptob = &scm_ptobs[SCM_PTOBNUM (port)]; scm_t_ptob_descriptor *ptob = &scm_ptobs[SCM_PTOBNUM (port)];
if (ptob->input_waiting) if (ptob->input_waiting)
return SCM_BOOL(ptob->input_waiting (port)); return SCM_BOOL(ptob->input_waiting (port));
@ -278,7 +278,7 @@ SCM_DEFINE (scm_char_ready_p, "char-ready?", 0, 1, 0,
into memory starting at dest. returns the number of chars moved. */ into memory starting at dest. returns the number of chars moved. */
size_t scm_take_from_input_buffers (SCM port, char *dest, size_t read_len) size_t scm_take_from_input_buffers (SCM port, char *dest, size_t read_len)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
size_t chars_read = 0; size_t chars_read = 0;
size_t from_buf = min (pt->read_end - pt->read_pos, read_len); size_t from_buf = min (pt->read_end - pt->read_pos, read_len);
@ -313,7 +313,7 @@ SCM_DEFINE (scm_drain_input, "drain-input", 1, 0, 0,
#define FUNC_NAME s_scm_drain_input #define FUNC_NAME s_scm_drain_input
{ {
SCM result; SCM result;
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
long count; long count;
SCM_VALIDATE_OPINPORT (1,port); SCM_VALIDATE_OPINPORT (1,port);
@ -422,35 +422,35 @@ SCM_DEFINE (scm_set_current_error_port, "set-current-error-port", 1, 0, 0,
/* The port table --- an array of pointers to ports. */ /* The port table --- an array of pointers to ports. */
scm_port_t **scm_port_table; scm_t_port **scm_t_portable;
long scm_port_table_size = 0; /* Number of ports in scm_port_table. */ long scm_t_portable_size = 0; /* Number of ports in scm_t_portable. */
long scm_port_table_room = 20; /* Size of the array. */ long scm_t_portable_room = 20; /* Size of the array. */
/* Add a port to the table. */ /* Add a port to the table. */
scm_port_t * scm_t_port *
scm_add_to_port_table (SCM port) scm_add_to_port_table (SCM port)
#define FUNC_NAME "scm_add_to_port_table" #define FUNC_NAME "scm_add_to_port_table"
{ {
scm_port_t *entry; scm_t_port *entry;
if (scm_port_table_size == scm_port_table_room) if (scm_t_portable_size == scm_t_portable_room)
{ {
/* initial malloc is in gc.c. this doesn't use scm_must_malloc etc., /* initial malloc is in gc.c. this doesn't use scm_must_malloc etc.,
since it can never be freed during gc. */ since it can never be freed during gc. */
void *newt = realloc ((char *) scm_port_table, void *newt = realloc ((char *) scm_t_portable,
(size_t) (sizeof (scm_port_t *) (size_t) (sizeof (scm_t_port *)
* scm_port_table_room * 2)); * scm_t_portable_room * 2));
if (newt == NULL) if (newt == NULL)
scm_memory_error ("scm_add_to_port_table"); scm_memory_error ("scm_add_to_port_table");
scm_port_table = (scm_port_t **) newt; scm_t_portable = (scm_t_port **) newt;
scm_port_table_room *= 2; scm_t_portable_room *= 2;
} }
entry = (scm_port_t *) scm_must_malloc (sizeof (scm_port_t), FUNC_NAME); entry = (scm_t_port *) scm_must_malloc (sizeof (scm_t_port), FUNC_NAME);
entry->port = port; entry->port = port;
entry->entry = scm_port_table_size; entry->entry = scm_t_portable_size;
entry->revealed = 0; entry->revealed = 0;
entry->stream = 0; entry->stream = 0;
entry->file_name = SCM_BOOL_F; entry->file_name = SCM_BOOL_F;
@ -461,8 +461,8 @@ scm_add_to_port_table (SCM port)
entry->rw_active = SCM_PORT_NEITHER; entry->rw_active = SCM_PORT_NEITHER;
entry->rw_random = 0; entry->rw_random = 0;
scm_port_table[scm_port_table_size] = entry; scm_t_portable[scm_t_portable_size] = entry;
scm_port_table_size++; scm_t_portable_size++;
return entry; return entry;
} }
@ -474,23 +474,23 @@ void
scm_remove_from_port_table (SCM port) scm_remove_from_port_table (SCM port)
#define FUNC_NAME "scm_remove_from_port_table" #define FUNC_NAME "scm_remove_from_port_table"
{ {
scm_port_t *p = SCM_PTAB_ENTRY (port); scm_t_port *p = SCM_PTAB_ENTRY (port);
long i = p->entry; long i = p->entry;
if (i >= scm_port_table_size) if (i >= scm_t_portable_size)
SCM_MISC_ERROR ("Port not in table: ~S", SCM_LIST1 (port)); SCM_MISC_ERROR ("Port not in table: ~S", SCM_LIST1 (port));
if (p->putback_buf) if (p->putback_buf)
scm_must_free (p->putback_buf); scm_must_free (p->putback_buf);
scm_must_free (p); scm_must_free (p);
/* Since we have just freed slot i we can shrink the table by moving /* Since we have just freed slot i we can shrink the table by moving
the last entry to that slot... */ the last entry to that slot... */
if (i < scm_port_table_size - 1) if (i < scm_t_portable_size - 1)
{ {
scm_port_table[i] = scm_port_table[scm_port_table_size - 1]; scm_t_portable[i] = scm_t_portable[scm_t_portable_size - 1];
scm_port_table[i]->entry = i; scm_t_portable[i]->entry = i;
} }
SCM_SETPTAB_ENTRY (port, 0); SCM_SETPTAB_ENTRY (port, 0);
scm_port_table_size--; scm_t_portable_size--;
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -504,7 +504,7 @@ SCM_DEFINE (scm_pt_size, "pt-size", 0, 0, 0,
"is only included in @code{--enable-guile-debug} builds.") "is only included in @code{--enable-guile-debug} builds.")
#define FUNC_NAME s_scm_pt_size #define FUNC_NAME s_scm_pt_size
{ {
return SCM_MAKINUM (scm_port_table_size); return SCM_MAKINUM (scm_t_portable_size);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -517,16 +517,16 @@ SCM_DEFINE (scm_pt_member, "pt-member", 1, 0, 0,
{ {
long i; long i;
SCM_VALIDATE_INUM_COPY (1,index,i); SCM_VALIDATE_INUM_COPY (1,index,i);
if (i < 0 || i >= scm_port_table_size) if (i < 0 || i >= scm_t_portable_size)
return SCM_BOOL_F; return SCM_BOOL_F;
else else
return scm_port_table[i]->port; return scm_t_portable[i]->port;
} }
#undef FUNC_NAME #undef FUNC_NAME
#endif #endif
void void
scm_port_non_buffer (scm_port_t *pt) scm_port_non_buffer (scm_t_port *pt)
{ {
pt->read_pos = pt->read_buf = pt->read_end = &pt->shortbuf; pt->read_pos = pt->read_buf = pt->read_end = &pt->shortbuf;
pt->write_buf = pt->write_pos = &pt->shortbuf; pt->write_buf = pt->write_pos = &pt->shortbuf;
@ -725,8 +725,8 @@ SCM_DEFINE (scm_port_for_each, "port-for-each", 1, 0, 0,
SCM_DEFER_INTS; SCM_DEFER_INTS;
scm_block_gc++; scm_block_gc++;
ports = SCM_EOL; ports = SCM_EOL;
for (i = 0; i < scm_port_table_size; i++) for (i = 0; i < scm_t_portable_size; i++)
ports = scm_cons (scm_port_table[i]->port, ports); ports = scm_cons (scm_t_portable[i]->port, ports);
scm_block_gc--; scm_block_gc--;
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
@ -754,9 +754,9 @@ SCM_DEFINE (scm_close_all_ports_except, "close-all-ports-except", 0, 0, 1,
{ {
long i = 0; long i = 0;
SCM_VALIDATE_REST_ARGUMENT (ports); SCM_VALIDATE_REST_ARGUMENT (ports);
while (i < scm_port_table_size) while (i < scm_t_portable_size)
{ {
SCM thisport = scm_port_table[i]->port; SCM thisport = scm_t_portable[i]->port;
int found = 0; int found = 0;
SCM ports_ptr = ports; SCM ports_ptr = ports;
@ -874,10 +874,10 @@ SCM_DEFINE (scm_flush_all_ports, "flush-all-ports", 0, 0, 0,
{ {
size_t i; size_t i;
for (i = 0; i < scm_port_table_size; i++) for (i = 0; i < scm_t_portable_size; i++)
{ {
if (SCM_OPOUTPORTP (scm_port_table[i]->port)) if (SCM_OPOUTPORTP (scm_t_portable[i]->port))
scm_flush (scm_port_table[i]->port); scm_flush (scm_t_portable[i]->port);
} }
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
@ -907,7 +907,7 @@ SCM_DEFINE (scm_read_char, "read-char", 0, 1, 0,
int int
scm_fill_input (SCM port) scm_fill_input (SCM port)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->read_buf == pt->putback_buf) if (pt->read_buf == pt->putback_buf)
{ {
@ -926,7 +926,7 @@ int
scm_getc (SCM port) scm_getc (SCM port)
{ {
int c; int c;
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->rw_active == SCM_PORT_WRITE) if (pt->rw_active == SCM_PORT_WRITE)
{ {
@ -981,8 +981,8 @@ scm_puts (const char *s, SCM port)
void void
scm_lfwrite (const char *ptr, size_t size, SCM port) scm_lfwrite (const char *ptr, size_t size, SCM port)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
scm_ptob_descriptor_t *ptob = &scm_ptobs[SCM_PTOBNUM (port)]; scm_t_ptob_descriptor *ptob = &scm_ptobs[SCM_PTOBNUM (port)];
if (pt->rw_active == SCM_PORT_READ) if (pt->rw_active == SCM_PORT_READ)
scm_end_input (port); scm_end_input (port);
@ -1016,7 +1016,7 @@ scm_lfwrite (const char *ptr, size_t size, SCM port)
size_t size_t
scm_c_read (SCM port, void *buffer, size_t size) scm_c_read (SCM port, void *buffer, size_t size)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
size_t n_read = 0, n_available; size_t n_read = 0, n_available;
if (pt->rw_active == SCM_PORT_WRITE) if (pt->rw_active == SCM_PORT_WRITE)
@ -1069,8 +1069,8 @@ scm_c_read (SCM port, void *buffer, size_t size)
void void
scm_c_write (SCM port, const void *ptr, size_t size) scm_c_write (SCM port, const void *ptr, size_t size)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
scm_ptob_descriptor_t *ptob = &scm_ptobs[SCM_PTOBNUM (port)]; scm_t_ptob_descriptor *ptob = &scm_ptobs[SCM_PTOBNUM (port)];
if (pt->rw_active == SCM_PORT_READ) if (pt->rw_active == SCM_PORT_READ)
scm_end_input (port); scm_end_input (port);
@ -1092,7 +1092,7 @@ void
scm_end_input (SCM port) scm_end_input (SCM port)
{ {
long offset; long offset;
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->read_buf == pt->putback_buf) if (pt->read_buf == pt->putback_buf)
{ {
@ -1115,7 +1115,7 @@ void
scm_ungetc (int c, SCM port) scm_ungetc (int c, SCM port)
#define FUNC_NAME "scm_ungetc" #define FUNC_NAME "scm_ungetc"
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->read_buf == pt->putback_buf) if (pt->read_buf == pt->putback_buf)
/* already using the put-back buffer. */ /* already using the put-back buffer. */
@ -1311,7 +1311,7 @@ SCM_DEFINE (scm_seek, "seek", 3, 0, 0,
SCM_OUT_OF_RANGE (3, whence); SCM_OUT_OF_RANGE (3, whence);
if (SCM_OPPORTP (fd_port)) if (SCM_OPPORTP (fd_port))
{ {
scm_ptob_descriptor_t *ptob = scm_ptobs + SCM_PTOBNUM (fd_port); scm_t_ptob_descriptor *ptob = scm_ptobs + SCM_PTOBNUM (fd_port);
if (!ptob->seek) if (!ptob->seek)
SCM_MISC_ERROR ("port is not seekable", SCM_MISC_ERROR ("port is not seekable",
@ -1364,8 +1364,8 @@ SCM_DEFINE (scm_truncate_file, "truncate-file", 1, 1, 0,
} }
else if (SCM_OPOUTPORTP (object)) else if (SCM_OPOUTPORTP (object))
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (object); scm_t_port *pt = SCM_PTAB_ENTRY (object);
scm_ptob_descriptor_t *ptob = scm_ptobs + SCM_PTOBNUM (object); scm_t_ptob_descriptor *ptob = scm_ptobs + SCM_PTOBNUM (object);
if (!ptob->truncate) if (!ptob->truncate)
SCM_MISC_ERROR ("port is not truncatable", SCM_EOL); SCM_MISC_ERROR ("port is not truncatable", SCM_EOL);
@ -1514,14 +1514,14 @@ void
scm_ports_prehistory () scm_ports_prehistory ()
{ {
scm_numptob = 0; scm_numptob = 0;
scm_ptobs = (scm_ptob_descriptor_t *) malloc (sizeof (scm_ptob_descriptor_t)); scm_ptobs = (scm_t_ptob_descriptor *) malloc (sizeof (scm_t_ptob_descriptor));
} }
/* Void ports. */ /* Void ports. */
scm_bits_t scm_tc16_void_port = 0; scm_t_bits scm_tc16_void_port = 0;
static int fill_input_void_port (SCM port SCM_UNUSED) static int fill_input_void_port (SCM port SCM_UNUSED)
{ {
@ -1540,7 +1540,7 @@ scm_void_port (char *mode_str)
{ {
int mode_bits; int mode_bits;
SCM answer; SCM answer;
scm_port_t * pt; scm_t_port * pt;
SCM_NEWCELL (answer); SCM_NEWCELL (answer);
SCM_DEFER_INTS; SCM_DEFER_INTS;

View file

@ -59,11 +59,11 @@
#define SCM_INITIAL_PUTBACK_BUF_SIZE 4 #define SCM_INITIAL_PUTBACK_BUF_SIZE 4
/* values for the rw_active flag. */ /* values for the rw_active flag. */
typedef enum scm_port_rw_active_t { typedef enum scm_t_port_rw_active {
SCM_PORT_NEITHER = 0, SCM_PORT_NEITHER = 0,
SCM_PORT_READ = 1, SCM_PORT_READ = 1,
SCM_PORT_WRITE = 2 SCM_PORT_WRITE = 2
} scm_port_rw_active_t; } scm_t_port_rw_active;
/* C representation of a Scheme port. */ /* C representation of a Scheme port. */
@ -75,7 +75,7 @@ typedef struct
* Revealed ports do not get GC'd. * Revealed ports do not get GC'd.
*/ */
/* data for the underlying port implementation as a raw C value. */ /* data for the underlying port implementation as a raw C value. */
scm_bits_t stream; scm_t_bits stream;
SCM file_name; /* debugging support. */ SCM file_name; /* debugging support. */
long line_number; /* debugging support. */ long line_number; /* debugging support. */
@ -120,7 +120,7 @@ typedef struct
flushed before switching between flushed before switching between
reading and writing, seeking, etc. */ reading and writing, seeking, etc. */
scm_port_rw_active_t rw_active; /* for random access ports, scm_t_port_rw_active rw_active; /* for random access ports,
indicates which of the buffers indicates which of the buffers
is currently in use. can be is currently in use. can be
SCM_PORT_WRITE, SCM_PORT_READ, SCM_PORT_WRITE, SCM_PORT_READ,
@ -130,10 +130,10 @@ typedef struct
/* a buffer for un-read chars and strings. */ /* a buffer for un-read chars and strings. */
unsigned char *putback_buf; unsigned char *putback_buf;
size_t putback_buf_size; /* allocated size of putback_buf. */ size_t putback_buf_size; /* allocated size of putback_buf. */
} scm_port_t; } scm_t_port;
extern scm_port_t **scm_port_table; extern scm_t_port **scm_t_portable;
extern long scm_port_table_size; /* Number of ports in scm_port_table. */ extern long scm_t_portable_size; /* Number of ports in scm_t_portable. */
#define SCM_READ_BUFFER_EMPTY_P(c_port) (c_port->read_pos >= c_port->read_end) #define SCM_READ_BUFFER_EMPTY_P(c_port) (c_port->read_pos >= c_port->read_end)
@ -167,10 +167,10 @@ extern long scm_port_table_size; /* Number of ports in scm_port_table. */
#define SCM_CLR_PORT_OPEN_FLAG(p) \ #define SCM_CLR_PORT_OPEN_FLAG(p) \
SCM_SET_CELL_WORD_0 ((p), SCM_CELL_WORD_0 (p) & ~SCM_OPN) SCM_SET_CELL_WORD_0 ((p), SCM_CELL_WORD_0 (p) & ~SCM_OPN)
#define SCM_PTAB_ENTRY(x) ((scm_port_t *) SCM_CELL_WORD_1 (x)) #define SCM_PTAB_ENTRY(x) ((scm_t_port *) SCM_CELL_WORD_1 (x))
#define SCM_SETPTAB_ENTRY(x,ent) (SCM_SET_CELL_WORD_1 ((x), (scm_bits_t) (ent))) #define SCM_SETPTAB_ENTRY(x,ent) (SCM_SET_CELL_WORD_1 ((x), (scm_t_bits) (ent)))
#define SCM_STREAM(x) (SCM_PTAB_ENTRY(x)->stream) #define SCM_STREAM(x) (SCM_PTAB_ENTRY(x)->stream)
#define SCM_SETSTREAM(x,s) (SCM_PTAB_ENTRY(x)->stream = (scm_bits_t) (s)) #define SCM_SETSTREAM(x,s) (SCM_PTAB_ENTRY(x)->stream = (scm_t_bits) (s))
#define SCM_FILENAME(x) (SCM_PTAB_ENTRY(x)->file_name) #define SCM_FILENAME(x) (SCM_PTAB_ENTRY(x)->file_name)
#define SCM_SET_FILENAME(x, n) (SCM_PTAB_ENTRY(x)->file_name = (n)) #define SCM_SET_FILENAME(x, n) (SCM_PTAB_ENTRY(x)->file_name = (n))
#define SCM_LINUM(x) (SCM_PTAB_ENTRY(x)->line_number) #define SCM_LINUM(x) (SCM_PTAB_ENTRY(x)->line_number)
@ -185,7 +185,7 @@ extern long scm_port_table_size; /* Number of ports in scm_port_table. */
/* port-type description. */ /* port-type description. */
typedef struct scm_ptob_descriptor_t typedef struct scm_t_ptob_descriptor
{ {
char *name; char *name;
SCM (*mark) (SCM); SCM (*mark) (SCM);
@ -204,12 +204,12 @@ typedef struct scm_ptob_descriptor_t
off_t (*seek) (SCM port, off_t OFFSET, int WHENCE); off_t (*seek) (SCM port, off_t OFFSET, int WHENCE);
void (*truncate) (SCM port, off_t length); void (*truncate) (SCM port, off_t length);
} scm_ptob_descriptor_t; } scm_t_ptob_descriptor;
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
# define scm_port scm_port_t # define scm_port scm_t_port
# define scm_ptob_descriptor scm_ptob_descriptor_t # define scm_ptob_descriptor scm_t_ptob_descriptor
# define scm_port_rw_active scm_port_rw_active_t # define scm_port_rw_active scm_t_port_rw_active
#endif #endif
#define SCM_TC2PTOBNUM(x) (0x0ff & ((x) >> 8)) #define SCM_TC2PTOBNUM(x) (0x0ff & ((x) >> 8))
@ -219,14 +219,14 @@ typedef struct scm_ptob_descriptor_t
extern scm_ptob_descriptor_t *scm_ptobs; extern scm_t_ptob_descriptor *scm_ptobs;
extern long scm_numptob; extern long scm_numptob;
extern long scm_port_table_room; extern long scm_t_portable_room;
extern SCM scm_markstream (SCM ptr); extern SCM scm_markstream (SCM ptr);
extern scm_bits_t scm_make_port_type (char *name, extern scm_t_bits scm_make_port_type (char *name,
int (*fill_input) (SCM port), int (*fill_input) (SCM port),
void (*write) (SCM port, void (*write) (SCM port,
const void *data, const void *data,
@ -263,12 +263,12 @@ extern SCM scm_current_load_port (void);
extern SCM scm_set_current_input_port (SCM port); extern SCM scm_set_current_input_port (SCM port);
extern SCM scm_set_current_output_port (SCM port); extern SCM scm_set_current_output_port (SCM port);
extern SCM scm_set_current_error_port (SCM port); extern SCM scm_set_current_error_port (SCM port);
extern scm_port_t * scm_add_to_port_table (SCM port); extern scm_t_port * scm_add_to_port_table (SCM port);
extern void scm_remove_from_port_table (SCM port); extern void scm_remove_from_port_table (SCM port);
extern void scm_grow_port_cbuf (SCM port, size_t requested); extern void scm_grow_port_cbuf (SCM port, size_t requested);
extern SCM scm_pt_size (void); extern SCM scm_pt_size (void);
extern SCM scm_pt_member (SCM member); extern SCM scm_pt_member (SCM member);
extern void scm_port_non_buffer (scm_port_t *pt); extern void scm_port_non_buffer (scm_t_port *pt);
extern int scm_revealed_count (SCM port); extern int scm_revealed_count (SCM port);
extern SCM scm_port_revealed (SCM port); extern SCM scm_port_revealed (SCM port);
extern SCM scm_set_port_revealed_x (SCM port, SCM rcount); extern SCM scm_set_port_revealed_x (SCM port, SCM rcount);

View file

@ -127,7 +127,7 @@ char *scm_isymnames[] =
"#<unbound>" "#<unbound>"
}; };
scm_option_t scm_print_opts[] = { scm_t_option scm_print_opts[] = {
{ SCM_OPTION_SCM, "closure-hook", SCM_UNPACK (SCM_BOOL_F), { SCM_OPTION_SCM, "closure-hook", SCM_UNPACK (SCM_BOOL_F),
"Hook for printing closures (should handle macros as well)." }, "Hook for printing closures (should handle macros as well)." },
{ SCM_OPTION_BOOLEAN, "source", 0, { SCM_OPTION_BOOLEAN, "source", 0,
@ -1050,7 +1050,7 @@ SCM_DEFINE (scm_write_char, "write-char", 1, 1, 0,
* escaped to Scheme and thus has to be freed by the GC. * escaped to Scheme and thus has to be freed by the GC.
*/ */
scm_bits_t scm_tc16_port_with_ps; scm_t_bits scm_tc16_port_with_ps;
/* Print exactly as the port itself would */ /* Print exactly as the port itself would */

View file

@ -51,7 +51,7 @@
#include "libguile/options.h" #include "libguile/options.h"
extern scm_option_t scm_print_opts[]; extern scm_t_option scm_print_opts[];
#define SCM_PRINT_CLOSURE (SCM_PACK (scm_print_opts[0].val)) #define SCM_PRINT_CLOSURE (SCM_PACK (scm_print_opts[0].val))
#define SCM_PRINT_SOURCE_P ((int) scm_print_opts[1].val) #define SCM_PRINT_SOURCE_P ((int) scm_print_opts[1].val)
@ -99,7 +99,7 @@ typedef struct scm_print_state {
extern SCM scm_print_state_vtable; extern SCM scm_print_state_vtable;
extern scm_bits_t scm_tc16_port_with_ps; extern scm_t_bits scm_tc16_port_with_ps;
extern SCM scm_print_options (SCM setting); extern SCM scm_print_options (SCM setting);
SCM scm_make_print_state (void); SCM scm_make_print_state (void);

View file

@ -60,7 +60,7 @@
/* {Procedures} /* {Procedures}
*/ */
scm_subr_entry_t *scm_subr_table; scm_t_subr_entry *scm_subr_table;
/* libguile contained approx. 700 primitive procedures on 24 Aug 1999. */ /* libguile contained approx. 700 primitive procedures on 24 Aug 1999. */
@ -81,8 +81,8 @@ scm_c_make_subr (const char *name, long type, SCM (*fcn) ())
long new_size = scm_subr_table_room * 3 / 2; long new_size = scm_subr_table_room * 3 / 2;
void *new_table void *new_table
= scm_must_realloc ((char *) scm_subr_table, = scm_must_realloc ((char *) scm_subr_table,
sizeof (scm_subr_entry_t) * scm_subr_table_room, sizeof (scm_t_subr_entry) * scm_subr_table_room,
sizeof (scm_subr_entry_t) * new_size, sizeof (scm_t_subr_entry) * new_size,
"scm_subr_table"); "scm_subr_table");
scm_subr_table = new_table; scm_subr_table = new_table;
scm_subr_table_room = new_size; scm_subr_table_room = new_size;
@ -160,7 +160,7 @@ scm_mark_subr_table ()
SCM SCM
scm_makcclo (SCM proc, size_t len) scm_makcclo (SCM proc, size_t len)
{ {
scm_bits_t *base = scm_must_malloc (len * sizeof (scm_bits_t), "compiled-closure"); scm_t_bits *base = scm_must_malloc (len * sizeof (scm_t_bits), "compiled-closure");
unsigned long i; unsigned long i;
SCM s; SCM s;
@ -390,8 +390,8 @@ void
scm_init_subr_table () scm_init_subr_table ()
{ {
scm_subr_table scm_subr_table
= ((scm_subr_entry_t *) = ((scm_t_subr_entry *)
scm_must_malloc (sizeof (scm_subr_entry_t) * scm_subr_table_room, scm_must_malloc (sizeof (scm_t_subr_entry) * scm_subr_table_room,
"scm_subr_table")); "scm_subr_table"));
} }

View file

@ -63,10 +63,10 @@ typedef struct
* *generic == 0 until first method * *generic == 0 until first method
*/ */
SCM properties; /* procedure properties */ SCM properties; /* procedure properties */
} scm_subr_entry_t; } scm_t_subr_entry;
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
# define scm_subr_entry scm_subr_entry_t # define scm_subr_entry scm_t_subr_entry
#endif #endif
#define SCM_SUBRNUM(subr) (SCM_CELL_WORD_0 (subr) >> 8) #define SCM_SUBRNUM(subr) (SCM_CELL_WORD_0 (subr) >> 8)
@ -82,7 +82,7 @@ typedef struct
#define SCM_CCLO_LENGTH(x) (SCM_CELL_WORD_0 (x) >> 8) #define SCM_CCLO_LENGTH(x) (SCM_CELL_WORD_0 (x) >> 8)
#define SCM_SET_CCLO_LENGTH(x, v) (SCM_SET_CELL_WORD_0 ((x), ((v) << 8) + scm_tc7_cclo)) #define SCM_SET_CCLO_LENGTH(x, v) (SCM_SET_CELL_WORD_0 ((x), ((v) << 8) + scm_tc7_cclo))
#define SCM_CCLO_BASE(x) ((scm_bits_t *) SCM_CELL_WORD_1 (x)) #define SCM_CCLO_BASE(x) ((scm_t_bits *) SCM_CELL_WORD_1 (x))
#define SCM_SET_CCLO_BASE(x, v) (SCM_SET_CELL_WORD_1 ((x), (v))) #define SCM_SET_CCLO_BASE(x, v) (SCM_SET_CELL_WORD_1 ((x), (v)))
#define SCM_CCLO_REF(x, i) (SCM_PACK (SCM_CCLO_BASE (x) [i])) #define SCM_CCLO_REF(x, i) (SCM_PACK (SCM_CCLO_BASE (x) [i]))
@ -157,7 +157,7 @@ typedef struct
#define SCM_PROCEDURE(obj) SCM_CELL_OBJECT_1 (obj) #define SCM_PROCEDURE(obj) SCM_CELL_OBJECT_1 (obj)
#define SCM_SETTER(obj) SCM_CELL_OBJECT_2 (obj) #define SCM_SETTER(obj) SCM_CELL_OBJECT_2 (obj)
extern scm_subr_entry_t *scm_subr_table; extern scm_t_subr_entry *scm_subr_table;
extern long scm_subr_table_size; extern long scm_subr_table_size;
extern long scm_subr_table_room; extern long scm_subr_table_room;

View file

@ -190,9 +190,9 @@ int
scm_ra_matchp (SCM ra0, SCM ras) scm_ra_matchp (SCM ra0, SCM ras)
{ {
SCM ra1; SCM ra1;
scm_array_dim_t dims; scm_t_array_dim dims;
scm_array_dim_t *s0 = &dims; scm_t_array_dim *s0 = &dims;
scm_array_dim_t *s1; scm_t_array_dim *s1;
unsigned long bas0 = 0; unsigned long bas0 = 0;
int i, ndim = 1; int i, ndim = 1;
int exact = 2 /* 4 */ ; /* Don't care about values >2 (yet?) */ int exact = 2 /* 4 */ ; /* Don't care about values >2 (yet?) */
@ -1912,8 +1912,8 @@ static int
raeql (SCM ra0,SCM as_equal,SCM ra1) raeql (SCM ra0,SCM as_equal,SCM ra1)
{ {
SCM v0 = ra0, v1 = ra1; SCM v0 = ra0, v1 = ra1;
scm_array_dim_t dim0, dim1; scm_t_array_dim dim0, dim1;
scm_array_dim_t *s0 = &dim0, *s1 = &dim1; scm_t_array_dim *s0 = &dim0, *s1 = &dim1;
unsigned long bas0 = 0, bas1 = 0; unsigned long bas0 = 0, bas1 = 0;
int k, unroll = 1, vlen = 1, ndim = 1; int k, unroll = 1, vlen = 1, ndim = 1;
if (SCM_ARRAYP (ra0)) if (SCM_ARRAYP (ra0))

View file

@ -73,7 +73,7 @@
* scm_init_random(). * scm_init_random().
*/ */
scm_rng_t scm_the_rng; scm_t_rng scm_the_rng;
/* /*
@ -106,7 +106,7 @@ scm_rng_t scm_the_rng;
#if SIZEOF_LONG > 4 || defined (HAVE_LONG_LONGS) #if SIZEOF_LONG > 4 || defined (HAVE_LONG_LONGS)
unsigned long unsigned long
scm_i_uniform32 (scm_i_rstate_t *state) scm_i_uniform32 (scm_t_i_rstate *state)
{ {
LONG64 x = (LONG64) A * state->w + state->c; LONG64 x = (LONG64) A * state->w + state->c;
LONG32 w = x & 0xffffffffUL; LONG32 w = x & 0xffffffffUL;
@ -132,7 +132,7 @@ scm_i_uniform32 (scm_i_rstate_t *state)
#define H(x) ((x) >> 16) #define H(x) ((x) >> 16)
unsigned long unsigned long
scm_i_uniform32 (scm_i_rstate_t *state) scm_i_uniform32 (scm_t_i_rstate *state)
{ {
LONG32 x1 = L (A) * L (state->w); LONG32 x1 = L (A) * L (state->w);
LONG32 x2 = L (A) * H (state->w); LONG32 x2 = L (A) * H (state->w);
@ -148,7 +148,7 @@ scm_i_uniform32 (scm_i_rstate_t *state)
#endif #endif
void void
scm_i_init_rstate (scm_i_rstate_t *state, char *seed, int n) scm_i_init_rstate (scm_t_i_rstate *state, char *seed, int n)
{ {
LONG32 w = 0L; LONG32 w = 0L;
LONG32 c = 0L; LONG32 c = 0L;
@ -167,10 +167,10 @@ scm_i_init_rstate (scm_i_rstate_t *state, char *seed, int n)
state->c = c; state->c = c;
} }
scm_i_rstate_t * scm_t_i_rstate *
scm_i_copy_rstate (scm_i_rstate_t *state) scm_i_copy_rstate (scm_t_i_rstate *state)
{ {
scm_rstate_t *new_state = malloc (scm_the_rng.rstate_size); scm_t_rstate *new_state = malloc (scm_the_rng.rstate_size);
if (new_state == 0) if (new_state == 0)
scm_memory_error ("rstate"); scm_memory_error ("rstate");
return memcpy (new_state, state, scm_the_rng.rstate_size); return memcpy (new_state, state, scm_the_rng.rstate_size);
@ -181,10 +181,10 @@ scm_i_copy_rstate (scm_i_rstate_t *state)
* Random number library functions * Random number library functions
*/ */
scm_rstate_t * scm_t_rstate *
scm_c_make_rstate (char *seed, int n) scm_c_make_rstate (char *seed, int n)
{ {
scm_rstate_t *state = malloc (scm_the_rng.rstate_size); scm_t_rstate *state = malloc (scm_the_rng.rstate_size);
if (state == 0) if (state == 0)
scm_memory_error ("rstate"); scm_memory_error ("rstate");
state->reserved0 = 0; state->reserved0 = 0;
@ -193,7 +193,7 @@ scm_c_make_rstate (char *seed, int n)
} }
scm_rstate_t * scm_t_rstate *
scm_c_default_rstate () scm_c_default_rstate ()
#define FUNC_NAME "scm_c_default_rstate" #define FUNC_NAME "scm_c_default_rstate"
{ {
@ -206,7 +206,7 @@ scm_c_default_rstate ()
inline double inline double
scm_c_uniform01 (scm_rstate_t *state) scm_c_uniform01 (scm_t_rstate *state)
{ {
double x = (double) scm_the_rng.random_bits (state) / (double) 0xffffffffUL; double x = (double) scm_the_rng.random_bits (state) / (double) 0xffffffffUL;
return ((x + (double) scm_the_rng.random_bits (state)) return ((x + (double) scm_the_rng.random_bits (state))
@ -214,7 +214,7 @@ scm_c_uniform01 (scm_rstate_t *state)
} }
double double
scm_c_normal01 (scm_rstate_t *state) scm_c_normal01 (scm_t_rstate *state)
{ {
if (state->reserved0) if (state->reserved0)
{ {
@ -237,7 +237,7 @@ scm_c_normal01 (scm_rstate_t *state)
} }
double double
scm_c_exp1 (scm_rstate_t *state) scm_c_exp1 (scm_t_rstate *state)
{ {
return - log (scm_c_uniform01 (state)); return - log (scm_c_uniform01 (state));
} }
@ -245,7 +245,7 @@ scm_c_exp1 (scm_rstate_t *state)
unsigned char scm_masktab[256]; unsigned char scm_masktab[256];
unsigned long unsigned long
scm_c_random (scm_rstate_t *state, unsigned long m) scm_c_random (scm_t_rstate *state, unsigned long m)
{ {
unsigned int r, mask; unsigned int r, mask;
mask = (m < 0x100 mask = (m < 0x100
@ -260,7 +260,7 @@ scm_c_random (scm_rstate_t *state, unsigned long m)
} }
SCM SCM
scm_c_random_bignum (scm_rstate_t *state, SCM m) scm_c_random_bignum (scm_t_rstate *state, SCM m)
{ {
SCM b; SCM b;
int i, nd; int i, nd;
@ -333,10 +333,10 @@ scm_c_random_bignum (scm_rstate_t *state, SCM m)
* Scheme level representation of random states. * Scheme level representation of random states.
*/ */
scm_bits_t scm_tc16_rstate; scm_t_bits scm_tc16_rstate;
static SCM static SCM
make_rstate (scm_rstate_t *state) make_rstate (scm_t_rstate *state)
{ {
SCM_RETURN_NEWSMOB (scm_tc16_rstate, state); SCM_RETURN_NEWSMOB (scm_tc16_rstate, state);
} }
@ -568,12 +568,12 @@ scm_init_random ()
{ {
int i, m; int i, m;
/* plug in default RNG */ /* plug in default RNG */
scm_rng_t rng = scm_t_rng rng =
{ {
sizeof (scm_i_rstate_t), sizeof (scm_t_i_rstate),
(unsigned long (*)()) scm_i_uniform32, (unsigned long (*)()) scm_i_uniform32,
(void (*)()) scm_i_init_rstate, (void (*)()) scm_i_init_rstate,
(scm_rstate_t *(*)()) scm_i_copy_rstate (scm_t_rstate *(*)()) scm_i_copy_rstate
}; };
scm_the_rng = rng; scm_the_rng = rng;

View file

@ -62,61 +62,61 @@
* Look how the default generator is "plugged in" in scm_init_random(). * Look how the default generator is "plugged in" in scm_init_random().
*/ */
typedef struct scm_rstate_t { typedef struct scm_t_rstate {
int reserved0; int reserved0;
double reserved1; double reserved1;
/* Custom fields follow here */ /* Custom fields follow here */
} scm_rstate_t; } scm_t_rstate;
typedef struct scm_rng_t { typedef struct scm_t_rng {
size_t rstate_size; /* size of random state */ size_t rstate_size; /* size of random state */
unsigned long (*random_bits) (scm_rstate_t *state); /* gives 32 random bits */ unsigned long (*random_bits) (scm_t_rstate *state); /* gives 32 random bits */
void (*init_rstate) (scm_rstate_t *state, char *seed, int n); void (*init_rstate) (scm_t_rstate *state, char *seed, int n);
scm_rstate_t *(*copy_rstate) (scm_rstate_t *state); scm_t_rstate *(*copy_rstate) (scm_t_rstate *state);
} scm_rng_t; } scm_t_rng;
extern scm_rng_t scm_the_rng; extern scm_t_rng scm_the_rng;
/* /*
* Default RNG * Default RNG
*/ */
typedef struct scm_i_rstate_t { typedef struct scm_t_i_rstate {
scm_rstate_t rstate; scm_t_rstate rstate;
unsigned long w; unsigned long w;
unsigned long c; unsigned long c;
} scm_i_rstate_t; } scm_t_i_rstate;
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
# define scm_rstate scm_rstate_t # define scm_rstate scm_t_rstate
# define scm_rng scm_rng_t # define scm_rng scm_t_rng
# define scm_i_rstate scm_i_rstate_t # define scm_i_rstate scm_t_i_rstate
#endif #endif
extern unsigned long scm_i_uniform32 (scm_i_rstate_t *); extern unsigned long scm_i_uniform32 (scm_t_i_rstate *);
extern void scm_i_init_rstate (scm_i_rstate_t *, char *seed, int n); extern void scm_i_init_rstate (scm_t_i_rstate *, char *seed, int n);
extern scm_i_rstate_t *scm_i_copy_rstate (scm_i_rstate_t *); extern scm_t_i_rstate *scm_i_copy_rstate (scm_t_i_rstate *);
/* /*
* Random number library functions * Random number library functions
*/ */
extern scm_rstate_t *scm_c_make_rstate (char *, int); extern scm_t_rstate *scm_c_make_rstate (char *, int);
extern scm_rstate_t *scm_c_default_rstate (void); extern scm_t_rstate *scm_c_default_rstate (void);
#define scm_c_uniform32(RSTATE) scm_the_rng.random_bits (RSTATE) #define scm_c_uniform32(RSTATE) scm_the_rng.random_bits (RSTATE)
extern double scm_c_uniform01 (scm_rstate_t *); extern double scm_c_uniform01 (scm_t_rstate *);
extern double scm_c_normal01 (scm_rstate_t *); extern double scm_c_normal01 (scm_t_rstate *);
extern double scm_c_exp1 (scm_rstate_t *); extern double scm_c_exp1 (scm_t_rstate *);
extern unsigned long scm_c_random (scm_rstate_t *, unsigned long m); extern unsigned long scm_c_random (scm_t_rstate *, unsigned long m);
extern SCM scm_c_random_bignum (scm_rstate_t *, SCM m); extern SCM scm_c_random_bignum (scm_t_rstate *, SCM m);
/* /*
* Scheme level interface * Scheme level interface
*/ */
extern scm_bits_t scm_tc16_rstate; extern scm_t_bits scm_tc16_rstate;
#define SCM_RSTATEP(obj) SCM_TYP16_PREDICATE (scm_tc16_rstate, obj) #define SCM_RSTATEP(obj) SCM_TYP16_PREDICATE (scm_tc16_rstate, obj)
#define SCM_RSTATE(obj) ((scm_rstate_t *) SCM_CELL_WORD_1 (obj)) #define SCM_RSTATE(obj) ((scm_t_rstate *) SCM_CELL_WORD_1 (obj))
extern unsigned char scm_masktab[256]; extern unsigned char scm_masktab[256];

View file

@ -124,7 +124,7 @@ SCM_DEFINE (scm_read_delimited_x, "%read-delimited!", 3, 3, 0,
static unsigned char * static unsigned char *
scm_do_read_line (SCM port, size_t *len_p) scm_do_read_line (SCM port, size_t *len_p)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
unsigned char *end; unsigned char *end;
/* I thought reading lines was simple. Mercy me. */ /* I thought reading lines was simple. Mercy me. */
@ -223,7 +223,7 @@ SCM_DEFINE (scm_read_line, "%read-line", 0, 1, 0,
"@code{(#<eof> . #<eof>)}.") "@code{(#<eof> . #<eof>)}.")
#define FUNC_NAME s_scm_read_line #define FUNC_NAME s_scm_read_line
{ {
scm_port_t *pt; scm_t_port *pt;
char *s; char *s;
size_t slen; size_t slen;
SCM line, term; SCM line, term;

View file

@ -66,7 +66,7 @@
SCM_SYMBOL (scm_keyword_prefix, "prefix"); SCM_SYMBOL (scm_keyword_prefix, "prefix");
scm_option_t scm_read_opts[] = { scm_t_option scm_read_opts[] = {
{ SCM_OPTION_BOOLEAN, "copy", 0, { SCM_OPTION_BOOLEAN, "copy", 0,
"Copy source code expressions." }, "Copy source code expressions." },
{ SCM_OPTION_BOOLEAN, "positions", 0, { SCM_OPTION_BOOLEAN, "positions", 0,

View file

@ -67,7 +67,7 @@
#define SCM_WHITE_SPACES SCM_SINGLE_SPACES: case '\t' #define SCM_WHITE_SPACES SCM_SINGLE_SPACES: case '\t'
extern scm_option_t scm_read_opts[]; extern scm_t_option scm_read_opts[];
#define SCM_COPY_SOURCE_P scm_read_opts[0].val #define SCM_COPY_SOURCE_P scm_read_opts[0].val
#define SCM_RECORD_POSITIONS_P scm_read_opts[1].val #define SCM_RECORD_POSITIONS_P scm_read_opts[1].val

View file

@ -91,7 +91,7 @@
#define REG_BASIC 0 #define REG_BASIC 0
#endif #endif
scm_bits_t scm_tc16_regex; scm_t_bits scm_tc16_regex;
static size_t static size_t
regex_free (SCM obj) regex_free (SCM obj)

View file

@ -50,7 +50,7 @@
#include "libguile/__scm.h" #include "libguile/__scm.h"
extern scm_bits_t scm_tc16_regex; extern scm_t_bits scm_tc16_regex;
#define SCM_RGX(X) ((regex_t *) SCM_CELL_WORD_1 (X)) #define SCM_RGX(X) ((regex_t *) SCM_CELL_WORD_1 (X))
#define SCM_RGXP(X) (SCM_NIMP (X) && (SCM_CELL_TYPE (X) == scm_tc16_regex)) #define SCM_RGXP(X) (SCM_NIMP (X) && (SCM_CELL_TYPE (X) == scm_tc16_regex))

View file

@ -60,7 +60,7 @@
SCM scm_sys_protects[SCM_NUM_PROTECTS]; SCM scm_sys_protects[SCM_NUM_PROTECTS];
scm_bits_t scm_tc16_root; scm_t_bits scm_tc16_root;
#ifndef USE_THREADS #ifndef USE_THREADS
struct scm_root_state *scm_root; struct scm_root_state *scm_root;
@ -238,8 +238,8 @@ cwdr_handler (void *data, SCM tag, SCM args)
* in a messed up state. */ * in a messed up state. */
SCM SCM
scm_internal_cwdr (scm_catch_body_t body, void *body_data, scm_internal_cwdr (scm_t_catch_body body, void *body_data,
scm_catch_handler_t handler, void *handler_data, scm_t_catch_handler handler, void *handler_data,
SCM_STACKITEM *stack_start) SCM_STACKITEM *stack_start)
{ {
int old_ints_disabled = scm_ints_disabled; int old_ints_disabled = scm_ints_disabled;
@ -253,7 +253,7 @@ scm_internal_cwdr (scm_catch_body_t body, void *body_data,
SCM_REDEFER_INTS; SCM_REDEFER_INTS;
{ {
scm_contregs_t *contregs = scm_must_malloc (sizeof (scm_contregs_t), scm_t_contregs *contregs = scm_must_malloc (sizeof (scm_t_contregs),
"inferior root continuation"); "inferior root continuation");
contregs->num_stack_items = 0; contregs->num_stack_items = 0;

View file

@ -80,7 +80,7 @@ extern SCM scm_sys_protects[];
extern scm_bits_t scm_tc16_root; extern scm_t_bits scm_tc16_root;
#define SCM_ROOTP(obj) SCM_TYP16_PREDICATE (scm_tc16_root, obj) #define SCM_ROOTP(obj) SCM_TYP16_PREDICATE (scm_tc16_root, obj)
#define SCM_ROOT_STATE(root) ((scm_root_state *) SCM_CELL_WORD_1 (root)) #define SCM_ROOT_STATE(root) ((scm_root_state *) SCM_CELL_WORD_1 (root))
@ -97,7 +97,7 @@ typedef struct scm_root_state
SCM continuation_stack_ptr; SCM continuation_stack_ptr;
#ifdef DEBUG_EXTENSIONS #ifdef DEBUG_EXTENSIONS
/* It is very inefficient to have this variable in the root state. */ /* It is very inefficient to have this variable in the root state. */
scm_debug_frame_t *last_debug_frame; scm_t_debug_frame *last_debug_frame;
#endif #endif
SCM progargs; /* vestigial */ SCM progargs; /* vestigial */
@ -149,9 +149,9 @@ extern struct scm_root_state *scm_root;
extern SCM scm_make_root (SCM parent); extern SCM scm_make_root (SCM parent);
extern SCM scm_internal_cwdr (scm_catch_body_t body, extern SCM scm_internal_cwdr (scm_t_catch_body body,
void *body_data, void *body_data,
scm_catch_handler_t handler, scm_t_catch_handler handler,
void *handler_data, void *handler_data,
SCM_STACKITEM *stack_start); SCM_STACKITEM *stack_start);
extern SCM scm_call_with_dynamic_root (SCM thunk, SCM handler); extern SCM scm_call_with_dynamic_root (SCM thunk, SCM handler);

View file

@ -233,7 +233,7 @@ SCM_DEFINE (scm_write_string_partial, "write-string/partial", 1, 3, 0,
else else
{ {
SCM port = SCM_UNBNDP (port_or_fdes) ? scm_cur_outp : port_or_fdes; SCM port = SCM_UNBNDP (port_or_fdes) ? scm_cur_outp : port_or_fdes;
scm_port_t *pt; scm_t_port *pt;
off_t space; off_t space;
SCM_VALIDATE_OPFPORT (2, port); SCM_VALIDATE_OPFPORT (2, port);

View file

@ -288,7 +288,7 @@ scm_smob_apply_3_error (SCM smob,
scm_bits_t scm_t_bits
scm_make_smob_type (char *name, size_t size) scm_make_smob_type (char *name, size_t size)
#define FUNC_NAME "scm_make_smob_type" #define FUNC_NAME "scm_make_smob_type"
{ {
@ -320,31 +320,31 @@ scm_make_smob_type (char *name, size_t size)
void void
scm_set_smob_mark (scm_bits_t tc, SCM (*mark) (SCM)) scm_set_smob_mark (scm_t_bits tc, SCM (*mark) (SCM))
{ {
scm_smobs[SCM_TC2SMOBNUM (tc)].mark = mark; scm_smobs[SCM_TC2SMOBNUM (tc)].mark = mark;
} }
void void
scm_set_smob_free (scm_bits_t tc, size_t (*free) (SCM)) scm_set_smob_free (scm_t_bits tc, size_t (*free) (SCM))
{ {
scm_smobs[SCM_TC2SMOBNUM (tc)].free = free; scm_smobs[SCM_TC2SMOBNUM (tc)].free = free;
} }
void void
scm_set_smob_print (scm_bits_t tc, int (*print) (SCM, SCM, scm_print_state*)) scm_set_smob_print (scm_t_bits tc, int (*print) (SCM, SCM, scm_print_state*))
{ {
scm_smobs[SCM_TC2SMOBNUM (tc)].print = print; scm_smobs[SCM_TC2SMOBNUM (tc)].print = print;
} }
void void
scm_set_smob_equalp (scm_bits_t tc, SCM (*equalp) (SCM, SCM)) scm_set_smob_equalp (scm_t_bits tc, SCM (*equalp) (SCM, SCM))
{ {
scm_smobs[SCM_TC2SMOBNUM (tc)].equalp = equalp; scm_smobs[SCM_TC2SMOBNUM (tc)].equalp = equalp;
} }
void void
scm_set_smob_apply (scm_bits_t tc, SCM (*apply) (), scm_set_smob_apply (scm_t_bits tc, SCM (*apply) (),
unsigned int req, unsigned int opt, unsigned int rst) unsigned int req, unsigned int opt, unsigned int rst)
{ {
SCM (*apply_0) (SCM); SCM (*apply_0) (SCM);
@ -454,7 +454,7 @@ scm_set_smob_apply (scm_bits_t tc, SCM (*apply) (),
} }
SCM SCM
scm_make_smob (scm_bits_t tc) scm_make_smob (scm_t_bits tc)
{ {
long n = SCM_TC2SMOBNUM (tc); long n = SCM_TC2SMOBNUM (tc);
size_t size = scm_smobs[n].size; size_t size = scm_smobs[n].size;
@ -530,7 +530,7 @@ void
scm_smob_prehistory () scm_smob_prehistory ()
{ {
long i; long i;
scm_bits_t tc; scm_t_bits tc;
scm_numsmob = 0; scm_numsmob = 0;
for (i = 0; i < MAX_SMOB_COUNT; ++i) for (i = 0; i < MAX_SMOB_COUNT; ++i)

View file

@ -143,14 +143,14 @@ extern int scm_smob_print (SCM exp, SCM port, scm_print_state *pstate);
* values using `scm_set_smob_xxx'. * values using `scm_set_smob_xxx'.
*/ */
extern scm_bits_t scm_make_smob_type (char *name, size_t size); extern scm_t_bits scm_make_smob_type (char *name, size_t size);
extern void scm_set_smob_mark (scm_bits_t tc, SCM (*mark) (SCM)); extern void scm_set_smob_mark (scm_t_bits tc, SCM (*mark) (SCM));
extern void scm_set_smob_free (scm_bits_t tc, size_t (*free) (SCM)); extern void scm_set_smob_free (scm_t_bits tc, size_t (*free) (SCM));
extern void scm_set_smob_print (scm_bits_t tc, extern void scm_set_smob_print (scm_t_bits tc,
int (*print) (SCM, SCM, scm_print_state*)); int (*print) (SCM, SCM, scm_print_state*));
extern void scm_set_smob_equalp (scm_bits_t tc, SCM (*equalp) (SCM, SCM)); extern void scm_set_smob_equalp (scm_t_bits tc, SCM (*equalp) (SCM, SCM));
extern void scm_set_smob_apply (scm_bits_t tc, extern void scm_set_smob_apply (scm_t_bits tc,
SCM (*apply) (), SCM (*apply) (),
unsigned int req, unsigned int req,
unsigned int opt, unsigned int opt,
@ -158,7 +158,7 @@ extern void scm_set_smob_apply (scm_bits_t tc,
/* Function for creating smobs */ /* Function for creating smobs */
extern SCM scm_make_smob (scm_bits_t tc); extern SCM scm_make_smob (scm_t_bits tc);
extern void scm_smob_prehistory (void); extern void scm_smob_prehistory (void);

View file

@ -83,9 +83,9 @@ SCM_GLOBAL_SYMBOL (scm_sym_line, "line");
SCM_GLOBAL_SYMBOL (scm_sym_column, "column"); SCM_GLOBAL_SYMBOL (scm_sym_column, "column");
SCM_GLOBAL_SYMBOL (scm_sym_breakpoint, "breakpoint"); SCM_GLOBAL_SYMBOL (scm_sym_breakpoint, "breakpoint");
scm_bits_t scm_tc16_srcprops; scm_t_bits scm_tc16_srcprops;
static scm_srcprops_chunk_t *srcprops_chunklist = 0; static scm_t_srcprops_chunk *srcprops_chunklist = 0;
static scm_srcprops_t *srcprops_freelist = 0; static scm_t_srcprops *srcprops_freelist = 0;
static SCM static SCM
@ -100,8 +100,8 @@ srcprops_mark (SCM obj)
static size_t static size_t
srcprops_free (SCM obj) srcprops_free (SCM obj)
{ {
*((scm_srcprops_t **) SCM_CELL_WORD_1 (obj)) = srcprops_freelist; *((scm_t_srcprops **) SCM_CELL_WORD_1 (obj)) = srcprops_freelist;
srcprops_freelist = (scm_srcprops_t *) SCM_CELL_WORD_1 (obj); srcprops_freelist = (scm_t_srcprops *) SCM_CELL_WORD_1 (obj);
return 0; /* srcprops_chunks are not freed until leaving guile */ return 0; /* srcprops_chunks are not freed until leaving guile */
} }
@ -112,7 +112,7 @@ srcprops_print (SCM obj, SCM port, scm_print_state *pstate)
int writingp = SCM_WRITINGP (pstate); int writingp = SCM_WRITINGP (pstate);
scm_puts ("#<srcprops ", port); scm_puts ("#<srcprops ", port);
SCM_SET_WRITINGP (pstate, 1); SCM_SET_WRITINGP (pstate, 1);
scm_iprin1 (scm_srcprops_to_plist (obj), port, pstate); scm_iprin1 (scm_t_srcpropso_plist (obj), port, pstate);
SCM_SET_WRITINGP (pstate, writingp); SCM_SET_WRITINGP (pstate, writingp);
scm_putc ('>', port); scm_putc ('>', port);
return 1; return 1;
@ -122,17 +122,17 @@ srcprops_print (SCM obj, SCM port, scm_print_state *pstate)
SCM SCM
scm_make_srcprops (long line, int col, SCM filename, SCM copy, SCM plist) scm_make_srcprops (long line, int col, SCM filename, SCM copy, SCM plist)
{ {
register scm_srcprops_t *ptr; register scm_t_srcprops *ptr;
SCM_DEFER_INTS; SCM_DEFER_INTS;
if ((ptr = srcprops_freelist) != NULL) if ((ptr = srcprops_freelist) != NULL)
srcprops_freelist = *(scm_srcprops_t **)ptr; srcprops_freelist = *(scm_t_srcprops **)ptr;
else else
{ {
size_t i; size_t i;
scm_srcprops_chunk_t *mem; scm_t_srcprops_chunk *mem;
size_t n = sizeof (scm_srcprops_chunk_t) size_t n = sizeof (scm_t_srcprops_chunk)
+ sizeof (scm_srcprops_t) * (SRCPROPS_CHUNKSIZE - 1); + sizeof (scm_t_srcprops) * (SRCPROPS_CHUNKSIZE - 1);
SCM_SYSCALL (mem = (scm_srcprops_chunk_t *) malloc (n)); SCM_SYSCALL (mem = (scm_t_srcprops_chunk *) malloc (n));
if (mem == NULL) if (mem == NULL)
scm_memory_error ("srcprops"); scm_memory_error ("srcprops");
scm_mallocated += n; scm_mallocated += n;
@ -140,9 +140,9 @@ scm_make_srcprops (long line, int col, SCM filename, SCM copy, SCM plist)
srcprops_chunklist = mem; srcprops_chunklist = mem;
ptr = &mem->srcprops[0]; ptr = &mem->srcprops[0];
for (i = 1; i < SRCPROPS_CHUNKSIZE - 1; ++i) for (i = 1; i < SRCPROPS_CHUNKSIZE - 1; ++i)
*(scm_srcprops_t **)&ptr[i] = &ptr[i + 1]; *(scm_t_srcprops **)&ptr[i] = &ptr[i + 1];
*(scm_srcprops_t **)&ptr[SRCPROPS_CHUNKSIZE - 1] = 0; *(scm_t_srcprops **)&ptr[SRCPROPS_CHUNKSIZE - 1] = 0;
srcprops_freelist = (scm_srcprops_t *) &ptr[1]; srcprops_freelist = (scm_t_srcprops *) &ptr[1];
} }
ptr->pos = SRCPROPMAKPOS (line, col); ptr->pos = SRCPROPMAKPOS (line, col);
ptr->fname = filename; ptr->fname = filename;
@ -154,7 +154,7 @@ scm_make_srcprops (long line, int col, SCM filename, SCM copy, SCM plist)
SCM SCM
scm_srcprops_to_plist (SCM obj) scm_t_srcpropso_plist (SCM obj)
{ {
SCM plist = SRCPROPPLIST (obj); SCM plist = SRCPROPPLIST (obj);
if (!SCM_UNBNDP (SRCPROPCOPY (obj))) if (!SCM_UNBNDP (SRCPROPCOPY (obj)))
@ -182,7 +182,7 @@ SCM_DEFINE (scm_source_properties, "source-properties", 1, 0, 0,
#endif #endif
p = scm_hashq_ref (scm_source_whash, obj, SCM_BOOL_F); p = scm_hashq_ref (scm_source_whash, obj, SCM_BOOL_F);
if (SRCPROPSP (p)) if (SRCPROPSP (p))
return scm_srcprops_to_plist (p); return scm_t_srcpropso_plist (p);
return SCM_EOL; return SCM_EOL;
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -344,13 +344,13 @@ scm_init_srcprop ()
void void
scm_finish_srcprop () scm_finish_srcprop ()
{ {
register scm_srcprops_chunk_t *ptr = srcprops_chunklist, *next; register scm_t_srcprops_chunk *ptr = srcprops_chunklist, *next;
while (ptr) while (ptr)
{ {
next = ptr->next; next = ptr->next;
free ((char *) ptr); free ((char *) ptr);
scm_mallocated -= sizeof (scm_srcprops_chunk_t) scm_mallocated -= sizeof (scm_t_srcprops_chunk)
+ sizeof (scm_srcprops_t) * (SRCPROPS_CHUNKSIZE - 1); + sizeof (scm_t_srcprops) * (SRCPROPS_CHUNKSIZE - 1);
ptr = next; ptr = next;
} }
} }

View file

@ -78,26 +78,26 @@ do { \
/* {Source properties} /* {Source properties}
*/ */
extern scm_bits_t scm_tc16_srcprops; extern scm_t_bits scm_tc16_srcprops;
typedef struct scm_srcprops_t typedef struct scm_t_srcprops
{ {
unsigned long pos; unsigned long pos;
SCM fname; SCM fname;
SCM copy; SCM copy;
SCM plist; SCM plist;
} scm_srcprops_t; } scm_t_srcprops;
#define SRCPROPS_CHUNKSIZE 2047 /* Number of srcprops per chunk */ #define SRCPROPS_CHUNKSIZE 2047 /* Number of srcprops per chunk */
typedef struct scm_srcprops_chunk_t typedef struct scm_t_srcprops_chunk
{ {
struct scm_srcprops_chunk_t *next; struct scm_t_srcprops_chunk *next;
scm_srcprops_t srcprops[1]; scm_t_srcprops srcprops[1];
} scm_srcprops_chunk_t; } scm_t_srcprops_chunk;
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
# define scm_srcprops scm_srcprops_t # define scm_srcprops scm_t_srcprops
# define scm_srcprops_chunk scm_srcprops_chunk_t # define scm_srcprops_chunk scm_t_srcprops_chunk
#endif #endif
#define SCM_SOURCE_PROPERTY_FLAG_BREAK (1L << 16) #define SCM_SOURCE_PROPERTY_FLAG_BREAK (1L << 16)
@ -105,12 +105,12 @@ typedef struct scm_srcprops_chunk_t
#define SRCPROPSP(p) (SCM_TYP16_PREDICATE (scm_tc16_srcprops, p)) #define SRCPROPSP(p) (SCM_TYP16_PREDICATE (scm_tc16_srcprops, p))
#define SRCPROPBRK(p) \ #define SRCPROPBRK(p) \
(SCM_BOOL (SCM_CELL_WORD_0 (p) & SCM_SOURCE_PROPERTY_FLAG_BREAK)) (SCM_BOOL (SCM_CELL_WORD_0 (p) & SCM_SOURCE_PROPERTY_FLAG_BREAK))
#define SRCPROPPOS(p) ((scm_srcprops_t *) SCM_CELL_WORD_1 (p))->pos #define SRCPROPPOS(p) ((scm_t_srcprops *) SCM_CELL_WORD_1 (p))->pos
#define SRCPROPLINE(p) (SRCPROPPOS(p) >> 12) #define SRCPROPLINE(p) (SRCPROPPOS(p) >> 12)
#define SRCPROPCOL(p) (SRCPROPPOS(p) & 0x0fffL) #define SRCPROPCOL(p) (SRCPROPPOS(p) & 0x0fffL)
#define SRCPROPFNAME(p) ((scm_srcprops_t *) SCM_CELL_WORD_1 (p))->fname #define SRCPROPFNAME(p) ((scm_t_srcprops *) SCM_CELL_WORD_1 (p))->fname
#define SRCPROPCOPY(p) ((scm_srcprops_t *) SCM_CELL_WORD_1 (p))->copy #define SRCPROPCOPY(p) ((scm_t_srcprops *) SCM_CELL_WORD_1 (p))->copy
#define SRCPROPPLIST(p) ((scm_srcprops_t *) SCM_CELL_WORD_1 (p))->plist #define SRCPROPPLIST(p) ((scm_t_srcprops *) SCM_CELL_WORD_1 (p))->plist
#define SETSRCPROPBRK(p) \ #define SETSRCPROPBRK(p) \
(SCM_SET_CELL_WORD_0 ((p), SCM_CELL_WORD_0 (p) \ (SCM_SET_CELL_WORD_0 ((p), SCM_CELL_WORD_0 (p) \
| SCM_SOURCE_PROPERTY_FLAG_BREAK)) | SCM_SOURCE_PROPERTY_FLAG_BREAK))
@ -137,7 +137,7 @@ extern SCM scm_sym_breakpoint;
extern SCM scm_srcprops_to_plist (SCM obj); extern SCM scm_t_srcpropso_plist (SCM obj);
extern SCM scm_make_srcprops (long line, int col, SCM fname, SCM copy, SCM plist); extern SCM scm_make_srcprops (long line, int col, SCM fname, SCM copy, SCM plist);
extern SCM scm_source_property (SCM obj, SCM key); extern SCM scm_source_property (SCM obj, SCM key);
extern SCM scm_set_source_property_x (SCM obj, SCM key, SCM datum); extern SCM scm_set_source_property_x (SCM obj, SCM key, SCM datum);

View file

@ -92,11 +92,11 @@
* Representation: * Representation:
* *
* The stack is represented as a struct with an id slot and a tail * The stack is represented as a struct with an id slot and a tail
* array of scm_info_frame_t structs. * array of scm_t_info_frame structs.
* *
* A frame is represented as a pair where the car contains a stack and * A frame is represented as a pair where the car contains a stack and
* the cdr an inum. The inum is an index to the first SCM value of * the cdr an inum. The inum is an index to the first SCM value of
* the scm_info_frame_t struct. * the scm_t_info_frame struct.
* *
* Stacks * Stacks
* Constructor * Constructor
@ -129,7 +129,7 @@
*/ */
/* Stacks often contain pointers to other items on the stack; for /* Stacks often contain pointers to other items on the stack; for
example, each scm_debug_frame_t structure contains a pointer to the example, each scm_t_debug_frame structure contains a pointer to the
next frame out. When we capture a continuation, we copy the stack next frame out. When we capture a continuation, we copy the stack
into the heap, and just leave all the pointers unchanged. This into the heap, and just leave all the pointers unchanged. This
makes it simple to restore the continuation --- just copy the stack makes it simple to restore the continuation --- just copy the stack
@ -143,17 +143,17 @@
OFFSET) is a pointer to the copy in the continuation of the OFFSET) is a pointer to the copy in the continuation of the
original referent, cast to an scm_debug_MUMBLE *. */ original referent, cast to an scm_debug_MUMBLE *. */
#define RELOC_INFO(ptr, offset) \ #define RELOC_INFO(ptr, offset) \
((scm_debug_info_t *) ((SCM_STACKITEM *) (ptr) + (offset))) ((scm_t_debug_info *) ((SCM_STACKITEM *) (ptr) + (offset)))
#define RELOC_FRAME(ptr, offset) \ #define RELOC_FRAME(ptr, offset) \
((scm_debug_frame_t *) ((SCM_STACKITEM *) (ptr) + (offset))) ((scm_t_debug_frame *) ((SCM_STACKITEM *) (ptr) + (offset)))
/* Count number of debug info frames on a stack, beginning with /* Count number of debug info frames on a stack, beginning with
* DFRAME. OFFSET is used for relocation of pointers when the stack * DFRAME. OFFSET is used for relocation of pointers when the stack
* is read from a continuation. * is read from a continuation.
*/ */
static scm_bits_t static scm_t_bits
stack_depth (scm_debug_frame_t *dframe,long offset,SCM *id,int *maxp) stack_depth (scm_t_debug_frame *dframe,long offset,SCM *id,int *maxp)
{ {
long n; long n;
long max_depth = SCM_BACKTRACE_MAXDEPTH; long max_depth = SCM_BACKTRACE_MAXDEPTH;
@ -163,10 +163,10 @@ stack_depth (scm_debug_frame_t *dframe,long offset,SCM *id,int *maxp)
{ {
if (SCM_EVALFRAMEP (*dframe)) if (SCM_EVALFRAMEP (*dframe))
{ {
scm_debug_info_t * info = RELOC_INFO (dframe->info, offset); scm_t_debug_info * info = RELOC_INFO (dframe->info, offset);
n += (info - dframe->vect) / 2 + 1; n += (info - dframe->vect) / 2 + 1;
/* Data in the apply part of an eval info frame comes from previous /* Data in the apply part of an eval info frame comes from previous
stack frame if the scm_debug_info_t vector is overflowed. */ stack frame if the scm_t_debug_info vector is overflowed. */
if ((((info - dframe->vect) & 1) == 0) if ((((info - dframe->vect) & 1) == 0)
&& SCM_OVERFLOWP (*dframe) && SCM_OVERFLOWP (*dframe)
&& !SCM_UNBNDP (info[1].a.proc)) && !SCM_UNBNDP (info[1].a.proc))
@ -185,12 +185,12 @@ stack_depth (scm_debug_frame_t *dframe,long offset,SCM *id,int *maxp)
/* Read debug info from DFRAME into IFRAME. /* Read debug info from DFRAME into IFRAME.
*/ */
static void static void
read_frame (scm_debug_frame_t *dframe,long offset,scm_info_frame_t *iframe) read_frame (scm_t_debug_frame *dframe,long offset,scm_t_info_frame *iframe)
{ {
scm_bits_t flags = SCM_UNPACK (SCM_INUM0); /* UGh. */ scm_t_bits flags = SCM_UNPACK (SCM_INUM0); /* UGh. */
if (SCM_EVALFRAMEP (*dframe)) if (SCM_EVALFRAMEP (*dframe))
{ {
scm_debug_info_t * info = RELOC_INFO (dframe->info, offset); scm_t_debug_info * info = RELOC_INFO (dframe->info, offset);
if ((info - dframe->vect) & 1) if ((info - dframe->vect) & 1)
{ {
/* Debug.vect ends with apply info. */ /* Debug.vect ends with apply info. */
@ -246,16 +246,16 @@ do { \
} while (0) } while (0)
/* Fill the scm_info_frame_t vector IFRAME with data from N stack frames /* Fill the scm_t_info_frame vector IFRAME with data from N stack frames
* starting with the first stack frame represented by debug frame * starting with the first stack frame represented by debug frame
* DFRAME. * DFRAME.
*/ */
static scm_bits_t static scm_t_bits
read_frames (scm_debug_frame_t *dframe,long offset,long n,scm_info_frame_t *iframes) read_frames (scm_t_debug_frame *dframe,long offset,long n,scm_t_info_frame *iframes)
{ {
scm_info_frame_t *iframe = iframes; scm_t_info_frame *iframe = iframes;
scm_debug_info_t *info; scm_t_debug_info *info;
static SCM applybody = SCM_UNDEFINED; static SCM applybody = SCM_UNDEFINED;
/* The value of applybody has to be setup after r4rs.scm has executed. */ /* The value of applybody has to be setup after r4rs.scm has executed. */
@ -280,7 +280,7 @@ read_frames (scm_debug_frame_t *dframe,long offset,long n,scm_info_frame_t *ifra
if ((info - dframe->vect) & 1) if ((info - dframe->vect) & 1)
--info; --info;
/* Data in the apply part of an eval info frame comes from /* Data in the apply part of an eval info frame comes from
previous stack frame if the scm_debug_info_t vector is overflowed. */ previous stack frame if the scm_t_debug_info vector is overflowed. */
else if (SCM_OVERFLOWP (*dframe) else if (SCM_OVERFLOWP (*dframe)
&& !SCM_UNBNDP (info[1].a.proc)) && !SCM_UNBNDP (info[1].a.proc))
{ {
@ -347,7 +347,7 @@ read_frames (scm_debug_frame_t *dframe,long offset,long n,scm_info_frame_t *ifra
static void static void
narrow_stack (SCM stack,long inner,SCM inner_key,long outer,SCM outer_key) narrow_stack (SCM stack,long inner,SCM inner_key,long outer,SCM outer_key)
{ {
scm_stack_t *s = SCM_STACK (stack); scm_t_stack *s = SCM_STACK (stack);
long i; long i;
long n = s->length; long n = s->length;
@ -400,7 +400,7 @@ narrow_stack (SCM stack,long inner,SCM inner_key,long outer,SCM outer_key)
/* Stacks /* Stacks
*/ */
SCM scm_stack_type; SCM scm_t_stackype;
SCM_DEFINE (scm_stack_p, "stack?", 1, 0, 0, SCM_DEFINE (scm_stack_p, "stack?", 1, 0, 0,
(SCM obj), (SCM obj),
@ -423,8 +423,8 @@ SCM_DEFINE (scm_make_stack, "make-stack", 1, 0, 1,
{ {
long n, size; long n, size;
int maxp; int maxp;
scm_debug_frame_t *dframe = scm_last_debug_frame; scm_t_debug_frame *dframe = scm_last_debug_frame;
scm_info_frame_t *iframe; scm_t_info_frame *iframe;
long offset = 0; long offset = 0;
SCM stack, id; SCM stack, id;
SCM inner_cut, outer_cut; SCM inner_cut, outer_cut;
@ -437,10 +437,10 @@ SCM_DEFINE (scm_make_stack, "make-stack", 1, 0, 1,
{ {
SCM_ASSERT (SCM_NIMP (obj), obj, SCM_ARG1, FUNC_NAME); SCM_ASSERT (SCM_NIMP (obj), obj, SCM_ARG1, FUNC_NAME);
if (SCM_DEBUGOBJP (obj)) if (SCM_DEBUGOBJP (obj))
dframe = (scm_debug_frame_t *) SCM_DEBUGOBJ_FRAME (obj); dframe = (scm_t_debug_frame *) SCM_DEBUGOBJ_FRAME (obj);
else if (SCM_CONTINUATIONP (obj)) else if (SCM_CONTINUATIONP (obj))
{ {
offset = ((SCM_STACKITEM *) ((char *) SCM_CONTREGS (obj) + sizeof (scm_contregs_t)) offset = ((SCM_STACKITEM *) ((char *) SCM_CONTREGS (obj) + sizeof (scm_t_contregs))
- SCM_BASE (obj)); - SCM_BASE (obj));
#ifndef STACK_GROWS_UP #ifndef STACK_GROWS_UP
offset += SCM_CONTINUATION_LENGTH (obj); offset += SCM_CONTINUATION_LENGTH (obj);
@ -463,7 +463,7 @@ SCM_DEFINE (scm_make_stack, "make-stack", 1, 0, 1,
size = n * SCM_FRAME_N_SLOTS; size = n * SCM_FRAME_N_SLOTS;
/* Make the stack object. */ /* Make the stack object. */
stack = scm_make_struct (scm_stack_type, SCM_MAKINUM (size), SCM_EOL); stack = scm_make_struct (scm_t_stackype, SCM_MAKINUM (size), SCM_EOL);
SCM_STACK (stack) -> id = id; SCM_STACK (stack) -> id = id;
iframe = &SCM_STACK (stack) -> tail[0]; iframe = &SCM_STACK (stack) -> tail[0];
SCM_STACK (stack) -> frames = iframe; SCM_STACK (stack) -> frames = iframe;
@ -513,7 +513,7 @@ SCM_DEFINE (scm_stack_id, "stack-id", 1, 0, 0,
"Return the identifier given to @var{stack} by @code{start-stack}.") "Return the identifier given to @var{stack} by @code{start-stack}.")
#define FUNC_NAME s_scm_stack_id #define FUNC_NAME s_scm_stack_id
{ {
scm_debug_frame_t *dframe; scm_t_debug_frame *dframe;
long offset = 0; long offset = 0;
if (SCM_EQ_P (stack, SCM_BOOL_T)) if (SCM_EQ_P (stack, SCM_BOOL_T))
dframe = scm_last_debug_frame; dframe = scm_last_debug_frame;
@ -521,10 +521,10 @@ SCM_DEFINE (scm_stack_id, "stack-id", 1, 0, 0,
{ {
SCM_VALIDATE_NIM (1,stack); SCM_VALIDATE_NIM (1,stack);
if (SCM_DEBUGOBJP (stack)) if (SCM_DEBUGOBJP (stack))
dframe = (scm_debug_frame_t *) SCM_DEBUGOBJ_FRAME (stack); dframe = (scm_t_debug_frame *) SCM_DEBUGOBJ_FRAME (stack);
else if (SCM_CONTINUATIONP (stack)) else if (SCM_CONTINUATIONP (stack))
{ {
offset = ((SCM_STACKITEM *) ((char *) SCM_CONTREGS (stack) + sizeof (scm_contregs_t)) offset = ((SCM_STACKITEM *) ((char *) SCM_CONTREGS (stack) + sizeof (scm_t_contregs))
- SCM_BASE (stack)); - SCM_BASE (stack));
#ifndef STACK_GROWS_UP #ifndef STACK_GROWS_UP
offset += SCM_CONTINUATION_LENGTH (stack); offset += SCM_CONTINUATION_LENGTH (stack);
@ -587,16 +587,16 @@ SCM_DEFINE (scm_last_stack_frame, "last-stack-frame", 1, 0, 0,
"debug object or a continuation.") "debug object or a continuation.")
#define FUNC_NAME s_scm_last_stack_frame #define FUNC_NAME s_scm_last_stack_frame
{ {
scm_debug_frame_t *dframe; scm_t_debug_frame *dframe;
long offset = 0; long offset = 0;
SCM stack; SCM stack;
SCM_VALIDATE_NIM (1,obj); SCM_VALIDATE_NIM (1,obj);
if (SCM_DEBUGOBJP (obj)) if (SCM_DEBUGOBJP (obj))
dframe = (scm_debug_frame_t *) SCM_DEBUGOBJ_FRAME (obj); dframe = (scm_t_debug_frame *) SCM_DEBUGOBJ_FRAME (obj);
else if (SCM_CONTINUATIONP (obj)) else if (SCM_CONTINUATIONP (obj))
{ {
offset = ((SCM_STACKITEM *) ((char *) SCM_CONTREGS (obj) + sizeof (scm_contregs_t)) offset = ((SCM_STACKITEM *) ((char *) SCM_CONTREGS (obj) + sizeof (scm_t_contregs))
- SCM_BASE (obj)); - SCM_BASE (obj));
#ifndef STACK_GROWS_UP #ifndef STACK_GROWS_UP
offset += SCM_CONTINUATION_LENGTH (obj); offset += SCM_CONTINUATION_LENGTH (obj);
@ -612,12 +612,12 @@ SCM_DEFINE (scm_last_stack_frame, "last-stack-frame", 1, 0, 0,
if (!dframe || SCM_VOIDFRAMEP (*dframe)) if (!dframe || SCM_VOIDFRAMEP (*dframe))
return SCM_BOOL_F; return SCM_BOOL_F;
stack = scm_make_struct (scm_stack_type, SCM_MAKINUM (SCM_FRAME_N_SLOTS), stack = scm_make_struct (scm_t_stackype, SCM_MAKINUM (SCM_FRAME_N_SLOTS),
SCM_EOL); SCM_EOL);
SCM_STACK (stack) -> length = 1; SCM_STACK (stack) -> length = 1;
SCM_STACK (stack) -> frames = &SCM_STACK (stack) -> tail[0]; SCM_STACK (stack) -> frames = &SCM_STACK (stack) -> tail[0];
read_frame (dframe, offset, read_frame (dframe, offset,
(scm_info_frame_t *) &SCM_STACK (stack) -> frames[0]); (scm_t_info_frame *) &SCM_STACK (stack) -> frames[0]);
return scm_cons (stack, SCM_INUM0);; return scm_cons (stack, SCM_INUM0);;
} }
@ -747,11 +747,11 @@ scm_init_stacks ()
SCM stack_layout SCM stack_layout
= scm_make_struct_layout (scm_makfrom0str (SCM_STACK_LAYOUT)); = scm_make_struct_layout (scm_makfrom0str (SCM_STACK_LAYOUT));
vtable = scm_make_vtable_vtable (scm_nullstr, SCM_INUM0, SCM_EOL); vtable = scm_make_vtable_vtable (scm_nullstr, SCM_INUM0, SCM_EOL);
scm_stack_type scm_t_stackype
= scm_permanent_object (scm_make_struct (vtable, SCM_INUM0, = scm_permanent_object (scm_make_struct (vtable, SCM_INUM0,
scm_cons (stack_layout, scm_cons (stack_layout,
SCM_EOL))); SCM_EOL)));
scm_set_struct_vtable_name_x (scm_stack_type, scm_str2symbol ("stack")); scm_set_struct_vtable_name_x (scm_t_stackype, scm_str2symbol ("stack"));
#ifndef SCM_MAGIC_SNARFER #ifndef SCM_MAGIC_SNARFER
#include "libguile/stacks.x" #include "libguile/stacks.x"
#endif #endif

View file

@ -55,33 +55,33 @@
/* {Frames and stacks} /* {Frames and stacks}
*/ */
typedef struct scm_info_frame_t { typedef struct scm_t_info_frame {
/* SCM flags; */ /* SCM flags; */
scm_bits_t flags; scm_t_bits flags;
SCM source; SCM source;
SCM proc; SCM proc;
SCM args; SCM args;
} scm_info_frame_t; } scm_t_info_frame;
#define SCM_FRAME_N_SLOTS (sizeof (scm_info_frame_t) / sizeof (SCM)) #define SCM_FRAME_N_SLOTS (sizeof (scm_t_info_frame) / sizeof (SCM))
#define SCM_STACK(obj) ((scm_stack_t *) SCM_STRUCT_DATA (obj)) #define SCM_STACK(obj) ((scm_t_stack *) SCM_STRUCT_DATA (obj))
#define SCM_STACK_LAYOUT "pwuourpW" #define SCM_STACK_LAYOUT "pwuourpW"
typedef struct scm_stack_t { typedef struct scm_t_stack {
SCM id; /* Stack id */ SCM id; /* Stack id */
scm_info_frame_t *frames; /* Info frames */ scm_t_info_frame *frames; /* Info frames */
unsigned long length; /* Stack length */ unsigned long length; /* Stack length */
unsigned long tail_length; unsigned long tail_length;
scm_info_frame_t tail[1]; scm_t_info_frame tail[1];
} scm_stack_t; } scm_t_stack;
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
# define scm_info_frame scm_info_frame_t # define scm_info_frame scm_t_info_frame
# define scm_stack scm_stack_t # define scm_stack scm_t_stack
#endif #endif
extern SCM scm_stack_type; extern SCM scm_t_stackype;
#define SCM_STACKP(obj) (SCM_STRUCTP (obj) && SCM_EQ_P (SCM_STRUCT_VTABLE (obj), scm_stack_type)) #define SCM_STACKP(obj) (SCM_STRUCTP (obj) && SCM_EQ_P (SCM_STRUCT_VTABLE (obj), scm_t_stackype))
#define SCM_STACK_LENGTH(stack) (SCM_STACK (stack) -> length) #define SCM_STACK_LENGTH(stack) (SCM_STACK (stack) -> length)
#define SCM_FRAMEP(obj) (SCM_CONSP (obj) \ #define SCM_FRAMEP(obj) (SCM_CONSP (obj) \

View file

@ -80,13 +80,13 @@
when rw_active is SCM_PORT_NEITHER. when rw_active is SCM_PORT_NEITHER.
*/ */
scm_bits_t scm_tc16_strport; scm_t_bits scm_tc16_strport;
static int static int
stfill_buffer (SCM port) stfill_buffer (SCM port)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->read_pos >= pt->read_end) if (pt->read_pos >= pt->read_end)
return EOF; return EOF;
@ -97,7 +97,7 @@ stfill_buffer (SCM port)
/* change the size of a port's string to new_size. this doesn't /* change the size of a port's string to new_size. this doesn't
change read_buf_size. */ change read_buf_size. */
static void static void
st_resize_port (scm_port_t *pt, off_t new_size) st_resize_port (scm_t_port *pt, off_t new_size)
{ {
SCM old_stream = SCM_PACK (pt->stream); SCM old_stream = SCM_PACK (pt->stream);
SCM new_stream = scm_allocate_string (new_size); SCM new_stream = scm_allocate_string (new_size);
@ -130,7 +130,7 @@ st_resize_port (scm_port_t *pt, off_t new_size)
static void static void
st_flush (SCM port) st_flush (SCM port)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->write_pos == pt->write_end) if (pt->write_pos == pt->write_end)
{ {
@ -148,7 +148,7 @@ st_flush (SCM port)
static void static void
st_write (SCM port, const void *data, size_t size) st_write (SCM port, const void *data, size_t size)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
const char *input = (char *) data; const char *input = (char *) data;
while (size > 0) while (size > 0)
@ -168,7 +168,7 @@ st_write (SCM port, const void *data, size_t size)
static void static void
st_end_input (SCM port, int offset) st_end_input (SCM port, int offset)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->read_pos - pt->read_buf < offset) if (pt->read_pos - pt->read_buf < offset)
scm_misc_error ("st_end_input", "negative position", SCM_EOL); scm_misc_error ("st_end_input", "negative position", SCM_EOL);
@ -180,7 +180,7 @@ st_end_input (SCM port, int offset)
static off_t static off_t
st_seek (SCM port, off_t offset, int whence) st_seek (SCM port, off_t offset, int whence)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
off_t target; off_t target;
if (pt->rw_active == SCM_PORT_READ && offset == 0 && whence == SEEK_CUR) if (pt->rw_active == SCM_PORT_READ && offset == 0 && whence == SEEK_CUR)
@ -252,7 +252,7 @@ st_seek (SCM port, off_t offset, int whence)
static void static void
st_truncate (SCM port, off_t length) st_truncate (SCM port, off_t length)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (length > pt->write_buf_size) if (length > pt->write_buf_size)
st_resize_port (pt, length); st_resize_port (pt, length);
@ -270,7 +270,7 @@ SCM
scm_mkstrport (SCM pos, SCM str, long modes, const char *caller) scm_mkstrport (SCM pos, SCM str, long modes, const char *caller)
{ {
SCM z; SCM z;
scm_port_t *pt; scm_t_port *pt;
size_t str_len; size_t str_len;
SCM_ASSERT (SCM_INUMP(pos) && SCM_INUM(pos) >= 0, pos, SCM_ARG1, caller); SCM_ASSERT (SCM_INUMP(pos) && SCM_INUM(pos) >= 0, pos, SCM_ARG1, caller);
@ -304,7 +304,7 @@ scm_mkstrport (SCM pos, SCM str, long modes, const char *caller)
/* create a new string from a string port's buffer. */ /* create a new string from a string port's buffer. */
SCM scm_strport_to_string (SCM port) SCM scm_strport_to_string (SCM port)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
if (pt->rw_active == SCM_PORT_WRITE) if (pt->rw_active == SCM_PORT_WRITE)
st_flush (port); st_flush (port);
@ -481,10 +481,10 @@ SCM_DEFINE (scm_eval_string, "eval-string", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
static scm_bits_t static scm_t_bits
scm_make_stptob () scm_make_stptob ()
{ {
scm_bits_t tc = scm_make_port_type ("string", stfill_buffer, st_write); scm_t_bits tc = scm_make_port_type ("string", stfill_buffer, st_write);
scm_set_port_mark (tc, scm_markstream); scm_set_port_mark (tc, scm_markstream);
scm_set_port_end_input (tc, st_end_input); scm_set_port_end_input (tc, st_end_input);

View file

@ -60,7 +60,7 @@
extern scm_bits_t scm_tc16_strport; extern scm_t_bits scm_tc16_strport;

View file

@ -155,7 +155,7 @@ SCM_DEFINE (scm_make_struct_layout, "make-struct-layout", 1, 0, 0,
static void static void
scm_struct_init (SCM handle, SCM layout, scm_bits_t * mem, int tail_elts, SCM inits) scm_struct_init (SCM handle, SCM layout, scm_t_bits * mem, int tail_elts, SCM inits)
{ {
unsigned char * fields_desc = (unsigned char *) SCM_SYMBOL_CHARS (layout) - 2; unsigned char * fields_desc = (unsigned char *) SCM_SYMBOL_CHARS (layout) - 2;
unsigned char prot = 0; unsigned char prot = 0;
@ -256,7 +256,7 @@ SCM_DEFINE (scm_struct_vtable_p, "struct-vtable?", 1, 0, 0,
#define FUNC_NAME s_scm_struct_vtable_p #define FUNC_NAME s_scm_struct_vtable_p
{ {
SCM layout; SCM layout;
scm_bits_t * mem; scm_t_bits * mem;
if (!SCM_STRUCTP (x)) if (!SCM_STRUCTP (x))
return SCM_BOOL_F; return SCM_BOOL_F;
@ -310,21 +310,21 @@ SCM_DEFINE (scm_struct_vtable_p, "struct-vtable?", 1, 0, 0,
Ugh. */ Ugh. */
scm_bits_t * scm_t_bits *
scm_alloc_struct (int n_words, int n_extra, char *who) scm_alloc_struct (int n_words, int n_extra, char *who)
{ {
int size = sizeof (scm_bits_t) * (n_words + n_extra) + 7; int size = sizeof (scm_t_bits) * (n_words + n_extra) + 7;
void * block = scm_must_malloc (size, who); void * block = scm_must_malloc (size, who);
/* Adjust the pointer to hide the extra words. */ /* Adjust the pointer to hide the extra words. */
scm_bits_t * p = (scm_bits_t *) block + n_extra; scm_t_bits * p = (scm_t_bits *) block + n_extra;
/* Adjust it even further so it's aligned on an eight-byte boundary. */ /* Adjust it even further so it's aligned on an eight-byte boundary. */
p = (scm_bits_t *) (((scm_bits_t) p + 7) & ~7); p = (scm_t_bits *) (((scm_t_bits) p + 7) & ~7);
/* Initialize a few fields as described above. */ /* Initialize a few fields as described above. */
p[scm_struct_i_free] = (scm_bits_t) scm_struct_free_standard; p[scm_struct_i_free] = (scm_t_bits) scm_struct_free_standard;
p[scm_struct_i_ptr] = (scm_bits_t) block; p[scm_struct_i_ptr] = (scm_t_bits) block;
p[scm_struct_i_n_words] = n_words; p[scm_struct_i_n_words] = n_words;
p[scm_struct_i_flags] = 0; p[scm_struct_i_flags] = 0;
@ -332,33 +332,33 @@ scm_alloc_struct (int n_words, int n_extra, char *who)
} }
size_t size_t
scm_struct_free_0 (scm_bits_t * vtable SCM_UNUSED, scm_struct_free_0 (scm_t_bits * vtable SCM_UNUSED,
scm_bits_t * data SCM_UNUSED) scm_t_bits * data SCM_UNUSED)
{ {
return 0; return 0;
} }
size_t size_t
scm_struct_free_light (scm_bits_t * vtable, scm_bits_t * data) scm_struct_free_light (scm_t_bits * vtable, scm_t_bits * data)
{ {
scm_must_free (data); scm_must_free (data);
return vtable [scm_struct_i_size] & ~SCM_STRUCTF_MASK; return vtable [scm_struct_i_size] & ~SCM_STRUCTF_MASK;
} }
size_t size_t
scm_struct_free_standard (scm_bits_t * vtable SCM_UNUSED, scm_bits_t * data) scm_struct_free_standard (scm_t_bits * vtable SCM_UNUSED, scm_t_bits * data)
{ {
size_t n = (data[scm_struct_i_n_words] + scm_struct_n_extra_words) size_t n = (data[scm_struct_i_n_words] + scm_struct_n_extra_words)
* sizeof (scm_bits_t) + 7; * sizeof (scm_t_bits) + 7;
scm_must_free ((void *) data[scm_struct_i_ptr]); scm_must_free ((void *) data[scm_struct_i_ptr]);
return n; return n;
} }
size_t size_t
scm_struct_free_entity (scm_bits_t * vtable SCM_UNUSED, scm_bits_t * data) scm_struct_free_entity (scm_t_bits * vtable SCM_UNUSED, scm_t_bits * data)
{ {
size_t n = (data[scm_struct_i_n_words] + scm_struct_entity_n_extra_words) size_t n = (data[scm_struct_i_n_words] + scm_struct_entity_n_extra_words)
* sizeof (scm_bits_t) + 7; * sizeof (scm_t_bits) + 7;
scm_must_free ((void *) data[scm_struct_i_ptr]); scm_must_free ((void *) data[scm_struct_i_ptr]);
return n; return n;
} }
@ -404,12 +404,12 @@ scm_free_structs (void *dummy1 SCM_UNUSED,
} }
else else
{ {
scm_bits_t word0 = SCM_CELL_WORD_0 (obj) - scm_tc3_cons_gloc; scm_t_bits word0 = SCM_CELL_WORD_0 (obj) - scm_tc3_cons_gloc;
/* access as struct */ /* access as struct */
scm_bits_t * vtable_data = (scm_bits_t *) word0; scm_t_bits * vtable_data = (scm_t_bits *) word0;
scm_bits_t * data = SCM_STRUCT_DATA (obj); scm_t_bits * data = SCM_STRUCT_DATA (obj);
scm_struct_free_t free_struct_data scm_t_struct_free free_struct_data
= ((scm_struct_free_t) vtable_data[scm_struct_i_free]); = ((scm_t_struct_free) vtable_data[scm_struct_i_free]);
SCM_SET_CELL_TYPE (obj, scm_tc_free_cell); SCM_SET_CELL_TYPE (obj, scm_tc_free_cell);
free_struct_data (vtable_data, data); free_struct_data (vtable_data, data);
} }
@ -445,7 +445,7 @@ SCM_DEFINE (scm_make_struct, "make-struct", 2, 0, 1,
SCM layout; SCM layout;
int basic_size; int basic_size;
int tail_elts; int tail_elts;
scm_bits_t * data; scm_t_bits * data;
SCM handle; SCM handle;
SCM_VALIDATE_VTABLE (1,vtable); SCM_VALIDATE_VTABLE (1,vtable);
@ -472,7 +472,7 @@ SCM_DEFINE (scm_make_struct, "make-struct", 2, 0, 1,
SCM_SET_CELL_WORD_1 (handle, data); SCM_SET_CELL_WORD_1 (handle, data);
SCM_SET_STRUCT_GC_CHAIN (handle, 0); SCM_SET_STRUCT_GC_CHAIN (handle, 0);
scm_struct_init (handle, layout, data, tail_elts, init); scm_struct_init (handle, layout, data, tail_elts, init);
SCM_SET_CELL_WORD_0 (handle, (scm_bits_t) SCM_STRUCT_DATA (vtable) + scm_tc3_cons_gloc); SCM_SET_CELL_WORD_0 (handle, (scm_t_bits) SCM_STRUCT_DATA (vtable) + scm_tc3_cons_gloc);
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
return handle; return handle;
} }
@ -532,7 +532,7 @@ SCM_DEFINE (scm_make_vtable_vtable, "make-vtable-vtable", 2, 0, 1,
SCM layout; SCM layout;
int basic_size; int basic_size;
int tail_elts; int tail_elts;
scm_bits_t * data; scm_t_bits * data;
SCM handle; SCM handle;
SCM_VALIDATE_STRING (1, user_fields); SCM_VALIDATE_STRING (1, user_fields);
@ -552,7 +552,7 @@ SCM_DEFINE (scm_make_vtable_vtable, "make-vtable-vtable", 2, 0, 1,
SCM_SET_STRUCT_GC_CHAIN (handle, 0); SCM_SET_STRUCT_GC_CHAIN (handle, 0);
data [scm_vtable_index_layout] = SCM_UNPACK (layout); data [scm_vtable_index_layout] = SCM_UNPACK (layout);
scm_struct_init (handle, layout, data, tail_elts, scm_cons (layout, init)); scm_struct_init (handle, layout, data, tail_elts, scm_cons (layout, init));
SCM_SET_CELL_WORD_0 (handle, (scm_bits_t) data + scm_tc3_cons_gloc); SCM_SET_CELL_WORD_0 (handle, (scm_t_bits) data + scm_tc3_cons_gloc);
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
return handle; return handle;
} }
@ -571,10 +571,10 @@ SCM_DEFINE (scm_struct_ref, "struct-ref", 2, 0, 0,
#define FUNC_NAME s_scm_struct_ref #define FUNC_NAME s_scm_struct_ref
{ {
SCM answer = SCM_UNDEFINED; SCM answer = SCM_UNDEFINED;
scm_bits_t * data; scm_t_bits * data;
SCM layout; SCM layout;
int p; int p;
scm_bits_t n_fields; scm_t_bits n_fields;
char * fields_desc; char * fields_desc;
char field_type = 0; char field_type = 0;
@ -648,7 +648,7 @@ SCM_DEFINE (scm_struct_set_x, "struct-set!", 3, 0, 0,
"to.") "to.")
#define FUNC_NAME s_scm_struct_set_x #define FUNC_NAME s_scm_struct_set_x
{ {
scm_bits_t * data; scm_t_bits * data;
SCM layout; SCM layout;
int p; int p;
int n_fields; int n_fields;

View file

@ -70,7 +70,7 @@
#define scm_vtable_index_printer 3 /* A printer for this struct type. */ #define scm_vtable_index_printer 3 /* A printer for this struct type. */
#define scm_vtable_offset_user 4 /* Where do user fields start? */ #define scm_vtable_offset_user 4 /* Where do user fields start? */
typedef size_t (*scm_struct_free_t) (scm_bits_t * vtable, scm_bits_t * data); typedef size_t (*scm_t_struct_free) (scm_t_bits * vtable, scm_t_bits * data);
#define SCM_STRUCTF_MASK (0xFFF << 20) #define SCM_STRUCTF_MASK (0xFFF << 20)
#define SCM_STRUCTF_ENTITY (1L << 30) /* Indicates presence of proc slots */ #define SCM_STRUCTF_ENTITY (1L << 30) /* Indicates presence of proc slots */
@ -79,8 +79,8 @@ typedef size_t (*scm_struct_free_t) (scm_bits_t * vtable, scm_bits_t * data);
/* Dirk:FIXME:: the SCM_STRUCTP predicate is also fulfilled for glocs */ /* Dirk:FIXME:: the SCM_STRUCTP predicate is also fulfilled for glocs */
#define SCM_STRUCTP(X) (SCM_NIMP(X) && (SCM_TYP3(X) == scm_tc3_cons_gloc)) #define SCM_STRUCTP(X) (SCM_NIMP(X) && (SCM_TYP3(X) == scm_tc3_cons_gloc))
#define SCM_STRUCT_DATA(X) ((scm_bits_t *) SCM_CELL_WORD_1 (X)) #define SCM_STRUCT_DATA(X) ((scm_t_bits *) SCM_CELL_WORD_1 (X))
#define SCM_STRUCT_VTABLE_DATA(X) ((scm_bits_t *) (SCM_CELL_WORD_0 (X) - scm_tc3_cons_gloc)) #define SCM_STRUCT_VTABLE_DATA(X) ((scm_t_bits *) (SCM_CELL_WORD_0 (X) - scm_tc3_cons_gloc))
#define SCM_STRUCT_LAYOUT(X) (SCM_PACK (SCM_STRUCT_VTABLE_DATA (X) [scm_vtable_index_layout])) #define SCM_STRUCT_LAYOUT(X) (SCM_PACK (SCM_STRUCT_VTABLE_DATA (X) [scm_vtable_index_layout]))
#define SCM_SET_STRUCT_LAYOUT(X, v) (SCM_STRUCT_VTABLE_DATA (X) [scm_vtable_index_layout] = SCM_UNPACK (v)) #define SCM_SET_STRUCT_LAYOUT(X, v) (SCM_STRUCT_VTABLE_DATA (X) [scm_vtable_index_layout] = SCM_UNPACK (v))
@ -91,7 +91,7 @@ typedef size_t (*scm_struct_free_t) (scm_bits_t * vtable, scm_bits_t * data);
#define SCM_STRUCT_PRINTER(X) (SCM_PACK (SCM_STRUCT_VTABLE_DATA (X) [scm_vtable_index_printer])) #define SCM_STRUCT_PRINTER(X) (SCM_PACK (SCM_STRUCT_VTABLE_DATA (X) [scm_vtable_index_printer]))
#define SCM_SET_STRUCT_PRINTER(x, v)\ #define SCM_SET_STRUCT_PRINTER(x, v)\
(SCM_STRUCT_VTABLE_DATA (x) [scm_vtable_index_printer] = SCM_UNPACK (v)) (SCM_STRUCT_VTABLE_DATA (x) [scm_vtable_index_printer] = SCM_UNPACK (v))
#define SCM_SET_VTABLE_DESTRUCTOR(X, D) (SCM_STRUCT_DATA (X) [scm_struct_i_free] = (scm_bits_t) (D)) #define SCM_SET_VTABLE_DESTRUCTOR(X, D) (SCM_STRUCT_DATA (X) [scm_struct_i_free] = (scm_t_bits) (D))
/* Efficiency is important in the following macro, since it's used in GC */ /* Efficiency is important in the following macro, since it's used in GC */
#define SCM_LAYOUT_TAILP(X) (((X) & 32) == 0) /* R, W or O */ #define SCM_LAYOUT_TAILP(X) (((X) & 32) == 0) /* R, W or O */
@ -107,11 +107,11 @@ extern SCM scm_structs_to_free;
extern scm_bits_t * scm_alloc_struct (int n_words, int n_extra, char * who); extern scm_t_bits * scm_alloc_struct (int n_words, int n_extra, char * who);
extern size_t scm_struct_free_0 (scm_bits_t * vtable, scm_bits_t * data); extern size_t scm_struct_free_0 (scm_t_bits * vtable, scm_t_bits * data);
extern size_t scm_struct_free_light (scm_bits_t * vtable, scm_bits_t * data); extern size_t scm_struct_free_light (scm_t_bits * vtable, scm_t_bits * data);
extern size_t scm_struct_free_standard (scm_bits_t * vtable, scm_bits_t * data); extern size_t scm_struct_free_standard (scm_t_bits * vtable, scm_t_bits * data);
extern size_t scm_struct_free_entity (scm_bits_t * vtable, scm_bits_t * data); extern size_t scm_struct_free_entity (scm_t_bits * vtable, scm_t_bits * data);
extern SCM scm_make_struct_layout (SCM fields); extern SCM scm_make_struct_layout (SCM fields);
extern SCM scm_struct_p (SCM x); extern SCM scm_struct_p (SCM x);
extern SCM scm_struct_vtable_p (SCM x); extern SCM scm_struct_vtable_p (SCM x);

View file

@ -98,7 +98,7 @@ extern void scm_init_symbols (void);
#define SCM_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x))) #define SCM_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
#define SCM_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x))) #define SCM_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x)))
#define SCM_SETCHARS(x, v) (SCM_SET_CELL_WORD_1 ((x), (scm_bits_t) (v))) #define SCM_SETCHARS(x, v) (SCM_SET_CELL_WORD_1 ((x), (scm_t_bits) (v)))
#define SCM_SLOPPY_SUBSTRP(x) (SCM_SUBSTRP (x)) #define SCM_SLOPPY_SUBSTRP(x) (SCM_SUBSTRP (x))
#define SCM_SUBSTR_STR(x) (SCM_CDDR (x)) #define SCM_SUBSTR_STR(x) (SCM_CDDR (x))
#define SCM_SUBSTR_OFFSET(x) (SCM_CADR (x)) #define SCM_SUBSTR_OFFSET(x) (SCM_CADR (x))

View file

@ -61,36 +61,36 @@
/* In the beginning was the Word: /* In the beginning was the Word:
*/ */
#ifdef HAVE_UINTPTR_T #ifdef HAVE_UINTPTR_T
typedef uintptr_t scm_bits_t; typedef uintptr_t scm_t_bits;
typedef intptr_t scm_signed_bits_t; typedef intptr_t scm_t_signed_bits;
#else #else
typedef unsigned long scm_bits_t; typedef unsigned long scm_t_bits;
typedef signed long scm_signed_bits_t; typedef signed long scm_t_signed_bits;
#endif #endif
/* But as external interface, we use SCM, which may, according to the desired /* But as external interface, we use SCM, which may, according to the desired
* level of type checking, be defined in several ways: * level of type checking, be defined in several ways:
*/ */
#if (SCM_DEBUG_TYPING_STRICTNESS == 2) #if (SCM_DEBUG_TYPING_STRICTNESS == 2)
typedef union { struct { scm_bits_t n; } n; } SCM; typedef union { struct { scm_t_bits n; } n; } SCM;
static SCM scm_pack(scm_bits_t b) { SCM s; s.n.n = b; return s; } static SCM scm_pack(scm_t_bits b) { SCM s; s.n.n = b; return s; }
# define SCM_UNPACK(x) ((x).n.n) # define SCM_UNPACK(x) ((x).n.n)
# define SCM_PACK(x) (scm_pack ((scm_bits_t) (x))) # define SCM_PACK(x) (scm_pack ((scm_t_bits) (x)))
#elif (SCM_DEBUG_TYPING_STRICTNESS == 1) #elif (SCM_DEBUG_TYPING_STRICTNESS == 1)
/* This is the default, which provides an intermediate level of compile time /* This is the default, which provides an intermediate level of compile time
* type checking while still resulting in very efficient code. * type checking while still resulting in very efficient code.
*/ */
typedef struct scm_unused_struct * SCM; typedef struct scm_unused_struct * SCM;
# define SCM_UNPACK(x) ((scm_bits_t) (x)) # define SCM_UNPACK(x) ((scm_t_bits) (x))
# define SCM_PACK(x) ((SCM) (x)) # define SCM_PACK(x) ((SCM) (x))
#else #else
/* This should be used as a fall back solution for machines on which casting /* This should be used as a fall back solution for machines on which casting
* to a pointer may lead to loss of bit information, e. g. in the three least * to a pointer may lead to loss of bit information, e. g. in the three least
* significant bits. * significant bits.
*/ */
typedef scm_bits_t SCM; typedef scm_t_bits SCM;
# define SCM_UNPACK(x) (x) # define SCM_UNPACK(x) (x)
# define SCM_PACK(x) ((scm_bits_t) (x)) # define SCM_PACK(x) ((scm_t_bits) (x))
#endif #endif

View file

@ -70,9 +70,9 @@
scm_bits_t scm_tc16_thread; scm_t_bits scm_tc16_thread;
scm_bits_t scm_tc16_mutex; scm_t_bits scm_tc16_mutex;
scm_bits_t scm_tc16_condvar; scm_t_bits scm_tc16_condvar;
/* Scheme-visible thread functions. */ /* Scheme-visible thread functions. */

View file

@ -55,9 +55,9 @@
/* smob tags for the thread datatypes */ /* smob tags for the thread datatypes */
extern scm_bits_t scm_tc16_thread; extern scm_t_bits scm_tc16_thread;
extern scm_bits_t scm_tc16_mutex; extern scm_t_bits scm_tc16_mutex;
extern scm_bits_t scm_tc16_condvar; extern scm_t_bits scm_tc16_condvar;
#define SCM_THREADP(x) SCM_TYP16_PREDICATE (scm_tc16_thread, x) #define SCM_THREADP(x) SCM_TYP16_PREDICATE (scm_tc16_thread, x)
#define SCM_THREAD_DATA(x) ((void *) SCM_CELL_WORD_1 (x)) #define SCM_THREAD_DATA(x) ((void *) SCM_CELL_WORD_1 (x))
@ -79,8 +79,8 @@ SCM scm_threads_lock_mutex (SCM);
SCM scm_threads_unlock_mutex (SCM); SCM scm_threads_unlock_mutex (SCM);
SCM scm_threads_monitor (void); SCM scm_threads_monitor (void);
SCM scm_spawn_thread (scm_catch_body_t body, void *body_data, SCM scm_spawn_thread (scm_t_catch_body body, void *body_data,
scm_catch_handler_t handler, void *handler_data); scm_t_catch_handler handler, void *handler_data);
/* These are versions of the ordinary sleep and usleep functions, /* These are versions of the ordinary sleep and usleep functions,
that play nicely with the thread system. */ that play nicely with the thread system. */

View file

@ -66,7 +66,7 @@
/* the jump buffer data structure */ /* the jump buffer data structure */
static scm_bits_t tc16_jmpbuffer; static scm_t_bits tc16_jmpbuffer;
#define SCM_JMPBUFP(OBJ) SCM_TYP16_PREDICATE (tc16_jmpbuffer, OBJ) #define SCM_JMPBUFP(OBJ) SCM_TYP16_PREDICATE (tc16_jmpbuffer, OBJ)
@ -79,7 +79,7 @@ static scm_bits_t tc16_jmpbuffer;
#define JBJMPBUF(OBJ) ((jmp_buf *) SCM_CELL_WORD_1 (OBJ)) #define JBJMPBUF(OBJ) ((jmp_buf *) SCM_CELL_WORD_1 (OBJ))
#define SETJBJMPBUF(x,v) (SCM_SET_CELL_WORD_1 ((x), (v))) #define SETJBJMPBUF(x,v) (SCM_SET_CELL_WORD_1 ((x), (v)))
#ifdef DEBUG_EXTENSIONS #ifdef DEBUG_EXTENSIONS
#define SCM_JBDFRAME(x) ((scm_debug_frame_t *) SCM_CELL_WORD_2 (x)) #define SCM_JBDFRAME(x) ((scm_t_debug_frame *) SCM_CELL_WORD_2 (x))
#define SCM_SETJBDFRAME(x,v) (SCM_SET_CELL_WORD_2 ((x), (v))) #define SCM_SETJBDFRAME(x,v) (SCM_SET_CELL_WORD_2 ((x), (v)))
#endif #endif
@ -170,7 +170,7 @@ struct jmp_buf_and_retval /* use only on the stack, in scm_catch */
will be found. */ will be found. */
SCM SCM
scm_internal_catch (SCM tag, scm_catch_body_t body, void *body_data, scm_catch_handler_t handler, void *handler_data) scm_internal_catch (SCM tag, scm_t_catch_body body, void *body_data, scm_t_catch_handler handler, void *handler_data)
{ {
struct jmp_buf_and_retval jbr; struct jmp_buf_and_retval jbr;
SCM jmpbuf; SCM jmpbuf;
@ -218,7 +218,7 @@ scm_internal_catch (SCM tag, scm_catch_body_t body, void *body_data, scm_catch_h
/* scm_internal_lazy_catch (the guts of lazy catching) */ /* scm_internal_lazy_catch (the guts of lazy catching) */
/* The smob tag for lazy_catch smobs. */ /* The smob tag for lazy_catch smobs. */
static scm_bits_t tc16_lazy_catch; static scm_t_bits tc16_lazy_catch;
/* This is the structure we put on the wind list for a lazy catch. It /* This is the structure we put on the wind list for a lazy catch. It
stores the handler function to call, and the data pointer to pass stores the handler function to call, and the data pointer to pass
@ -229,7 +229,7 @@ static scm_bits_t tc16_lazy_catch;
(We don't need anything like this in the "eager" catch code, (We don't need anything like this in the "eager" catch code,
because the same C frame runs both the body and the handler.) */ because the same C frame runs both the body and the handler.) */
struct lazy_catch { struct lazy_catch {
scm_catch_handler_t handler; scm_t_catch_handler handler;
void *handler_data; void *handler_data;
}; };
@ -267,7 +267,7 @@ make_lazy_catch (struct lazy_catch *c)
- It does not unwind the stack (this is the major difference). - It does not unwind the stack (this is the major difference).
- The handler is not allowed to return. */ - The handler is not allowed to return. */
SCM SCM
scm_internal_lazy_catch (SCM tag, scm_catch_body_t body, void *body_data, scm_catch_handler_t handler, void *handler_data) scm_internal_lazy_catch (SCM tag, scm_t_catch_body body, void *body_data, scm_t_catch_handler handler, void *handler_data)
{ {
SCM lazy_catch, answer; SCM lazy_catch, answer;
struct lazy_catch c; struct lazy_catch c;
@ -307,7 +307,7 @@ ss_handler (void *data SCM_UNUSED, SCM tag, SCM throw_args)
struct cwss_data struct cwss_data
{ {
SCM tag; SCM tag;
scm_catch_body_t body; scm_t_catch_body body;
void *data; void *data;
}; };
@ -320,9 +320,9 @@ cwss_body (void *data)
SCM SCM
scm_internal_stack_catch (SCM tag, scm_internal_stack_catch (SCM tag,
scm_catch_body_t body, scm_t_catch_body body,
void *body_data, void *body_data,
scm_catch_handler_t handler, scm_t_catch_handler handler,
void *handler_data) void *handler_data)
{ {
struct cwss_data d; struct cwss_data d;

View file

@ -48,26 +48,26 @@
typedef SCM (*scm_catch_body_t) (void *data); typedef SCM (*scm_t_catch_body) (void *data);
typedef SCM (*scm_catch_handler_t) (void *data, typedef SCM (*scm_t_catch_handler) (void *data,
SCM tag, SCM throw_args); SCM tag, SCM throw_args);
extern SCM scm_internal_catch (SCM tag, extern SCM scm_internal_catch (SCM tag,
scm_catch_body_t body, scm_t_catch_body body,
void *body_data, void *body_data,
scm_catch_handler_t handler, scm_t_catch_handler handler,
void *handler_data); void *handler_data);
extern SCM scm_internal_lazy_catch (SCM tag, extern SCM scm_internal_lazy_catch (SCM tag,
scm_catch_body_t body, scm_t_catch_body body,
void *body_data, void *body_data,
scm_catch_handler_t handler, scm_t_catch_handler handler,
void *handler_data); void *handler_data);
extern SCM scm_internal_stack_catch (SCM tag, extern SCM scm_internal_stack_catch (SCM tag,
scm_catch_body_t body, scm_t_catch_body body,
void *body_data, void *body_data,
scm_catch_handler_t handler, scm_t_catch_handler handler,
void *handler_data); void *handler_data);
/* The first argument to scm_body_thunk should be a pointer to one of /* The first argument to scm_body_thunk should be a pointer to one of

View file

@ -89,7 +89,7 @@
* long long llvect * long long llvect
*/ */
scm_bits_t scm_tc16_array; scm_t_bits scm_tc16_array;
/* return the size of an element in a uniform array or 0 if type not /* return the size of an element in a uniform array or 0 if type not
found. */ found. */
@ -400,7 +400,7 @@ SCM_DEFINE (scm_array_dimensions, "array-dimensions", 1, 0, 0,
{ {
SCM res = SCM_EOL; SCM res = SCM_EOL;
size_t k; size_t k;
scm_array_dim_t *s; scm_t_array_dim *s;
if (SCM_IMP (ra)) if (SCM_IMP (ra))
return SCM_BOOL_F; return SCM_BOOL_F;
switch (SCM_TYP7 (ra)) switch (SCM_TYP7 (ra))
@ -469,7 +469,7 @@ SCM_DEFINE (scm_shared_array_increments, "shared-array-increments", 1, 0, 0,
{ {
SCM res = SCM_EOL; SCM res = SCM_EOL;
size_t k; size_t k;
scm_array_dim_t *s; scm_t_array_dim *s;
SCM_ASSERT (SCM_ARRAYP (ra), ra, SCM_ARG1, FUNC_NAME); SCM_ASSERT (SCM_ARRAYP (ra), ra, SCM_ARG1, FUNC_NAME);
k = SCM_ARRAY_NDIM (ra); k = SCM_ARRAY_NDIM (ra);
s = SCM_ARRAY_DIMS (ra); s = SCM_ARRAY_DIMS (ra);
@ -491,7 +491,7 @@ scm_aind (SCM ra, SCM args, const char *what)
register long j; register long j;
register unsigned long pos = SCM_ARRAY_BASE (ra); register unsigned long pos = SCM_ARRAY_BASE (ra);
register unsigned long k = SCM_ARRAY_NDIM (ra); register unsigned long k = SCM_ARRAY_NDIM (ra);
scm_array_dim_t *s = SCM_ARRAY_DIMS (ra); scm_t_array_dim *s = SCM_ARRAY_DIMS (ra);
if (SCM_INUMP (args)) if (SCM_INUMP (args))
{ {
if (k != 1) if (k != 1)
@ -525,9 +525,9 @@ scm_make_ra (int ndim)
SCM ra; SCM ra;
SCM_NEWCELL (ra); SCM_NEWCELL (ra);
SCM_DEFER_INTS; SCM_DEFER_INTS;
SCM_NEWSMOB(ra, ((scm_bits_t) ndim << 17) + scm_tc16_array, SCM_NEWSMOB(ra, ((scm_t_bits) ndim << 17) + scm_tc16_array,
scm_must_malloc ((sizeof (scm_array_t) + scm_must_malloc ((sizeof (scm_t_array) +
ndim * sizeof (scm_array_dim_t)), ndim * sizeof (scm_t_array_dim)),
"array")); "array"));
SCM_ARRAY_V (ra) = scm_nullvect; SCM_ARRAY_V (ra) = scm_nullvect;
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
@ -541,7 +541,7 @@ static char s_bad_spec[] = "Bad scm_array dimension";
SCM SCM
scm_shap2ra (SCM args, const char *what) scm_shap2ra (SCM args, const char *what)
{ {
scm_array_dim_t *s; scm_t_array_dim *s;
SCM ra, spec, sp; SCM ra, spec, sp;
int ndim = scm_ilength (args); int ndim = scm_ilength (args);
if (ndim < 0) if (ndim < 0)
@ -589,7 +589,7 @@ SCM_DEFINE (scm_dimensions_to_uniform_array, "dimensions->uniform-array", 2, 1,
{ {
size_t k; size_t k;
unsigned long rlen = 1; unsigned long rlen = 1;
scm_array_dim_t *s; scm_t_array_dim *s;
SCM ra; SCM ra;
if (SCM_INUMP (dims)) if (SCM_INUMP (dims))
@ -681,7 +681,7 @@ SCM_DEFINE (scm_make_shared_array, "make-shared-array", 2, 0, 1,
SCM imap; SCM imap;
size_t k, i; size_t k, i;
long old_min, new_min, old_max, new_max; long old_min, new_min, old_max, new_max;
scm_array_dim_t *s; scm_t_array_dim *s;
SCM_VALIDATE_REST_ARGUMENT (dims); SCM_VALIDATE_REST_ARGUMENT (dims);
SCM_VALIDATE_ARRAY (1,oldra); SCM_VALIDATE_ARRAY (1,oldra);
@ -809,7 +809,7 @@ SCM_DEFINE (scm_transpose_array, "transpose-array", 1, 0, 1,
#define FUNC_NAME s_scm_transpose_array #define FUNC_NAME s_scm_transpose_array
{ {
SCM res, vargs, *ve = &vargs; SCM res, vargs, *ve = &vargs;
scm_array_dim_t *s, *r; scm_t_array_dim *s, *r;
int ndim, i, k; int ndim, i, k;
SCM_VALIDATE_REST_ARGUMENT (args); SCM_VALIDATE_REST_ARGUMENT (args);
@ -918,7 +918,7 @@ SCM_DEFINE (scm_enclose_array, "enclose-array", 1, 0, 1,
#define FUNC_NAME s_scm_enclose_array #define FUNC_NAME s_scm_enclose_array
{ {
SCM axv, res, ra_inr; SCM axv, res, ra_inr;
scm_array_dim_t vdim, *s = &vdim; scm_t_array_dim vdim, *s = &vdim;
int ndim, j, k, ninr, noutr; int ndim, j, k, ninr, noutr;
SCM_VALIDATE_REST_ARGUMENT (axes); SCM_VALIDATE_REST_ARGUMENT (axes);
@ -1005,7 +1005,7 @@ SCM_DEFINE (scm_array_in_bounds_p, "array-in-bounds?", 1, 0, 1,
long pos = 0; long pos = 0;
register size_t k; register size_t k;
register long j; register long j;
scm_array_dim_t *s; scm_t_array_dim *s;
SCM_VALIDATE_REST_ARGUMENT (args); SCM_VALIDATE_REST_ARGUMENT (args);
SCM_ASRTGO (SCM_NIMP (v), badarg1); SCM_ASRTGO (SCM_NIMP (v), badarg1);
@ -1591,7 +1591,7 @@ loop:
if (SCM_NIMP (port_or_fd)) if (SCM_NIMP (port_or_fd))
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port_or_fd); scm_t_port *pt = SCM_PTAB_ENTRY (port_or_fd);
int remaining = (cend - offset) * sz; int remaining = (cend - offset) * sz;
char *dest = base + (cstart + offset) * sz; char *dest = base + (cstart + offset) * sz;
@ -2083,11 +2083,11 @@ ra2l (SCM ra,unsigned long base,unsigned long k)
} }
SCM_DEFINE (scm_array_to_list, "array->list", 1, 0, 0, SCM_DEFINE (scm_t_arrayo_list, "array->list", 1, 0, 0,
(SCM v), (SCM v),
"Return a list consisting of all the elements, in order, of\n" "Return a list consisting of all the elements, in order, of\n"
"@var{array}.") "@var{array}.")
#define FUNC_NAME s_scm_array_to_list #define FUNC_NAME s_scm_t_arrayo_list
{ {
SCM res = SCM_EOL; SCM res = SCM_EOL;
register long k; register long k;
@ -2475,7 +2475,7 @@ tail:
scm_putc ('*', port); scm_putc ('*', port);
for (i = 0; i < (SCM_BITVECTOR_LENGTH (exp)) / SCM_LONG_BIT; i++) for (i = 0; i < (SCM_BITVECTOR_LENGTH (exp)) / SCM_LONG_BIT; i++)
{ {
scm_bits_t w = SCM_UNPACK (SCM_VELTS (exp)[i]); scm_t_bits w = SCM_UNPACK (SCM_VELTS (exp)[i]);
for (j = SCM_LONG_BIT; j; j--) for (j = SCM_LONG_BIT; j; j--)
{ {
scm_putc (w & 1 ? '1' : '0', port); scm_putc (w & 1 ? '1' : '0', port);
@ -2594,8 +2594,8 @@ static size_t
array_free (SCM ptr) array_free (SCM ptr)
{ {
scm_must_free (SCM_ARRAY_MEM (ptr)); scm_must_free (SCM_ARRAY_MEM (ptr));
return sizeof (scm_array_t) + return sizeof (scm_t_array) +
SCM_ARRAY_NDIM (ptr) * sizeof (scm_array_dim_t); SCM_ARRAY_NDIM (ptr) * sizeof (scm_t_array_dim);
} }
void void

View file

@ -58,28 +58,28 @@
bit 15 is the SCM_ARRAY_FLAG_CONTIGUOUS flag bit 15 is the SCM_ARRAY_FLAG_CONTIGUOUS flag
bits 16-31 hold the smob type id: scm_tc16_array bits 16-31 hold the smob type id: scm_tc16_array
CDR: pointer to a malloced block containing an scm_array structure CDR: pointer to a malloced block containing an scm_array structure
followed by an scm_array_dim_t structure for each dimension. followed by an scm_t_array_dim structure for each dimension.
*/ */
typedef struct scm_array_t typedef struct scm_t_array
{ {
SCM v; /* the contents of the array, e.g., a vector or uniform vector. */ SCM v; /* the contents of the array, e.g., a vector or uniform vector. */
unsigned long base; unsigned long base;
} scm_array_t; } scm_t_array;
typedef struct scm_array_dim_t typedef struct scm_t_array_dim
{ {
long lbnd; long lbnd;
long ubnd; long ubnd;
long inc; long inc;
} scm_array_dim_t; } scm_t_array_dim;
#if (SCM_DEBUG_DEPRECATED == 0) #if (SCM_DEBUG_DEPRECATED == 0)
# define scm_array scm_array_t # define scm_array scm_t_array
# define scm_array_dim scm_array_dim_t # define scm_array_dim scm_t_array_dim
#endif #endif
extern scm_bits_t scm_tc16_array; extern scm_t_bits scm_tc16_array;
#define SCM_ARRAY_FLAG_CONTIGUOUS (1 << 16) #define SCM_ARRAY_FLAG_CONTIGUOUS (1 << 16)
@ -95,10 +95,10 @@ extern scm_bits_t scm_tc16_array;
#define SCM_CLR_ARRAY_CONTIGUOUS_FLAG(x) \ #define SCM_CLR_ARRAY_CONTIGUOUS_FLAG(x) \
(SCM_SET_CELL_WORD_0 ((x), SCM_CELL_WORD_0 (x) & ~SCM_ARRAY_FLAG_CONTIGUOUS)) (SCM_SET_CELL_WORD_0 ((x), SCM_CELL_WORD_0 (x) & ~SCM_ARRAY_FLAG_CONTIGUOUS))
#define SCM_ARRAY_MEM(a) ((scm_array_t *) SCM_CELL_WORD_1 (a)) #define SCM_ARRAY_MEM(a) ((scm_t_array *) SCM_CELL_WORD_1 (a))
#define SCM_ARRAY_V(a) (SCM_ARRAY_MEM (a)->v) #define SCM_ARRAY_V(a) (SCM_ARRAY_MEM (a)->v)
#define SCM_ARRAY_BASE(a) (SCM_ARRAY_MEM (a)->base) #define SCM_ARRAY_BASE(a) (SCM_ARRAY_MEM (a)->base)
#define SCM_ARRAY_DIMS(a) ((scm_array_dim_t *)((char *) SCM_ARRAY_MEM (a) + sizeof (scm_array_t))) #define SCM_ARRAY_DIMS(a) ((scm_t_array_dim *)((char *) SCM_ARRAY_MEM (a) + sizeof (scm_t_array)))
#define SCM_I_MAX_LENGTH ((unsigned long) (-1L) >> 8) #define SCM_I_MAX_LENGTH ((unsigned long) (-1L) >> 8)
@ -148,7 +148,7 @@ extern SCM scm_bit_set_star_x (SCM v, SCM kv, SCM obj);
extern SCM scm_bit_count_star (SCM v, SCM kv, SCM obj); extern SCM scm_bit_count_star (SCM v, SCM kv, SCM obj);
extern SCM scm_bit_invert_x (SCM v); extern SCM scm_bit_invert_x (SCM v);
extern SCM scm_istr2bve (char *str, long len); extern SCM scm_istr2bve (char *str, long len);
extern SCM scm_array_to_list (SCM v); extern SCM scm_t_arrayo_list (SCM v);
extern SCM scm_list_to_uniform_array (SCM ndim, SCM prot, SCM lst); extern SCM scm_list_to_uniform_array (SCM ndim, SCM prot, SCM lst);
extern int scm_raprin1 (SCM exp, SCM port, scm_print_state *pstate); extern int scm_raprin1 (SCM exp, SCM port, scm_print_state *pstate);
extern SCM scm_array_prototype (SCM ra); extern SCM scm_array_prototype (SCM ra);

View file

@ -54,7 +54,7 @@
#include "libguile/validate.h" #include "libguile/validate.h"
#include "libguile/variable.h" #include "libguile/variable.h"
scm_bits_t scm_tc16_variable; scm_t_bits scm_tc16_variable;
static int static int
variable_print (SCM exp, SCM port, scm_print_state *pstate) variable_print (SCM exp, SCM port, scm_print_state *pstate)

View file

@ -54,7 +54,7 @@
/* Variables /* Variables
*/ */
extern scm_bits_t scm_tc16_variable; extern scm_t_bits scm_tc16_variable;
#define SCM_VARIABLEP(X) SCM_SMOB_PREDICATE (scm_tc16_variable, X) #define SCM_VARIABLEP(X) SCM_SMOB_PREDICATE (scm_tc16_variable, X)

View file

@ -285,7 +285,7 @@ scm_c_make_vector (unsigned long int k, SCM fill)
#define FUNC_NAME s_scm_make_vector #define FUNC_NAME s_scm_make_vector
{ {
SCM v; SCM v;
scm_bits_t *base; scm_t_bits *base;
if (k > 0) if (k > 0)
{ {
@ -293,7 +293,7 @@ scm_c_make_vector (unsigned long int k, SCM fill)
SCM_ASSERT_RANGE (1, scm_ulong2num (k), k <= SCM_VECTOR_MAX_LENGTH); SCM_ASSERT_RANGE (1, scm_ulong2num (k), k <= SCM_VECTOR_MAX_LENGTH);
base = scm_must_malloc (k * sizeof (scm_bits_t), FUNC_NAME); base = scm_must_malloc (k * sizeof (scm_t_bits), FUNC_NAME);
for (j = 0; j != k; ++j) for (j = 0; j != k; ++j)
base[j] = SCM_UNPACK (fill); base[j] = SCM_UNPACK (fill);
} }

View file

@ -52,7 +52,7 @@
#define SCM_VECTORP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_vector)) #define SCM_VECTORP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_vector))
#define SCM_VECTOR_BASE(x) ((scm_bits_t *) SCM_CELL_WORD_1 (x)) #define SCM_VECTOR_BASE(x) ((scm_t_bits *) SCM_CELL_WORD_1 (x))
#define SCM_SET_VECTOR_BASE(v, b) (SCM_SET_CELL_WORD_1 ((v), (b))) #define SCM_SET_VECTOR_BASE(v, b) (SCM_SET_CELL_WORD_1 ((v), (b)))
#define SCM_VECTOR_MAX_LENGTH ((1L << 24) - 1) #define SCM_VECTOR_MAX_LENGTH ((1L << 24) - 1)
#define SCM_VECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8) #define SCM_VECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)

View file

@ -69,13 +69,13 @@
*/ */
static scm_bits_t scm_tc16_sfport; static scm_t_bits scm_tc16_sfport;
static void static void
sf_flush (SCM port) sf_flush (SCM port)
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
SCM stream = SCM_PACK (pt->stream); SCM stream = SCM_PACK (pt->stream);
if (pt->write_pos > pt->write_buf) if (pt->write_pos > pt->write_buf)
@ -121,7 +121,7 @@ sf_fill_input (SCM port)
return EOF; return EOF;
SCM_ASSERT (SCM_CHARP (ans), ans, SCM_ARG1, "sf_fill_input"); SCM_ASSERT (SCM_CHARP (ans), ans, SCM_ARG1, "sf_fill_input");
{ {
scm_port_t *pt = SCM_PTAB_ENTRY (port); scm_t_port *pt = SCM_PTAB_ENTRY (port);
*pt->read_buf = SCM_CHAR (ans); *pt->read_buf = SCM_CHAR (ans);
pt->read_pos = pt->read_buf; pt->read_pos = pt->read_buf;
@ -190,7 +190,7 @@ SCM_DEFINE (scm_make_soft_port, "make-soft-port", 2, 0, 0,
"@end lisp") "@end lisp")
#define FUNC_NAME s_scm_make_soft_port #define FUNC_NAME s_scm_make_soft_port
{ {
scm_port_t *pt; scm_t_port *pt;
SCM z; SCM z;
SCM_VALIDATE_VECTOR_LEN (1,pv,5); SCM_VALIDATE_VECTOR_LEN (1,pv,5);
SCM_VALIDATE_STRING (2, modes); SCM_VALIDATE_STRING (2, modes);
@ -208,10 +208,10 @@ SCM_DEFINE (scm_make_soft_port, "make-soft-port", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
static scm_bits_t static scm_t_bits
scm_make_sfptob () scm_make_sfptob ()
{ {
scm_bits_t tc = scm_make_port_type ("soft", sf_fill_input, sf_write); scm_t_bits tc = scm_make_port_type ("soft", sf_fill_input, sf_write);
scm_set_port_mark (tc, scm_markstream); scm_set_port_mark (tc, scm_markstream);
scm_set_port_flush (tc, sf_flush); scm_set_port_flush (tc, sf_flush);