1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 23:50:19 +02:00

* *.[ch]: Whitespace changes -- added space after SCM_VALIDATE_*

macros and SCM_DEFINE macros to match GNU coding standards.
This commit is contained in:
Greg J. Badros 2000-01-05 19:25:37 +00:00
parent cbaee92a8b
commit 3b3b36ddb7
61 changed files with 730 additions and 730 deletions

View file

@ -53,7 +53,7 @@
SCM_DEFINE(scm_acons, "acons", 3, 0, 0, SCM_DEFINE (scm_acons, "acons", 3, 0, 0,
(SCM key, SCM value, SCM alist), (SCM key, SCM value, SCM alist),
"Adds a new key-value pair to @var{alist}. A new pair is "Adds a new key-value pair to @var{alist}. A new pair is
created whose car is @var{key} and whose cdr is @var{value}, and the created whose car is @var{key} and whose cdr is @var{value}, and the
@ -134,7 +134,7 @@ Recommended only for use in Guile internals.")
SCM_DEFINE(scm_assq, "assq", 2, 0, 0, SCM_DEFINE (scm_assq, "assq", 2, 0, 0,
(SCM key, SCM alist), (SCM key, SCM alist),
"@deffnx primitive assv key alist "@deffnx primitive assv key alist
@deffnx primitive assoc key alist @deffnx primitive assoc key alist
@ -149,16 +149,16 @@ return the entire alist entry found (i.e. both the key and the value).")
{ {
SCM tmp; SCM tmp;
for(;SCM_NIMP(alist);alist = SCM_CDR(alist)) { for(;SCM_NIMP(alist);alist = SCM_CDR(alist)) {
SCM_VALIDATE_ALISTCELL_COPYSCM(2,alist,tmp); SCM_VALIDATE_ALISTCELL_COPYSCM (2,alist,tmp);
if (SCM_CAR(tmp)==key) return tmp; if (SCM_CAR(tmp)==key) return tmp;
} }
SCM_VALIDATE_NULL(2,alist); SCM_VALIDATE_NULL (2,alist);
return SCM_BOOL_F; return SCM_BOOL_F;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_assv, "assv", 2, 0, 0, SCM_DEFINE (scm_assv, "assv", 2, 0, 0,
(SCM key, SCM alist), (SCM key, SCM alist),
"Behaves like @code{assq} but uses @code{eqv?} for key comparison.") "Behaves like @code{assq} but uses @code{eqv?} for key comparison.")
#define FUNC_NAME s_scm_assv #define FUNC_NAME s_scm_assv
@ -179,17 +179,17 @@ SCM_DEFINE(scm_assv, "assv", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_assoc, "assoc", 2, 0, 0, SCM_DEFINE (scm_assoc, "assoc", 2, 0, 0,
(SCM key, SCM alist), (SCM key, SCM alist),
"Behaves like @code{assq} but uses @code{equal?} for key comparison.") "Behaves like @code{assq} but uses @code{equal?} for key comparison.")
#define FUNC_NAME s_scm_assoc #define FUNC_NAME s_scm_assoc
{ {
SCM tmp; SCM tmp;
for(;SCM_NIMP(alist);alist = SCM_CDR(alist)) { for(;SCM_NIMP(alist);alist = SCM_CDR(alist)) {
SCM_VALIDATE_ALISTCELL_COPYSCM(2,alist,tmp); SCM_VALIDATE_ALISTCELL_COPYSCM (2,alist,tmp);
if SCM_NFALSEP(scm_equal_p(SCM_CAR(tmp), key)) return tmp; if SCM_NFALSEP(scm_equal_p(SCM_CAR(tmp), key)) return tmp;
} }
SCM_VALIDATE_NULL(2,alist); SCM_VALIDATE_NULL (2,alist);
return SCM_BOOL_F; return SCM_BOOL_F;
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -74,7 +74,7 @@ prinarb (SCM exp, SCM port, scm_print_state *pstate)
return !0; return !0;
} }
SCM_DEFINE(scm_make_arbiter, "make-arbiter", 1, 0, 0, SCM_DEFINE (scm_make_arbiter, "make-arbiter", 1, 0, 0,
(SCM name), (SCM name),
"") "")
#define FUNC_NAME s_scm_make_arbiter #define FUNC_NAME s_scm_make_arbiter
@ -83,12 +83,12 @@ SCM_DEFINE(scm_make_arbiter, "make-arbiter", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_try_arbiter, "try-arbiter", 1, 0, 0, SCM_DEFINE (scm_try_arbiter, "try-arbiter", 1, 0, 0,
(SCM arb), (SCM arb),
"") "")
#define FUNC_NAME s_scm_try_arbiter #define FUNC_NAME s_scm_try_arbiter
{ {
SCM_VALIDATE_SMOB(1,arb,arbiter); SCM_VALIDATE_SMOB (1,arb,arbiter);
SCM_DEFER_INTS; SCM_DEFER_INTS;
if (SCM_CAR (arb) & (1L << 16)) if (SCM_CAR (arb) & (1L << 16))
arb = SCM_BOOL_F; arb = SCM_BOOL_F;
@ -103,12 +103,12 @@ SCM_DEFINE(scm_try_arbiter, "try-arbiter", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_release_arbiter, "release-arbiter", 1, 0, 0, SCM_DEFINE (scm_release_arbiter, "release-arbiter", 1, 0, 0,
(SCM arb), (SCM arb),
"") "")
#define FUNC_NAME s_scm_release_arbiter #define FUNC_NAME s_scm_release_arbiter
{ {
SCM_VALIDATE_SMOB(1,arb,arbiter); SCM_VALIDATE_SMOB (1,arb,arbiter);
if (!(SCM_CAR (arb) & (1L << 16))) if (!(SCM_CAR (arb) & (1L << 16)))
return SCM_BOOL_F; return SCM_BOOL_F;
SCM_SETCAR (arb, scm_tc16_arbiter); SCM_SETCAR (arb, scm_tc16_arbiter);

View file

@ -277,7 +277,7 @@ mark_async (SCM obj)
SCM_DEFINE(scm_async, "async", 1, 0, 0, SCM_DEFINE (scm_async, "async", 1, 0, 0,
(SCM thunk), (SCM thunk),
"") "")
#define FUNC_NAME s_scm_async #define FUNC_NAME s_scm_async
@ -290,7 +290,7 @@ SCM_DEFINE(scm_async, "async", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_system_async, "system-async", 1, 0, 0, SCM_DEFINE (scm_system_async, "system-async", 1, 0, 0,
(SCM thunk), (SCM thunk),
"") "")
#define FUNC_NAME s_scm_system_async #define FUNC_NAME s_scm_system_async
@ -305,26 +305,26 @@ SCM_DEFINE(scm_system_async, "system-async", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_async_mark, "async-mark", 1, 0, 0, SCM_DEFINE (scm_async_mark, "async-mark", 1, 0, 0,
(SCM a), (SCM a),
"") "")
#define FUNC_NAME s_scm_async_mark #define FUNC_NAME s_scm_async_mark
{ {
struct scm_async * it; struct scm_async * it;
SCM_VALIDATE_ASYNC_COPY(1,a,it); SCM_VALIDATE_ASYNC_COPY (1,a,it);
it->got_it = 1; it->got_it = 1;
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_system_async_mark, "system-async-mark", 1, 0, 0, SCM_DEFINE (scm_system_async_mark, "system-async-mark", 1, 0, 0,
(SCM a), (SCM a),
"") "")
#define FUNC_NAME s_scm_system_async_mark #define FUNC_NAME s_scm_system_async_mark
{ {
struct scm_async * it; struct scm_async * it;
SCM_VALIDATE_ASYNC_COPY(1,a,it); SCM_VALIDATE_ASYNC_COPY (1,a,it);
SCM_REDEFER_INTS; SCM_REDEFER_INTS;
it->got_it = 1; it->got_it = 1;
scm_async_rate = 1 + scm_async_rate - scm_async_clock; scm_async_rate = 1 + scm_async_rate - scm_async_clock;
@ -335,7 +335,7 @@ SCM_DEFINE(scm_system_async_mark, "system-async-mark", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_run_asyncs, "run-asyncs", 1, 0, 0, SCM_DEFINE (scm_run_asyncs, "run-asyncs", 1, 0, 0,
(SCM list_of_a), (SCM list_of_a),
"") "")
#define FUNC_NAME s_scm_run_asyncs #define FUNC_NAME s_scm_run_asyncs
@ -346,7 +346,7 @@ SCM_DEFINE(scm_run_asyncs, "run-asyncs", 1, 0, 0,
{ {
SCM a; SCM a;
struct scm_async * it; struct scm_async * it;
SCM_VALIDATE_CONS(1,list_of_a); SCM_VALIDATE_CONS (1,list_of_a);
a = SCM_CAR (list_of_a); a = SCM_CAR (list_of_a);
SCM_ASSERT (SCM_ASYNCP (a), a, SCM_ARG1, FUNC_NAME); SCM_ASSERT (SCM_ASYNCP (a), a, SCM_ARG1, FUNC_NAME);
it = SCM_ASYNC (a); it = SCM_ASYNC (a);
@ -366,7 +366,7 @@ SCM_DEFINE(scm_run_asyncs, "run-asyncs", 1, 0, 0,
SCM_DEFINE(scm_noop, "noop", 0, 0, 1, SCM_DEFINE (scm_noop, "noop", 0, 0, 1,
(SCM args), (SCM args),
"") "")
#define FUNC_NAME s_scm_noop #define FUNC_NAME s_scm_noop
@ -380,13 +380,13 @@ SCM_DEFINE(scm_noop, "noop", 0, 0, 1,
SCM_DEFINE(scm_set_tick_rate, "set-tick-rate", 1, 0, 0, SCM_DEFINE (scm_set_tick_rate, "set-tick-rate", 1, 0, 0,
(SCM n), (SCM n),
"") "")
#define FUNC_NAME s_scm_set_tick_rate #define FUNC_NAME s_scm_set_tick_rate
{ {
unsigned int old_n; unsigned int old_n;
SCM_VALIDATE_INUM(1,n); SCM_VALIDATE_INUM (1,n);
old_n = scm_tick_rate; old_n = scm_tick_rate;
scm_desired_tick_rate = SCM_INUM (n); scm_desired_tick_rate = SCM_INUM (n);
scm_async_rate = 1 + scm_async_rate - scm_async_clock; scm_async_rate = 1 + scm_async_rate - scm_async_clock;
@ -398,13 +398,13 @@ SCM_DEFINE(scm_set_tick_rate, "set-tick-rate", 1, 0, 0,
SCM_DEFINE(scm_set_switch_rate, "set-switch-rate", 1, 0, 0, SCM_DEFINE (scm_set_switch_rate, "set-switch-rate", 1, 0, 0,
(SCM n), (SCM n),
"") "")
#define FUNC_NAME s_scm_set_switch_rate #define FUNC_NAME s_scm_set_switch_rate
{ {
unsigned int old_n; unsigned int old_n;
SCM_VALIDATE_INUM(1,n); SCM_VALIDATE_INUM (1,n);
old_n = scm_switch_rate; old_n = scm_switch_rate;
scm_desired_switch_rate = SCM_INUM (n); scm_desired_switch_rate = SCM_INUM (n);
scm_async_rate = 1 + scm_async_rate - scm_async_clock; scm_async_rate = 1 + scm_async_rate - scm_async_clock;
@ -438,7 +438,7 @@ scm_sys_gc_async_thunk (void)
SCM_DEFINE(scm_unmask_signals, "unmask-signals", 0, 0, 0, SCM_DEFINE (scm_unmask_signals, "unmask-signals", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_unmask_signals #define FUNC_NAME s_scm_unmask_signals
@ -449,7 +449,7 @@ SCM_DEFINE(scm_unmask_signals, "unmask-signals", 0, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_mask_signals, "mask-signals", 0, 0, 0, SCM_DEFINE (scm_mask_signals, "mask-signals", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_mask_signals #define FUNC_NAME s_scm_mask_signals

View file

@ -246,7 +246,7 @@ display_error_handler (struct display_error_handler_data *data,
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
SCM_DEFINE(scm_display_error, "display-error", 6, 0, 0, SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0,
(SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest), (SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest),
"") "")
#define FUNC_NAME s_scm_display_error #define FUNC_NAME s_scm_display_error
@ -283,7 +283,7 @@ static print_params_t default_print_params[] = {
static print_params_t *print_params = default_print_params; static print_params_t *print_params = default_print_params;
#ifdef GUILE_DEBUG #ifdef GUILE_DEBUG
SCM_DEFINE(scm_set_print_params_x, "set-print-params!", 1, 0, 0, SCM_DEFINE (scm_set_print_params_x, "set-print-params!", 1, 0, 0,
(SCM params), (SCM params),
"") "")
#define FUNC_NAME s_scm_set_print_params_x #define FUNC_NAME s_scm_set_print_params_x
@ -385,20 +385,20 @@ display_application (SCM frame,int indentation,SCM sport,SCM port,scm_print_stat
pstate); pstate);
} }
SCM_DEFINE(scm_display_application, "display-application", 1, 2, 0, SCM_DEFINE (scm_display_application, "display-application", 1, 2, 0,
(SCM frame, SCM port, SCM indent), (SCM frame, SCM port, SCM indent),
"") "")
#define FUNC_NAME s_scm_display_application #define FUNC_NAME s_scm_display_application
{ {
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_outp; port = scm_cur_outp;
else else
SCM_VALIDATE_OPOUTPORT(2,port); SCM_VALIDATE_OPOUTPORT (2,port);
if (SCM_UNBNDP (indent)) if (SCM_UNBNDP (indent))
indent = SCM_INUM0; indent = SCM_INUM0;
else else
SCM_VALIDATE_INUM(3,indent); SCM_VALIDATE_INUM (3,indent);
if (SCM_FRAME_PROC_P (frame)) if (SCM_FRAME_PROC_P (frame))
/* Display an application. */ /* Display an application. */
@ -599,7 +599,7 @@ display_backtrace_body(struct display_backtrace_args *a)
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_display_backtrace, "display-backtrace", 2, 2, 0, SCM_DEFINE (scm_display_backtrace, "display-backtrace", 2, 2, 0,
(SCM stack, SCM port, SCM first, SCM depth), (SCM stack, SCM port, SCM first, SCM depth),
"") "")
#define FUNC_NAME s_scm_display_backtrace #define FUNC_NAME s_scm_display_backtrace
@ -621,7 +621,7 @@ SCM_DEFINE(scm_display_backtrace, "display-backtrace", 2, 2, 0,
SCM_VCELL (scm_has_shown_backtrace_hint_p_var, "has-shown-backtrace-hint?"); SCM_VCELL (scm_has_shown_backtrace_hint_p_var, "has-shown-backtrace-hint?");
SCM_DEFINE(scm_backtrace, "backtrace", 0, 0, 0, SCM_DEFINE (scm_backtrace, "backtrace", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_backtrace #define FUNC_NAME s_scm_backtrace

View file

@ -52,7 +52,7 @@
SCM_DEFINE(scm_not, "not", 1, 0, 0, SCM_DEFINE (scm_not, "not", 1, 0, 0,
(SCM x), (SCM x),
"") "")
#define FUNC_NAME s_scm_not #define FUNC_NAME s_scm_not
@ -62,7 +62,7 @@ SCM_DEFINE(scm_not, "not", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_boolean_p, "boolean?", 1, 0, 0, SCM_DEFINE (scm_boolean_p, "boolean?", 1, 0, 0,
(SCM obj), (SCM obj),
"") "")
#define FUNC_NAME s_scm_boolean_p #define FUNC_NAME s_scm_boolean_p

View file

@ -66,8 +66,8 @@ GUILE_PROC1 (scm_char_eq_p, "char=?", scm_tc7_rpsubr,
"Return #t iff X is the same character as Y, else #f.") "Return #t iff X is the same character as Y, else #f.")
#define FUNC_NAME s_scm_char_eq_p #define FUNC_NAME s_scm_char_eq_p
{ {
SCM_VALIDATE_CHAR(1,x); SCM_VALIDATE_CHAR (1,x);
SCM_VALIDATE_CHAR(2,y); SCM_VALIDATE_CHAR (2,y);
return SCM_BOOL(SCM_ICHR(x) == SCM_ICHR(y)); return SCM_BOOL(SCM_ICHR(x) == SCM_ICHR(y));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -78,8 +78,8 @@ GUILE_PROC1 (scm_char_less_p, "char<?", scm_tc7_rpsubr,
"Return #t iff X is less than Y in the Ascii sequence, else #f.") "Return #t iff X is less than Y in the Ascii sequence, else #f.")
#define FUNC_NAME s_scm_char_less_p #define FUNC_NAME s_scm_char_less_p
{ {
SCM_VALIDATE_CHAR(1,x); SCM_VALIDATE_CHAR (1,x);
SCM_VALIDATE_CHAR(2,y); SCM_VALIDATE_CHAR (2,y);
return SCM_BOOL(SCM_ICHR(x) < SCM_ICHR(y)); return SCM_BOOL(SCM_ICHR(x) < SCM_ICHR(y));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -89,8 +89,8 @@ GUILE_PROC1 (scm_char_leq_p, "char<=?", scm_tc7_rpsubr,
"Return #t iff X is less than or equal to Y in the Ascii sequence, else #f.") "Return #t iff X is less than or equal to Y in the Ascii sequence, else #f.")
#define FUNC_NAME s_scm_char_leq_p #define FUNC_NAME s_scm_char_leq_p
{ {
SCM_VALIDATE_CHAR(1,x); SCM_VALIDATE_CHAR (1,x);
SCM_VALIDATE_CHAR(2,y); SCM_VALIDATE_CHAR (2,y);
return SCM_BOOL(SCM_ICHR(x) <= SCM_ICHR(y)); return SCM_BOOL(SCM_ICHR(x) <= SCM_ICHR(y));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -100,8 +100,8 @@ GUILE_PROC1 (scm_char_gr_p, "char>?", scm_tc7_rpsubr,
"Return #t iff X is greater than Y in the Ascii sequence, else #f.") "Return #t iff X is greater than Y in the Ascii sequence, else #f.")
#define FUNC_NAME s_scm_char_gr_p #define FUNC_NAME s_scm_char_gr_p
{ {
SCM_VALIDATE_CHAR(1,x); SCM_VALIDATE_CHAR (1,x);
SCM_VALIDATE_CHAR(2,y); SCM_VALIDATE_CHAR (2,y);
return SCM_BOOL(SCM_ICHR(x) > SCM_ICHR(y)); return SCM_BOOL(SCM_ICHR(x) > SCM_ICHR(y));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -111,8 +111,8 @@ GUILE_PROC1 (scm_char_geq_p, "char>=?", scm_tc7_rpsubr,
"Return #t iff X is greater than or equal to Y in the Ascii sequence, else #f.") "Return #t iff X is greater than or equal to Y in the Ascii sequence, else #f.")
#define FUNC_NAME s_scm_char_geq_p #define FUNC_NAME s_scm_char_geq_p
{ {
SCM_VALIDATE_CHAR(1,x); SCM_VALIDATE_CHAR (1,x);
SCM_VALIDATE_CHAR(2,y); SCM_VALIDATE_CHAR (2,y);
return SCM_BOOL(SCM_ICHR(x) >= SCM_ICHR(y)); return SCM_BOOL(SCM_ICHR(x) >= SCM_ICHR(y));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -122,8 +122,8 @@ GUILE_PROC1 (scm_char_ci_eq_p, "char-ci=?", scm_tc7_rpsubr,
"Return #t iff X is the same character as Y ignoring case, else #f.") "Return #t iff X is the same character as Y ignoring case, else #f.")
#define FUNC_NAME s_scm_char_ci_eq_p #define FUNC_NAME s_scm_char_ci_eq_p
{ {
SCM_VALIDATE_CHAR(1,x); SCM_VALIDATE_CHAR (1,x);
SCM_VALIDATE_CHAR(2,y); SCM_VALIDATE_CHAR (2,y);
return SCM_BOOL(scm_upcase(SCM_ICHR(x))==scm_upcase(SCM_ICHR(y))); return SCM_BOOL(scm_upcase(SCM_ICHR(x))==scm_upcase(SCM_ICHR(y)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -133,8 +133,8 @@ GUILE_PROC1 (scm_char_ci_less_p, "char-ci<?", scm_tc7_rpsubr,
"Return #t iff X is less than Y in the Ascii sequence ignoring case, else #f.") "Return #t iff X is less than Y in the Ascii sequence ignoring case, else #f.")
#define FUNC_NAME s_scm_char_ci_less_p #define FUNC_NAME s_scm_char_ci_less_p
{ {
SCM_VALIDATE_CHAR(1,x); SCM_VALIDATE_CHAR (1,x);
SCM_VALIDATE_CHAR(2,y); SCM_VALIDATE_CHAR (2,y);
return SCM_BOOL((scm_upcase(SCM_ICHR(x))) < scm_upcase(SCM_ICHR(y))); return SCM_BOOL((scm_upcase(SCM_ICHR(x))) < scm_upcase(SCM_ICHR(y)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -144,8 +144,8 @@ GUILE_PROC1 (scm_char_ci_leq_p, "char-ci<=?", scm_tc7_rpsubr,
"Return #t iff X is less than or equal to Y in the Ascii sequence ignoring case, else #f.") "Return #t iff X is less than or equal to Y in the Ascii sequence ignoring case, else #f.")
#define FUNC_NAME s_scm_char_ci_leq_p #define FUNC_NAME s_scm_char_ci_leq_p
{ {
SCM_VALIDATE_CHAR(1,x); SCM_VALIDATE_CHAR (1,x);
SCM_VALIDATE_CHAR(2,y); SCM_VALIDATE_CHAR (2,y);
return SCM_BOOL(scm_upcase(SCM_ICHR(x)) <= scm_upcase(SCM_ICHR(y))); return SCM_BOOL(scm_upcase(SCM_ICHR(x)) <= scm_upcase(SCM_ICHR(y)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -155,8 +155,8 @@ GUILE_PROC1 (scm_char_ci_gr_p, "char-ci>?", scm_tc7_rpsubr,
"Return #t iff X is greater than Y in the Ascii sequence ignoring case, else #f.") "Return #t iff X is greater than Y in the Ascii sequence ignoring case, else #f.")
#define FUNC_NAME s_scm_char_ci_gr_p #define FUNC_NAME s_scm_char_ci_gr_p
{ {
SCM_VALIDATE_CHAR(1,x); SCM_VALIDATE_CHAR (1,x);
SCM_VALIDATE_CHAR(2,y); SCM_VALIDATE_CHAR (2,y);
return SCM_BOOL(scm_upcase(SCM_ICHR(x)) > scm_upcase(SCM_ICHR(y))); return SCM_BOOL(scm_upcase(SCM_ICHR(x)) > scm_upcase(SCM_ICHR(y)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -166,67 +166,67 @@ GUILE_PROC1 (scm_char_ci_geq_p, "char-ci>=?", scm_tc7_rpsubr,
"Return #t iff X is greater than or equal to Y in the Ascii sequence ignoring case, else #f.") "Return #t iff X is greater than or equal to Y in the Ascii sequence ignoring case, else #f.")
#define FUNC_NAME s_scm_char_ci_geq_p #define FUNC_NAME s_scm_char_ci_geq_p
{ {
SCM_VALIDATE_CHAR(1,x); SCM_VALIDATE_CHAR (1,x);
SCM_VALIDATE_CHAR(2,y); SCM_VALIDATE_CHAR (2,y);
return SCM_BOOL(scm_upcase(SCM_ICHR(x)) >= scm_upcase(SCM_ICHR(y))); return SCM_BOOL(scm_upcase(SCM_ICHR(x)) >= scm_upcase(SCM_ICHR(y)));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_char_alphabetic_p, "char-alphabetic?", 1, 0, 0, SCM_DEFINE (scm_char_alphabetic_p, "char-alphabetic?", 1, 0, 0,
(SCM chr), (SCM chr),
"Return #t iff CHR is alphabetic, else #f. "Return #t iff CHR is alphabetic, else #f.
Alphabetic means the same thing as the isalpha C library function.") Alphabetic means the same thing as the isalpha C library function.")
#define FUNC_NAME s_scm_char_alphabetic_p #define FUNC_NAME s_scm_char_alphabetic_p
{ {
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
return SCM_BOOL(isascii(SCM_ICHR(chr)) && isalpha(SCM_ICHR(chr))); return SCM_BOOL(isascii(SCM_ICHR(chr)) && isalpha(SCM_ICHR(chr)));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_char_numeric_p, "char-numeric?", 1, 0, 0, SCM_DEFINE (scm_char_numeric_p, "char-numeric?", 1, 0, 0,
(SCM chr), (SCM chr),
"Return #t iff CHR is numeric, else #f. "Return #t iff CHR is numeric, else #f.
Numeric means the same thing as the isdigit C library function.") Numeric means the same thing as the isdigit C library function.")
#define FUNC_NAME s_scm_char_numeric_p #define FUNC_NAME s_scm_char_numeric_p
{ {
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
return SCM_BOOL(isascii(SCM_ICHR(chr)) && isdigit(SCM_ICHR(chr))); return SCM_BOOL(isascii(SCM_ICHR(chr)) && isdigit(SCM_ICHR(chr)));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_char_whitespace_p, "char-whitespace?", 1, 0, 0, SCM_DEFINE (scm_char_whitespace_p, "char-whitespace?", 1, 0, 0,
(SCM chr), (SCM chr),
"Return #t iff CHR is whitespace, else #f. "Return #t iff CHR is whitespace, else #f.
Whitespace means the same thing as the isspace C library function.") Whitespace means the same thing as the isspace C library function.")
#define FUNC_NAME s_scm_char_whitespace_p #define FUNC_NAME s_scm_char_whitespace_p
{ {
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
return SCM_BOOL(isascii(SCM_ICHR(chr)) && isspace(SCM_ICHR(chr))); return SCM_BOOL(isascii(SCM_ICHR(chr)) && isspace(SCM_ICHR(chr)));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_char_upper_case_p, "char-upper-case?", 1, 0, 0, SCM_DEFINE (scm_char_upper_case_p, "char-upper-case?", 1, 0, 0,
(SCM chr), (SCM chr),
"Return #t iff CHR is uppercase, else #f. "Return #t iff CHR is uppercase, else #f.
Uppercase means the same thing as the isupper C library function.") Uppercase means the same thing as the isupper C library function.")
#define FUNC_NAME s_scm_char_upper_case_p #define FUNC_NAME s_scm_char_upper_case_p
{ {
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
return SCM_BOOL(isascii(SCM_ICHR(chr)) && isupper(SCM_ICHR(chr))); return SCM_BOOL(isascii(SCM_ICHR(chr)) && isupper(SCM_ICHR(chr)));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_char_lower_case_p, "char-lower-case?", 1, 0, 0, SCM_DEFINE (scm_char_lower_case_p, "char-lower-case?", 1, 0, 0,
(SCM chr), (SCM chr),
"Return #t iff CHR is lowercase, else #f. "Return #t iff CHR is lowercase, else #f.
Lowercase means the same thing as the islower C library function.") Lowercase means the same thing as the islower C library function.")
#define FUNC_NAME s_scm_char_lower_case_p #define FUNC_NAME s_scm_char_lower_case_p
{ {
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
return SCM_BOOL(isascii(SCM_ICHR(chr)) && islower(SCM_ICHR(chr))); return SCM_BOOL(isascii(SCM_ICHR(chr)) && islower(SCM_ICHR(chr)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -240,7 +240,7 @@ Uppercase and lowercase are as defined by the isupper and islower
C library functions.") C library functions.")
#define FUNC_NAME s_scm_char_is_both_p #define FUNC_NAME s_scm_char_is_both_p
{ {
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
return SCM_BOOL(isascii(SCM_ICHR(chr)) && (isupper(SCM_ICHR(chr)) || islower(SCM_ICHR(chr)))); return SCM_BOOL(isascii(SCM_ICHR(chr)) && (isupper(SCM_ICHR(chr)) || islower(SCM_ICHR(chr))));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -253,14 +253,14 @@ SCM_DEFINE (scm_char_to_integer, "char->integer", 1, 0, 0,
"Return the number corresponding to ordinal position of CHR in the Ascii sequence.") "Return the number corresponding to ordinal position of CHR in the Ascii sequence.")
#define FUNC_NAME s_scm_char_to_integer #define FUNC_NAME s_scm_char_to_integer
{ {
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
return scm_ulong2num((unsigned long)SCM_ICHR(chr)); return scm_ulong2num((unsigned long)SCM_ICHR(chr));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_integer_to_char, "integer->char", 1, 0, 0, SCM_DEFINE (scm_integer_to_char, "integer->char", 1, 0, 0,
(SCM n), (SCM n),
"Return the character at position N in the Ascii sequence.") "Return the character at position N in the Ascii sequence.")
#define FUNC_NAME s_scm_integer_to_char #define FUNC_NAME s_scm_integer_to_char
@ -271,23 +271,23 @@ SCM_DEFINE(scm_integer_to_char, "integer->char", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_char_upcase, "char-upcase", 1, 0, 0, SCM_DEFINE (scm_char_upcase, "char-upcase", 1, 0, 0,
(SCM chr), (SCM chr),
"Return the uppercase character version of CHR.") "Return the uppercase character version of CHR.")
#define FUNC_NAME s_scm_char_upcase #define FUNC_NAME s_scm_char_upcase
{ {
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
return SCM_MAKICHR(scm_upcase(SCM_ICHR(chr))); return SCM_MAKICHR(scm_upcase(SCM_ICHR(chr)));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_char_downcase, "char-downcase", 1, 0, 0, SCM_DEFINE (scm_char_downcase, "char-downcase", 1, 0, 0,
(SCM chr), (SCM chr),
"Return the lowercase character version of CHR.") "Return the lowercase character version of CHR.")
#define FUNC_NAME s_scm_char_downcase #define FUNC_NAME s_scm_char_downcase
{ {
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
return SCM_MAKICHR(scm_downcase(SCM_ICHR(chr))); return SCM_MAKICHR(scm_downcase(SCM_ICHR(chr)));
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -375,7 +375,7 @@ SCM
scm_join_thread (SCM t) scm_join_thread (SCM t)
#define FUNC_NAME s_join_thread #define FUNC_NAME s_join_thread
{ {
SCM_VALIDATE_THREAD(1,t); SCM_VALIDATE_THREAD (1,t);
coop_join (SCM_THREAD_DATA (t)); coop_join (SCM_THREAD_DATA (t));
return SCM_BOOL_T; return SCM_BOOL_T;
} }

View file

@ -126,7 +126,7 @@ SCM_DEFINE (scm_with_traps, "with-traps", 1, 0, 0,
#define FUNC_NAME s_scm_with_traps #define FUNC_NAME s_scm_with_traps
{ {
int trap_flag; int trap_flag;
SCM_VALIDATE_THUNK(1,thunk); SCM_VALIDATE_THUNK (1,thunk);
return scm_internal_dynamic_wind (with_traps_before, return scm_internal_dynamic_wind (with_traps_before,
with_traps_inner, with_traps_inner,
with_traps_after, with_traps_after,
@ -260,11 +260,11 @@ SCM_DEFINE (scm_make_gloc, "make-gloc", 1, 1, 0,
var = scm_cons (SCM_BOOL_F, var); var = scm_cons (SCM_BOOL_F, var);
else else
#endif #endif
SCM_VALIDATE_VARIABLE(1,var); SCM_VALIDATE_VARIABLE (1,var);
if (SCM_UNBNDP (env)) if (SCM_UNBNDP (env))
env = scm_top_level_env (SCM_CDR (scm_top_level_lookup_closure_var)); env = scm_top_level_env (SCM_CDR (scm_top_level_lookup_closure_var));
else else
SCM_VALIDATE_NULLORCONS(2,env); SCM_VALIDATE_NULLORCONS (2,env);
return scm_make_memoized (SCM_VARVCELL (var) + 1, env); return scm_make_memoized (SCM_VARVCELL (var) + 1, env);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -284,8 +284,8 @@ SCM_DEFINE (scm_make_iloc, "make-iloc", 3, 0, 0,
"") "")
#define FUNC_NAME s_scm_make_iloc #define FUNC_NAME s_scm_make_iloc
{ {
SCM_VALIDATE_INUM(1,frame); SCM_VALIDATE_INUM (1,frame);
SCM_VALIDATE_INUM(2,binding); SCM_VALIDATE_INUM (2,binding);
return (SCM_ILOC00 return (SCM_ILOC00
+ SCM_IFRINC * SCM_INUM (frame) + SCM_IFRINC * SCM_INUM (frame)
+ (SCM_NFALSEP (cdrp) ? SCM_ICDR : 0) + (SCM_NFALSEP (cdrp) ? SCM_ICDR : 0)
@ -329,7 +329,7 @@ SCM_DEFINE (scm_memcons, "memcons", 2, 1, 0,
if (SCM_UNBNDP (env)) if (SCM_UNBNDP (env))
env = scm_top_level_env (SCM_CDR (scm_top_level_lookup_closure_var)); env = scm_top_level_env (SCM_CDR (scm_top_level_lookup_closure_var));
else else
SCM_VALIDATE_NULLORCONS(3,env); SCM_VALIDATE_NULLORCONS (3,env);
return scm_make_memoized (scm_cons (car, cdr), env); return scm_make_memoized (scm_cons (car, cdr), env);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -340,7 +340,7 @@ SCM_DEFINE (scm_mem_to_proc, "mem->proc", 1, 0, 0,
#define FUNC_NAME s_scm_mem_to_proc #define FUNC_NAME s_scm_mem_to_proc
{ {
SCM env; SCM env;
SCM_VALIDATE_MEMOIZED(1,obj); SCM_VALIDATE_MEMOIZED (1,obj);
env = SCM_MEMOIZED_ENV (obj); env = SCM_MEMOIZED_ENV (obj);
obj = SCM_MEMOIZED_EXP (obj); obj = SCM_MEMOIZED_EXP (obj);
if (!(SCM_NIMP (obj) && SCM_CAR (obj) == SCM_IM_LAMBDA)) if (!(SCM_NIMP (obj) && SCM_CAR (obj) == SCM_IM_LAMBDA))
@ -368,7 +368,7 @@ SCM_DEFINE (scm_unmemoize, "unmemoize", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_unmemoize #define FUNC_NAME s_scm_unmemoize
{ {
SCM_VALIDATE_MEMOIZED(1,m); SCM_VALIDATE_MEMOIZED (1,m);
return scm_unmemocopy (SCM_MEMOIZED_EXP (m), SCM_MEMOIZED_ENV (m)); return scm_unmemocopy (SCM_MEMOIZED_EXP (m), SCM_MEMOIZED_ENV (m));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -378,7 +378,7 @@ SCM_DEFINE (scm_memoized_environment, "memoized-environment", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_memoized_environment #define FUNC_NAME s_scm_memoized_environment
{ {
SCM_VALIDATE_MEMOIZED(1,m); SCM_VALIDATE_MEMOIZED (1,m);
return SCM_MEMOIZED_ENV (m); return SCM_MEMOIZED_ENV (m);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -388,7 +388,7 @@ SCM_DEFINE (scm_procedure_name, "procedure-name", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_procedure_name #define FUNC_NAME s_scm_procedure_name
{ {
SCM_VALIDATE_PROC(1,proc); SCM_VALIDATE_PROC (1,proc);
switch (SCM_TYP7 (proc)) { switch (SCM_TYP7 (proc)) {
case scm_tcs_subrs: case scm_tcs_subrs:
return SCM_SNAME (proc); return SCM_SNAME (proc);
@ -484,7 +484,7 @@ is implicit).")
{ {
if (SCM_UNBNDP (env)) if (SCM_UNBNDP (env))
{ {
SCM_VALIDATE_MEMOIZED(1,exp); SCM_VALIDATE_MEMOIZED (1,exp);
return scm_eval_3 (SCM_MEMOIZED_EXP (exp), 0, SCM_MEMOIZED_ENV (exp)); return scm_eval_3 (SCM_MEMOIZED_EXP (exp), 0, SCM_MEMOIZED_ENV (exp));
} }
return scm_eval_3 (exp, 1, env); return scm_eval_3 (exp, 1, env);

View file

@ -70,7 +70,7 @@
SCM_DEFINE(scm_dynamic_wind, "dynamic-wind", 3, 0, 0, SCM_DEFINE (scm_dynamic_wind, "dynamic-wind", 3, 0, 0,
(SCM thunk1, SCM thunk2, SCM thunk3), (SCM thunk1, SCM thunk2, SCM thunk3),
"All three arguments must be 0-argument procedures. "All three arguments must be 0-argument procedures.

View file

@ -87,7 +87,7 @@ scm_error (SCM key, const char *subr, const char *message, SCM args, SCM rest)
} }
/* Scheme interface to scm_error. */ /* Scheme interface to scm_error. */
SCM_DEFINE(scm_error_scm, "scm-error", 5, 0, 0, SCM_DEFINE (scm_error_scm, "scm-error", 5, 0, 0,
(SCM key, SCM subr, SCM message, SCM args, SCM rest), (SCM key, SCM subr, SCM message, SCM args, SCM rest),
"Raise an error with key @var{key}. @var{subr} can be a string naming "Raise an error with key @var{key}. @var{subr} can be a string naming
the procedure associated with the error, or @code{#f}. @var{message} the procedure associated with the error, or @code{#f}. @var{message}
@ -104,9 +104,9 @@ will usually be @code{#f}.")
{ {
char *szSubr; char *szSubr;
char *szMessage; char *szMessage;
SCM_VALIDATE_SYMBOL(1,key); SCM_VALIDATE_SYMBOL (1,key);
SCM_VALIDATE_NULLORROSTRING_COPY(2,subr,szSubr); SCM_VALIDATE_NULLORROSTRING_COPY (2,subr,szSubr);
SCM_VALIDATE_NULLORROSTRING_COPY(3,message,szMessage); SCM_VALIDATE_NULLORROSTRING_COPY (3,message,szMessage);
SCM_COERCE_SUBSTR (message); SCM_COERCE_SUBSTR (message);
scm_error (key, szSubr, szMessage, args, rest); scm_error (key, szSubr, szMessage, args, rest);
@ -119,7 +119,7 @@ SCM_DEFINE (scm_strerror, "strerror", 1, 0, 0,
"Returns the Unix error message corresponding to @var{errno}, an integer.") "Returns the Unix error message corresponding to @var{errno}, an integer.")
#define FUNC_NAME s_scm_strerror #define FUNC_NAME s_scm_strerror
{ {
SCM_VALIDATE_INUM(1,err); SCM_VALIDATE_INUM (1,err);
return scm_makfrom0str (strerror (SCM_INUM (err))); return scm_makfrom0str (strerror (SCM_INUM (err)));
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -3179,13 +3179,13 @@ ret:
you if you do (scm_apply scm_apply '( ... ))" If you know what you if you do (scm_apply scm_apply '( ... ))" If you know what
they're referring to, send me a patch to this comment. */ they're referring to, send me a patch to this comment. */
SCM_DEFINE(scm_nconc2last, "apply:nconc2last", 1, 0, 0, SCM_DEFINE (scm_nconc2last, "apply:nconc2last", 1, 0, 0,
(SCM lst), (SCM lst),
"") "")
#define FUNC_NAME s_scm_nconc2last #define FUNC_NAME s_scm_nconc2last
{ {
SCM *lloc; SCM *lloc;
SCM_VALIDATE_LIST(1,lst); SCM_VALIDATE_LIST (1,lst);
lloc = &lst; lloc = &lst;
while (SCM_NNULLP (SCM_CDR (*lloc))) while (SCM_NNULLP (SCM_CDR (*lloc)))
lloc = SCM_CDRLOC (*lloc); lloc = SCM_CDRLOC (*lloc);
@ -3698,12 +3698,12 @@ prinprom (SCM exp,SCM port,scm_print_state *pstate)
} }
SCM_DEFINE(scm_force, "force", 1, 0, 0, SCM_DEFINE (scm_force, "force", 1, 0, 0,
(SCM x), (SCM x),
"") "")
#define FUNC_NAME s_scm_force #define FUNC_NAME s_scm_force
{ {
SCM_VALIDATE_SMOB(1,x,promise); SCM_VALIDATE_SMOB (1,x,promise);
if (!((1L << 16) & SCM_CAR (x))) if (!((1L << 16) & SCM_CAR (x)))
{ {
SCM ans = scm_apply (SCM_CDR (x), SCM_EOL, SCM_EOL); SCM ans = scm_apply (SCM_CDR (x), SCM_EOL, SCM_EOL);
@ -3794,7 +3794,7 @@ scm_eval_3 (SCM obj, int copyp, SCM env)
return SCM_XEVAL (obj, env); return SCM_XEVAL (obj, env);
} }
SCM_DEFINE(scm_eval2, "eval2", 2, 0, 0, SCM_DEFINE (scm_eval2, "eval2", 2, 0, 0,
(SCM obj, SCM env_thunk), (SCM obj, SCM env_thunk),
"Evaluate @var{exp}, a Scheme expression, in the environment designated "Evaluate @var{exp}, a Scheme expression, in the environment designated
by @var{lookup}, a symbol-lookup function. @code{(eval exp)} is by @var{lookup}, a symbol-lookup function. @code{(eval exp)} is
@ -3805,7 +3805,7 @@ equivalent to @code{(eval2 exp *top-level-lookup-closure*)}.")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_eval, "eval", 1, 0, 0, SCM_DEFINE (scm_eval, "eval", 1, 0, 0,
(SCM obj), (SCM obj),
"Evaluate @var{exp}, a list representing a Scheme expression, in the "Evaluate @var{exp}, a list representing a Scheme expression, in the
top-level environment.") top-level environment.")

View file

@ -74,7 +74,7 @@ SCM_DEFINE (scm_definedp, "defined?", 1, 1, 0,
{ {
SCM vcell; SCM vcell;
SCM_VALIDATE_SYMBOL(1,sym); SCM_VALIDATE_SYMBOL (1,sym);
if (SCM_UNBNDP (env)) if (SCM_UNBNDP (env))
vcell = scm_sym2vcell(sym, vcell = scm_sym2vcell(sym,

View file

@ -71,7 +71,7 @@ scm_add_feature (const char *str)
SCM_DEFINE(scm_program_arguments, "program-arguments", 0, 0, 0, SCM_DEFINE (scm_program_arguments, "program-arguments", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_program_arguments #define FUNC_NAME s_scm_program_arguments
@ -214,7 +214,7 @@ SCM_DEFINE (scm_hook_empty_p, "hook-empty?", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_hook_empty_p #define FUNC_NAME s_scm_hook_empty_p
{ {
SCM_VALIDATE_HOOK(1,hook); SCM_VALIDATE_HOOK (1,hook);
return SCM_BOOL(SCM_NULLP (SCM_HOOK_PROCEDURES (hook))); return SCM_BOOL(SCM_NULLP (SCM_HOOK_PROCEDURES (hook)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -227,7 +227,7 @@ SCM_DEFINE (scm_add_hook_x, "add-hook!", 2, 1, 0,
{ {
SCM arity, rest; SCM arity, rest;
int n_args; int n_args;
SCM_VALIDATE_HOOK(1,hook); SCM_VALIDATE_HOOK (1,hook);
SCM_ASSERT (SCM_NFALSEP (arity = scm_i_procedure_arity (proc)), SCM_ASSERT (SCM_NFALSEP (arity = scm_i_procedure_arity (proc)),
proc, SCM_ARG2, FUNC_NAME); proc, SCM_ARG2, FUNC_NAME);
n_args = SCM_HOOK_ARITY (hook); n_args = SCM_HOOK_ARITY (hook);
@ -251,7 +251,7 @@ SCM_DEFINE (scm_remove_hook_x, "remove-hook!", 2, 0, 0,
"") "")
#define FUNC_NAME s_scm_remove_hook_x #define FUNC_NAME s_scm_remove_hook_x
{ {
SCM_VALIDATE_HOOK(1,hook); SCM_VALIDATE_HOOK (1,hook);
SCM_SET_HOOK_PROCEDURES (hook, SCM_SET_HOOK_PROCEDURES (hook,
scm_delq_x (proc, SCM_HOOK_PROCEDURES (hook))); scm_delq_x (proc, SCM_HOOK_PROCEDURES (hook)));
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
@ -264,7 +264,7 @@ SCM_DEFINE (scm_reset_hook_x, "reset-hook!", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_reset_hook_x #define FUNC_NAME s_scm_reset_hook_x
{ {
SCM_VALIDATE_HOOK(1,hook); SCM_VALIDATE_HOOK (1,hook);
SCM_SET_HOOK_PROCEDURES (hook, SCM_EOL); SCM_SET_HOOK_PROCEDURES (hook, SCM_EOL);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
@ -276,7 +276,7 @@ SCM_DEFINE (scm_run_hook, "run-hook", 1, 0, 1,
"") "")
#define FUNC_NAME s_scm_run_hook #define FUNC_NAME s_scm_run_hook
{ {
SCM_VALIDATE_HOOK(1,hook); SCM_VALIDATE_HOOK (1,hook);
if (SCM_UNBNDP (args)) if (SCM_UNBNDP (args))
args = SCM_EOL; args = SCM_EOL;
if (scm_ilength (args) != SCM_HOOK_ARITY (hook)) if (scm_ilength (args) != SCM_HOOK_ARITY (hook))
@ -306,7 +306,7 @@ SCM_DEFINE (scm_hook_to_list, "hook->list", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_hook_to_list #define FUNC_NAME s_scm_hook_to_list
{ {
SCM_VALIDATE_HOOK(1,hook); SCM_VALIDATE_HOOK (1,hook);
return scm_list_copy (SCM_HOOK_PROCEDURES (hook)); return scm_list_copy (SCM_HOOK_PROCEDURES (hook));
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -143,8 +143,8 @@ as @code{-1}, then that ID is not changed.")
object = SCM_COERCE_OUTPORT (object); object = SCM_COERCE_OUTPORT (object);
SCM_VALIDATE_INUM(2,owner); SCM_VALIDATE_INUM (2,owner);
SCM_VALIDATE_INUM(3,group); SCM_VALIDATE_INUM (3,group);
if (SCM_INUMP (object) || (SCM_OPFPORTP (object))) if (SCM_INUMP (object) || (SCM_OPFPORTP (object)))
{ {
if (SCM_INUMP (object)) if (SCM_INUMP (object))
@ -184,7 +184,7 @@ The return value is unspecified.")
object = SCM_COERCE_OUTPORT (object); object = SCM_COERCE_OUTPORT (object);
SCM_VALIDATE_INUM(2,mode); SCM_VALIDATE_INUM (2,mode);
if (SCM_INUMP (object) || SCM_OPFPORTP (object)) if (SCM_INUMP (object) || SCM_OPFPORTP (object))
{ {
if (SCM_INUMP (object)) if (SCM_INUMP (object))
@ -195,7 +195,7 @@ The return value is unspecified.")
} }
else else
{ {
SCM_VALIDATE_ROSTRING(1,object); SCM_VALIDATE_ROSTRING (1,object);
SCM_COERCE_SUBSTR (object); SCM_COERCE_SUBSTR (object);
SCM_SYSCALL (rv = chmod (SCM_ROCHARS (object), SCM_INUM (mode))); SCM_SYSCALL (rv = chmod (SCM_ROCHARS (object), SCM_INUM (mode)));
} }
@ -222,7 +222,7 @@ E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.")
} }
else else
{ {
SCM_VALIDATE_INUM(1,mode); SCM_VALIDATE_INUM (1,mode);
mask = umask (SCM_INUM (mode)); mask = umask (SCM_INUM (mode));
} }
return SCM_MAKINUM (mask); return SCM_MAKINUM (mask);
@ -241,10 +241,10 @@ port.")
int iflags; int iflags;
int imode; int imode;
SCM_VALIDATE_ROSTRING(1,path); SCM_VALIDATE_ROSTRING (1,path);
SCM_COERCE_SUBSTR (path); SCM_COERCE_SUBSTR (path);
SCM_VALIDATE_INUM_COPY(2,flags,iflags); SCM_VALIDATE_INUM_COPY (2,flags,iflags);
SCM_VALIDATE_INUM_DEF_COPY(3,mode,0666,imode); SCM_VALIDATE_INUM_DEF_COPY (3,mode,0666,imode);
SCM_SYSCALL (fd = open (SCM_ROCHARS (path), iflags, imode)); SCM_SYSCALL (fd = open (SCM_ROCHARS (path), iflags, imode));
if (fd == -1) if (fd == -1)
SCM_SYSERROR; SCM_SYSERROR;
@ -289,7 +289,7 @@ for additional flags.")
int iflags; int iflags;
fd = SCM_INUM (scm_open_fdes (path, flags, mode)); fd = SCM_INUM (scm_open_fdes (path, flags, mode));
SCM_VALIDATE_INUM_COPY(2,flags,iflags); SCM_VALIDATE_INUM_COPY (2,flags,iflags);
if (iflags & O_RDWR) if (iflags & O_RDWR)
{ {
if (iflags & O_APPEND) if (iflags & O_APPEND)
@ -328,7 +328,7 @@ their revealed counts set to zero.")
if (SCM_PORTP (fd_or_port)) if (SCM_PORTP (fd_or_port))
return scm_close_port (fd_or_port); return scm_close_port (fd_or_port);
SCM_VALIDATE_INUM(1,fd_or_port); SCM_VALIDATE_INUM (1,fd_or_port);
fd = SCM_INUM (fd_or_port); fd = SCM_INUM (fd_or_port);
scm_evict_ports (fd); /* see scsh manual. */ scm_evict_ports (fd); /* see scsh manual. */
SCM_SYSCALL (rv = close (fd)); SCM_SYSCALL (rv = close (fd));
@ -552,11 +552,11 @@ link may or may not be followed depending on the system.")
{ {
int val; int val;
SCM_VALIDATE_ROSTRING(1,oldpath); SCM_VALIDATE_ROSTRING (1,oldpath);
if (SCM_SUBSTRP (oldpath)) if (SCM_SUBSTRP (oldpath))
oldpath = scm_makfromstr (SCM_ROCHARS (oldpath), oldpath = scm_makfromstr (SCM_ROCHARS (oldpath),
SCM_ROLENGTH (oldpath), 0); SCM_ROLENGTH (oldpath), 0);
SCM_VALIDATE_ROSTRING(2,newpath); SCM_VALIDATE_ROSTRING (2,newpath);
if (SCM_SUBSTRP (newpath)) if (SCM_SUBSTRP (newpath))
newpath = scm_makfromstr (SCM_ROCHARS (newpath), newpath = scm_makfromstr (SCM_ROCHARS (newpath),
SCM_ROLENGTH (newpath), 0); SCM_ROLENGTH (newpath), 0);
@ -576,8 +576,8 @@ The return value is unspecified.")
#define FUNC_NAME s_scm_rename #define FUNC_NAME s_scm_rename
{ {
int rv; int rv;
SCM_VALIDATE_ROSTRING(1,oldname); SCM_VALIDATE_ROSTRING (1,oldname);
SCM_VALIDATE_ROSTRING(2,newname); SCM_VALIDATE_ROSTRING (2,newname);
SCM_COERCE_SUBSTR (oldname); SCM_COERCE_SUBSTR (oldname);
SCM_COERCE_SUBSTR (newname); SCM_COERCE_SUBSTR (newname);
#ifdef HAVE_RENAME #ifdef HAVE_RENAME
@ -599,13 +599,13 @@ The return value is unspecified.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_delete_file, "delete-file", 1, 0, 0, SCM_DEFINE (scm_delete_file, "delete-file", 1, 0, 0,
(SCM str), (SCM str),
"Deletes (or \"unlinks\") the file specified by @var{path}.") "Deletes (or \"unlinks\") the file specified by @var{path}.")
#define FUNC_NAME s_scm_delete_file #define FUNC_NAME s_scm_delete_file
{ {
int ans; int ans;
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
SCM_COERCE_SUBSTR (str); SCM_COERCE_SUBSTR (str);
SCM_SYSCALL (ans = unlink (SCM_ROCHARS (str))); SCM_SYSCALL (ans = unlink (SCM_ROCHARS (str)));
if (ans != 0) if (ans != 0)
@ -625,7 +625,7 @@ umask. Otherwise they are set to the decimal value specified with
#ifdef HAVE_MKDIR #ifdef HAVE_MKDIR
int rv; int rv;
mode_t mask; mode_t mask;
SCM_VALIDATE_ROSTRING(1,path); SCM_VALIDATE_ROSTRING (1,path);
SCM_COERCE_SUBSTR (path); SCM_COERCE_SUBSTR (path);
if (SCM_UNBNDP (mode)) if (SCM_UNBNDP (mode))
{ {
@ -635,7 +635,7 @@ umask. Otherwise they are set to the decimal value specified with
} }
else else
{ {
SCM_VALIDATE_INUM(2,mode); SCM_VALIDATE_INUM (2,mode);
SCM_SYSCALL (rv = mkdir (SCM_ROCHARS (path), SCM_INUM (mode))); SCM_SYSCALL (rv = mkdir (SCM_ROCHARS (path), SCM_INUM (mode)));
} }
if (rv != 0) if (rv != 0)
@ -659,7 +659,7 @@ be empty for this to succeed. The return value is unspecified.")
#ifdef HAVE_RMDIR #ifdef HAVE_RMDIR
int val; int val;
SCM_VALIDATE_ROSTRING(1,path); SCM_VALIDATE_ROSTRING (1,path);
SCM_COERCE_SUBSTR (path); SCM_COERCE_SUBSTR (path);
SCM_SYSCALL (val = rmdir (SCM_ROCHARS (path))); SCM_SYSCALL (val = rmdir (SCM_ROCHARS (path)));
if (val != 0) if (val != 0)
@ -696,7 +696,7 @@ stream.")
#define FUNC_NAME s_scm_opendir #define FUNC_NAME s_scm_opendir
{ {
DIR *ds; DIR *ds;
SCM_VALIDATE_ROSTRING(1,dirname); SCM_VALIDATE_ROSTRING (1,dirname);
SCM_COERCE_SUBSTR (dirname); SCM_COERCE_SUBSTR (dirname);
SCM_SYSCALL (ds = opendir (SCM_ROCHARS (dirname))); SCM_SYSCALL (ds = opendir (SCM_ROCHARS (dirname)));
if (ds == NULL) if (ds == NULL)
@ -714,7 +714,7 @@ end of file object is returned.")
#define FUNC_NAME s_scm_readdir #define FUNC_NAME s_scm_readdir
{ {
struct dirent *rdent; struct dirent *rdent;
SCM_VALIDATE_OPDIR(1,port); SCM_VALIDATE_OPDIR (1,port);
errno = 0; errno = 0;
SCM_SYSCALL (rdent = readdir ((DIR *) SCM_CDR (port))); SCM_SYSCALL (rdent = readdir ((DIR *) SCM_CDR (port)));
if (errno != 0) if (errno != 0)
@ -732,7 +732,7 @@ SCM_DEFINE (scm_rewinddir, "rewinddir", 1, 0, 0,
@code{readdir} will return the first directory entry.") @code{readdir} will return the first directory entry.")
#define FUNC_NAME s_scm_rewinddir #define FUNC_NAME s_scm_rewinddir
{ {
SCM_VALIDATE_OPDIR(1,port); SCM_VALIDATE_OPDIR (1,port);
rewinddir ((DIR *) SCM_CDR (port)); rewinddir ((DIR *) SCM_CDR (port));
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
@ -748,7 +748,7 @@ The return value is unspecified.")
{ {
int sts; int sts;
SCM_VALIDATE_DIR(1,port); SCM_VALIDATE_DIR (1,port);
if (SCM_CLOSEDP (port)) if (SCM_CLOSEDP (port))
{ {
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
@ -798,7 +798,7 @@ The return value is unspecified.")
{ {
int ans; int ans;
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
SCM_COERCE_SUBSTR (str); SCM_COERCE_SUBSTR (str);
SCM_SYSCALL (ans = chdir (SCM_ROCHARS (str))); SCM_SYSCALL (ans = chdir (SCM_ROCHARS (str)));
if (ans != 0) if (ans != 0)
@ -1003,7 +1003,7 @@ values instead of a list and has an additional select! interface.
timeout.tv_usec = 0; timeout.tv_usec = 0;
else else
{ {
SCM_VALIDATE_INUM(5,usecs); SCM_VALIDATE_INUM (5,usecs);
timeout.tv_usec = SCM_INUM (usecs); timeout.tv_usec = SCM_INUM (usecs);
} }
} }
@ -1079,12 +1079,12 @@ The value used to indicate the "close on exec" flag with @code{F_GETFL} or
object = SCM_COERCE_OUTPORT (object); object = SCM_COERCE_OUTPORT (object);
SCM_VALIDATE_INUM(2,cmd); SCM_VALIDATE_INUM (2,cmd);
if (SCM_OPFPORTP (object)) if (SCM_OPFPORTP (object))
fdes = SCM_FPORT_FDES (object); fdes = SCM_FPORT_FDES (object);
else else
{ {
SCM_VALIDATE_INUM(1,object); SCM_VALIDATE_INUM (1,object);
fdes = SCM_INUM (object); fdes = SCM_INUM (object);
} }
if (SCM_NULLP (value)) if (SCM_NULLP (value))
@ -1120,7 +1120,7 @@ The return value is unspecified.")
} }
else else
{ {
SCM_VALIDATE_INUM(1,object); SCM_VALIDATE_INUM (1,object);
fdes = SCM_INUM (object); fdes = SCM_INUM (object);
} }
if (fsync (fdes) == -1) if (fsync (fdes) == -1)
@ -1138,8 +1138,8 @@ SCM_DEFINE (scm_symlink, "symlink", 2, 0, 0,
#ifdef HAVE_SYMLINK #ifdef HAVE_SYMLINK
int val; int val;
SCM_VALIDATE_ROSTRING(1,oldpath); SCM_VALIDATE_ROSTRING (1,oldpath);
SCM_VALIDATE_ROSTRING(2,newpath); SCM_VALIDATE_ROSTRING (2,newpath);
SCM_COERCE_SUBSTR (oldpath); SCM_COERCE_SUBSTR (oldpath);
SCM_COERCE_SUBSTR (newpath); SCM_COERCE_SUBSTR (newpath);
SCM_SYSCALL (val = symlink(SCM_ROCHARS(oldpath), SCM_ROCHARS(newpath))); SCM_SYSCALL (val = symlink(SCM_ROCHARS(oldpath), SCM_ROCHARS(newpath)));
@ -1167,7 +1167,7 @@ file that the link points to.")
int size = 100; int size = 100;
char *buf; char *buf;
SCM result; SCM result;
SCM_VALIDATE_ROSTRING(1,path); SCM_VALIDATE_ROSTRING (1,path);
SCM_COERCE_SUBSTR (path); SCM_COERCE_SUBSTR (path);
buf = scm_must_malloc (size, FUNC_NAME); buf = scm_must_malloc (size, FUNC_NAME);
while ((rv = readlink (SCM_ROCHARS (path), buf, size)) == size) while ((rv = readlink (SCM_ROCHARS (path), buf, size)) == size)
@ -1201,7 +1201,7 @@ file it points to. @var{path} must be a string.")
int rv; int rv;
struct stat stat_temp; struct stat stat_temp;
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
SCM_COERCE_SUBSTR (str); SCM_COERCE_SUBSTR (str);
SCM_SYSCALL(rv = lstat(SCM_ROCHARS(str), &stat_temp)); SCM_SYSCALL(rv = lstat(SCM_ROCHARS(str), &stat_temp));
if (rv != 0) if (rv != 0)
@ -1235,10 +1235,10 @@ The return value is unspecified.")
char buf[BUFSIZ]; char buf[BUFSIZ];
struct stat oldstat; struct stat oldstat;
SCM_VALIDATE_ROSTRING(1,oldfile); SCM_VALIDATE_ROSTRING (1,oldfile);
if (SCM_SUBSTRP (oldfile)) if (SCM_SUBSTRP (oldfile))
oldfile = scm_makfromstr (SCM_ROCHARS (oldfile), SCM_ROLENGTH (oldfile), 0); oldfile = scm_makfromstr (SCM_ROCHARS (oldfile), SCM_ROLENGTH (oldfile), 0);
SCM_VALIDATE_ROSTRING(2,newfile); SCM_VALIDATE_ROSTRING (2,newfile);
if (SCM_SUBSTRP (newfile)) if (SCM_SUBSTRP (newfile))
newfile = scm_makfromstr (SCM_ROCHARS (newfile), SCM_ROLENGTH (newfile), 0); newfile = scm_makfromstr (SCM_ROCHARS (newfile), SCM_ROLENGTH (newfile), 0);
if (stat (SCM_ROCHARS (oldfile), &oldstat) == -1) if (stat (SCM_ROCHARS (oldfile), &oldstat) == -1)
@ -1279,7 +1279,7 @@ SCM_DEFINE (scm_dirname, "dirname", 1, 0, 0,
{ {
char *s; char *s;
int i, len; int i, len;
SCM_VALIDATE_ROSTRING(1,filename); SCM_VALIDATE_ROSTRING (1,filename);
s = SCM_ROCHARS (filename); s = SCM_ROCHARS (filename);
len = SCM_LENGTH (filename); len = SCM_LENGTH (filename);
i = len - 1; i = len - 1;
@ -1305,7 +1305,7 @@ SCM_DEFINE (scm_basename, "basename", 1, 1, 0,
{ {
char *f, *s = 0; char *f, *s = 0;
int i, j, len, end; int i, j, len, end;
SCM_VALIDATE_ROSTRING(1,filename); SCM_VALIDATE_ROSTRING (1,filename);
SCM_ASSERT (SCM_UNBNDP (suffix) SCM_ASSERT (SCM_UNBNDP (suffix)
|| (SCM_ROSTRINGP (suffix)), || (SCM_ROSTRINGP (suffix)),
suffix, suffix,

View file

@ -147,7 +147,7 @@ SCM_DEFINE (scm_fluid_ref, "fluid-ref", 1, 0, 0,
{ {
int n; int n;
SCM_VALIDATE_FLUID(1,fl); SCM_VALIDATE_FLUID (1,fl);
n = SCM_FLUID_NUM (fl); n = SCM_FLUID_NUM (fl);
@ -164,7 +164,7 @@ SCM_DEFINE (scm_fluid_set_x, "fluid-set!", 2, 0, 0,
{ {
int n; int n;
SCM_VALIDATE_FLUID(1,fl); SCM_VALIDATE_FLUID (1,fl);
n = SCM_FLUID_NUM (fl); n = SCM_FLUID_NUM (fl);
if (SCM_LENGTH (scm_root->fluids) <= n) if (SCM_LENGTH (scm_root->fluids) <= n)

View file

@ -177,8 +177,8 @@ The value used to indicate the "close on exec" flag with @code{F_GETFL} or
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPFPORT(1,port); SCM_VALIDATE_OPFPORT (1,port);
SCM_VALIDATE_INUM_COPY(2,mode,cmode); SCM_VALIDATE_INUM_COPY (2,mode,cmode);
if (cmode != _IONBF && cmode != _IOFBF && cmode != _IOLBF) if (cmode != _IONBF && cmode != _IOFBF && cmode != _IOLBF)
scm_out_of_range (FUNC_NAME, mode); scm_out_of_range (FUNC_NAME, mode);
@ -201,7 +201,7 @@ The value used to indicate the "close on exec" flag with @code{F_GETFL} or
} }
else else
{ {
SCM_VALIDATE_INUM_COPY(3,size,csize); SCM_VALIDATE_INUM_COPY (3,size,csize);
if (csize < 0 || (cmode == _IONBF && csize > 0)) if (csize < 0 || (cmode == _IONBF && csize > 0))
scm_out_of_range (FUNC_NAME, size); scm_out_of_range (FUNC_NAME, size);
} }
@ -255,7 +255,7 @@ scm_evict_ports (int fd)
* *
* Return the new port. * Return the new port.
*/ */
SCM_DEFINE(scm_open_file, "open-file", 2, 0, 0, SCM_DEFINE (scm_open_file, "open-file", 2, 0, 0,
(SCM filename, SCM modes), (SCM filename, SCM modes),
"Open the file whose name is @var{string}, and return a port "Open the file whose name is @var{string}, and return a port
representing that file. The attributes of the port are representing that file. The attributes of the port are
@ -308,8 +308,8 @@ If a file cannot be opened with the access requested,
char *mode; char *mode;
char *ptr; char *ptr;
SCM_VALIDATE_ROSTRING(1,filename); SCM_VALIDATE_ROSTRING (1,filename);
SCM_VALIDATE_ROSTRING(2,modes); SCM_VALIDATE_ROSTRING (2,modes);
if (SCM_SUBSTRP (filename)) if (SCM_SUBSTRP (filename))
filename = scm_makfromstr (SCM_ROCHARS (filename), SCM_ROLENGTH (filename), 0); filename = scm_makfromstr (SCM_ROCHARS (filename), SCM_ROLENGTH (filename), 0);
if (SCM_SUBSTRP (modes)) if (SCM_SUBSTRP (modes))

View file

@ -303,7 +303,7 @@ SCM_DEFINE (scm_gc_set_debug_check_freelist_x, "gc-set-debug-check-freelist!", 1
"") "")
#define FUNC_NAME s_scm_gc_set_debug_check_freelist_x #define FUNC_NAME s_scm_gc_set_debug_check_freelist_x
{ {
SCM_VALIDATE_BOOL_COPY(1,flag,scm_debug_check_freelist); SCM_VALIDATE_BOOL_COPY (1,flag,scm_debug_check_freelist);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -418,7 +418,7 @@ returned by this function for @var{obj}")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_gc, "gc", 0, 0, 0, SCM_DEFINE (scm_gc, "gc", 0, 0, 0,
(), (),
"Scans all of SCM objects and reclaims for further use those that are "Scans all of SCM objects and reclaims for further use those that are
no longer accessible.") no longer accessible.")
@ -1761,7 +1761,7 @@ SCM_DEFINE (scm_unhash_name, "unhash-name", 1, 0, 0,
{ {
int x; int x;
int bound; int bound;
SCM_VALIDATE_SYMBOL(1,name); SCM_VALIDATE_SYMBOL (1,name);
SCM_DEFER_INTS; SCM_DEFER_INTS;
bound = scm_n_heap_segs; bound = scm_n_heap_segs;
for (x = 0; x < bound; ++x) for (x = 0; x < bound; ++x)

View file

@ -129,7 +129,7 @@ scm_make_gsubr_with_generic (const char *name,
} }
SCM_DEFINE(scm_gsubr_apply, "gsubr-apply", 0, 0, 1, SCM_DEFINE (scm_gsubr_apply, "gsubr-apply", 0, 0, 1,
(SCM args), (SCM args),
"") "")
#define FUNC_NAME s_scm_gsubr_apply #define FUNC_NAME s_scm_gsubr_apply

View file

@ -144,7 +144,7 @@ scm_ihashq (SCM obj, unsigned int n)
} }
SCM_DEFINE(scm_hashq, "hashq", 2, 0, 0, SCM_DEFINE (scm_hashq, "hashq", 2, 0, 0,
(SCM obj, SCM n), (SCM obj, SCM n),
"@deffnx primitive hashv key size "@deffnx primitive hashv key size
@deffnx primitive hash key size @deffnx primitive hash key size
@ -154,7 +154,7 @@ table. Each function returns an integer in the range 0 to
@var{size}-1.") @var{size}-1.")
#define FUNC_NAME s_scm_hashq #define FUNC_NAME s_scm_hashq
{ {
SCM_VALIDATE_INUM_MIN(2,n,0); SCM_VALIDATE_INUM_MIN (2,n,0);
return SCM_MAKINUM(scm_ihashq (obj, SCM_INUM (n))); return SCM_MAKINUM(scm_ihashq (obj, SCM_INUM (n)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -176,12 +176,12 @@ scm_ihashv (SCM obj, unsigned int n)
} }
SCM_DEFINE(scm_hashv, "hashv", 2, 0, 0, SCM_DEFINE (scm_hashv, "hashv", 2, 0, 0,
(SCM obj, SCM n), (SCM obj, SCM n),
"") "")
#define FUNC_NAME s_scm_hashv #define FUNC_NAME s_scm_hashv
{ {
SCM_VALIDATE_INUM_MIN(2,n,0); SCM_VALIDATE_INUM_MIN (2,n,0);
return SCM_MAKINUM(scm_ihashv (obj, SCM_INUM (n))); return SCM_MAKINUM(scm_ihashv (obj, SCM_INUM (n)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -196,12 +196,12 @@ scm_ihash (SCM obj, unsigned int n)
return (unsigned int)scm_hasher (obj, n, 10); return (unsigned int)scm_hasher (obj, n, 10);
} }
SCM_DEFINE(scm_hash, "hash", 2, 0, 0, SCM_DEFINE (scm_hash, "hash", 2, 0, 0,
(SCM obj, SCM n), (SCM obj, SCM n),
"") "")
#define FUNC_NAME s_scm_hash #define FUNC_NAME s_scm_hash
{ {
SCM_VALIDATE_INUM_MIN(2,n,0); SCM_VALIDATE_INUM_MIN (2,n,0);
return SCM_MAKINUM(scm_ihash(obj, SCM_INUM(n))); return SCM_MAKINUM(scm_ihash(obj, SCM_INUM(n)));
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -494,8 +494,8 @@ SCM_DEFINE (scm_hash_fold, "hash-fold", 3, 0, 0,
"") "")
#define FUNC_NAME s_scm_hash_fold #define FUNC_NAME s_scm_hash_fold
{ {
SCM_VALIDATE_PROC(1,proc); SCM_VALIDATE_PROC (1,proc);
SCM_VALIDATE_VECTOR(3,table); SCM_VALIDATE_VECTOR (3,table);
return scm_internal_hash_fold (fold_proc, (void *) proc, init, table); return scm_internal_hash_fold (fold_proc, (void *) proc, init, table);
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -92,20 +92,20 @@ without encountering a delimiter, this value is @var{#f}.")
char *cdelims; char *cdelims;
int num_delims; int num_delims;
SCM_VALIDATE_ROSTRING_COPY(1,delims,cdelims); SCM_VALIDATE_ROSTRING_COPY (1,delims,cdelims);
num_delims = SCM_ROLENGTH (delims); num_delims = SCM_ROLENGTH (delims);
SCM_VALIDATE_STRING_COPY(2,buf,cbuf); SCM_VALIDATE_STRING_COPY (2,buf,cbuf);
cend = SCM_LENGTH (buf); cend = SCM_LENGTH (buf);
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_inp; port = scm_cur_inp;
else else
SCM_VALIDATE_OPINPORT(4,port); SCM_VALIDATE_OPINPORT (4,port);
SCM_VALIDATE_INUM_DEF_COPY(5,start,0,cstart); SCM_VALIDATE_INUM_DEF_COPY (5,start,0,cstart);
if (cstart < 0 || cstart >= cend) if (cstart < 0 || cstart >= cend)
scm_out_of_range (FUNC_NAME, start); scm_out_of_range (FUNC_NAME, start);
SCM_VALIDATE_INUM_DEF_COPY(6,end,cend,tend); SCM_VALIDATE_INUM_DEF_COPY (6,end,cend,tend);
if (tend <= cstart || tend > cend) if (tend <= cstart || tend > cend)
scm_out_of_range (FUNC_NAME, end); scm_out_of_range (FUNC_NAME, end);
cend = tend; cend = tend;
@ -245,7 +245,7 @@ delimiter may be either a newline or the @var{eof-object}; if
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_inp; port = scm_cur_inp;
SCM_VALIDATE_OPINPORT(1,port); SCM_VALIDATE_OPINPORT (1,port);
pt = SCM_PTAB_ENTRY (port); pt = SCM_PTAB_ENTRY (port);
if (pt->rw_active == SCM_PORT_WRITE) if (pt->rw_active == SCM_PORT_WRITE)
@ -345,8 +345,8 @@ revealed counts.")
old = SCM_COERCE_OUTPORT (old); old = SCM_COERCE_OUTPORT (old);
new = SCM_COERCE_OUTPORT (new); new = SCM_COERCE_OUTPORT (new);
SCM_VALIDATE_OPFPORT(1,old); SCM_VALIDATE_OPFPORT (1,old);
SCM_VALIDATE_OPFPORT(2,new); SCM_VALIDATE_OPFPORT (2,new);
oldfd = SCM_FPORT_FDES (old); oldfd = SCM_FPORT_FDES (old);
fp = SCM_FSTREAM (new); fp = SCM_FSTREAM (new);
newfd = fp->fdes; newfd = fp->fdes;
@ -384,7 +384,7 @@ SCM_DEFINE (scm_dup_to_fdes, "dup->fdes", 1, 1, 0,
oldfd = SCM_INUM (fd_or_port); oldfd = SCM_INUM (fd_or_port);
else else
{ {
SCM_VALIDATE_OPFPORT(1,fd_or_port); SCM_VALIDATE_OPFPORT (1,fd_or_port);
oldfd = SCM_FPORT_FDES (fd_or_port); oldfd = SCM_FPORT_FDES (fd_or_port);
} }
@ -418,7 +418,7 @@ Does not change its revealed count.")
#define FUNC_NAME s_scm_fileno #define FUNC_NAME s_scm_fileno
{ {
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPFPORT(1,port); SCM_VALIDATE_OPFPORT (1,port);
return SCM_MAKINUM (SCM_FPORT_FDES (port)); return SCM_MAKINUM (SCM_FPORT_FDES (port));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -457,8 +457,8 @@ by @ref{File Ports, open-file}.")
{ {
SCM port; SCM port;
SCM_VALIDATE_INUM(1,fdes); SCM_VALIDATE_INUM (1,fdes);
SCM_VALIDATE_ROSTRING(2,modes); SCM_VALIDATE_ROSTRING (2,modes);
SCM_COERCE_SUBSTR (modes); SCM_COERCE_SUBSTR (modes);
port = scm_fdes_to_port (SCM_INUM (fdes), SCM_ROCHARS (modes), SCM_BOOL_F); port = scm_fdes_to_port (SCM_INUM (fdes), SCM_ROCHARS (modes), SCM_BOOL_F);
return port; return port;
@ -489,8 +489,8 @@ required value or @code{#t} if it was moved.")
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPFPORT(1,port); SCM_VALIDATE_OPFPORT (1,port);
SCM_VALIDATE_INUM(2,fd); SCM_VALIDATE_INUM (2,fd);
stream = SCM_FSTREAM (port); stream = SCM_FSTREAM (port);
old_fd = stream->fdes; old_fd = stream->fdes;
new_fd = SCM_INUM (fd); new_fd = SCM_INUM (fd);
@ -509,7 +509,7 @@ required value or @code{#t} if it was moved.")
#undef FUNC_NAME #undef FUNC_NAME
/* Return a list of ports using a given file descriptor. */ /* Return a list of ports using a given file descriptor. */
SCM_DEFINE(scm_fdes_to_ports, "fdes->ports", 1, 0, 0, SCM_DEFINE (scm_fdes_to_ports, "fdes->ports", 1, 0, 0,
(SCM fd), (SCM fd),
"Returns a list of existing ports which have @var{fdes} as an "Returns a list of existing ports which have @var{fdes} as an
underlying file descriptor, without changing their revealed counts.") underlying file descriptor, without changing their revealed counts.")
@ -519,7 +519,7 @@ underlying file descriptor, without changing their revealed counts.")
int int_fd; int int_fd;
int i; int i;
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_port_table_size; i++)
{ {

View file

@ -106,7 +106,7 @@ scm_c_make_keyword (char *s)
return scm_make_keyword_from_dash_symbol (SCM_CAR (vcell)); return scm_make_keyword_from_dash_symbol (SCM_CAR (vcell));
} }
SCM_DEFINE(scm_keyword_p, "keyword?", 1, 0, 0, SCM_DEFINE (scm_keyword_p, "keyword?", 1, 0, 0,
(SCM obj), (SCM obj),
"@code{keyword?} returns @code{#t} if the argument @var{kw} is a keyword; "@code{keyword?} returns @code{#t} if the argument @var{kw} is a keyword;
it returns @code{#f} otherwise.") it returns @code{#f} otherwise.")
@ -117,13 +117,13 @@ it returns @code{#f} otherwise.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_keyword_dash_symbol, "keyword-dash-symbol", 1, 0, 0, SCM_DEFINE (scm_keyword_dash_symbol, "keyword-dash-symbol", 1, 0, 0,
(SCM keyword), (SCM keyword),
"@code{keyword-dash-symbol} [FIXME: have no idea what this does; it is "@code{keyword-dash-symbol} [FIXME: have no idea what this does; it is
not commented.]") not commented.]")
#define FUNC_NAME s_scm_keyword_dash_symbol #define FUNC_NAME s_scm_keyword_dash_symbol
{ {
SCM_VALIDATE_KEYWORD(1,keyword); SCM_VALIDATE_KEYWORD (1,keyword);
return SCM_CDR (keyword); return SCM_CDR (keyword);
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -84,7 +84,7 @@ SCM_DEFINE (scm_nil_car, "nil-car", 1, 0, 0,
{ {
if (SCM_NILP (x)) if (SCM_NILP (x))
return scm_nil; return scm_nil;
SCM_VALIDATE_CONS(1,x); SCM_VALIDATE_CONS (1,x);
return SCM_CAR (x); return SCM_CAR (x);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -96,7 +96,7 @@ SCM_DEFINE (scm_nil_cdr, "nil-cdr", 1, 0, 0,
{ {
if (SCM_NILP (x)) if (SCM_NILP (x))
return scm_nil; return scm_nil;
SCM_VALIDATE_CONS(1,x); SCM_VALIDATE_CONS (1,x);
return SCM_EOL2NIL (SCM_CDR (x), x); return SCM_EOL2NIL (SCM_CDR (x), x);
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -82,7 +82,7 @@ scm_listify (SCM elt, ...)
} }
SCM_DEFINE(scm_list, "list", 0, 0, 1, SCM_DEFINE (scm_list, "list", 0, 0, 1,
(SCM objs), (SCM objs),
"") "")
#define FUNC_NAME s_scm_list #define FUNC_NAME s_scm_list
@ -115,7 +115,7 @@ SCM_DEFINE (scm_list_star, "list*", 1, 0, 1,
/* general questions about lists --- null?, list?, length, etc. */ /* general questions about lists --- null?, list?, length, etc. */
SCM_DEFINE(scm_null_p, "null?", 1, 0, 0, SCM_DEFINE (scm_null_p, "null?", 1, 0, 0,
(SCM x), (SCM x),
"") "")
#define FUNC_NAME s_scm_null_p #define FUNC_NAME s_scm_null_p
@ -124,7 +124,7 @@ SCM_DEFINE(scm_null_p, "null?", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_list_p, "list?", 1, 0, 0, SCM_DEFINE (scm_list_p, "list?", 1, 0, 0,
(SCM x), (SCM x),
"") "")
#define FUNC_NAME s_scm_list_p #define FUNC_NAME s_scm_list_p
@ -164,13 +164,13 @@ scm_ilength(SCM sx)
return -1; return -1;
} }
SCM_DEFINE(scm_length, "length", 1, 0, 0, SCM_DEFINE (scm_length, "length", 1, 0, 0,
(SCM lst), (SCM lst),
"") "")
#define FUNC_NAME s_scm_length #define FUNC_NAME s_scm_length
{ {
int i; int i;
SCM_VALIDATE_LIST_COPYLEN(1,lst,i); SCM_VALIDATE_LIST_COPYLEN (1,lst,i);
return SCM_MAKINUM (i); return SCM_MAKINUM (i);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -190,25 +190,25 @@ performed. Return a pointer to the mutated list.")
SCM res = SCM_EOL; SCM res = SCM_EOL;
SCM *lloc = &res, arg; SCM *lloc = &res, arg;
if (SCM_IMP(args)) { if (SCM_IMP(args)) {
SCM_VALIDATE_NULL(SCM_ARGn, args); SCM_VALIDATE_NULL (SCM_ARGn, args);
return res; return res;
} }
SCM_VALIDATE_CONS(SCM_ARGn, args); SCM_VALIDATE_CONS (SCM_ARGn, args);
while (1) { while (1) {
arg = SCM_CAR(args); arg = SCM_CAR(args);
args = SCM_CDR(args); args = SCM_CDR(args);
if (SCM_IMP(args)) { if (SCM_IMP(args)) {
*lloc = arg; *lloc = arg;
SCM_VALIDATE_NULL(SCM_ARGn, args); SCM_VALIDATE_NULL (SCM_ARGn, args);
return res; return res;
} }
SCM_VALIDATE_CONS(SCM_ARGn, args); SCM_VALIDATE_CONS (SCM_ARGn, args);
for(;SCM_NIMP(arg);arg = SCM_CDR(arg)) { for(;SCM_NIMP(arg);arg = SCM_CDR(arg)) {
SCM_VALIDATE_CONS(SCM_ARGn, arg); SCM_VALIDATE_CONS (SCM_ARGn, arg);
*lloc = scm_cons(SCM_CAR(arg), SCM_EOL); *lloc = scm_cons(SCM_CAR(arg), SCM_EOL);
lloc = SCM_CDRLOC(*lloc); lloc = SCM_CDRLOC(*lloc);
} }
SCM_VALIDATE_NULL(SCM_ARGn, arg); SCM_VALIDATE_NULL (SCM_ARGn, arg);
} }
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -226,14 +226,14 @@ SCM_DEFINE (scm_append_x, "append!", 0, 0, 1,
args = SCM_CDR(args); args = SCM_CDR(args);
if (SCM_NULLP(args)) return arg; if (SCM_NULLP(args)) return arg;
if (SCM_NULLP(arg)) goto tail; if (SCM_NULLP(arg)) goto tail;
SCM_VALIDATE_CONS(SCM_ARG1,arg); SCM_VALIDATE_CONS (SCM_ARG1,arg);
SCM_SETCDR (scm_last_pair (arg), scm_append_x (args)); SCM_SETCDR (scm_last_pair (arg), scm_append_x (args));
return arg; return arg;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_last_pair, "last-pair", 1, 0, 0, SCM_DEFINE (scm_last_pair, "last-pair", 1, 0, 0,
(SCM sx), (SCM sx),
"Return a pointer to the last pair in @var{lst}, signalling an error if "Return a pointer to the last pair in @var{lst}, signalling an error if
@var{lst} is circular.") @var{lst} is circular.")
@ -245,7 +245,7 @@ SCM_DEFINE(scm_last_pair, "last-pair", 1, 0, 0,
if (SCM_NULLP (sx)) if (SCM_NULLP (sx))
return SCM_EOL; return SCM_EOL;
SCM_VALIDATE_CONS(SCM_ARG1,res); SCM_VALIDATE_CONS (SCM_ARG1,res);
while (!0) { while (!0) {
x = SCM_CDR(res); x = SCM_CDR(res);
if (SCM_IMP(x) || SCM_NCONSP(x)) return res; if (SCM_IMP(x) || SCM_NCONSP(x)) return res;
@ -281,12 +281,12 @@ of the modified list is not lost, it is wise to save the return value of
SCM p = ls, t = ls; SCM p = ls, t = ls;
while (SCM_NIMP (p)) while (SCM_NIMP (p))
{ {
SCM_VALIDATE_CONS(1,ls); SCM_VALIDATE_CONS (1,ls);
res = scm_cons (SCM_CAR (p), res); res = scm_cons (SCM_CAR (p), res);
p = SCM_CDR (p); p = SCM_CDR (p);
if (SCM_IMP (p)) if (SCM_IMP (p))
break; break;
SCM_VALIDATE_CONS(1,ls); SCM_VALIDATE_CONS (1,ls);
res = scm_cons (SCM_CAR (p), res); res = scm_cons (SCM_CAR (p), res);
p = SCM_CDR (p); p = SCM_CDR (p);
t = SCM_CDR (t); t = SCM_CDR (t);
@ -294,7 +294,7 @@ of the modified list is not lost, it is wise to save the return value of
scm_misc_error (FUNC_NAME, "Circular structure: %S", SCM_LIST1 (ls)); scm_misc_error (FUNC_NAME, "Circular structure: %S", SCM_LIST1 (ls));
} }
ls = p; ls = p;
SCM_VALIDATE_NULL(1,ls); SCM_VALIDATE_NULL (1,ls);
return res; return res;
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -326,13 +326,13 @@ SCM_DEFINE (scm_reverse_x, "reverse!", 1, 1, 0,
/* indexing lists by element number */ /* indexing lists by element number */
SCM_DEFINE(scm_list_ref, "list-ref", 2, 0, 0, SCM_DEFINE (scm_list_ref, "list-ref", 2, 0, 0,
(SCM lst, SCM k), (SCM lst, SCM k),
"") "")
#define FUNC_NAME s_scm_list_ref #define FUNC_NAME s_scm_list_ref
{ {
register long i; register long i;
SCM_VALIDATE_INUM_MIN_COPY(2,k,0,i); SCM_VALIDATE_INUM_MIN_COPY (2,k,0,i);
while (i-- > 0) { while (i-- > 0) {
SCM_ASRTGO(SCM_CONSP(lst), erout); SCM_ASRTGO(SCM_CONSP(lst), erout);
lst = SCM_CDR(lst); lst = SCM_CDR(lst);
@ -344,13 +344,13 @@ SCM_DEFINE(scm_list_ref, "list-ref", 2, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_list_set_x, "list-set!", 3, 0, 0, SCM_DEFINE (scm_list_set_x, "list-set!", 3, 0, 0,
(SCM lst, SCM k, SCM val), (SCM lst, SCM k, SCM val),
"Set the @var{k}th element of @var{lst} to @var{val}.") "Set the @var{k}th element of @var{lst} to @var{val}.")
#define FUNC_NAME s_scm_list_set_x #define FUNC_NAME s_scm_list_set_x
{ {
register long i; register long i;
SCM_VALIDATE_INUM_MIN_COPY(2,k,0,i); SCM_VALIDATE_INUM_MIN_COPY (2,k,0,i);
while (i-- > 0) { while (i-- > 0) {
SCM_ASRTGO(SCM_CONSP(lst), erout); SCM_ASRTGO(SCM_CONSP(lst), erout);
lst = SCM_CDR(lst); lst = SCM_CDR(lst);
@ -366,7 +366,7 @@ SCM_DEFINE(scm_list_set_x, "list-set!", 3, 0, 0,
SCM_REGISTER_PROC(s_list_cdr_ref, "list-cdr-ref", 2, 0, 0, scm_list_tail); SCM_REGISTER_PROC(s_list_cdr_ref, "list-cdr-ref", 2, 0, 0, scm_list_tail);
SCM_DEFINE(scm_list_tail, "list-tail", 2, 0, 0, SCM_DEFINE (scm_list_tail, "list-tail", 2, 0, 0,
(SCM lst, SCM k), (SCM lst, SCM k),
"Return the \"tail\" of @var{lst} beginning with its @var{k}th element. "Return the \"tail\" of @var{lst} beginning with its @var{k}th element.
The first element of the list is considered to be element 0. The first element of the list is considered to be element 0.
@ -377,9 +377,9 @@ or returning the results of cdring @var{k} times down @var{lst}.")
#define FUNC_NAME s_scm_list_tail #define FUNC_NAME s_scm_list_tail
{ {
register long i; register long i;
SCM_VALIDATE_INUM_MIN_COPY(2,k,0,i); SCM_VALIDATE_INUM_MIN_COPY (2,k,0,i);
while (i-- > 0) { while (i-- > 0) {
SCM_VALIDATE_CONS(1,lst); SCM_VALIDATE_CONS (1,lst);
lst = SCM_CDR(lst); lst = SCM_CDR(lst);
} }
return lst; return lst;
@ -387,13 +387,13 @@ or returning the results of cdring @var{k} times down @var{lst}.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_list_cdr_set_x, "list-cdr-set!", 3, 0, 0, SCM_DEFINE (scm_list_cdr_set_x, "list-cdr-set!", 3, 0, 0,
(SCM lst, SCM k, SCM val), (SCM lst, SCM k, SCM val),
"Set the @var{k}th cdr of @var{lst} to @var{val}.") "Set the @var{k}th cdr of @var{lst} to @var{val}.")
#define FUNC_NAME s_scm_list_cdr_set_x #define FUNC_NAME s_scm_list_cdr_set_x
{ {
register long i; register long i;
SCM_VALIDATE_INUM_MIN_COPY(2,k,0,i); SCM_VALIDATE_INUM_MIN_COPY (2,k,0,i);
while (i-- > 0) { while (i-- > 0) {
SCM_ASRTGO(SCM_CONSP(lst), erout); SCM_ASRTGO(SCM_CONSP(lst), erout);
lst = SCM_CDR(lst); lst = SCM_CDR(lst);
@ -410,7 +410,7 @@ erout:
/* copying lists, perhaps partially */ /* copying lists, perhaps partially */
SCM_DEFINE(scm_list_head, "list-head", 2, 0, 0, SCM_DEFINE (scm_list_head, "list-head", 2, 0, 0,
(SCM lst, SCM k), (SCM lst, SCM k),
"Copy the first @var{k} elements from @var{lst} into a new list, and "Copy the first @var{k} elements from @var{lst} into a new list, and
return it.") return it.")
@ -420,12 +420,12 @@ return it.")
SCM * pos; SCM * pos;
register long i; register long i;
SCM_VALIDATE_INUM_MIN_COPY(2,k,0,i); SCM_VALIDATE_INUM_MIN_COPY (2,k,0,i);
answer = SCM_EOL; answer = SCM_EOL;
pos = &answer; pos = &answer;
while (i-- > 0) while (i-- > 0)
{ {
SCM_VALIDATE_CONS(1,lst); SCM_VALIDATE_CONS (1,lst);
*pos = scm_cons (SCM_CAR (lst), SCM_EOL); *pos = scm_cons (SCM_CAR (lst), SCM_EOL);
pos = SCM_CDRLOC (*pos); pos = SCM_CDRLOC (*pos);
lst = SCM_CDR(lst); lst = SCM_CDR(lst);
@ -514,13 +514,13 @@ SCM_DEFINE (scm_sloppy_member, "sloppy-member", 2, 0, 0,
SCM_DEFINE(scm_memq, "memq", 2, 0, 0, SCM_DEFINE (scm_memq, "memq", 2, 0, 0,
(SCM x, SCM lst), (SCM x, SCM lst),
"") "")
#define FUNC_NAME s_scm_memq #define FUNC_NAME s_scm_memq
{ {
SCM answer; SCM answer;
SCM_VALIDATE_LIST(2,lst); SCM_VALIDATE_LIST (2,lst);
answer = scm_sloppy_memq (x, lst); answer = scm_sloppy_memq (x, lst);
return (answer == SCM_EOL) ? SCM_BOOL_F : answer; return (answer == SCM_EOL) ? SCM_BOOL_F : answer;
} }
@ -528,26 +528,26 @@ SCM_DEFINE(scm_memq, "memq", 2, 0, 0,
SCM_DEFINE(scm_memv, "memv", 2, 0, 0, SCM_DEFINE (scm_memv, "memv", 2, 0, 0,
(SCM x, SCM lst), (SCM x, SCM lst),
"") "")
#define FUNC_NAME s_scm_memv #define FUNC_NAME s_scm_memv
{ {
SCM answer; SCM answer;
SCM_VALIDATE_LIST(2,lst); SCM_VALIDATE_LIST (2,lst);
answer = scm_sloppy_memv (x, lst); answer = scm_sloppy_memv (x, lst);
return (answer == SCM_EOL) ? SCM_BOOL_F : answer; return (answer == SCM_EOL) ? SCM_BOOL_F : answer;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_member, "member", 2, 0, 0, SCM_DEFINE (scm_member, "member", 2, 0, 0,
(SCM x, SCM lst), (SCM x, SCM lst),
"") "")
#define FUNC_NAME s_scm_member #define FUNC_NAME s_scm_member
{ {
SCM answer; SCM answer;
SCM_VALIDATE_LIST(2,lst); SCM_VALIDATE_LIST (2,lst);
answer = scm_sloppy_member (x, lst); answer = scm_sloppy_member (x, lst);
return (answer == SCM_EOL) ? SCM_BOOL_F : answer; return (answer == SCM_EOL) ? SCM_BOOL_F : answer;
} }
@ -557,7 +557,7 @@ SCM_DEFINE(scm_member, "member", 2, 0, 0,
/* deleting elements from a list (delq, etc.) */ /* deleting elements from a list (delq, etc.) */
SCM_DEFINE(scm_delq_x, "delq!", 2, 0, 0, SCM_DEFINE (scm_delq_x, "delq!", 2, 0, 0,
(SCM item, SCM lst), (SCM item, SCM lst),
"@deffnx primitive delv! item lst "@deffnx primitive delv! item lst
@deffnx primitive delete! item lst @deffnx primitive delete! item lst
@ -587,7 +587,7 @@ destructive list functions, these functions cannot modify the binding of
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_delv_x, "delv!", 2, 0, 0, SCM_DEFINE (scm_delv_x, "delv!", 2, 0, 0,
(SCM item, SCM lst), (SCM item, SCM lst),
"") "")
#define FUNC_NAME s_scm_delv_x #define FUNC_NAME s_scm_delv_x
@ -611,7 +611,7 @@ SCM_DEFINE(scm_delv_x, "delv!", 2, 0, 0,
SCM_DEFINE(scm_delete_x, "delete!", 2, 0, 0, SCM_DEFINE (scm_delete_x, "delete!", 2, 0, 0,
(SCM item, SCM lst), (SCM item, SCM lst),
"") "")
#define FUNC_NAME s_scm_delete_x #define FUNC_NAME s_scm_delete_x
@ -673,7 +673,7 @@ SCM_DEFINE (scm_delete, "delete", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_delq1_x, "delq1!", 2, 0, 0, SCM_DEFINE (scm_delq1_x, "delq1!", 2, 0, 0,
(SCM item, SCM lst), (SCM item, SCM lst),
"") "")
#define FUNC_NAME s_scm_delq1_x #define FUNC_NAME s_scm_delq1_x
@ -699,7 +699,7 @@ SCM_DEFINE(scm_delq1_x, "delq1!", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_delv1_x, "delv1!", 2, 0, 0, SCM_DEFINE (scm_delv1_x, "delv1!", 2, 0, 0,
(SCM item, SCM lst), (SCM item, SCM lst),
"") "")
#define FUNC_NAME s_scm_delv1_x #define FUNC_NAME s_scm_delv1_x
@ -725,7 +725,7 @@ SCM_DEFINE(scm_delv1_x, "delv1!", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_delete1_x, "delete1!", 2, 0, 0, SCM_DEFINE (scm_delete1_x, "delete1!", 2, 0, 0,
(SCM item, SCM lst), (SCM item, SCM lst),
"") "")
#define FUNC_NAME s_scm_delete1_x #define FUNC_NAME s_scm_delete1_x

View file

@ -97,7 +97,7 @@ load (void *data)
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
SCM_DEFINE(scm_primitive_load, "primitive-load", 1, 0, 0, SCM_DEFINE (scm_primitive_load, "primitive-load", 1, 0, 0,
(SCM filename), (SCM filename),
"Load @var{file} and evaluate its contents in the top-level environment. "Load @var{file} and evaluate its contents in the top-level environment.
The load paths are not searched; @var{file} must either be a full The load paths are not searched; @var{file} must either be a full
@ -108,7 +108,7 @@ that will be called before any code is loaded. See documentation for
#define FUNC_NAME s_scm_primitive_load #define FUNC_NAME s_scm_primitive_load
{ {
SCM hook = *scm_loc_load_hook; SCM hook = *scm_loc_load_hook;
SCM_VALIDATE_ROSTRING(1,filename); SCM_VALIDATE_ROSTRING (1,filename);
SCM_ASSERT (hook == SCM_BOOL_F SCM_ASSERT (hook == SCM_BOOL_F
|| (scm_procedure_p (hook) == SCM_BOOL_T), || (scm_procedure_p (hook) == SCM_BOOL_T),
hook, "value of %load-hook is neither a procedure nor #f", hook, "value of %load-hook is neither a procedure nor #f",
@ -256,7 +256,7 @@ SCM scm_listofnullstr;
If FILENAME is absolute, return it unchanged. If FILENAME is absolute, return it unchanged.
If given, EXTENSIONS is a list of strings; for each directory If given, EXTENSIONS is a list of strings; for each directory
in PATH, we search for FILENAME concatenated with each EXTENSION. */ in PATH, we search for FILENAME concatenated with each EXTENSION. */
SCM_DEFINE(scm_search_path, "search-path", 2, 1, 0, SCM_DEFINE (scm_search_path, "search-path", 2, 1, 0,
(SCM path, SCM filename, SCM extensions), (SCM path, SCM filename, SCM extensions),
"") "")
#define FUNC_NAME s_scm_search_path #define FUNC_NAME s_scm_search_path
@ -266,12 +266,12 @@ SCM_DEFINE(scm_search_path, "search-path", 2, 1, 0,
size_t max_path_len; /* maximum length of any PATH element */ size_t max_path_len; /* maximum length of any PATH element */
size_t max_ext_len; /* maximum length of any EXTENSIONS element */ size_t max_ext_len; /* maximum length of any EXTENSIONS element */
SCM_VALIDATE_LIST(1,path); SCM_VALIDATE_LIST (1,path);
SCM_VALIDATE_ROSTRING(2,filename); SCM_VALIDATE_ROSTRING (2,filename);
if (SCM_UNBNDP (extensions)) if (SCM_UNBNDP (extensions))
extensions = SCM_EOL; extensions = SCM_EOL;
else else
SCM_VALIDATE_LIST(3,extensions); SCM_VALIDATE_LIST (3,extensions);
filename_chars = SCM_ROCHARS (filename); filename_chars = SCM_ROCHARS (filename);
filename_len = SCM_ROLENGTH (filename); filename_len = SCM_ROLENGTH (filename);
@ -399,7 +399,7 @@ SCM_DEFINE(scm_search_path, "search-path", 2, 1, 0,
The file must be readable, and not a directory. The file must be readable, and not a directory.
If we find one, return its full filename; otherwise, return #f. If we find one, return its full filename; otherwise, return #f.
If FILENAME is absolute, return it unchanged. */ If FILENAME is absolute, return it unchanged. */
SCM_DEFINE(scm_sys_search_load_path, "%search-load-path", 1, 0, 0, SCM_DEFINE (scm_sys_search_load_path, "%search-load-path", 1, 0, 0,
(SCM filename), (SCM filename),
"Search @var{%load-path} for @var{file}, which must be readable by the "Search @var{%load-path} for @var{file}, which must be readable by the
current user. If @var{file} is found in the list of paths to search or current user. If @var{file} is found in the list of paths to search or
@ -411,7 +411,7 @@ extension automatically.")
{ {
SCM path = *scm_loc_load_path; SCM path = *scm_loc_load_path;
SCM exts = *scm_loc_load_extensions; SCM exts = *scm_loc_load_extensions;
SCM_VALIDATE_ROSTRING(1,filename); SCM_VALIDATE_ROSTRING (1,filename);
SCM_ASSERT (scm_ilength (path) >= 0, path, "load path is not a proper list", SCM_ASSERT (scm_ilength (path) >= 0, path, "load path is not a proper list",
FUNC_NAME); FUNC_NAME);
@ -423,7 +423,7 @@ extension automatically.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_primitive_load_path, "primitive-load-path", 1, 0, 0, SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 1, 0, 0,
(SCM filename), (SCM filename),
"Search @var{%load-path} for @var{file} and load it into the top-level "Search @var{%load-path} for @var{file} and load it into the top-level
environment. If @var{file} is a relative pathname and is not found in environment. If @var{file} is a relative pathname and is not found in
@ -432,7 +432,7 @@ the list of search paths, an error is signalled.")
{ {
SCM full_filename; SCM full_filename;
SCM_VALIDATE_ROSTRING(1,filename); SCM_VALIDATE_ROSTRING (1,filename);
full_filename = scm_sys_search_load_path (filename); full_filename = scm_sys_search_load_path (filename);

View file

@ -57,29 +57,29 @@ SCM_DEFINE (scm_makacro, "procedure->syntax", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_makacro #define FUNC_NAME s_scm_makacro
{ {
SCM_VALIDATE_PROC(1,code); SCM_VALIDATE_PROC (1,code);
SCM_RETURN_NEWSMOB (scm_tc16_macro, code); SCM_RETURN_NEWSMOB (scm_tc16_macro, code);
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_makmacro, "procedure->macro", 1, 0, 0, SCM_DEFINE (scm_makmacro, "procedure->macro", 1, 0, 0,
(SCM code), (SCM code),
"") "")
#define FUNC_NAME s_scm_makmacro #define FUNC_NAME s_scm_makmacro
{ {
SCM_VALIDATE_PROC(1,code); SCM_VALIDATE_PROC (1,code);
SCM_RETURN_NEWSMOB (scm_tc16_macro | (1L << 16), code); SCM_RETURN_NEWSMOB (scm_tc16_macro | (1L << 16), code);
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_makmmacro, "procedure->memoizing-macro", 1, 0, 0, SCM_DEFINE (scm_makmmacro, "procedure->memoizing-macro", 1, 0, 0,
(SCM code), (SCM code),
"") "")
#define FUNC_NAME s_scm_makmmacro #define FUNC_NAME s_scm_makmmacro
{ {
SCM_VALIDATE_PROC(1,code); SCM_VALIDATE_PROC (1,code);
SCM_RETURN_NEWSMOB (scm_tc16_macro | (2L << 16), code); SCM_RETURN_NEWSMOB (scm_tc16_macro | (2L << 16), code);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -126,7 +126,7 @@ SCM_DEFINE (scm_macro_name, "macro-name", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_macro_name #define FUNC_NAME s_scm_macro_name
{ {
SCM_VALIDATE_SMOB(1,m,macro); SCM_VALIDATE_SMOB (1,m,macro);
return scm_procedure_name (SCM_CDR (m)); return scm_procedure_name (SCM_CDR (m));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -137,7 +137,7 @@ SCM_DEFINE (scm_macro_transformer, "macro-transformer", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_macro_transformer #define FUNC_NAME s_scm_macro_transformer
{ {
SCM_VALIDATE_SMOB(1,m,macro); SCM_VALIDATE_SMOB (1,m,macro);
return SCM_CLOSUREP (SCM_CDR (m)) ? SCM_CDR (m) : SCM_BOOL_F; return SCM_CLOSUREP (SCM_CDR (m)) ? SCM_CDR (m) : SCM_BOOL_F;
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -95,7 +95,7 @@ dotted decimal notation into an integer.
{ {
struct in_addr soka; struct in_addr soka;
SCM_VALIDATE_ROSTRING(1,address); SCM_VALIDATE_ROSTRING (1,address);
if (SCM_SUBSTRP (address)) if (SCM_SUBSTRP (address))
address = scm_makfromstr (SCM_ROCHARS (address), SCM_ROLENGTH (address), 0); address = scm_makfromstr (SCM_ROCHARS (address), SCM_ROLENGTH (address), 0);
if (inet_aton (SCM_ROCHARS (address), &soka) == 0) if (inet_aton (SCM_ROCHARS (address), &soka) == 0)
@ -175,8 +175,8 @@ with the local-address-within-network number @var{lna}.
unsigned long netnum; unsigned long netnum;
unsigned long lnanum; unsigned long lnanum;
SCM_VALIDATE_INUM_COPY(1,net,netnum); SCM_VALIDATE_INUM_COPY (1,net,netnum);
SCM_VALIDATE_INUM_COPY(2,lna,lnanum); SCM_VALIDATE_INUM_COPY (2,lna,lnanum);
addr = inet_makeaddr (netnum, lnanum); addr = inet_makeaddr (netnum, lnanum);
return scm_ulong2num (ntohl (addr.s_addr)); return scm_ulong2num (ntohl (addr.s_addr));
} }
@ -466,7 +466,7 @@ as its first argument; if given no arguments, it behaves like
} }
return scm_return_entry (entry); return scm_return_entry (entry);
} }
SCM_VALIDATE_ROSTRING(2,proto); SCM_VALIDATE_ROSTRING (2,proto);
SCM_COERCE_SUBSTR (proto); SCM_COERCE_SUBSTR (proto);
if (SCM_ROSTRINGP (name)) if (SCM_ROSTRINGP (name))
{ {
@ -475,7 +475,7 @@ as its first argument; if given no arguments, it behaves like
} }
else else
{ {
SCM_VALIDATE_INUM(1,name); SCM_VALIDATE_INUM (1,name);
entry = getservbyport (htons (SCM_INUM (name)), SCM_ROCHARS (proto)); entry = getservbyport (htons (SCM_INUM (name)), SCM_ROCHARS (proto));
} }
if (!entry) if (!entry)

View file

@ -118,11 +118,11 @@ SCM_DEFINE (scm_odd_p, "odd?", 1, 0, 0,
#ifdef SCM_BIGDIG #ifdef SCM_BIGDIG
if (SCM_NINUMP (n)) if (SCM_NINUMP (n))
{ {
SCM_VALIDATE_BIGINT(1,n); SCM_VALIDATE_BIGINT (1,n);
return SCM_BOOL(1 & SCM_BDIGITS (n)[0]); return SCM_BOOL(1 & SCM_BDIGITS (n)[0]);
} }
#else #else
SCM_VALIDATE_INUM(1,n); SCM_VALIDATE_INUM (1,n);
#endif #endif
return SCM_BOOL(4 & (int) n); return SCM_BOOL(4 & (int) n);
} }
@ -136,11 +136,11 @@ SCM_DEFINE (scm_even_p, "even?", 1, 0, 0,
#ifdef SCM_BIGDIG #ifdef SCM_BIGDIG
if (SCM_NINUMP (n)) if (SCM_NINUMP (n))
{ {
SCM_VALIDATE_BIGINT(1,n); SCM_VALIDATE_BIGINT (1,n);
return SCM_NEGATE_BOOL(1 & SCM_BDIGITS (n)[0]); return SCM_NEGATE_BOOL(1 & SCM_BDIGITS (n)[0]);
} }
#else #else
SCM_VALIDATE_INUM(1,n); SCM_VALIDATE_INUM (1,n);
#endif #endif
return SCM_NEGATE_BOOL(4 & (int) n); return SCM_NEGATE_BOOL(4 & (int) n);
} }
@ -528,8 +528,8 @@ Example:
return SCM_MAKINUM (-1); return SCM_MAKINUM (-1);
return n1; return n1;
} }
SCM_VALIDATE_INUM_COPY(1,n1,i1); SCM_VALIDATE_INUM_COPY (1,n1,i1);
SCM_VALIDATE_INUM_COPY(2,n2,i2); SCM_VALIDATE_INUM_COPY (2,n2,i2);
return scm_ulong2num (i1 & i2); return scm_ulong2num (i1 & i2);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -553,8 +553,8 @@ Example:
return SCM_INUM0; return SCM_INUM0;
return n1; return n1;
} }
SCM_VALIDATE_INUM_COPY(1,n1,i1); SCM_VALIDATE_INUM_COPY (1,n1,i1);
SCM_VALIDATE_INUM_COPY(2,n2,i2); SCM_VALIDATE_INUM_COPY (2,n2,i2);
return scm_ulong2num (i1 | i2); return scm_ulong2num (i1 | i2);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -578,8 +578,8 @@ Example:
return SCM_INUM0; return SCM_INUM0;
return n1; return n1;
} }
SCM_VALIDATE_INUM_COPY(1,n1,i1); SCM_VALIDATE_INUM_COPY (1,n1,i1);
SCM_VALIDATE_INUM_COPY(2,n2,i2); SCM_VALIDATE_INUM_COPY (2,n2,i2);
return scm_ulong2num (i1 ^ i2); return scm_ulong2num (i1 ^ i2);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -590,8 +590,8 @@ SCM_DEFINE (scm_logtest, "logtest", 2, 0, 0,
#define FUNC_NAME s_scm_logtest #define FUNC_NAME s_scm_logtest
{ {
int i1, i2; int i1, i2;
SCM_VALIDATE_INUM_COPY(1,n1,i1); SCM_VALIDATE_INUM_COPY (1,n1,i1);
SCM_VALIDATE_INUM_COPY(2,n2,i2); SCM_VALIDATE_INUM_COPY (2,n2,i2);
return SCM_BOOL(i1 & i2); return SCM_BOOL(i1 & i2);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -603,8 +603,8 @@ SCM_DEFINE (scm_logbit_p, "logbit?", 2, 0, 0,
#define FUNC_NAME s_scm_logbit_p #define FUNC_NAME s_scm_logbit_p
{ {
int i1, i2; int i1, i2;
SCM_VALIDATE_INUM_COPY(1,n1,i1); SCM_VALIDATE_INUM_COPY (1,n1,i1);
SCM_VALIDATE_INUM_COPY(2,n2,i2); SCM_VALIDATE_INUM_COPY (2,n2,i2);
return SCM_BOOL((1 << i1) & i2); return SCM_BOOL((1 << i1) & i2);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -623,8 +623,8 @@ GUILE_PROC1 (scm_logand, "logand", scm_tc7_asubr,
return SCM_MAKINUM (-1); return SCM_MAKINUM (-1);
return n1; return n1;
} }
SCM_VALIDATE_INUM_COPY(1,n1,i1); SCM_VALIDATE_INUM_COPY (1,n1,i1);
SCM_VALIDATE_INUM_COPY(2,n2,i2); SCM_VALIDATE_INUM_COPY (2,n2,i2);
return SCM_MAKINUM (i1 & i2); return SCM_MAKINUM (i1 & i2);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -641,8 +641,8 @@ GUILE_PROC1 (scm_logior, "logior", scm_tc7_asubr,
return SCM_INUM0; return SCM_INUM0;
return n1; return n1;
} }
SCM_VALIDATE_INUM_COPY(1,n1,i1); SCM_VALIDATE_INUM_COPY (1,n1,i1);
SCM_VALIDATE_INUM_COPY(2,n2,i2); SCM_VALIDATE_INUM_COPY (2,n2,i2);
return SCM_MAKINUM (i1 | i2); return SCM_MAKINUM (i1 | i2);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -659,8 +659,8 @@ GUILE_PROC1 (scm_logxor, "logxor", scm_tc7_asubr,
return SCM_INUM0; return SCM_INUM0;
return n1; return n1;
} }
SCM_VALIDATE_INUM_COPY(1,n1,i1); SCM_VALIDATE_INUM_COPY (1,n1,i1);
SCM_VALIDATE_INUM_COPY(2,n2,i2); SCM_VALIDATE_INUM_COPY (2,n2,i2);
return SCM_MAKINUM (i1 ^ i2); return SCM_MAKINUM (i1 ^ i2);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -676,8 +676,8 @@ SCM_DEFINE (scm_logtest, "logtest", 2, 0, 0,
#define FUNC_NAME s_scm_logtest #define FUNC_NAME s_scm_logtest
{ {
int i1, i2; int i1, i2;
SCM_VALIDATE_INUM_COPY(1,n1,i1); SCM_VALIDATE_INUM_COPY (1,n1,i1);
SCM_VALIDATE_INUM_COPY(2,n2,i2); SCM_VALIDATE_INUM_COPY (2,n2,i2);
return SCM_BOOL(i1 & i2); return SCM_BOOL(i1 & i2);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -696,8 +696,8 @@ SCM_DEFINE (scm_logbit_p, "logbit?", 2, 0, 0,
#define FUNC_NAME s_scm_logbit_p #define FUNC_NAME s_scm_logbit_p
{ {
int i1, i2; int i1, i2;
SCM_VALIDATE_INUM_MIN_COPY(1,n1,0,i1); SCM_VALIDATE_INUM_MIN_COPY (1,n1,0,i1);
SCM_VALIDATE_INUM_COPY(2,n2,i2); SCM_VALIDATE_INUM_COPY (2,n2,i2);
return SCM_BOOL((1 << i1) & i2); return SCM_BOOL((1 << i1) & i2);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -717,7 +717,7 @@ Example:
") ")
#define FUNC_NAME s_scm_lognot #define FUNC_NAME s_scm_lognot
{ {
SCM_VALIDATE_INUM(1,n); SCM_VALIDATE_INUM (1,n);
return scm_difference (SCM_MAKINUM (-1L), n); return scm_difference (SCM_MAKINUM (-1L), n);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -743,7 +743,7 @@ Example:
else if (SCM_MAKINUM (-1L) == z1) else if (SCM_MAKINUM (-1L) == z1)
return SCM_BOOL_F == scm_even_p (z2) ? z1 : acc; return SCM_BOOL_F == scm_even_p (z2) ? z1 : acc;
#endif #endif
SCM_VALIDATE_INUM_COPY(2,z2,i2); SCM_VALIDATE_INUM_COPY (2,z2,i2);
if (i2 < 0) if (i2 < 0)
{ {
i2 = -i2; i2 = -i2;
@ -779,7 +779,7 @@ Example:
{ {
/* GJB:FIXME:: what is going on here? */ /* GJB:FIXME:: what is going on here? */
SCM res = SCM_INUM (n); SCM res = SCM_INUM (n);
SCM_VALIDATE_INUM(2,cnt); SCM_VALIDATE_INUM (2,cnt);
#ifdef SCM_BIGDIG #ifdef SCM_BIGDIG
if (cnt < 0) if (cnt < 0)
{ {
@ -793,7 +793,7 @@ Example:
else else
return scm_product (n, scm_integer_expt (SCM_MAKINUM (2), cnt)); return scm_product (n, scm_integer_expt (SCM_MAKINUM (2), cnt));
#else #else
SCM_VALIDATE_INUM(1,n) SCM_VALIDATE_INUM (1,n)
cnt = SCM_INUM (cnt); cnt = SCM_INUM (cnt);
if (cnt < 0) if (cnt < 0)
return SCM_MAKINUM (SCM_SRS (res, -cnt)); return SCM_MAKINUM (SCM_SRS (res, -cnt));
@ -821,9 +821,9 @@ Example:
@end lisp") @end lisp")
#define FUNC_NAME s_scm_bit_extract #define FUNC_NAME s_scm_bit_extract
{ {
SCM_VALIDATE_INUM(1,n); SCM_VALIDATE_INUM (1,n);
SCM_VALIDATE_INUM_MIN(2,start,0); SCM_VALIDATE_INUM_MIN (2,start,0);
SCM_VALIDATE_INUM_MIN(3,end,0); SCM_VALIDATE_INUM_MIN (3,end,0);
start = SCM_INUM (start); start = SCM_INUM (start);
end = SCM_INUM (end); end = SCM_INUM (end);
SCM_ASSERT (end >= start, SCM_MAKINUM (end), SCM_OUTOFRANGE, FUNC_NAME); SCM_ASSERT (end >= start, SCM_MAKINUM (end), SCM_OUTOFRANGE, FUNC_NAME);
@ -835,7 +835,7 @@ Example:
SCM_MAKINUM (1L)), SCM_MAKINUM (1L)),
scm_ash (n, SCM_MAKINUM (-start))); scm_ash (n, SCM_MAKINUM (-start)));
#else #else
SCM_VALIDATE_INUM(1,n); SCM_VALIDATE_INUM (1,n);
#endif #endif
return SCM_MAKINUM ((SCM_INUM (n) >> start) & ((1L << (end - start)) - 1)); return SCM_MAKINUM ((SCM_INUM (n) >> start) & ((1L << (end - start)) - 1));
} }
@ -870,7 +870,7 @@ Example:
{ {
scm_sizet i; scm_sizet i;
SCM_BIGDIG *ds, d; SCM_BIGDIG *ds, d;
SCM_VALIDATE_BIGINT(1,n); SCM_VALIDATE_BIGINT (1,n);
if (SCM_BIGSIGN (n)) if (SCM_BIGSIGN (n))
return scm_logcount (scm_difference (SCM_MAKINUM (-1L), n)); return scm_logcount (scm_difference (SCM_MAKINUM (-1L), n));
ds = SCM_BDIGITS (n); ds = SCM_BDIGITS (n);
@ -880,7 +880,7 @@ Example:
return SCM_MAKINUM (c); return SCM_MAKINUM (c);
} }
#else #else
SCM_VALIDATE_INUM(1,n); SCM_VALIDATE_INUM (1,n);
#endif #endif
if ((nn = SCM_INUM (n)) < 0) if ((nn = SCM_INUM (n)) < 0)
nn = -1 - nn; nn = -1 - nn;
@ -917,7 +917,7 @@ Example:
if (SCM_NINUMP (n)) if (SCM_NINUMP (n))
{ {
SCM_BIGDIG *ds, d; SCM_BIGDIG *ds, d;
SCM_VALIDATE_BIGINT(1,n); SCM_VALIDATE_BIGINT (1,n);
if (SCM_BIGSIGN (n)) if (SCM_BIGSIGN (n))
return scm_integer_length (scm_difference (SCM_MAKINUM (-1L), n)); return scm_integer_length (scm_difference (SCM_MAKINUM (-1L), n));
ds = SCM_BDIGITS (n); ds = SCM_BDIGITS (n);
@ -930,7 +930,7 @@ Example:
return SCM_MAKINUM (c - 4 + l); return SCM_MAKINUM (c - 4 + l);
} }
#else #else
SCM_VALIDATE_INUM(1,n); SCM_VALIDATE_INUM (1,n);
#endif #endif
if ((nn = SCM_INUM (n)) < 0) if ((nn = SCM_INUM (n)) < 0)
nn = -1 - nn; nn = -1 - nn;
@ -1862,7 +1862,7 @@ SCM_DEFINE (scm_number_to_string, "number->string", 1, 1, 0,
#define FUNC_NAME s_scm_number_to_string #define FUNC_NAME s_scm_number_to_string
{ {
int base; int base;
SCM_VALIDATE_INUM_MIN_DEF_COPY(2,radix,2,10,base); SCM_VALIDATE_INUM_MIN_DEF_COPY (2,radix,2,10,base);
#ifdef SCM_FLOATS #ifdef SCM_FLOATS
if (SCM_NINUMP (x)) if (SCM_NINUMP (x))
{ {
@ -2465,8 +2465,8 @@ SCM_DEFINE (scm_string_to_number, "string->number", 1, 1, 0,
{ {
SCM answer; SCM answer;
int base; int base;
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
SCM_VALIDATE_INUM_MIN_DEF_COPY(2,radix,2,10,base); SCM_VALIDATE_INUM_MIN_DEF_COPY (2,radix,2,10,base);
answer = scm_istring2number (SCM_ROCHARS (str), answer = scm_istring2number (SCM_ROCHARS (str),
SCM_ROLENGTH (str), SCM_ROLENGTH (str),
base); base);
@ -4440,7 +4440,7 @@ SCM_DEFINE (scm_inexact_to_exact, "inexact->exact", 1, 0, 0,
} }
#endif #endif
#else #else
SCM_VALIDATE_REAL(1,z); SCM_VALIDATE_REAL (1,z);
#endif #endif
#ifdef SCM_BIGDIG #ifdef SCM_BIGDIG
{ {

View file

@ -392,7 +392,7 @@ SCM_DEFINE (scm_set_object_procedure_x, "set-object-procedure!", 2, 0, 0,
obj, obj,
SCM_ARG1, SCM_ARG1,
FUNC_NAME); FUNC_NAME);
SCM_VALIDATE_PROC(2,proc); SCM_VALIDATE_PROC (2,proc);
if (SCM_I_ENTITYP (obj)) if (SCM_I_ENTITYP (obj))
SCM_ENTITY_PROCEDURE (obj) = proc; SCM_ENTITY_PROCEDURE (obj) = proc;
else else
@ -443,8 +443,8 @@ SCM_DEFINE (scm_make_class_object, "make-class-object", 2, 0, 0,
#define FUNC_NAME s_scm_make_class_object #define FUNC_NAME s_scm_make_class_object
{ {
unsigned long flags = 0; unsigned long flags = 0;
SCM_VALIDATE_STRUCT(1,metaclass); SCM_VALIDATE_STRUCT (1,metaclass);
SCM_VALIDATE_STRING(2,layout); SCM_VALIDATE_STRING (2,layout);
if (metaclass == scm_metaclass_operator) if (metaclass == scm_metaclass_operator)
flags = SCM_CLASSF_OPERATOR; flags = SCM_CLASSF_OPERATOR;
return scm_i_make_class_object (metaclass, layout, flags); return scm_i_make_class_object (metaclass, layout, flags);
@ -457,8 +457,8 @@ SCM_DEFINE (scm_make_subclass_object, "make-subclass-object", 2, 0, 0,
#define FUNC_NAME s_scm_make_subclass_object #define FUNC_NAME s_scm_make_subclass_object
{ {
SCM pl; SCM pl;
SCM_VALIDATE_STRUCT(1,class); SCM_VALIDATE_STRUCT (1,class);
SCM_VALIDATE_STRING(2,layout); SCM_VALIDATE_STRING (2,layout);
pl = SCM_STRUCT_DATA (class)[scm_vtable_index_layout]; pl = SCM_STRUCT_DATA (class)[scm_vtable_index_layout];
/* Convert symbol->string */ /* Convert symbol->string */
pl = scm_makfromstr (SCM_CHARS (pl), (scm_sizet) SCM_LENGTH (pl), 0); pl = scm_makfromstr (SCM_CHARS (pl), (scm_sizet) SCM_LENGTH (pl), 0);

View file

@ -56,7 +56,7 @@
/* {Object Properties} /* {Object Properties}
*/ */
SCM_DEFINE(scm_object_properties, "object-properties", 1, 0, 0, SCM_DEFINE (scm_object_properties, "object-properties", 1, 0, 0,
(SCM obj), (SCM obj),
"@deffnx primitive procedure-properties obj "@deffnx primitive procedure-properties obj
Return @var{obj}'s property list.") Return @var{obj}'s property list.")
@ -67,7 +67,7 @@ Return @var{obj}'s property list.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_set_object_properties_x, "set-object-properties!", 2, 0, 0, SCM_DEFINE (scm_set_object_properties_x, "set-object-properties!", 2, 0, 0,
(SCM obj, SCM plist), (SCM obj, SCM plist),
"@deffnx primitive set-procedure-properties! obj alist "@deffnx primitive set-procedure-properties! obj alist
Set @var{obj}'s property list to @var{alist}.") Set @var{obj}'s property list to @var{alist}.")
@ -79,7 +79,7 @@ Set @var{obj}'s property list to @var{alist}.")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_object_property, "object-property", 2, 0, 0, SCM_DEFINE (scm_object_property, "object-property", 2, 0, 0,
(SCM obj, SCM key), (SCM obj, SCM key),
"@deffnx primitive procedure-property obj key "@deffnx primitive procedure-property obj key
Return the property of @var{obj} with name @var{key}.") Return the property of @var{obj} with name @var{key}.")
@ -91,7 +91,7 @@ Return the property of @var{obj} with name @var{key}.")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_set_object_property_x, "set-object-property!", 3, 0, 0, SCM_DEFINE (scm_set_object_property_x, "set-object-property!", 3, 0, 0,
(SCM obj, SCM key, SCM val), (SCM obj, SCM key, SCM val),
"@deffnx primitive set-procedure-property! obj key value "@deffnx primitive set-procedure-property! obj key value
In @var{obj}'s property list, set the property named @var{key} to In @var{obj}'s property list, set the property named @var{key} to

View file

@ -54,7 +54,7 @@
/* {Pairs} /* {Pairs}
*/ */
SCM_DEFINE(scm_cons, "cons", 2, 0, 0, SCM_DEFINE (scm_cons, "cons", 2, 0, 0,
(SCM x, SCM y), (SCM x, SCM y),
"") "")
#define FUNC_NAME s_scm_cons #define FUNC_NAME s_scm_cons
@ -99,7 +99,7 @@ SCM_DEFINE (scm_set_car_x, "set-car!", 2, 0, 0,
"") "")
#define FUNC_NAME s_scm_set_car_x #define FUNC_NAME s_scm_set_car_x
{ {
SCM_VALIDATE_CONS(1,pair); SCM_VALIDATE_CONS (1,pair);
SCM_SETCAR (pair, value); SCM_SETCAR (pair, value);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
@ -110,7 +110,7 @@ SCM_DEFINE (scm_set_cdr_x, "set-cdr!", 2, 0, 0,
"") "")
#define FUNC_NAME s_scm_set_cdr_x #define FUNC_NAME s_scm_set_cdr_x
{ {
SCM_VALIDATE_CONS(1,pair); SCM_VALIDATE_CONS (1,pair);
SCM_SETCDR (pair, value); SCM_SETCDR (pair, value);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }

View file

@ -212,7 +212,7 @@ scm_set_port_input_waiting (long tc, int (*input_waiting) (SCM))
SCM_DEFINE(scm_char_ready_p, "char-ready?", 0, 1, 0, SCM_DEFINE (scm_char_ready_p, "char-ready?", 0, 1, 0,
(SCM port), (SCM port),
"") "")
#define FUNC_NAME s_scm_char_ready_p #define FUNC_NAME s_scm_char_ready_p
@ -222,7 +222,7 @@ SCM_DEFINE(scm_char_ready_p, "char-ready?", 0, 1, 0,
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_inp; port = scm_cur_inp;
else else
SCM_VALIDATE_OPINPORT(1,port); SCM_VALIDATE_OPINPORT (1,port);
pt = SCM_PTAB_ENTRY (port); pt = SCM_PTAB_ENTRY (port);
@ -257,7 +257,7 @@ and returns the contents as a single string.")
int count; int count;
char *dst; char *dst;
SCM_VALIDATE_OPINPORT(1,port); SCM_VALIDATE_OPINPORT (1,port);
count = pt->read_end - pt->read_pos; count = pt->read_end - pt->read_pos;
if (pt->read_buf == pt->putback_buf) if (pt->read_buf == pt->putback_buf)
@ -282,7 +282,7 @@ and returns the contents as a single string.")
/* Standard ports --- current input, output, error, and more(!). */ /* Standard ports --- current input, output, error, and more(!). */
SCM_DEFINE(scm_current_input_port, "current-input-port", 0, 0, 0, SCM_DEFINE (scm_current_input_port, "current-input-port", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_current_input_port #define FUNC_NAME s_scm_current_input_port
@ -291,7 +291,7 @@ SCM_DEFINE(scm_current_input_port, "current-input-port", 0, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_current_output_port, "current-output-port", 0, 0, 0, SCM_DEFINE (scm_current_output_port, "current-output-port", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_current_output_port #define FUNC_NAME s_scm_current_output_port
@ -300,7 +300,7 @@ SCM_DEFINE(scm_current_output_port, "current-output-port", 0, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_current_error_port, "current-error-port", 0, 0, 0, SCM_DEFINE (scm_current_error_port, "current-error-port", 0, 0, 0,
(), (),
"Return the port to which errors and warnings should be sent (the "Return the port to which errors and warnings should be sent (the
@dfn{standard error} in Unix and C terminology).") @dfn{standard error} in Unix and C terminology).")
@ -310,7 +310,7 @@ SCM_DEFINE(scm_current_error_port, "current-error-port", 0, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_current_load_port, "current-load-port", 0, 0, 0, SCM_DEFINE (scm_current_load_port, "current-load-port", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_current_load_port #define FUNC_NAME s_scm_current_load_port
@ -319,7 +319,7 @@ SCM_DEFINE(scm_current_load_port, "current-load-port", 0, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_set_current_input_port, "set-current-input-port", 1, 0, 0, SCM_DEFINE (scm_set_current_input_port, "set-current-input-port", 1, 0, 0,
(SCM port), (SCM port),
"@deffnx primitive set-current-output-port port "@deffnx primitive set-current-output-port port
@deffnx primitive set-current-error-port port @deffnx primitive set-current-error-port port
@ -329,35 +329,35 @@ so that they use the supplied @var{port} for input or output.")
#define FUNC_NAME s_scm_set_current_input_port #define FUNC_NAME s_scm_set_current_input_port
{ {
SCM oinp = scm_cur_inp; SCM oinp = scm_cur_inp;
SCM_VALIDATE_OPINPORT(1,port); SCM_VALIDATE_OPINPORT (1,port);
scm_cur_inp = port; scm_cur_inp = port;
return oinp; return oinp;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_set_current_output_port, "set-current-output-port", 1, 0, 0, SCM_DEFINE (scm_set_current_output_port, "set-current-output-port", 1, 0, 0,
(SCM port), (SCM port),
"") "")
#define FUNC_NAME s_scm_set_current_output_port #define FUNC_NAME s_scm_set_current_output_port
{ {
SCM ooutp = scm_cur_outp; SCM ooutp = scm_cur_outp;
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPOUTPORT(1,port); SCM_VALIDATE_OPOUTPORT (1,port);
scm_cur_outp = port; scm_cur_outp = port;
return ooutp; return ooutp;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_set_current_error_port, "set-current-error-port", 1, 0, 0, SCM_DEFINE (scm_set_current_error_port, "set-current-error-port", 1, 0, 0,
(SCM port), (SCM port),
"") "")
#define FUNC_NAME s_scm_set_current_error_port #define FUNC_NAME s_scm_set_current_error_port
{ {
SCM oerrp = scm_cur_errp; SCM oerrp = scm_cur_errp;
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPOUTPORT(1,port); SCM_VALIDATE_OPOUTPORT (1,port);
scm_cur_errp = port; scm_cur_errp = port;
return oerrp; return oerrp;
} }
@ -438,7 +438,7 @@ scm_remove_from_port_table (SCM port)
/* Undocumented functions for debugging. */ /* Undocumented functions for debugging. */
/* Return the number of ports in the table. */ /* Return the number of ports in the table. */
SCM_DEFINE(scm_pt_size, "pt-size", 0, 0, 0, SCM_DEFINE (scm_pt_size, "pt-size", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_pt_size #define FUNC_NAME s_scm_pt_size
@ -448,7 +448,7 @@ SCM_DEFINE(scm_pt_size, "pt-size", 0, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
/* Return the ith member of the port table. */ /* Return the ith member of the port table. */
SCM_DEFINE(scm_pt_member, "pt-member", 1, 0, 0, SCM_DEFINE (scm_pt_member, "pt-member", 1, 0, 0,
(SCM member), (SCM member),
"") "")
#define FUNC_NAME s_scm_pt_member #define FUNC_NAME s_scm_pt_member
@ -481,27 +481,27 @@ scm_revealed_count (SCM port)
/* Return the revealed count for a port. */ /* Return the revealed count for a port. */
SCM_DEFINE(scm_port_revealed, "port-revealed", 1, 0, 0, SCM_DEFINE (scm_port_revealed, "port-revealed", 1, 0, 0,
(SCM port), (SCM port),
"Returns the revealed count for @var{port}.") "Returns the revealed count for @var{port}.")
#define FUNC_NAME s_scm_port_revealed #define FUNC_NAME s_scm_port_revealed
{ {
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_PORT(1,port); SCM_VALIDATE_PORT (1,port);
return SCM_MAKINUM (scm_revealed_count (port)); return SCM_MAKINUM (scm_revealed_count (port));
} }
#undef FUNC_NAME #undef FUNC_NAME
/* Set the revealed count for a port. */ /* Set the revealed count for a port. */
SCM_DEFINE(scm_set_port_revealed_x, "set-port-revealed!", 2, 0, 0, SCM_DEFINE (scm_set_port_revealed_x, "set-port-revealed!", 2, 0, 0,
(SCM port, SCM rcount), (SCM port, SCM rcount),
"Sets the revealed count for a port to a given value. "Sets the revealed count for a port to a given value.
The return value is unspecified.") The return value is unspecified.")
#define FUNC_NAME s_scm_set_port_revealed_x #define FUNC_NAME s_scm_set_port_revealed_x
{ {
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_PORT(1,port); SCM_VALIDATE_PORT (1,port);
SCM_VALIDATE_INUM(2,rcount); SCM_VALIDATE_INUM (2,rcount);
SCM_REVEALED (port) = SCM_INUM (rcount); SCM_REVEALED (port) = SCM_INUM (rcount);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
@ -534,7 +534,7 @@ scm_mode_bits (char *modes)
* Some modes such as "append" are only used when opening * Some modes such as "append" are only used when opening
* a file and are not returned here. */ * a file and are not returned here. */
SCM_DEFINE(scm_port_mode, "port-mode", 1, 0, 0, SCM_DEFINE (scm_port_mode, "port-mode", 1, 0, 0,
(SCM port), (SCM port),
"Returns the port modes associated with the open port @var{port}. These "Returns the port modes associated with the open port @var{port}. These
will not necessarily be identical to the modes used when the port was will not necessarily be identical to the modes used when the port was
@ -546,7 +546,7 @@ port creation are not retained.")
modes[0] = '\0'; modes[0] = '\0';
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPPORT(1,port); SCM_VALIDATE_OPPORT (1,port);
if (SCM_CAR (port) & SCM_RDNG) { if (SCM_CAR (port) & SCM_RDNG) {
if (SCM_CAR (port) & SCM_WRTNG) if (SCM_CAR (port) & SCM_WRTNG)
strcpy (modes, "r+"); strcpy (modes, "r+");
@ -569,7 +569,7 @@ port creation are not retained.")
* Call the close operation on a port object. * Call the close operation on a port object.
* see also scm_close. * see also scm_close.
*/ */
SCM_DEFINE(scm_close_port, "close-port", 1, 0, 0, SCM_DEFINE (scm_close_port, "close-port", 1, 0, 0,
(SCM port), (SCM port),
"Close the specified port object. Returns @code{#t} if it successfully "Close the specified port object. Returns @code{#t} if it successfully
closes a port or @code{#f} if it was already closes a port or @code{#f} if it was already
@ -584,7 +584,7 @@ which can close file descriptors.")
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_PORT(1,port); SCM_VALIDATE_PORT (1,port);
if (SCM_CLOSEDP (port)) if (SCM_CLOSEDP (port))
return SCM_BOOL_F; return SCM_BOOL_F;
i = SCM_PTOBNUM (port); i = SCM_PTOBNUM (port);
@ -598,7 +598,7 @@ which can close file descriptors.")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_close_all_ports_except, "close-all-ports-except", 0, 0, 1, SCM_DEFINE (scm_close_all_ports_except, "close-all-ports-except", 0, 0, 1,
(SCM ports), (SCM ports),
"Close all open file ports used by the interpreter "Close all open file ports used by the interpreter
except for those supplied as arguments. This procedure except for those supplied as arguments. This procedure
@ -610,7 +610,7 @@ which are not needed in the new process.")
#define FUNC_NAME s_scm_close_all_ports_except #define FUNC_NAME s_scm_close_all_ports_except
{ {
int i = 0; int i = 0;
SCM_VALIDATE_CONS(1,ports); SCM_VALIDATE_CONS (1,ports);
while (i < scm_port_table_size) while (i < scm_port_table_size)
{ {
SCM thisport = scm_port_table[i]->port; SCM thisport = scm_port_table[i]->port;
@ -621,7 +621,7 @@ which are not needed in the new process.")
{ {
SCM port = SCM_COERCE_OUTPORT (SCM_CAR (ports_ptr)); SCM port = SCM_COERCE_OUTPORT (SCM_CAR (ports_ptr));
if (i == 0) if (i == 0)
SCM_VALIDATE_OPPORT(SCM_ARG1,port); SCM_VALIDATE_OPPORT (SCM_ARG1,port);
if (port == thisport) if (port == thisport)
found = 1; found = 1;
ports_ptr = SCM_CDR (ports_ptr); ports_ptr = SCM_CDR (ports_ptr);
@ -640,7 +640,7 @@ which are not needed in the new process.")
/* Utter miscellany. Gosh, we should clean this up some time. */ /* Utter miscellany. Gosh, we should clean this up some time. */
SCM_DEFINE(scm_input_port_p, "input-port?", 1, 0, 0, SCM_DEFINE (scm_input_port_p, "input-port?", 1, 0, 0,
(SCM x), (SCM x),
"") "")
#define FUNC_NAME s_scm_input_port_p #define FUNC_NAME s_scm_input_port_p
@ -651,7 +651,7 @@ SCM_DEFINE(scm_input_port_p, "input-port?", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_output_port_p, "output-port?", 1, 0, 0, SCM_DEFINE (scm_output_port_p, "output-port?", 1, 0, 0,
(SCM x), (SCM x),
"") "")
#define FUNC_NAME s_scm_output_port_p #define FUNC_NAME s_scm_output_port_p
@ -664,17 +664,17 @@ SCM_DEFINE(scm_output_port_p, "output-port?", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_port_closed_p, "port-closed?", 1, 0, 0, SCM_DEFINE (scm_port_closed_p, "port-closed?", 1, 0, 0,
(SCM port), (SCM port),
"Returns @code{#t} if @var{port} is closed or @code{#f} if it is open.") "Returns @code{#t} if @var{port} is closed or @code{#f} if it is open.")
#define FUNC_NAME s_scm_port_closed_p #define FUNC_NAME s_scm_port_closed_p
{ {
SCM_VALIDATE_OPPORT(1,port); SCM_VALIDATE_OPPORT (1,port);
return SCM_NEGATE_BOOL(SCM_OPPORTP (port)); return SCM_NEGATE_BOOL(SCM_OPPORTP (port));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_eof_object_p, "eof-object?", 1, 0, 0, SCM_DEFINE (scm_eof_object_p, "eof-object?", 1, 0, 0,
(SCM x), (SCM x),
"") "")
#define FUNC_NAME s_scm_eof_object_p #define FUNC_NAME s_scm_eof_object_p
@ -683,7 +683,7 @@ SCM_DEFINE(scm_eof_object_p, "eof-object?", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_force_output, "force-output", 0, 1, 0, SCM_DEFINE (scm_force_output, "force-output", 0, 1, 0,
(SCM port), (SCM port),
"Flush the specified output port, or the current output port if @var{port} "Flush the specified output port, or the current output port if @var{port}
is omitted. The current output buffer contents are passed to the is omitted. The current output buffer contents are passed to the
@ -699,7 +699,7 @@ The return value is unspecified.")
else else
{ {
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPOUTPORT(1,port); SCM_VALIDATE_OPOUTPORT (1,port);
} }
scm_flush (port); scm_flush (port);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
@ -723,7 +723,7 @@ all open output ports. The return value is unspecified.")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_read_char, "read-char", 0, 1, 0, SCM_DEFINE (scm_read_char, "read-char", 0, 1, 0,
(SCM port), (SCM port),
"") "")
#define FUNC_NAME s_scm_read_char #define FUNC_NAME s_scm_read_char
@ -731,7 +731,7 @@ SCM_DEFINE(scm_read_char, "read-char", 0, 1, 0,
int c; int c;
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_inp; port = scm_cur_inp;
SCM_VALIDATE_OPINPORT(1,port); SCM_VALIDATE_OPINPORT (1,port);
c = scm_getc (port); c = scm_getc (port);
if (EOF == c) if (EOF == c)
return SCM_EOF_VAL; return SCM_EOF_VAL;
@ -945,7 +945,7 @@ scm_ungets (char *s, int n, SCM port)
} }
SCM_DEFINE(scm_peek_char, "peek-char", 0, 1, 0, SCM_DEFINE (scm_peek_char, "peek-char", 0, 1, 0,
(SCM port), (SCM port),
"") "")
#define FUNC_NAME s_scm_peek_char #define FUNC_NAME s_scm_peek_char
@ -954,7 +954,7 @@ SCM_DEFINE(scm_peek_char, "peek-char", 0, 1, 0,
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_inp; port = scm_cur_inp;
else else
SCM_VALIDATE_OPINPORT(1,port); SCM_VALIDATE_OPINPORT (1,port);
c = scm_getc (port); c = scm_getc (port);
if (EOF == c) if (EOF == c)
return SCM_EOF_VAL; return SCM_EOF_VAL;
@ -973,11 +973,11 @@ not supplied, the current input port is used.")
{ {
int c; int c;
SCM_VALIDATE_CHAR(1,cobj); SCM_VALIDATE_CHAR (1,cobj);
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_inp; port = scm_cur_inp;
else else
SCM_VALIDATE_OPINPORT(2,port); SCM_VALIDATE_OPINPORT (2,port);
c = SCM_ICHR (cobj); c = SCM_ICHR (cobj);
@ -994,11 +994,11 @@ unread characters will be read again in last-in first-out order. If
@var{port} is not supplied, the current-input-port is used.") @var{port} is not supplied, the current-input-port is used.")
#define FUNC_NAME s_scm_unread_string #define FUNC_NAME s_scm_unread_string
{ {
SCM_VALIDATE_STRING(1,str); SCM_VALIDATE_STRING (1,str);
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_inp; port = scm_cur_inp;
else else
SCM_VALIDATE_OPINPORT(2,port); SCM_VALIDATE_OPINPORT (2,port);
scm_ungets (SCM_ROUCHARS (str), SCM_LENGTH (str), port); scm_ungets (SCM_ROUCHARS (str), SCM_LENGTH (str), port);
@ -1040,7 +1040,7 @@ the current position of a port can be obtained using:
object = SCM_COERCE_OUTPORT (object); object = SCM_COERCE_OUTPORT (object);
off = SCM_NUM2LONG (2,offset); off = SCM_NUM2LONG (2,offset);
SCM_VALIDATE_INUM_COPY(3,whence,how); SCM_VALIDATE_INUM_COPY (3,whence,how);
if (how != SEEK_SET && how != SEEK_CUR && how != SEEK_END) if (how != SEEK_SET && how != SEEK_CUR && how != SEEK_END)
SCM_OUT_OF_RANGE (3, whence); SCM_OUT_OF_RANGE (3, whence);
if (SCM_OPPORTP (object)) if (SCM_OPPORTP (object))
@ -1055,7 +1055,7 @@ the current position of a port can be obtained using:
} }
else /* file descriptor?. */ else /* file descriptor?. */
{ {
SCM_VALIDATE_INUM(1,object); SCM_VALIDATE_INUM (1,object);
rv = lseek (SCM_INUM (object), off, how); rv = lseek (SCM_INUM (object), off, how);
if (rv == -1) if (rv == -1)
SCM_SYSERROR; SCM_SYSERROR;
@ -1114,7 +1114,7 @@ The return value is unspecified.")
} }
else else
{ {
SCM_VALIDATE_ROSTRING(1,object); SCM_VALIDATE_ROSTRING (1,object);
SCM_COERCE_SUBSTR (object); SCM_COERCE_SUBSTR (object);
SCM_SYSCALL (rv = truncate (SCM_ROCHARS (object), c_length)); SCM_SYSCALL (rv = truncate (SCM_ROCHARS (object), c_length));
} }
@ -1130,7 +1130,7 @@ SCM_DEFINE (scm_port_line, "port-line", 1, 0, 0,
#define FUNC_NAME s_scm_port_line #define FUNC_NAME s_scm_port_line
{ {
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPENPORT(1,port); SCM_VALIDATE_OPENPORT (1,port);
return SCM_MAKINUM (SCM_LINUM (port)); return SCM_MAKINUM (SCM_LINUM (port));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -1141,8 +1141,8 @@ SCM_DEFINE (scm_set_port_line_x, "set-port-line!", 2, 0, 0,
#define FUNC_NAME s_scm_set_port_line_x #define FUNC_NAME s_scm_set_port_line_x
{ {
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPENPORT(1,port); SCM_VALIDATE_OPENPORT (1,port);
SCM_VALIDATE_INUM(2,line); SCM_VALIDATE_INUM (2,line);
return SCM_PTAB_ENTRY (port)->line_number = SCM_INUM (line); return SCM_PTAB_ENTRY (port)->line_number = SCM_INUM (line);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -1161,7 +1161,7 @@ what non-programmers will find most natural.)")
#define FUNC_NAME s_scm_port_column #define FUNC_NAME s_scm_port_column
{ {
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPENPORT(1,port); SCM_VALIDATE_OPENPORT (1,port);
return SCM_MAKINUM (SCM_COL (port)); return SCM_MAKINUM (SCM_COL (port));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -1174,8 +1174,8 @@ current input port if none is specified.")
#define FUNC_NAME s_scm_set_port_column_x #define FUNC_NAME s_scm_set_port_column_x
{ {
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPENPORT(1,port); SCM_VALIDATE_OPENPORT (1,port);
SCM_VALIDATE_INUM(2,column); SCM_VALIDATE_INUM (2,column);
return SCM_PTAB_ENTRY (port)->column_number = SCM_INUM (column); return SCM_PTAB_ENTRY (port)->column_number = SCM_INUM (column);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -1188,7 +1188,7 @@ when called on the current input, output and error ports respectively.")
#define FUNC_NAME s_scm_port_filename #define FUNC_NAME s_scm_port_filename
{ {
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPENPORT(1,port); SCM_VALIDATE_OPENPORT (1,port);
return SCM_PTAB_ENTRY (port)->file_name; return SCM_PTAB_ENTRY (port)->file_name;
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -1202,7 +1202,7 @@ source of data, but only the value that is returned by
#define FUNC_NAME s_scm_set_port_filename_x #define FUNC_NAME s_scm_set_port_filename_x
{ {
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPENPORT(1,port); SCM_VALIDATE_OPENPORT (1,port);
/* We allow the user to set the filename to whatever he likes. */ /* We allow the user to set the filename to whatever he likes. */
return SCM_PTAB_ENTRY (port)->file_name = filename; return SCM_PTAB_ENTRY (port)->file_name = filename;
} }
@ -1308,7 +1308,7 @@ the input/output modes for this port; for a description, see the
documentation for @code{open-file} in @ref{File Ports}.") documentation for @code{open-file} in @ref{File Ports}.")
#define FUNC_NAME s_scm_sys_make_void_port #define FUNC_NAME s_scm_sys_make_void_port
{ {
SCM_VALIDATE_ROSTRING(1,mode); SCM_VALIDATE_ROSTRING (1,mode);
SCM_COERCE_SUBSTR (mode); SCM_COERCE_SUBSTR (mode);
return scm_void_port (SCM_ROCHARS (mode)); return scm_void_port (SCM_ROCHARS (mode));
} }

View file

@ -256,7 +256,7 @@ or getpwent respectively.")
} }
else else
{ {
SCM_VALIDATE_ROSTRING(1,user); SCM_VALIDATE_ROSTRING (1,user);
if (SCM_SUBSTRP (user)) if (SCM_SUBSTRP (user))
user = scm_makfromstr (SCM_ROCHARS (user), SCM_ROLENGTH (user), 0); user = scm_makfromstr (SCM_ROCHARS (user), SCM_ROLENGTH (user), 0);
entry = getpwnam (SCM_ROCHARS (user)); entry = getpwnam (SCM_ROCHARS (user));
@ -326,7 +326,7 @@ or getgrent respectively.")
SCM_SYSCALL (entry = getgrgid (SCM_INUM (name))); SCM_SYSCALL (entry = getgrgid (SCM_INUM (name)));
else else
{ {
SCM_VALIDATE_ROSTRING(1,name); SCM_VALIDATE_ROSTRING (1,name);
SCM_COERCE_SUBSTR (name); SCM_COERCE_SUBSTR (name);
SCM_SYSCALL (entry = getgrnam (SCM_ROCHARS (name))); SCM_SYSCALL (entry = getgrnam (SCM_ROCHARS (name)));
} }
@ -391,8 +391,8 @@ Interrupt signal.
@end defvar") @end defvar")
#define FUNC_NAME s_scm_kill #define FUNC_NAME s_scm_kill
{ {
SCM_VALIDATE_INUM(1,pid); SCM_VALIDATE_INUM (1,pid);
SCM_VALIDATE_INUM(2,sig); SCM_VALIDATE_INUM (2,sig);
/* Signal values are interned in scm_init_posix(). */ /* Signal values are interned in scm_init_posix(). */
if (kill ((int) SCM_INUM (pid), (int) SCM_INUM (sig)) != 0) if (kill ((int) SCM_INUM (pid), (int) SCM_INUM (sig)) != 0)
SCM_SYSERROR; SCM_SYSERROR;
@ -449,12 +449,12 @@ The integer status value.
int i; int i;
int status; int status;
int ioptions; int ioptions;
SCM_VALIDATE_INUM(1,pid); SCM_VALIDATE_INUM (1,pid);
if (SCM_UNBNDP (options)) if (SCM_UNBNDP (options))
ioptions = 0; ioptions = 0;
else else
{ {
SCM_VALIDATE_INUM(2,options); SCM_VALIDATE_INUM (2,options);
/* Flags are interned in scm_init_posix. */ /* Flags are interned in scm_init_posix. */
ioptions = SCM_INUM (options); ioptions = SCM_INUM (options);
} }
@ -475,7 +475,7 @@ call to @code{exit} or @code{_exit}, if any, otherwise @code{#f}.")
{ {
int lstatus; int lstatus;
SCM_VALIDATE_INUM(1,status); SCM_VALIDATE_INUM (1,status);
/* On Ultrix, the WIF... macros assume their argument is an lvalue; /* On Ultrix, the WIF... macros assume their argument is an lvalue;
go figure. SCM_INUM does not yield an lvalue. */ go figure. SCM_INUM does not yield an lvalue. */
@ -495,7 +495,7 @@ process, if any, otherwise @code{#f}.")
{ {
int lstatus; int lstatus;
SCM_VALIDATE_INUM(1,status); SCM_VALIDATE_INUM (1,status);
lstatus = SCM_INUM (status); lstatus = SCM_INUM (status);
if (WIFSIGNALED (lstatus)) if (WIFSIGNALED (lstatus))
@ -513,7 +513,7 @@ process, if any, otherwise @code{#f}.")
{ {
int lstatus; int lstatus;
SCM_VALIDATE_INUM(1,status); SCM_VALIDATE_INUM (1,status);
lstatus = SCM_INUM (status); lstatus = SCM_INUM (status);
if (WIFSTOPPED (lstatus)) if (WIFSTOPPED (lstatus))
@ -598,7 +598,7 @@ the process has appropriate privileges.
The return value is unspecified.") The return value is unspecified.")
#define FUNC_NAME s_scm_setuid #define FUNC_NAME s_scm_setuid
{ {
SCM_VALIDATE_INUM(1,id); SCM_VALIDATE_INUM (1,id);
if (setuid (SCM_INUM (id)) != 0) if (setuid (SCM_INUM (id)) != 0)
SCM_SYSERROR; SCM_SYSERROR;
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
@ -612,7 +612,7 @@ the process has appropriate privileges.
The return value is unspecified.") The return value is unspecified.")
#define FUNC_NAME s_scm_setgid #define FUNC_NAME s_scm_setgid
{ {
SCM_VALIDATE_INUM(1,id); SCM_VALIDATE_INUM (1,id);
if (setgid (SCM_INUM (id)) != 0) if (setgid (SCM_INUM (id)) != 0)
SCM_SYSERROR; SCM_SYSERROR;
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
@ -630,7 +630,7 @@ The return value is unspecified.")
{ {
int rv; int rv;
SCM_VALIDATE_INUM(1,id); SCM_VALIDATE_INUM (1,id);
#ifdef HAVE_SETEUID #ifdef HAVE_SETEUID
rv = seteuid (SCM_INUM (id)); rv = seteuid (SCM_INUM (id));
#else #else
@ -654,7 +654,7 @@ The return value is unspecified.")
{ {
int rv; int rv;
SCM_VALIDATE_INUM(1,id); SCM_VALIDATE_INUM (1,id);
#ifdef HAVE_SETEUID #ifdef HAVE_SETEUID
rv = setegid (SCM_INUM (id)); rv = setegid (SCM_INUM (id));
#else #else
@ -690,8 +690,8 @@ The return value is unspecified.")
#define FUNC_NAME s_scm_setpgid #define FUNC_NAME s_scm_setpgid
{ {
#ifdef HAVE_SETPGID #ifdef HAVE_SETPGID
SCM_VALIDATE_INUM(1,pid); SCM_VALIDATE_INUM (1,pid);
SCM_VALIDATE_INUM(2,pgid); SCM_VALIDATE_INUM (2,pgid);
/* FIXME(?): may be known as setpgrp. */ /* FIXME(?): may be known as setpgrp. */
if (setpgid (SCM_INUM (pid), SCM_INUM (pgid)) != 0) if (setpgid (SCM_INUM (pid), SCM_INUM (pgid)) != 0)
SCM_SYSERROR; SCM_SYSERROR;
@ -735,7 +735,7 @@ SCM_DEFINE (scm_ttyname, "ttyname", 1, 0, 0,
int fd; int fd;
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPPORT(1,port); SCM_VALIDATE_OPPORT (1,port);
if (scm_tc16_fport != SCM_TYP16 (port)) if (scm_tc16_fport != SCM_TYP16 (port))
return SCM_BOOL_F; return SCM_BOOL_F;
fd = SCM_FPORT_FDES (port); fd = SCM_FPORT_FDES (port);
@ -787,7 +787,7 @@ foreground.")
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPFPORT(1,port); SCM_VALIDATE_OPFPORT (1,port);
fd = SCM_FPORT_FDES (port); fd = SCM_FPORT_FDES (port);
if ((pgid = tcgetpgrp (fd)) == -1) if ((pgid = tcgetpgrp (fd)) == -1)
SCM_SYSERROR; SCM_SYSERROR;
@ -814,8 +814,8 @@ controlling terminal. The return value is unspecified.")
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPFPORT(1,port); SCM_VALIDATE_OPFPORT (1,port);
SCM_VALIDATE_INUM(2,pgid); SCM_VALIDATE_INUM (2,pgid);
fd = SCM_FPORT_FDES (port); fd = SCM_FPORT_FDES (port);
if (tcsetpgrp (fd, SCM_INUM (pgid)) == -1) if (tcsetpgrp (fd, SCM_INUM (pgid)) == -1)
SCM_SYSERROR; SCM_SYSERROR;
@ -878,7 +878,7 @@ call, but we call it @code{execl} because of its Scheme calling interface.")
#define FUNC_NAME s_scm_execl #define FUNC_NAME s_scm_execl
{ {
char **execargv; char **execargv;
SCM_VALIDATE_ROSTRING(1,filename); SCM_VALIDATE_ROSTRING (1,filename);
SCM_COERCE_SUBSTR (filename); SCM_COERCE_SUBSTR (filename);
execargv = scm_convert_exec_args (args, SCM_ARG2, FUNC_NAME); execargv = scm_convert_exec_args (args, SCM_ARG2, FUNC_NAME);
execv (SCM_ROCHARS (filename), execargv); execv (SCM_ROCHARS (filename), execargv);
@ -900,7 +900,7 @@ call, but we call it @code{execlp} because of its Scheme calling interface.")
#define FUNC_NAME s_scm_execlp #define FUNC_NAME s_scm_execlp
{ {
char **execargv; char **execargv;
SCM_VALIDATE_ROSTRING(1,filename); SCM_VALIDATE_ROSTRING (1,filename);
SCM_COERCE_SUBSTR (filename); SCM_COERCE_SUBSTR (filename);
execargv = scm_convert_exec_args (args, SCM_ARG2, FUNC_NAME); execargv = scm_convert_exec_args (args, SCM_ARG2, FUNC_NAME);
execvp (SCM_ROCHARS (filename), execargv); execvp (SCM_ROCHARS (filename), execargv);
@ -957,7 +957,7 @@ call, but we call it @code{execle} because of its Scheme calling interface.")
char **execargv; char **execargv;
char **exec_env; char **exec_env;
SCM_VALIDATE_ROSTRING(1,filename); SCM_VALIDATE_ROSTRING (1,filename);
SCM_COERCE_SUBSTR (filename); SCM_COERCE_SUBSTR (filename);
execargv = scm_convert_exec_args (args, SCM_ARG1, FUNC_NAME); execargv = scm_convert_exec_args (args, SCM_ARG1, FUNC_NAME);
@ -1094,7 +1094,7 @@ time to the current time.")
int rv; int rv;
struct utimbuf utm_tmp; struct utimbuf utm_tmp;
SCM_VALIDATE_ROSTRING(1,pathname); SCM_VALIDATE_ROSTRING (1,pathname);
SCM_COERCE_SUBSTR (pathname); SCM_COERCE_SUBSTR (pathname);
if (SCM_UNBNDP (actime)) if (SCM_UNBNDP (actime))
SCM_SYSCALL (time (&utm_tmp.actime)); SCM_SYSCALL (time (&utm_tmp.actime));
@ -1144,10 +1144,10 @@ test for existence of the file.
{ {
int rv; int rv;
SCM_VALIDATE_ROSTRING(1,path); SCM_VALIDATE_ROSTRING (1,path);
if (SCM_SUBSTRP (path)) if (SCM_SUBSTRP (path))
path = scm_makfromstr (SCM_ROCHARS (path), SCM_ROLENGTH (path), 0); path = scm_makfromstr (SCM_ROCHARS (path), SCM_ROLENGTH (path), 0);
SCM_VALIDATE_INUM(2,how); SCM_VALIDATE_INUM (2,how);
rv = access (SCM_ROCHARS (path), SCM_INUM (how)); rv = access (SCM_ROCHARS (path), SCM_INUM (how));
return SCM_NEGATE_BOOL(rv); return SCM_NEGATE_BOOL(rv);
} }
@ -1180,7 +1180,7 @@ The return value is unspecified.")
int rv; int rv;
char *ptr; char *ptr;
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
/* must make a new copy to be left in the environment, safe from gc. */ /* must make a new copy to be left in the environment, safe from gc. */
ptr = malloc (SCM_LENGTH (str) + 1); ptr = malloc (SCM_LENGTH (str) + 1);
if (ptr == NULL) if (ptr == NULL)
@ -1212,14 +1212,14 @@ is an empty string, the locale will be set using envirionment variables.")
char *clocale; char *clocale;
char *rv; char *rv;
SCM_VALIDATE_INUM(1,category); SCM_VALIDATE_INUM (1,category);
if (SCM_UNBNDP (locale)) if (SCM_UNBNDP (locale))
{ {
clocale = NULL; clocale = NULL;
} }
else else
{ {
SCM_VALIDATE_ROSTRING(2,locale); SCM_VALIDATE_ROSTRING (2,locale);
SCM_COERCE_SUBSTR (locale); SCM_COERCE_SUBSTR (locale);
clocale = SCM_ROCHARS (locale); clocale = SCM_ROCHARS (locale);
} }
@ -1260,10 +1260,10 @@ The return value is unspecified.")
char *p; char *p;
int ctype = 0; int ctype = 0;
SCM_VALIDATE_ROSTRING(1,path); SCM_VALIDATE_ROSTRING (1,path);
SCM_VALIDATE_SYMBOL(2,type); SCM_VALIDATE_SYMBOL (2,type);
SCM_VALIDATE_INUM(3,perms); SCM_VALIDATE_INUM (3,perms);
SCM_VALIDATE_INUM(4,dev); SCM_VALIDATE_INUM (4,dev);
SCM_COERCE_SUBSTR (path); SCM_COERCE_SUBSTR (path);
p = SCM_CHARS (type); p = SCM_CHARS (type);
@ -1306,7 +1306,7 @@ The return value is unspecified.")
#define FUNC_NAME s_scm_nice #define FUNC_NAME s_scm_nice
{ {
#ifdef HAVE_NICE #ifdef HAVE_NICE
SCM_VALIDATE_INUM(1,incr); SCM_VALIDATE_INUM (1,incr);
if (nice(SCM_INUM(incr)) != 0) if (nice(SCM_INUM(incr)) != 0)
SCM_SYSERROR; SCM_SYSERROR;
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;

View file

@ -184,7 +184,7 @@ static SCM print_state_pool;
#ifdef GUILE_DEBUG /* Used for debugging purposes */ #ifdef GUILE_DEBUG /* Used for debugging purposes */
SCM_DEFINE(scm_current_pstate, "current-pstate", 0, 0, 0, SCM_DEFINE (scm_current_pstate, "current-pstate", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_current_pstate #define FUNC_NAME s_scm_current_pstate
@ -934,7 +934,7 @@ scm_display (SCM obj, SCM port)
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
SCM_DEFINE(scm_newline, "newline", 0, 1, 0, SCM_DEFINE (scm_newline, "newline", 0, 1, 0,
(SCM port), (SCM port),
"") "")
#define FUNC_NAME s_scm_newline #define FUNC_NAME s_scm_newline
@ -942,14 +942,14 @@ SCM_DEFINE(scm_newline, "newline", 0, 1, 0,
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_outp; port = scm_cur_outp;
SCM_VALIDATE_OPORT_VALUE(1,port); SCM_VALIDATE_OPORT_VALUE (1,port);
scm_putc ('\n', SCM_COERCE_OUTPORT (port)); scm_putc ('\n', SCM_COERCE_OUTPORT (port));
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_write_char, "write-char", 1, 1, 0, SCM_DEFINE (scm_write_char, "write-char", 1, 1, 0,
(SCM chr, SCM port), (SCM chr, SCM port),
"") "")
#define FUNC_NAME s_scm_write_char #define FUNC_NAME s_scm_write_char
@ -957,8 +957,8 @@ SCM_DEFINE(scm_write_char, "write-char", 1, 1, 0,
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_outp; port = scm_cur_outp;
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
SCM_VALIDATE_OPORT_VALUE(2,port); SCM_VALIDATE_OPORT_VALUE (2,port);
scm_putc ((int) SCM_ICHR (chr), SCM_COERCE_OUTPORT (port)); scm_putc ((int) SCM_ICHR (chr), SCM_COERCE_OUTPORT (port));
#ifdef HAVE_PIPE #ifdef HAVE_PIPE
@ -1008,8 +1008,8 @@ SCM_DEFINE (scm_port_with_print_state, "port-with-print-state", 2, 0, 0,
#define FUNC_NAME s_scm_port_with_print_state #define FUNC_NAME s_scm_port_with_print_state
{ {
SCM pwps; SCM pwps;
SCM_VALIDATE_OPORT_VALUE(1,port); SCM_VALIDATE_OPORT_VALUE (1,port);
SCM_VALIDATE_PRINTSTATE(2,pstate); SCM_VALIDATE_PRINTSTATE (2,pstate);
port = SCM_COERCE_OUTPORT (port); port = SCM_COERCE_OUTPORT (port);
SCM_NEWSMOB (pwps, scm_tc16_port_with_ps, scm_cons (port, pstate)); SCM_NEWSMOB (pwps, scm_tc16_port_with_ps, scm_cons (port, pstate));
return pwps; return pwps;

View file

@ -162,12 +162,12 @@ scm_stand_in_scm_proc(SCM proc)
return answer; return answer;
} }
SCM_DEFINE(scm_procedure_properties, "procedure-properties", 1, 0, 0, SCM_DEFINE (scm_procedure_properties, "procedure-properties", 1, 0, 0,
(SCM proc), (SCM proc),
"Return @var{obj}'s property list.") "Return @var{obj}'s property list.")
#define FUNC_NAME s_scm_procedure_properties #define FUNC_NAME s_scm_procedure_properties
{ {
SCM_VALIDATE_PROC(1,proc); SCM_VALIDATE_PROC (1,proc);
return scm_acons (scm_sym_arity, scm_i_procedure_arity (proc), return scm_acons (scm_sym_arity, scm_i_procedure_arity (proc),
SCM_PROCPROPS (SCM_CLOSUREP (proc) SCM_PROCPROPS (SCM_CLOSUREP (proc)
? proc ? proc
@ -175,20 +175,20 @@ SCM_DEFINE(scm_procedure_properties, "procedure-properties", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_set_procedure_properties_x, "set-procedure-properties!", 2, 0, 0, SCM_DEFINE (scm_set_procedure_properties_x, "set-procedure-properties!", 2, 0, 0,
(SCM proc, SCM new_val), (SCM proc, SCM new_val),
"Set @var{obj}'s property list to @var{alist}.") "Set @var{obj}'s property list to @var{alist}.")
#define FUNC_NAME s_scm_set_procedure_properties_x #define FUNC_NAME s_scm_set_procedure_properties_x
{ {
if (!SCM_CLOSUREP (proc)) if (!SCM_CLOSUREP (proc))
proc = scm_stand_in_scm_proc(proc); proc = scm_stand_in_scm_proc(proc);
SCM_VALIDATE_CLOSURE(1,proc); SCM_VALIDATE_CLOSURE (1,proc);
SCM_SETPROCPROPS (proc, new_val); SCM_SETPROCPROPS (proc, new_val);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_procedure_property, "procedure-property", 2, 0, 0, SCM_DEFINE (scm_procedure_property, "procedure-property", 2, 0, 0,
(SCM p, SCM k), (SCM p, SCM k),
"Return the property of @var{obj} with name @var{key}.") "Return the property of @var{obj} with name @var{key}.")
#define FUNC_NAME s_scm_procedure_property #define FUNC_NAME s_scm_procedure_property
@ -201,7 +201,7 @@ SCM_DEFINE(scm_procedure_property, "procedure-property", 2, 0, 0,
p, SCM_ARG1, FUNC_NAME); p, SCM_ARG1, FUNC_NAME);
return arity; return arity;
} }
SCM_VALIDATE_PROC(1,p); SCM_VALIDATE_PROC (1,p);
assoc = scm_sloppy_assq (k, assoc = scm_sloppy_assq (k,
SCM_PROCPROPS (SCM_CLOSUREP (p) SCM_PROCPROPS (SCM_CLOSUREP (p)
? p ? p
@ -210,7 +210,7 @@ SCM_DEFINE(scm_procedure_property, "procedure-property", 2, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_set_procedure_property_x, "set-procedure-property!", 3, 0, 0, SCM_DEFINE (scm_set_procedure_property_x, "set-procedure-property!", 3, 0, 0,
(SCM p, SCM k, SCM v), (SCM p, SCM k, SCM v),
"In @var{obj}'s property list, set the property named @var{key} to "In @var{obj}'s property list, set the property named @var{key} to
@var{value}.") @var{value}.")
@ -219,7 +219,7 @@ SCM_DEFINE(scm_set_procedure_property_x, "set-procedure-property!", 3, 0, 0,
SCM assoc; SCM assoc;
if (!SCM_CLOSUREP (p)) if (!SCM_CLOSUREP (p))
p = scm_stand_in_scm_proc(p); p = scm_stand_in_scm_proc(p);
SCM_VALIDATE_CLOSURE(1,p); SCM_VALIDATE_CLOSURE (1,p);
if (k == scm_sym_arity) if (k == scm_sym_arity)
SCM_MISC_ERROR ("arity is a read-only property", SCM_EOL); SCM_MISC_ERROR ("arity is a read-only property", SCM_EOL);
assoc = scm_sloppy_assq (k, SCM_PROCPROPS (p)); assoc = scm_sloppy_assq (k, SCM_PROCPROPS (p));

View file

@ -177,7 +177,7 @@ SCM_DEFINE (scm_make_cclo, "make-cclo", 2, 0, 0,
SCM_DEFINE(scm_procedure_p, "procedure?", 1, 0, 0, SCM_DEFINE (scm_procedure_p, "procedure?", 1, 0, 0,
(SCM obj), (SCM obj),
"") "")
#define FUNC_NAME s_scm_procedure_p #define FUNC_NAME s_scm_procedure_p
@ -203,7 +203,7 @@ SCM_DEFINE(scm_procedure_p, "procedure?", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_closure_p, "closure?", 1, 0, 0, SCM_DEFINE (scm_closure_p, "closure?", 1, 0, 0,
(SCM obj), (SCM obj),
"") "")
#define FUNC_NAME s_scm_closure_p #define FUNC_NAME s_scm_closure_p
@ -212,7 +212,7 @@ SCM_DEFINE(scm_closure_p, "closure?", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_thunk_p, "thunk?", 1, 0, 0, SCM_DEFINE (scm_thunk_p, "thunk?", 1, 0, 0,
(SCM obj), (SCM obj),
"") "")
#define FUNC_NAME s_scm_thunk_p #define FUNC_NAME s_scm_thunk_p
@ -260,7 +260,7 @@ scm_subr_p (SCM obj)
return 0; return 0;
} }
SCM_DEFINE(scm_procedure_documentation, "procedure-documentation", 1, 0, 0, SCM_DEFINE (scm_procedure_documentation, "procedure-documentation", 1, 0, 0,
(SCM proc), (SCM proc),
"Return the documentation string associated with @code{proc}. By "Return the documentation string associated with @code{proc}. By
convention, if a procedure contains more than one expression and the convention, if a procedure contains more than one expression and the
@ -313,8 +313,8 @@ SCM_DEFINE (scm_make_procedure_with_setter, "make-procedure-with-setter", 2, 0,
#define FUNC_NAME s_scm_make_procedure_with_setter #define FUNC_NAME s_scm_make_procedure_with_setter
{ {
SCM z; SCM z;
SCM_VALIDATE_PROC(1,procedure); SCM_VALIDATE_PROC (1,procedure);
SCM_VALIDATE_PROC(2,setter); SCM_VALIDATE_PROC (2,setter);
SCM_NEWCELL (z); SCM_NEWCELL (z);
SCM_ENTER_A_SECTION; SCM_ENTER_A_SECTION;
SCM_SETCDR (z, scm_cons (procedure, setter)); SCM_SETCDR (z, scm_cons (procedure, setter));

View file

@ -404,7 +404,7 @@ scm_ramapc (int (*cproc)(), SCM data, SCM ra0, SCM lra, const char *what)
} }
SCM_DEFINE(scm_array_fill_x, "array-fill!", 2, 0, 0, SCM_DEFINE (scm_array_fill_x, "array-fill!", 2, 0, 0,
(SCM ra, SCM fill), (SCM ra, SCM fill),
"Stores @var{fill} in every element of @var{array}. The value returned "Stores @var{fill} in every element of @var{array}. The value returned
is unspecified.") is unspecified.")
@ -775,7 +775,7 @@ SCM_REGISTER_PROC(s_serial_array_copy_x, "serial-array-copy!", 2, 0, 0, scm_arra
SCM_REGISTER_PROC(s_array_copy_in_order_x, "array-copy-in-order!", 2, 0, 0, scm_array_copy_x); SCM_REGISTER_PROC(s_array_copy_in_order_x, "array-copy-in-order!", 2, 0, 0, scm_array_copy_x);
SCM_DEFINE(scm_array_copy_x, "array-copy!", 2, 0, 0, SCM_DEFINE (scm_array_copy_x, "array-copy!", 2, 0, 0,
(SCM src, SCM dst), (SCM src, SCM dst),
"Copies every element from vector or array @var{source} to the "Copies every element from vector or array @var{source} to the
corresponding element of @var{destination}. @var{destination} must have corresponding element of @var{destination}. @var{destination} must have
@ -1595,7 +1595,7 @@ SCM_REGISTER_PROC(s_serial_array_map_x, "serial-array-map!", 2, 0, 1, scm_array_
SCM_REGISTER_PROC(s_array_map_in_order_x, "array-map-in-order!", 2, 0, 1, scm_array_map_x); SCM_REGISTER_PROC(s_array_map_in_order_x, "array-map-in-order!", 2, 0, 1, scm_array_map_x);
SCM_DEFINE(scm_array_map_x, "array-map!", 2, 0, 1, SCM_DEFINE (scm_array_map_x, "array-map!", 2, 0, 1,
(SCM ra0, SCM proc, SCM lra), (SCM ra0, SCM proc, SCM lra),
"@var{array1}, @dots{} must have the same number of dimensions as "@var{array1}, @dots{} must have the same number of dimensions as
@var{array0} and have a range for each index which includes the range @var{array0} and have a range for each index which includes the range
@ -1605,7 +1605,7 @@ as the corresponding element in @var{array0}. The value returned is
unspecified. The order of application is unspecified.") unspecified. The order of application is unspecified.")
#define FUNC_NAME s_scm_array_map_x #define FUNC_NAME s_scm_array_map_x
{ {
SCM_VALIDATE_PROC(2,proc); SCM_VALIDATE_PROC (2,proc);
switch (SCM_TYP7 (proc)) switch (SCM_TYP7 (proc))
{ {
default: default:
@ -1742,19 +1742,19 @@ rafe (SCM ra0,SCM proc,SCM ras)
} }
SCM_DEFINE(scm_array_for_each, "array-for-each", 2, 0, 1, SCM_DEFINE (scm_array_for_each, "array-for-each", 2, 0, 1,
(SCM proc, SCM ra0, SCM lra), (SCM proc, SCM ra0, SCM lra),
"@var{proc} is applied to each tuple of elements of @var{array0} @dots{} "@var{proc} is applied to each tuple of elements of @var{array0} @dots{}
in row-major order. The value returned is unspecified.") in row-major order. The value returned is unspecified.")
#define FUNC_NAME s_scm_array_for_each #define FUNC_NAME s_scm_array_for_each
{ {
SCM_VALIDATE_PROC(1,proc); SCM_VALIDATE_PROC (1,proc);
SCM_RAMAPC (rafe, proc, ra0, lra); SCM_RAMAPC (rafe, proc, ra0, lra);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_array_index_map_x, "array-index-map!", 2, 0, 0, SCM_DEFINE (scm_array_index_map_x, "array-index-map!", 2, 0, 0,
(SCM ra, SCM proc), (SCM ra, SCM proc),
"applies @var{proc} to the indices of each element of @var{array} in "applies @var{proc} to the indices of each element of @var{array} in
turn, storing the result in the corresponding element. The value turn, storing the result in the corresponding element. The value
@ -1778,7 +1778,7 @@ Another example:
{ {
scm_sizet i; scm_sizet i;
SCM_VALIDATE_NIM (1,ra); SCM_VALIDATE_NIM (1,ra);
SCM_VALIDATE_PROC(2,proc); SCM_VALIDATE_PROC (2,proc);
switch (SCM_TYP7(ra)) switch (SCM_TYP7(ra))
{ {
default: default:

View file

@ -357,7 +357,7 @@ SCM_DEFINE (scm_random, "random", 1, 1, 0,
{ {
if (SCM_UNBNDP (state)) if (SCM_UNBNDP (state))
state = SCM_CDR (scm_var_random_state); state = SCM_CDR (scm_var_random_state);
SCM_VALIDATE_RSTATE(2,state); SCM_VALIDATE_RSTATE (2,state);
if (SCM_INUMP (n)) if (SCM_INUMP (n))
{ {
unsigned long m = SCM_INUM (n); unsigned long m = SCM_INUM (n);
@ -380,7 +380,7 @@ SCM_DEFINE (scm_copy_random_state, "copy-random-state", 0, 1, 0,
{ {
if (SCM_UNBNDP (state)) if (SCM_UNBNDP (state))
state = SCM_CDR (scm_var_random_state); state = SCM_CDR (scm_var_random_state);
SCM_VALIDATE_RSTATE(1,state); SCM_VALIDATE_RSTATE (1,state);
return make_rstate (scm_the_rng.copy_rstate (SCM_RSTATE (state))); return make_rstate (scm_the_rng.copy_rstate (SCM_RSTATE (state)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -392,7 +392,7 @@ SCM_DEFINE (scm_seed_to_random_state, "seed->random-state", 1, 0, 0,
{ {
if (SCM_NUMBERP (seed)) if (SCM_NUMBERP (seed))
seed = scm_number_to_string (seed, SCM_UNDEFINED); seed = scm_number_to_string (seed, SCM_UNDEFINED);
SCM_VALIDATE_STRING(1,seed); SCM_VALIDATE_STRING (1,seed);
return make_rstate (scm_c_make_rstate (SCM_ROCHARS (seed), return make_rstate (scm_c_make_rstate (SCM_ROCHARS (seed),
SCM_LENGTH (seed))); SCM_LENGTH (seed)));
} }
@ -405,7 +405,7 @@ SCM_DEFINE (scm_random_uniform, "random:uniform", 0, 1, 0,
{ {
if (SCM_UNBNDP (state)) if (SCM_UNBNDP (state))
state = SCM_CDR (scm_var_random_state); state = SCM_CDR (scm_var_random_state);
SCM_VALIDATE_RSTATE(1,state); SCM_VALIDATE_RSTATE (1,state);
return scm_makdbl (scm_c_uniform01 (SCM_RSTATE (state)), 0.0); return scm_makdbl (scm_c_uniform01 (SCM_RSTATE (state)), 0.0);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -417,7 +417,7 @@ SCM_DEFINE (scm_random_normal, "random:normal", 0, 1, 0,
{ {
if (SCM_UNBNDP (state)) if (SCM_UNBNDP (state))
state = SCM_CDR (scm_var_random_state); state = SCM_CDR (scm_var_random_state);
SCM_VALIDATE_RSTATE(1,state); SCM_VALIDATE_RSTATE (1,state);
return scm_makdbl (scm_c_normal01 (SCM_RSTATE (state)), 0.0); return scm_makdbl (scm_c_normal01 (SCM_RSTATE (state)), 0.0);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -466,10 +466,10 @@ SCM_DEFINE (scm_random_solid_sphere_x, "random:solid-sphere!", 1, 1, 0,
"") "")
#define FUNC_NAME s_scm_random_solid_sphere_x #define FUNC_NAME s_scm_random_solid_sphere_x
{ {
SCM_VALIDATE_VECTOR_OR_DVECTOR(1,v); SCM_VALIDATE_VECTOR_OR_DVECTOR (1,v);
if (SCM_UNBNDP (state)) if (SCM_UNBNDP (state))
state = SCM_CDR (scm_var_random_state); state = SCM_CDR (scm_var_random_state);
SCM_VALIDATE_RSTATE(2,state); SCM_VALIDATE_RSTATE (2,state);
scm_random_normal_vector_x (v, state); scm_random_normal_vector_x (v, state);
vector_scale (v, vector_scale (v,
pow (scm_c_uniform01 (SCM_RSTATE (state)), pow (scm_c_uniform01 (SCM_RSTATE (state)),
@ -484,10 +484,10 @@ SCM_DEFINE (scm_random_hollow_sphere_x, "random:hollow-sphere!", 1, 1, 0,
"") "")
#define FUNC_NAME s_scm_random_hollow_sphere_x #define FUNC_NAME s_scm_random_hollow_sphere_x
{ {
SCM_VALIDATE_VECTOR_OR_DVECTOR(1,v); SCM_VALIDATE_VECTOR_OR_DVECTOR (1,v);
if (SCM_UNBNDP (state)) if (SCM_UNBNDP (state))
state = SCM_CDR (scm_var_random_state); state = SCM_CDR (scm_var_random_state);
SCM_VALIDATE_RSTATE(2,state); SCM_VALIDATE_RSTATE (2,state);
scm_random_normal_vector_x (v, state); scm_random_normal_vector_x (v, state);
vector_scale (v, 1 / sqrt (vector_sum_squares (v))); vector_scale (v, 1 / sqrt (vector_sum_squares (v)));
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
@ -501,10 +501,10 @@ SCM_DEFINE (scm_random_normal_vector_x, "random:normal-vector!", 1, 1, 0,
#define FUNC_NAME s_scm_random_normal_vector_x #define FUNC_NAME s_scm_random_normal_vector_x
{ {
int n; int n;
SCM_VALIDATE_VECTOR_OR_DVECTOR(1,v); SCM_VALIDATE_VECTOR_OR_DVECTOR (1,v);
if (SCM_UNBNDP (state)) if (SCM_UNBNDP (state))
state = SCM_CDR (scm_var_random_state); state = SCM_CDR (scm_var_random_state);
SCM_VALIDATE_RSTATE(2,state); SCM_VALIDATE_RSTATE (2,state);
n = SCM_LENGTH (v); n = SCM_LENGTH (v);
if (SCM_VECTORP (v)) if (SCM_VECTORP (v))
while (--n >= 0) while (--n >= 0)
@ -525,7 +525,7 @@ SCM_DEFINE (scm_random_exp, "random:exp", 0, 1, 0,
{ {
if (SCM_UNBNDP (state)) if (SCM_UNBNDP (state))
state = SCM_CDR (scm_var_random_state); state = SCM_CDR (scm_var_random_state);
SCM_VALIDATE_RSTATE(1,state); SCM_VALIDATE_RSTATE (1,state);
return scm_makdbl (scm_c_exp1 (SCM_RSTATE (state)), 0.0); return scm_makdbl (scm_c_exp1 (SCM_RSTATE (state)), 0.0);
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -102,7 +102,7 @@ SCM_DEFINE (scm_read, "read", 0, 1, 0,
if (SCM_UNBNDP (port)) if (SCM_UNBNDP (port))
port = scm_cur_inp; port = scm_cur_inp;
SCM_VALIDATE_OPINPORT(1,port); SCM_VALIDATE_OPINPORT (1,port);
c = scm_flush_ws (port, (char *) NULL); c = scm_flush_ws (port, (char *) NULL);
if (EOF == c) if (EOF == c)
@ -709,7 +709,7 @@ SCM_DEFINE (scm_read_hash_extend, "read-hash-extend", 2, 0, 0,
SCM this; SCM this;
SCM prev; SCM prev;
SCM_VALIDATE_CHAR(1,chr); SCM_VALIDATE_CHAR (1,chr);
SCM_ASSERT (SCM_FALSEP (proc) || SCM_NIMP(proc), proc, SCM_ARG2, SCM_ASSERT (SCM_FALSEP (proc) || SCM_NIMP(proc), proc, SCM_ARG2,
FUNC_NAME); FUNC_NAME);

View file

@ -189,7 +189,7 @@ the earlier one.
regex_t *rx; regex_t *rx;
int status, cflags; int status, cflags;
SCM_VALIDATE_ROSTRING(1,pat); SCM_VALIDATE_ROSTRING (1,pat);
SCM_COERCE_SUBSTR (pat); SCM_COERCE_SUBSTR (pat);
/* Examine list of regexp flags. If REG_BASIC is supplied, then /* Examine list of regexp flags. If REG_BASIC is supplied, then
@ -235,13 +235,13 @@ the results of the match, or @code{#f} if no match could be found.")
regmatch_t *matches; regmatch_t *matches;
SCM mvec = SCM_BOOL_F; SCM mvec = SCM_BOOL_F;
SCM_VALIDATE_RGXP(1,rx); SCM_VALIDATE_RGXP (1,rx);
SCM_VALIDATE_ROSTRING(2,str); SCM_VALIDATE_ROSTRING (2,str);
SCM_VALIDATE_INUM_DEF_COPY(3,start,0,offset); SCM_VALIDATE_INUM_DEF_COPY (3,start,0,offset);
SCM_ASSERT_RANGE (3,start,offset >= 0 && (unsigned) offset <= SCM_LENGTH (str)); SCM_ASSERT_RANGE (3,start,offset >= 0 && (unsigned) offset <= SCM_LENGTH (str));
if (SCM_UNBNDP (flags)) if (SCM_UNBNDP (flags))
flags = SCM_INUM0; flags = SCM_INUM0;
SCM_VALIDATE_INUM(4,flags); SCM_VALIDATE_INUM (4,flags);
SCM_COERCE_SUBSTR (str); SCM_COERCE_SUBSTR (str);
/* re_nsub doesn't account for the `subexpression' representing the /* re_nsub doesn't account for the `subexpression' representing the

View file

@ -335,7 +335,7 @@ cwdr (SCM proc, SCM a1, SCM args, SCM handler, SCM_STACKITEM *stack_start)
stack_start); stack_start);
} }
SCM_DEFINE(scm_call_with_dynamic_root, "call-with-dynamic-root", 2, 0, 0, SCM_DEFINE (scm_call_with_dynamic_root, "call-with-dynamic-root", 2, 0, 0,
(SCM thunk, SCM handler), (SCM thunk, SCM handler),
"Evaluate @var{(thunk)} in a new dynamic context, returning its value. "Evaluate @var{(thunk)} in a new dynamic context, returning its value.
@ -386,7 +386,7 @@ be under a new dynamic root.)")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_dynamic_root, "dynamic-root", 0, 0, 0, SCM_DEFINE (scm_dynamic_root, "dynamic-root", 0, 0, 0,
(), (),
"Return an object representing the current dynamic root. "Return an object representing the current dynamic root.

View file

@ -179,7 +179,7 @@ sys_deliver_signals (void)
} }
/* user interface for installation of signal handlers. */ /* user interface for installation of signal handlers. */
SCM_DEFINE(scm_sigaction, "sigaction", 1, 2, 0, SCM_DEFINE (scm_sigaction, "sigaction", 1, 2, 0,
(SCM signum, SCM handler, SCM flags), (SCM signum, SCM handler, SCM flags),
"Install or report the signal hander for a specified signal. "Install or report the signal hander for a specified signal.
@ -222,7 +222,7 @@ structures.")
SCM *scheme_handlers = SCM_VELTS (*signal_handlers); SCM *scheme_handlers = SCM_VELTS (*signal_handlers);
SCM old_handler; SCM old_handler;
SCM_VALIDATE_INUM_COPY(1,signum,csig); SCM_VALIDATE_INUM_COPY (1,signum,csig);
#if defined(HAVE_SIGACTION) #if defined(HAVE_SIGACTION)
#if defined(SA_RESTART) && defined(HAVE_RESTARTABLE_SYSCALLS) #if defined(SA_RESTART) && defined(HAVE_RESTARTABLE_SYSCALLS)
/* don't allow SA_RESTART to be omitted if HAVE_RESTARTABLE_SYSCALLS /* don't allow SA_RESTART to be omitted if HAVE_RESTARTABLE_SYSCALLS
@ -234,7 +234,7 @@ structures.")
#endif #endif
if (!SCM_UNBNDP (flags)) if (!SCM_UNBNDP (flags))
{ {
SCM_VALIDATE_INUM(3,flags); SCM_VALIDATE_INUM (3,flags);
action.sa_flags |= SCM_INUM (flags); action.sa_flags |= SCM_INUM (flags);
} }
sigemptyset (&action.sa_mask); sigemptyset (&action.sa_mask);
@ -368,7 +368,7 @@ SCM_DEFINE (scm_restore_signals, "restore-signals", 0, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_alarm, "alarm", 1, 0, 0, SCM_DEFINE (scm_alarm, "alarm", 1, 0, 0,
(SCM i), (SCM i),
"Set a timer to raise a @code{SIGALRM} signal after the specified "Set a timer to raise a @code{SIGALRM} signal after the specified
number of seconds (an integer). It's advisable to install a signal number of seconds (an integer). It's advisable to install a signal
@ -382,14 +382,14 @@ no previous alarm, the return value is zero.")
#define FUNC_NAME s_scm_alarm #define FUNC_NAME s_scm_alarm
{ {
unsigned int j; unsigned int j;
SCM_VALIDATE_INUM(1,i); SCM_VALIDATE_INUM (1,i);
j = alarm (SCM_INUM (i)); j = alarm (SCM_INUM (i));
return SCM_MAKINUM (j); return SCM_MAKINUM (j);
} }
#undef FUNC_NAME #undef FUNC_NAME
#ifdef HAVE_PAUSE #ifdef HAVE_PAUSE
SCM_DEFINE(scm_pause, "pause", 0, 0, 0, SCM_DEFINE (scm_pause, "pause", 0, 0, 0,
(), (),
"Pause the current process (thread?) until a signal arrives whose "Pause the current process (thread?) until a signal arrives whose
action is to either terminate the current process or invoke a action is to either terminate the current process or invoke a
@ -402,7 +402,7 @@ handler procedure. The return value is unspecified.")
#undef FUNC_NAME #undef FUNC_NAME
#endif #endif
SCM_DEFINE(scm_sleep, "sleep", 1, 0, 0, SCM_DEFINE (scm_sleep, "sleep", 1, 0, 0,
(SCM i), (SCM i),
"Wait for the given number of seconds (an integer) or until a signal "Wait for the given number of seconds (an integer) or until a signal
arrives. The return value is zero if the time elapses or the number arrives. The return value is zero if the time elapses or the number
@ -410,7 +410,7 @@ of seconds remaining otherwise.")
#define FUNC_NAME s_scm_sleep #define FUNC_NAME s_scm_sleep
{ {
unsigned long j; unsigned long j;
SCM_VALIDATE_INUM_MIN(1,i,0); SCM_VALIDATE_INUM_MIN (1,i,0);
#ifdef USE_THREADS #ifdef USE_THREADS
j = scm_thread_sleep (SCM_INUM(i)); j = scm_thread_sleep (SCM_INUM(i));
#else #else
@ -421,12 +421,12 @@ of seconds remaining otherwise.")
#undef FUNC_NAME #undef FUNC_NAME
#if defined(USE_THREADS) || defined(HAVE_USLEEP) #if defined(USE_THREADS) || defined(HAVE_USLEEP)
SCM_DEFINE(scm_usleep, "usleep", 1, 0, 0, SCM_DEFINE (scm_usleep, "usleep", 1, 0, 0,
(SCM i), (SCM i),
"") "")
#define FUNC_NAME s_scm_usleep #define FUNC_NAME s_scm_usleep
{ {
SCM_VALIDATE_INUM_MIN(1,i,0); SCM_VALIDATE_INUM_MIN (1,i,0);
#ifdef USE_THREADS #ifdef USE_THREADS
/* If we have threads, we use the thread system's sleep function. */ /* If we have threads, we use the thread system's sleep function. */
@ -449,14 +449,14 @@ SCM_DEFINE(scm_usleep, "usleep", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
#endif /* GUILE_ISELECT || HAVE_USLEEP */ #endif /* GUILE_ISELECT || HAVE_USLEEP */
SCM_DEFINE(scm_raise, "raise", 1, 0, 0, SCM_DEFINE (scm_raise, "raise", 1, 0, 0,
(SCM sig), (SCM sig),
" "
Sends a specified signal @var{sig} to the current process, where Sends a specified signal @var{sig} to the current process, where
@var{sig} is as described for the kill procedure.") @var{sig} is as described for the kill procedure.")
#define FUNC_NAME s_scm_raise #define FUNC_NAME s_scm_raise
{ {
SCM_VALIDATE_INUM(1,sig); SCM_VALIDATE_INUM (1,sig);
SCM_DEFER_INTS; SCM_DEFER_INTS;
if (kill (getpid (), (int) SCM_INUM (sig)) != 0) if (kill (getpid (), (int) SCM_INUM (sig)) != 0)
SCM_SYSERROR; SCM_SYSERROR;

View file

@ -63,7 +63,7 @@
extern int system(); extern int system();
SCM_DEFINE(scm_system, "system", 0, 1, 0, SCM_DEFINE (scm_system, "system", 0, 1, 0,
(SCM cmd), (SCM cmd),
"Executes @var{cmd} using the operating system's "command processor". "Executes @var{cmd} using the operating system's "command processor".
Under Unix this is usually the default shell @code{sh}. The value Under Unix this is usually the default shell @code{sh}. The value
@ -85,7 +85,7 @@ indicating whether the command processor is available.")
#endif #endif
return SCM_BOOL(rv); return SCM_BOOL(rv);
} }
SCM_VALIDATE_ROSTRING(1,cmd); SCM_VALIDATE_ROSTRING (1,cmd);
#ifdef HAVE_SYSTEM #ifdef HAVE_SYSTEM
SCM_DEFER_INTS; SCM_DEFER_INTS;
errno = 0; errno = 0;
@ -112,7 +112,7 @@ returned.")
#define FUNC_NAME s_scm_getenv #define FUNC_NAME s_scm_getenv
{ {
char *val; char *val;
SCM_VALIDATE_ROSTRING(1,nam); SCM_VALIDATE_ROSTRING (1,nam);
nam = scm_makfromstr (SCM_ROCHARS (nam), SCM_ROLENGTH (nam), 0); nam = scm_makfromstr (SCM_ROCHARS (nam), SCM_ROLENGTH (nam), 0);
val = getenv(SCM_CHARS(nam)); val = getenv(SCM_CHARS(nam));
return (val) ? scm_makfromstr(val, (scm_sizet)strlen(val), 0) : SCM_BOOL_F; return (val) ? scm_makfromstr(val, (scm_sizet)strlen(val), 0) : SCM_BOOL_F;
@ -130,7 +130,7 @@ is @var{status} if supplied, otherwise zero.")
int cstatus = 0; int cstatus = 0;
if (!SCM_UNBNDP (status)) if (!SCM_UNBNDP (status))
{ {
SCM_VALIDATE_INUM(1,status); SCM_VALIDATE_INUM (1,status);
cstatus = SCM_INUM (status); cstatus = SCM_INUM (status);
} }
exit (cstatus); exit (cstatus);

View file

@ -80,7 +80,7 @@ short integer.")
{ {
unsigned short c_in; unsigned short c_in;
SCM_VALIDATE_INUM_COPY(1,in,c_in); SCM_VALIDATE_INUM_COPY (1,in,c_in);
if (c_in != SCM_INUM (in)) if (c_in != SCM_INUM (in))
SCM_OUT_OF_RANGE (1,in); SCM_OUT_OF_RANGE (1,in);
@ -97,7 +97,7 @@ integer.")
{ {
unsigned short c_in; unsigned short c_in;
SCM_VALIDATE_INUM_COPY(1,in,c_in); SCM_VALIDATE_INUM_COPY (1,in,c_in);
if (c_in != SCM_INUM (in)) if (c_in != SCM_INUM (in))
SCM_OUT_OF_RANGE (1,in); SCM_OUT_OF_RANGE (1,in);
@ -163,9 +163,9 @@ it has been connected to another socket.")
int fd; int fd;
SCM result; SCM result;
SCM_VALIDATE_INUM(1,family); SCM_VALIDATE_INUM (1,family);
SCM_VALIDATE_INUM(2,style); SCM_VALIDATE_INUM (2,style);
SCM_VALIDATE_INUM(3,proto); SCM_VALIDATE_INUM (3,proto);
fd = socket (SCM_INUM (family), SCM_INUM (style), SCM_INUM (proto)); fd = socket (SCM_INUM (family), SCM_INUM (style), SCM_INUM (proto));
result = SCM_SOCK_FD_TO_PORT (fd); result = SCM_SOCK_FD_TO_PORT (fd);
return result; return result;
@ -189,9 +189,9 @@ the only meaningful value for @var{protocol}.")
SCM a; SCM a;
SCM b; SCM b;
SCM_VALIDATE_INUM(1,family); SCM_VALIDATE_INUM (1,family);
SCM_VALIDATE_INUM(2,style); SCM_VALIDATE_INUM (2,style);
SCM_VALIDATE_INUM(3,proto); SCM_VALIDATE_INUM (3,proto);
fam = SCM_INUM (family); fam = SCM_INUM (family);
@ -235,9 +235,9 @@ pair of integers.")
#endif #endif
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
SCM_VALIDATE_INUM_COPY(2,level,ilevel); SCM_VALIDATE_INUM_COPY (2,level,ilevel);
SCM_VALIDATE_INUM_COPY(3,optname,ioptname); SCM_VALIDATE_INUM_COPY (3,optname,ioptname);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
if (getsockopt (fd, ilevel, ioptname, (void *) optval, &optlen) == -1) if (getsockopt (fd, ilevel, ioptname, (void *) optval, &optlen) == -1)
@ -299,9 +299,9 @@ The return value is unspecified.")
#endif #endif
int ilevel, ioptname; int ilevel, ioptname;
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
SCM_VALIDATE_INUM_COPY(2,level,ilevel); SCM_VALIDATE_INUM_COPY (2,level,ilevel);
SCM_VALIDATE_INUM_COPY(3,optname,ioptname); SCM_VALIDATE_INUM_COPY (3,optname,ioptname);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
if (0); if (0);
#ifdef SO_LINGER #ifdef SO_LINGER
@ -332,7 +332,7 @@ The return value is unspecified.")
#ifdef SO_SNDBUF #ifdef SO_SNDBUF
else if (ilevel == SOL_SOCKET && ioptname == SO_SNDBUF) else if (ilevel == SOL_SOCKET && ioptname == SO_SNDBUF)
{ {
SCM_VALIDATE_INUM(4,value); SCM_VALIDATE_INUM (4,value);
optlen = (int) sizeof (scm_sizet); optlen = (int) sizeof (scm_sizet);
(*(scm_sizet *) optval) = (scm_sizet) SCM_INUM (value); (*(scm_sizet *) optval) = (scm_sizet) SCM_INUM (value);
} }
@ -340,7 +340,7 @@ The return value is unspecified.")
#ifdef SO_RCVBUF #ifdef SO_RCVBUF
else if (ilevel == SOL_SOCKET && ioptname == SO_RCVBUF) else if (ilevel == SOL_SOCKET && ioptname == SO_RCVBUF)
{ {
SCM_VALIDATE_INUM(4,value); SCM_VALIDATE_INUM (4,value);
optlen = (int) sizeof (scm_sizet); optlen = (int) sizeof (scm_sizet);
(*(scm_sizet *) optval) = (scm_sizet) SCM_INUM (value); (*(scm_sizet *) optval) = (scm_sizet) SCM_INUM (value);
} }
@ -348,7 +348,7 @@ The return value is unspecified.")
else else
{ {
/* Most options just take an int. */ /* Most options just take an int. */
SCM_VALIDATE_INUM(4,value); SCM_VALIDATE_INUM (4,value);
optlen = (int) sizeof (int); optlen = (int) sizeof (int);
(*(int *) optval) = (int) SCM_INUM (value); (*(int *) optval) = (int) SCM_INUM (value);
} }
@ -381,8 +381,8 @@ The return value is unspecified.")
{ {
int fd; int fd;
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
SCM_VALIDATE_INUM(2,how); SCM_VALIDATE_INUM (2,how);
SCM_ASSERT_RANGE(2,how,0 <= SCM_INUM (how) && 2 >= SCM_INUM (how)); SCM_ASSERT_RANGE(2,how,0 <= SCM_INUM (how) && 2 >= SCM_INUM (how));
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
if (shutdown (fd, SCM_INUM (how)) == -1) if (shutdown (fd, SCM_INUM (how)) == -1)
@ -470,8 +470,8 @@ The return value is unspecified.")
scm_sizet size; scm_sizet size;
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
SCM_VALIDATE_INUM(2,fam); SCM_VALIDATE_INUM (2,fam);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
soka = scm_fill_sockaddr (SCM_INUM (fam), address, &args, 3, FUNC_NAME, &size); soka = scm_fill_sockaddr (SCM_INUM (fam), address, &args, 3, FUNC_NAME, &size);
if (connect (fd, soka, size) == -1) if (connect (fd, soka, size) == -1)
@ -527,8 +527,8 @@ The return value is unspecified.")
int fd; int fd;
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
SCM_VALIDATE_INUM(2,fam); SCM_VALIDATE_INUM (2,fam);
soka = scm_fill_sockaddr (SCM_INUM (fam), address, &args, 3, FUNC_NAME, &size); soka = scm_fill_sockaddr (SCM_INUM (fam), address, &args, 3, FUNC_NAME, &size);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
rv = bind (fd, soka, size); rv = bind (fd, soka, size);
@ -552,8 +552,8 @@ The return value is unspecified.")
{ {
int fd; int fd;
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
SCM_VALIDATE_INUM(2,backlog); SCM_VALIDATE_INUM (2,backlog);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
if (listen (fd, SCM_INUM (backlog)) == -1) if (listen (fd, SCM_INUM (backlog)) == -1)
SCM_SYSERROR; SCM_SYSERROR;
@ -641,7 +641,7 @@ connection and will continue to accept new requests.")
int tmp_size; int tmp_size;
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
tmp_size = scm_addr_buffer_size; tmp_size = scm_addr_buffer_size;
newfd = accept (fd, (struct sockaddr *) scm_addr_buffer, &tmp_size); newfd = accept (fd, (struct sockaddr *) scm_addr_buffer, &tmp_size);
@ -666,7 +666,7 @@ in the @code{AF_FILE} namespace cannot be read.")
int fd; int fd;
SCM result; SCM result;
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
tmp_size = scm_addr_buffer_size; tmp_size = scm_addr_buffer_size;
if (getsockname (fd, (struct sockaddr *) scm_addr_buffer, &tmp_size) == -1) if (getsockname (fd, (struct sockaddr *) scm_addr_buffer, &tmp_size) == -1)
@ -691,7 +691,7 @@ in the @code{AF_FILE} namespace cannot be read.")
int fd; int fd;
SCM result; SCM result;
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
tmp_size = scm_addr_buffer_size; tmp_size = scm_addr_buffer_size;
if (getpeername (fd, (struct sockaddr *) scm_addr_buffer, &tmp_size) == -1) if (getpeername (fd, (struct sockaddr *) scm_addr_buffer, &tmp_size) == -1)
@ -727,9 +727,9 @@ any unread buffered port data is ignored.")
int fd; int fd;
int flg; int flg;
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
SCM_VALIDATE_STRING(2,buf); SCM_VALIDATE_STRING (2,buf);
SCM_VALIDATE_INUM_DEF_COPY(3,flags,0,flg); SCM_VALIDATE_INUM_DEF_COPY (3,flags,0,flg);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
SCM_SYSCALL (rv = recv (fd, SCM_CHARS (buf), SCM_LENGTH (buf), flg)); SCM_SYSCALL (rv = recv (fd, SCM_CHARS (buf), SCM_LENGTH (buf), flg));
@ -758,9 +758,9 @@ any unflushed buffered port data is ignored.")
int flg; int flg;
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
SCM_VALIDATE_ROSTRING(2,message); SCM_VALIDATE_ROSTRING (2,message);
SCM_VALIDATE_INUM_DEF_COPY(3,flags,0,flg); SCM_VALIDATE_INUM_DEF_COPY (3,flags,0,flg);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
SCM_SYSCALL (rv = send (fd, SCM_ROCHARS (message), SCM_ROLENGTH (message), flg)); SCM_SYSCALL (rv = send (fd, SCM_ROCHARS (message), SCM_ROLENGTH (message), flg));
@ -803,8 +803,8 @@ any unread buffered port data is ignored.")
int tmp_size; int tmp_size;
SCM address; SCM address;
SCM_VALIDATE_OPFPORT(1,sock); SCM_VALIDATE_OPFPORT (1,sock);
SCM_VALIDATE_STRING(2,buf); SCM_VALIDATE_STRING (2,buf);
cend = SCM_LENGTH (buf); cend = SCM_LENGTH (buf);
if (SCM_UNBNDP (flags)) if (SCM_UNBNDP (flags))
@ -873,9 +873,9 @@ any unflushed buffered port data is ignored.")
int save_err; int save_err;
sock = SCM_COERCE_OUTPORT (sock); sock = SCM_COERCE_OUTPORT (sock);
SCM_VALIDATE_FPORT(1,sock); SCM_VALIDATE_FPORT (1,sock);
SCM_VALIDATE_ROSTRING(2,message); SCM_VALIDATE_ROSTRING (2,message);
SCM_VALIDATE_INUM(3,fam); SCM_VALIDATE_INUM (3,fam);
fd = SCM_FPORT_FDES (sock); fd = SCM_FPORT_FDES (sock);
soka = scm_fill_sockaddr (SCM_INUM (fam), address, &args_and_flags, 4, soka = scm_fill_sockaddr (SCM_INUM (fam), address, &args_and_flags, 4,
FUNC_NAME, &size); FUNC_NAME, &size);
@ -883,7 +883,7 @@ any unflushed buffered port data is ignored.")
flg = 0; flg = 0;
else else
{ {
SCM_VALIDATE_CONS(5,args_and_flags); SCM_VALIDATE_CONS (5,args_and_flags);
flg = SCM_NUM2ULONG (5,SCM_CAR (args_and_flags)); flg = SCM_NUM2ULONG (5,SCM_CAR (args_and_flags));
} }
SCM_SYSCALL (rv = sendto (fd, SCM_ROCHARS (message), SCM_ROLENGTH (message), SCM_SYSCALL (rv = sendto (fd, SCM_ROCHARS (message), SCM_ROLENGTH (message),

View file

@ -441,9 +441,9 @@ SCM_DEFINE (scm_restricted_vector_sort_x, "restricted-vector-sort!", 4, 0, 0,
vp = SCM_VELTS (vec); /* vector pointer */ vp = SCM_VELTS (vec); /* vector pointer */
vlen = SCM_LENGTH (vec); vlen = SCM_LENGTH (vec);
SCM_VALIDATE_INUM_COPY(3,startpos,spos); SCM_VALIDATE_INUM_COPY (3,startpos,spos);
SCM_ASSERT_RANGE (3,startpos,(spos >= 0) && (spos <= vlen)); SCM_ASSERT_RANGE (3,startpos,(spos >= 0) && (spos <= vlen));
SCM_VALIDATE_INUM_RANGE(4,endpos,0,vlen+1); SCM_VALIDATE_INUM_RANGE (4,endpos,0,vlen+1);
len = SCM_INUM (endpos) - spos; len = SCM_INUM (endpos) - spos;
quicksort (&vp[spos], len, size, scm_cmp_function (less), less); quicksort (&vp[spos], len, size, scm_cmp_function (less), less);
@ -552,8 +552,8 @@ SCM_DEFINE (scm_merge, "merge", 3, 0, 0,
return alist; return alist;
else else
{ {
SCM_VALIDATE_NONEMPTYLIST_COPYLEN(1,alist,alen); SCM_VALIDATE_NONEMPTYLIST_COPYLEN (1,alist,alen);
SCM_VALIDATE_NONEMPTYLIST_COPYLEN(2,blist,blen); SCM_VALIDATE_NONEMPTYLIST_COPYLEN (2,blist,blen);
if ((*cmp) (less, &SCM_CAR (blist), &SCM_CAR (alist))) if ((*cmp) (less, &SCM_CAR (blist), &SCM_CAR (alist)))
{ {
build = scm_cons (SCM_CAR (blist), SCM_EOL); build = scm_cons (SCM_CAR (blist), SCM_EOL);
@ -657,8 +657,8 @@ SCM_DEFINE (scm_merge_x, "merge!", 3, 0, 0,
return alist; return alist;
else else
{ {
SCM_VALIDATE_NONEMPTYLIST_COPYLEN(1,alist,alen); SCM_VALIDATE_NONEMPTYLIST_COPYLEN (1,alist,alen);
SCM_VALIDATE_NONEMPTYLIST_COPYLEN(2,blist,blen); SCM_VALIDATE_NONEMPTYLIST_COPYLEN (2,blist,blen);
return scm_merge_list_x (alist, blist, return scm_merge_list_x (alist, blist,
alen, blen, alen, blen,
scm_cmp_function (less), scm_cmp_function (less),
@ -728,7 +728,7 @@ SCM_DEFINE (scm_sort_x, "sort!", 2, 0, 0,
if (SCM_CONSP (items)) if (SCM_CONSP (items))
{ {
SCM_VALIDATE_LIST_COPYLEN(1,items,len); SCM_VALIDATE_LIST_COPYLEN (1,items,len);
return scm_merge_list_step (&items, scm_cmp_function (less), less, len); return scm_merge_list_step (&items, scm_cmp_function (less), less, len);
} }
else if (SCM_VECTORP (items)) else if (SCM_VECTORP (items))
@ -760,7 +760,7 @@ SCM_DEFINE (scm_sort, "sort", 2, 0, 0,
SCM_VALIDATE_NIM (2,less); SCM_VALIDATE_NIM (2,less);
if (SCM_CONSP (items)) if (SCM_CONSP (items))
{ {
SCM_VALIDATE_LIST_COPYLEN(1,items,len); SCM_VALIDATE_LIST_COPYLEN (1,items,len);
items = scm_list_copy (items); items = scm_list_copy (items);
return scm_merge_list_step (&items, scm_cmp_function (less), less, len); return scm_merge_list_step (&items, scm_cmp_function (less), less, len);
} }
@ -851,7 +851,7 @@ SCM_DEFINE (scm_stable_sort_x, "stable-sort!", 2, 0, 0,
SCM_VALIDATE_NIM (2,less); SCM_VALIDATE_NIM (2,less);
if (SCM_CONSP (items)) if (SCM_CONSP (items))
{ {
SCM_VALIDATE_LIST_COPYLEN(1,items,len); SCM_VALIDATE_LIST_COPYLEN (1,items,len);
return scm_merge_list_step (&items, scm_cmp_function (less), less, len); return scm_merge_list_step (&items, scm_cmp_function (less), less, len);
} }
else if (SCM_VECTORP (items)) else if (SCM_VECTORP (items))
@ -888,7 +888,7 @@ SCM_DEFINE (scm_stable_sort, "stable-sort", 2, 0, 0,
SCM_VALIDATE_NIM (2,less); SCM_VALIDATE_NIM (2,less);
if (SCM_CONSP (items)) if (SCM_CONSP (items))
{ {
SCM_VALIDATE_LIST_COPYLEN(1,items,len); SCM_VALIDATE_LIST_COPYLEN (1,items,len);
items = scm_list_copy (items); items = scm_list_copy (items);
return scm_merge_list_step (&items, scm_cmp_function (less), less, len); return scm_merge_list_step (&items, scm_cmp_function (less), less, len);
} }
@ -925,7 +925,7 @@ SCM_DEFINE (scm_sort_list_x, "sort-list!", 2, 0, 0,
#define FUNC_NAME s_scm_sort_list_x #define FUNC_NAME s_scm_sort_list_x
{ {
long len; long len;
SCM_VALIDATE_LIST_COPYLEN(1,items,len); SCM_VALIDATE_LIST_COPYLEN (1,items,len);
SCM_VALIDATE_NIM (2,less); SCM_VALIDATE_NIM (2,less);
return scm_merge_list_step (&items, scm_cmp_function (less), less, len); return scm_merge_list_step (&items, scm_cmp_function (less), less, len);
} }
@ -938,7 +938,7 @@ SCM_DEFINE (scm_sort_list, "sort-list", 2, 0, 0,
#define FUNC_NAME s_scm_sort_list #define FUNC_NAME s_scm_sort_list
{ {
long len; long len;
SCM_VALIDATE_LIST_COPYLEN(1,items,len); SCM_VALIDATE_LIST_COPYLEN (1,items,len);
SCM_VALIDATE_NIM (2,less); SCM_VALIDATE_NIM (2,less);
items = scm_list_copy (items); items = scm_list_copy (items);
return scm_merge_list_step (&items, scm_cmp_function (less), less, len); return scm_merge_list_step (&items, scm_cmp_function (less), less, len);

View file

@ -281,7 +281,7 @@ SCM_DEFINE (scm_set_source_property_x, "set-source-property!", 3, 0, 0,
} }
else if (scm_sym_line == key) else if (scm_sym_line == key)
{ {
SCM_VALIDATE_INUM(3,datum); SCM_VALIDATE_INUM (3,datum);
if (SRCPROPSP (p)) if (SRCPROPSP (p))
SETSRCPROPLINE (p, SCM_INUM (datum)); SETSRCPROPLINE (p, SCM_INUM (datum));
else else
@ -291,7 +291,7 @@ SCM_DEFINE (scm_set_source_property_x, "set-source-property!", 3, 0, 0,
} }
else if (scm_sym_column == key) else if (scm_sym_column == key)
{ {
SCM_VALIDATE_INUM(3,datum); SCM_VALIDATE_INUM (3,datum);
if (SRCPROPSP (p)) if (SRCPROPSP (p))
SETSRCPROPCOL (p, SCM_INUM (datum)); SETSRCPROPCOL (p, SCM_INUM (datum));
else else

View file

@ -551,8 +551,8 @@ SCM_DEFINE (scm_stack_ref, "stack-ref", 2, 0, 0,
"") "")
#define FUNC_NAME s_scm_stack_ref #define FUNC_NAME s_scm_stack_ref
{ {
SCM_VALIDATE_STACK(1,stack); SCM_VALIDATE_STACK (1,stack);
SCM_VALIDATE_INUM(2,i); SCM_VALIDATE_INUM (2,i);
SCM_ASSERT_RANGE (1,i, SCM_ASSERT_RANGE (1,i,
SCM_INUM (i) >= 0 && SCM_INUM (i) >= 0 &&
SCM_INUM (i) < SCM_STACK_LENGTH (stack)); SCM_INUM (i) < SCM_STACK_LENGTH (stack));
@ -560,12 +560,12 @@ SCM_DEFINE (scm_stack_ref, "stack-ref", 2, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_stack_length, "stack-length", 1, 0, 0, SCM_DEFINE (scm_stack_length, "stack-length", 1, 0, 0,
(SCM stack), (SCM stack),
"") "")
#define FUNC_NAME s_scm_stack_length #define FUNC_NAME s_scm_stack_length
{ {
SCM_VALIDATE_STACK(1,stack); SCM_VALIDATE_STACK (1,stack);
return SCM_MAKINUM (SCM_STACK_LENGTH (stack)); return SCM_MAKINUM (SCM_STACK_LENGTH (stack));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -582,7 +582,7 @@ SCM_DEFINE (scm_frame_p, "frame?", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_last_stack_frame, "last-stack-frame", 1, 0, 0, SCM_DEFINE (scm_last_stack_frame, "last-stack-frame", 1, 0, 0,
(SCM obj), (SCM obj),
"") "")
#define FUNC_NAME s_scm_last_stack_frame #define FUNC_NAME s_scm_last_stack_frame
@ -623,55 +623,55 @@ SCM_DEFINE(scm_last_stack_frame, "last-stack-frame", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_frame_number, "frame-number", 1, 0, 0, SCM_DEFINE (scm_frame_number, "frame-number", 1, 0, 0,
(SCM frame), (SCM frame),
"") "")
#define FUNC_NAME s_scm_frame_number #define FUNC_NAME s_scm_frame_number
{ {
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
return SCM_MAKINUM (SCM_FRAME_NUMBER (frame)); return SCM_MAKINUM (SCM_FRAME_NUMBER (frame));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_frame_source, "frame-source", 1, 0, 0, SCM_DEFINE (scm_frame_source, "frame-source", 1, 0, 0,
(SCM frame), (SCM frame),
"") "")
#define FUNC_NAME s_scm_frame_source #define FUNC_NAME s_scm_frame_source
{ {
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
return SCM_FRAME_SOURCE (frame); return SCM_FRAME_SOURCE (frame);
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_frame_procedure, "frame-procedure", 1, 0, 0, SCM_DEFINE (scm_frame_procedure, "frame-procedure", 1, 0, 0,
(SCM frame), (SCM frame),
"") "")
#define FUNC_NAME s_scm_frame_procedure #define FUNC_NAME s_scm_frame_procedure
{ {
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
return (SCM_FRAME_PROC_P (frame) return (SCM_FRAME_PROC_P (frame)
? SCM_FRAME_PROC (frame) ? SCM_FRAME_PROC (frame)
: SCM_BOOL_F); : SCM_BOOL_F);
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_frame_arguments, "frame-arguments", 1, 0, 0, SCM_DEFINE (scm_frame_arguments, "frame-arguments", 1, 0, 0,
(SCM frame), (SCM frame),
"") "")
#define FUNC_NAME s_scm_frame_arguments #define FUNC_NAME s_scm_frame_arguments
{ {
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
return SCM_FRAME_ARGS (frame); return SCM_FRAME_ARGS (frame);
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_frame_previous, "frame-previous", 1, 0, 0, SCM_DEFINE (scm_frame_previous, "frame-previous", 1, 0, 0,
(SCM frame), (SCM frame),
"") "")
#define FUNC_NAME s_scm_frame_previous #define FUNC_NAME s_scm_frame_previous
{ {
int n; int n;
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
n = SCM_INUM (SCM_CDR (frame)) + 1; n = SCM_INUM (SCM_CDR (frame)) + 1;
if (n >= SCM_STACK_LENGTH (SCM_CAR (frame))) if (n >= SCM_STACK_LENGTH (SCM_CAR (frame)))
return SCM_BOOL_F; return SCM_BOOL_F;
@ -680,13 +680,13 @@ SCM_DEFINE(scm_frame_previous, "frame-previous", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_frame_next, "frame-next", 1, 0, 0, SCM_DEFINE (scm_frame_next, "frame-next", 1, 0, 0,
(SCM frame), (SCM frame),
"") "")
#define FUNC_NAME s_scm_frame_next #define FUNC_NAME s_scm_frame_next
{ {
int n; int n;
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
n = SCM_INUM (SCM_CDR (frame)) - 1; n = SCM_INUM (SCM_CDR (frame)) - 1;
if (n < 0) if (n < 0)
return SCM_BOOL_F; return SCM_BOOL_F;
@ -695,42 +695,42 @@ SCM_DEFINE(scm_frame_next, "frame-next", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_frame_real_p, "frame-real?", 1, 0, 0, SCM_DEFINE (scm_frame_real_p, "frame-real?", 1, 0, 0,
(SCM frame), (SCM frame),
"") "")
#define FUNC_NAME s_scm_frame_real_p #define FUNC_NAME s_scm_frame_real_p
{ {
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
return SCM_BOOL(SCM_FRAME_REAL_P (frame)); return SCM_BOOL(SCM_FRAME_REAL_P (frame));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_frame_procedure_p, "frame-procedure?", 1, 0, 0, SCM_DEFINE (scm_frame_procedure_p, "frame-procedure?", 1, 0, 0,
(SCM frame), (SCM frame),
"") "")
#define FUNC_NAME s_scm_frame_procedure_p #define FUNC_NAME s_scm_frame_procedure_p
{ {
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
return SCM_BOOL(SCM_FRAME_PROC_P (frame)); return SCM_BOOL(SCM_FRAME_PROC_P (frame));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_frame_evaluating_args_p, "frame-evaluating-args?", 1, 0, 0, SCM_DEFINE (scm_frame_evaluating_args_p, "frame-evaluating-args?", 1, 0, 0,
(SCM frame), (SCM frame),
"") "")
#define FUNC_NAME s_scm_frame_evaluating_args_p #define FUNC_NAME s_scm_frame_evaluating_args_p
{ {
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
return SCM_BOOL(SCM_FRAME_EVAL_ARGS_P (frame)); return SCM_BOOL(SCM_FRAME_EVAL_ARGS_P (frame));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_frame_overflow_p, "frame-overflow?", 1, 0, 0, SCM_DEFINE (scm_frame_overflow_p, "frame-overflow?", 1, 0, 0,
(SCM frame), (SCM frame),
"") "")
#define FUNC_NAME s_scm_frame_overflow_p #define FUNC_NAME s_scm_frame_overflow_p
{ {
SCM_VALIDATE_FRAME(1,frame); SCM_VALIDATE_FRAME (1,frame);
return SCM_BOOL(SCM_FRAME_OVERFLOW_P (frame)); return SCM_BOOL(SCM_FRAME_OVERFLOW_P (frame));
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -129,7 +129,7 @@ extern int errno;
struct timeb scm_your_base = {0}; struct timeb scm_your_base = {0};
SCM_DEFINE(scm_get_internal_real_time, "get-internal-real-time", 0, 0, 0, SCM_DEFINE (scm_get_internal_real_time, "get-internal-real-time", 0, 0, 0,
(), (),
"Returns the number of time units since the interpreter was started.") "Returns the number of time units since the interpreter was started.")
#define FUNC_NAME s_scm_get_internal_real_time #define FUNC_NAME s_scm_get_internal_real_time
@ -153,7 +153,7 @@ SCM_DEFINE(scm_get_internal_real_time, "get-internal-real-time", 0, 0, 0,
timet scm_your_base = 0; timet scm_your_base = 0;
SCM_DEFINE(scm_get_internal_real_time, "get-internal-real-time", 0, 0, 0, SCM_DEFINE (scm_get_internal_real_time, "get-internal-real-time", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_get_internal_real_time #define FUNC_NAME s_scm_get_internal_real_time
@ -215,7 +215,7 @@ terminated child processes.
static long scm_my_base = 0; static long scm_my_base = 0;
SCM_DEFINE(scm_get_internal_run_time, "get-internal-run-time", 0, 0, 0, SCM_DEFINE (scm_get_internal_run_time, "get-internal-run-time", 0, 0, 0,
(void), (void),
"Returns the number of time units of processor time used by the interpreter. "Returns the number of time units of processor time used by the interpreter.
Both "system" and "user" time Both "system" and "user" time
@ -226,7 +226,7 @@ are included but subprocesses are not.")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_current_time, "current-time", 0, 0, 0, SCM_DEFINE (scm_current_time, "current-time", 0, 0, 0,
(void), (void),
"Returns the number of seconds since 1970-01-01 00:00:00 UTC, excluding "Returns the number of seconds since 1970-01-01 00:00:00 UTC, excluding
leap seconds.") leap seconds.")
@ -573,7 +573,7 @@ is the formatted string.
int len; int len;
SCM result; SCM result;
SCM_VALIDATE_ROSTRING(1,format); SCM_VALIDATE_ROSTRING (1,format);
bdtime2c (stime, &t, SCM_ARG2, FUNC_NAME); bdtime2c (stime, &t, SCM_ARG2, FUNC_NAME);
SCM_COERCE_SUBSTR (format); SCM_COERCE_SUBSTR (format);
@ -611,8 +611,8 @@ were used for the conversion.")
struct tm t; struct tm t;
char *fmt, *str, *rest; char *fmt, *str, *rest;
SCM_VALIDATE_ROSTRING(1,format); SCM_VALIDATE_ROSTRING (1,format);
SCM_VALIDATE_ROSTRING(2,string); SCM_VALIDATE_ROSTRING (2,string);
SCM_COERCE_SUBSTR (format); SCM_COERCE_SUBSTR (format);
SCM_COERCE_SUBSTR (string); SCM_COERCE_SUBSTR (string);

View file

@ -55,7 +55,7 @@
/* {Strings} /* {Strings}
*/ */
SCM_DEFINE(scm_string_p, "string?", 1, 0, 0, SCM_DEFINE (scm_string_p, "string?", 1, 0, 0,
(SCM x), (SCM x),
"") "")
#define FUNC_NAME s_scm_string_p #define FUNC_NAME s_scm_string_p
@ -66,7 +66,7 @@ SCM_DEFINE(scm_string_p, "string?", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_read_only_string_p, "read-only-string?", 1, 0, 0, SCM_DEFINE (scm_read_only_string_p, "read-only-string?", 1, 0, 0,
(SCM x), (SCM x),
"Return true of OBJ can be read as a string, "Return true of OBJ can be read as a string,
@ -91,7 +91,7 @@ This illustrates the difference between @code{string?} and
SCM_REGISTER_PROC(s_list_to_string, "list->string", 1, 0, 0, scm_string); SCM_REGISTER_PROC(s_list_to_string, "list->string", 1, 0, 0, scm_string);
SCM_DEFINE(scm_string, "string", 0, 0, 1, SCM_DEFINE (scm_string, "string", 0, 0, 1,
(SCM chrs), (SCM chrs),
"") "")
#define FUNC_NAME s_scm_string #define FUNC_NAME s_scm_string
@ -247,18 +247,18 @@ scm_makfrom0str_opt (const char *src)
SCM_DEFINE(scm_make_string, "make-string", 1, 1, 0, SCM_DEFINE (scm_make_string, "make-string", 1, 1, 0,
(SCM k, SCM chr), (SCM k, SCM chr),
"") "")
#define FUNC_NAME s_scm_make_string #define FUNC_NAME s_scm_make_string
{ {
SCM res; SCM res;
register long i; register long i;
SCM_VALIDATE_INUM_MIN_COPY(1,k,0,i); SCM_VALIDATE_INUM_MIN_COPY (1,k,0,i);
res = scm_makstr (i, 0); res = scm_makstr (i, 0);
if (!SCM_UNBNDP (chr)) if (!SCM_UNBNDP (chr))
{ {
SCM_VALIDATE_CHAR(2,chr); SCM_VALIDATE_CHAR (2,chr);
{ {
unsigned char *dst = SCM_UCHARS (res); unsigned char *dst = SCM_UCHARS (res);
char c = SCM_ICHR (chr); char c = SCM_ICHR (chr);
@ -270,36 +270,36 @@ SCM_DEFINE(scm_make_string, "make-string", 1, 1, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_length, "string-length", 1, 0, 0, SCM_DEFINE (scm_string_length, "string-length", 1, 0, 0,
(SCM str), (SCM str),
"") "")
#define FUNC_NAME s_scm_string_length #define FUNC_NAME s_scm_string_length
{ {
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
return SCM_MAKINUM (SCM_ROLENGTH (str)); return SCM_MAKINUM (SCM_ROLENGTH (str));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_ref, "string-ref", 1, 1, 0, SCM_DEFINE (scm_string_ref, "string-ref", 1, 1, 0,
(SCM str, SCM k), (SCM str, SCM k),
"") "")
#define FUNC_NAME s_scm_string_ref #define FUNC_NAME s_scm_string_ref
{ {
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
SCM_VALIDATE_INUM_DEF(2,k,0); SCM_VALIDATE_INUM_DEF (2,k,0);
SCM_ASSERT_RANGE (2,k,SCM_INUM (k) < SCM_ROLENGTH (str) && SCM_INUM (k) >= 0); SCM_ASSERT_RANGE (2,k,SCM_INUM (k) < SCM_ROLENGTH (str) && SCM_INUM (k) >= 0);
return SCM_MAKICHR (SCM_ROUCHARS (str)[SCM_INUM (k)]); return SCM_MAKICHR (SCM_ROUCHARS (str)[SCM_INUM (k)]);
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_set_x, "string-set!", 3, 0, 0, SCM_DEFINE (scm_string_set_x, "string-set!", 3, 0, 0,
(SCM str, SCM k, SCM chr), (SCM str, SCM k, SCM chr),
"") "")
#define FUNC_NAME s_scm_string_set_x #define FUNC_NAME s_scm_string_set_x
{ {
SCM_VALIDATE_RWSTRING(1,str); SCM_VALIDATE_RWSTRING (1,str);
SCM_VALIDATE_INUM_RANGE(2,k,0,SCM_LENGTH(str)); SCM_VALIDATE_INUM_RANGE (2,k,0,SCM_LENGTH(str));
SCM_VALIDATE_CHAR(3,chr); SCM_VALIDATE_CHAR (3,chr);
SCM_UCHARS (str)[SCM_INUM (k)] = SCM_ICHR (chr); SCM_UCHARS (str)[SCM_INUM (k)] = SCM_ICHR (chr);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
@ -307,15 +307,15 @@ SCM_DEFINE(scm_string_set_x, "string-set!", 3, 0, 0,
SCM_DEFINE(scm_substring, "substring", 2, 1, 0, SCM_DEFINE (scm_substring, "substring", 2, 1, 0,
(SCM str, SCM start, SCM end), (SCM str, SCM start, SCM end),
"") "")
#define FUNC_NAME s_scm_substring #define FUNC_NAME s_scm_substring
{ {
long l; long l;
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
SCM_VALIDATE_INUM(2,start); SCM_VALIDATE_INUM (2,start);
SCM_VALIDATE_INUM_DEF(3,end,SCM_ROLENGTH(str)); SCM_VALIDATE_INUM_DEF (3,end,SCM_ROLENGTH(str));
SCM_ASSERT_RANGE (2,start,SCM_INUM (start) <= SCM_ROLENGTH (str)); SCM_ASSERT_RANGE (2,start,SCM_INUM (start) <= SCM_ROLENGTH (str));
SCM_ASSERT_RANGE (2,end,SCM_INUM (end) <= SCM_ROLENGTH (str)); SCM_ASSERT_RANGE (2,end,SCM_INUM (end) <= SCM_ROLENGTH (str));
l = SCM_INUM (end)-SCM_INUM (start); l = SCM_INUM (end)-SCM_INUM (start);
@ -324,7 +324,7 @@ SCM_DEFINE(scm_substring, "substring", 2, 1, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_append, "string-append", 0, 0, 1, SCM_DEFINE (scm_string_append, "string-append", 0, 0, 1,
(SCM args), (SCM args),
"") "")
#define FUNC_NAME s_scm_string_append #define FUNC_NAME s_scm_string_append
@ -335,7 +335,7 @@ SCM_DEFINE(scm_string_append, "string-append", 0, 0, 1,
register unsigned char *data; register unsigned char *data;
for (l = args;SCM_CONSP (l);) { for (l = args;SCM_CONSP (l);) {
s = SCM_CAR (l); s = SCM_CAR (l);
SCM_VALIDATE_ROSTRING(SCM_ARGn,s); SCM_VALIDATE_ROSTRING (SCM_ARGn,s);
i += SCM_ROLENGTH (s); i += SCM_ROLENGTH (s);
l = SCM_CDR (l); l = SCM_CDR (l);
} }
@ -350,7 +350,7 @@ SCM_DEFINE(scm_string_append, "string-append", 0, 0, 1,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_make_shared_substring, "make-shared-substring", 1, 2, 0, SCM_DEFINE (scm_make_shared_substring, "make-shared-substring", 1, 2, 0,
(SCM str, SCM frm, SCM to), (SCM str, SCM frm, SCM to),
"Return a shared substring of @var{str}. The semantics are the same as "Return a shared substring of @var{str}. The semantics are the same as
for the @code{substring} function: the shared substring returned for the @code{substring} function: the shared substring returned
@ -366,9 +366,9 @@ defaults to the end of @var{str}. The shared substring returned by
SCM answer; SCM answer;
SCM len_str; SCM len_str;
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
SCM_VALIDATE_INUM_DEF_COPY(2,frm,0,f); SCM_VALIDATE_INUM_DEF_COPY (2,frm,0,f);
SCM_VALIDATE_INUM_DEF_COPY(3,to,SCM_ROLENGTH(str),t); SCM_VALIDATE_INUM_DEF_COPY (3,to,SCM_ROLENGTH(str),t);
SCM_ASSERT_RANGE (2,frm,(f >= 0)); SCM_ASSERT_RANGE (2,frm,(f >= 0));
SCM_ASSERT_RANGE (3,to, (f <= t) && (t <= SCM_ROLENGTH (str))); SCM_ASSERT_RANGE (3,to, (f <= t) && (t <= SCM_ROLENGTH (str)));

View file

@ -86,7 +86,7 @@ scm_i_index (SCM *str, SCM chr, int direction, SCM sub_start,
return -1; return -1;
} }
SCM_DEFINE(scm_string_index, "string-index", 2, 2, 0, SCM_DEFINE (scm_string_index, "string-index", 2, 2, 0,
(SCM str, SCM chr, SCM frm, SCM to), (SCM str, SCM chr, SCM frm, SCM to),
"Return the index of the first occurrence of @var{chr} in @var{str}. The "Return the index of the first occurrence of @var{chr} in @var{str}. The
optional integer arguments @var{frm} and @var{to} limit the search to optional integer arguments @var{frm} and @var{to} limit the search to
@ -107,7 +107,7 @@ a portion of the string. This procedure essentially implements the
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_rindex, "string-rindex", 2, 2, 0, SCM_DEFINE (scm_string_rindex, "string-rindex", 2, 2, 0,
(SCM str, SCM chr, SCM frm, SCM to), (SCM str, SCM chr, SCM frm, SCM to),
"Like @code{string-index}, but search from the right of the string rather "Like @code{string-index}, but search from the right of the string rather
than from the left. This procedure essentially implements the than from the left. This procedure essentially implements the
@ -132,7 +132,7 @@ SCM_REGISTER_PROC(s_substring_move_left_x, "substring-move-left!", 5, 0, 0, scm_
SCM_REGISTER_PROC(s_substring_move_right_x, "substring-move-right!", 5, 0, 0, scm_substring_move_x); SCM_REGISTER_PROC(s_substring_move_right_x, "substring-move-right!", 5, 0, 0, scm_substring_move_x);
SCM_DEFINE(scm_substring_move_x, "substring-move!", 5, 0, 0, SCM_DEFINE (scm_substring_move_x, "substring-move!", 5, 0, 0,
(SCM str1, SCM start1, SCM end1, SCM str2, SCM start2), (SCM str1, SCM start1, SCM end1, SCM str2, SCM start2),
"Copy the substring of @var{str1} bounded by @var{start1} and @var{end1} "Copy the substring of @var{str1} bounded by @var{start1} and @var{end1}
into @var{str2} beginning at position @var{end2}. into @var{str2} beginning at position @var{end2}.
@ -154,11 +154,11 @@ are different strings, it does not matter which function you use.")
{ {
long s1, s2, e, len; long s1, s2, e, len;
SCM_VALIDATE_STRING(1,str1); SCM_VALIDATE_STRING (1,str1);
SCM_VALIDATE_INUM_COPY(2,start1,s1); SCM_VALIDATE_INUM_COPY (2,start1,s1);
SCM_VALIDATE_INUM_COPY(3,end1,e); SCM_VALIDATE_INUM_COPY (3,end1,e);
SCM_VALIDATE_STRING(4,str2); SCM_VALIDATE_STRING (4,str2);
SCM_VALIDATE_INUM_COPY(5,start2,s2); SCM_VALIDATE_INUM_COPY (5,start2,s2);
len = e - s1; len = e - s1;
SCM_ASSERT_RANGE (3,end1,len >= 0); SCM_ASSERT_RANGE (3,end1,len >= 0);
SCM_ASSERT_RANGE (2,start1,s1 <= SCM_LENGTH (str1) && s1 >= 0); SCM_ASSERT_RANGE (2,start1,s1 <= SCM_LENGTH (str1) && s1 >= 0);
@ -175,7 +175,7 @@ are different strings, it does not matter which function you use.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_substring_fill_x, "substring-fill!", 4, 0, 0, SCM_DEFINE (scm_substring_fill_x, "substring-fill!", 4, 0, 0,
(SCM str, SCM start, SCM end, SCM fill), (SCM str, SCM start, SCM end, SCM fill),
"Change every character in @var{str} between @var{start} and @var{end} to "Change every character in @var{str} between @var{start} and @var{end} to
@var{fill-char}.") @var{fill-char}.")
@ -183,10 +183,10 @@ SCM_DEFINE(scm_substring_fill_x, "substring-fill!", 4, 0, 0,
{ {
long i, e; long i, e;
char c; char c;
SCM_VALIDATE_STRING(1,str); SCM_VALIDATE_STRING (1,str);
SCM_VALIDATE_INUM_COPY(2,start,i); SCM_VALIDATE_INUM_COPY (2,start,i);
SCM_VALIDATE_INUM_COPY(3,end,e); SCM_VALIDATE_INUM_COPY (3,end,e);
SCM_VALIDATE_CHAR_COPY(4,fill,c); SCM_VALIDATE_CHAR_COPY (4,fill,c);
SCM_ASSERT_RANGE (2,start,i <= SCM_LENGTH (str) && i >= 0); SCM_ASSERT_RANGE (2,start,i <= SCM_LENGTH (str) && i >= 0);
SCM_ASSERT_RANGE (3,end,e <= SCM_LENGTH (str) && e >= 0); SCM_ASSERT_RANGE (3,end,e <= SCM_LENGTH (str) && e >= 0);
while (i<e) SCM_CHARS (str)[i++] = c; while (i<e) SCM_CHARS (str)[i++] = c;
@ -195,19 +195,19 @@ SCM_DEFINE(scm_substring_fill_x, "substring-fill!", 4, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_null_p, "string-null?", 1, 0, 0, SCM_DEFINE (scm_string_null_p, "string-null?", 1, 0, 0,
(SCM str), (SCM str),
"Return @code{#t} if @var{str}'s length is nonzero, and @code{#f} "Return @code{#t} if @var{str}'s length is nonzero, and @code{#f}
otherwise.") otherwise.")
#define FUNC_NAME s_scm_string_null_p #define FUNC_NAME s_scm_string_null_p
{ {
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
return SCM_NEGATE_BOOL(SCM_ROLENGTH (str)); return SCM_NEGATE_BOOL(SCM_ROLENGTH (str));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_to_list, "string->list", 1, 0, 0, SCM_DEFINE (scm_string_to_list, "string->list", 1, 0, 0,
(SCM str), (SCM str),
"") "")
#define FUNC_NAME s_scm_string_to_list #define FUNC_NAME s_scm_string_to_list
@ -215,7 +215,7 @@ SCM_DEFINE(scm_string_to_list, "string->list", 1, 0, 0,
long i; long i;
SCM res = SCM_EOL; SCM res = SCM_EOL;
unsigned char *src; unsigned char *src;
SCM_VALIDATE_ROSTRING(1,str); SCM_VALIDATE_ROSTRING (1,str);
src = SCM_ROUCHARS (str); src = SCM_ROUCHARS (str);
for (i = SCM_ROLENGTH (str)-1;i >= 0;i--) res = scm_cons ((SCM)SCM_MAKICHR (src[i]), res); for (i = SCM_ROLENGTH (str)-1;i >= 0;i--) res = scm_cons ((SCM)SCM_MAKICHR (src[i]), res);
return res; return res;
@ -224,32 +224,32 @@ SCM_DEFINE(scm_string_to_list, "string->list", 1, 0, 0,
SCM_DEFINE(scm_string_copy, "string-copy", 1, 0, 0, SCM_DEFINE (scm_string_copy, "string-copy", 1, 0, 0,
(SCM str), (SCM str),
"") "")
#define FUNC_NAME s_scm_string_copy #define FUNC_NAME s_scm_string_copy
{ {
SCM_VALIDATE_STRINGORSUBSTR(1,str); SCM_VALIDATE_STRINGORSUBSTR (1,str);
return scm_makfromstr (SCM_ROCHARS (str), (scm_sizet)SCM_ROLENGTH (str), 0); return scm_makfromstr (SCM_ROCHARS (str), (scm_sizet)SCM_ROLENGTH (str), 0);
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_fill_x, "string-fill!", 2, 0, 0, SCM_DEFINE (scm_string_fill_x, "string-fill!", 2, 0, 0,
(SCM str, SCM chr), (SCM str, SCM chr),
"") "")
#define FUNC_NAME s_scm_string_fill_x #define FUNC_NAME s_scm_string_fill_x
{ {
register char *dst, c; register char *dst, c;
register long k; register long k;
SCM_VALIDATE_STRING_COPY(1,str,dst); SCM_VALIDATE_STRING_COPY (1,str,dst);
SCM_VALIDATE_CHAR_COPY(2,chr,c); SCM_VALIDATE_CHAR_COPY (2,chr,c);
for (k = SCM_LENGTH (str)-1;k >= 0;k--) dst[k] = c; for (k = SCM_LENGTH (str)-1;k >= 0;k--) dst[k] = c;
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_upcase_x, "string-upcase!", 1, 0, 0, SCM_DEFINE (scm_string_upcase_x, "string-upcase!", 1, 0, 0,
(SCM v), (SCM v),
"@deffnx primitive string-downcase! str "@deffnx primitive string-downcase! str
Upcase or downcase every character in @code{str}, respectively.") Upcase or downcase every character in @code{str}, respectively.")
@ -274,7 +274,7 @@ Upcase or downcase every character in @code{str}, respectively.")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_upcase, "string-upcase", 1, 0, 0, SCM_DEFINE (scm_string_upcase, "string-upcase", 1, 0, 0,
(SCM str), (SCM str),
"") "")
#define FUNC_NAME s_scm_string_upcase #define FUNC_NAME s_scm_string_upcase
@ -283,7 +283,7 @@ SCM_DEFINE(scm_string_upcase, "string-upcase", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_downcase_x, "string-downcase!", 1, 0, 0, SCM_DEFINE (scm_string_downcase_x, "string-downcase!", 1, 0, 0,
(SCM v), (SCM v),
"") "")
#define FUNC_NAME s_scm_string_downcase_x #define FUNC_NAME s_scm_string_downcase_x
@ -306,24 +306,24 @@ SCM_DEFINE(scm_string_downcase_x, "string-downcase!", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_downcase, "string-downcase", 1, 0, 0, SCM_DEFINE (scm_string_downcase, "string-downcase", 1, 0, 0,
(SCM str), (SCM str),
"") "")
#define FUNC_NAME s_scm_string_downcase #define FUNC_NAME s_scm_string_downcase
{ {
SCM_VALIDATE_STRING(1,str); SCM_VALIDATE_STRING (1,str);
return scm_string_downcase_x(scm_string_copy(str)); return scm_string_downcase_x(scm_string_copy(str));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_capitalize_x, "string-capitalize!", 1, 0, 0, SCM_DEFINE (scm_string_capitalize_x, "string-capitalize!", 1, 0, 0,
(SCM s), (SCM s),
"") "")
#define FUNC_NAME s_scm_string_capitalize_x #define FUNC_NAME s_scm_string_capitalize_x
{ {
char *str; char *str;
int i, len, in_word=0; int i, len, in_word=0;
SCM_VALIDATE_STRING(1,s); SCM_VALIDATE_STRING (1,s);
len = SCM_LENGTH(s); len = SCM_LENGTH(s);
str = SCM_CHARS(s); str = SCM_CHARS(s);
for(i=0; i<len; i++) { for(i=0; i<len; i++) {
@ -341,17 +341,17 @@ SCM_DEFINE(scm_string_capitalize_x, "string-capitalize!", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_capitalize, "string-capitalize", 1, 0, 0, SCM_DEFINE (scm_string_capitalize, "string-capitalize", 1, 0, 0,
(SCM s), (SCM s),
"") "")
#define FUNC_NAME s_scm_string_capitalize #define FUNC_NAME s_scm_string_capitalize
{ {
SCM_VALIDATE_STRING(1,s); SCM_VALIDATE_STRING (1,s);
return scm_string_capitalize_x(scm_string_copy(s)); return scm_string_capitalize_x(scm_string_copy(s));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_ci_to_symbol, "string-ci->symbol", 1, 0, 0, SCM_DEFINE (scm_string_ci_to_symbol, "string-ci->symbol", 1, 0, 0,
(SCM str), (SCM str),
"") "")
#define FUNC_NAME s_scm_string_ci_to_symbol #define FUNC_NAME s_scm_string_ci_to_symbol

View file

@ -58,8 +58,8 @@ GUILE_PROC1 (scm_string_equal_p, "string=?", scm_tc7_rpsubr,
{ {
register scm_sizet i; register scm_sizet i;
register unsigned char *c1, *c2; register unsigned char *c1, *c2;
SCM_VALIDATE_ROSTRING(1,s1); SCM_VALIDATE_ROSTRING (1,s1);
SCM_VALIDATE_ROSTRING(2,s2); SCM_VALIDATE_ROSTRING (2,s2);
i = SCM_ROLENGTH (s2); i = SCM_ROLENGTH (s2);
if (SCM_ROLENGTH (s1) != i) if (SCM_ROLENGTH (s1) != i)
@ -82,8 +82,8 @@ GUILE_PROC1 (scm_string_ci_equal_p, "string-ci=?", scm_tc7_rpsubr,
{ {
register scm_sizet i; register scm_sizet i;
register unsigned char *c1, *c2; register unsigned char *c1, *c2;
SCM_VALIDATE_ROSTRING(1,s1); SCM_VALIDATE_ROSTRING (1,s1);
SCM_VALIDATE_ROSTRING(2,s2); SCM_VALIDATE_ROSTRING (2,s2);
i = SCM_ROLENGTH (s2); i = SCM_ROLENGTH (s2);
if (SCM_ROLENGTH (s1) != i) if (SCM_ROLENGTH (s1) != i)
@ -108,8 +108,8 @@ GUILE_PROC1 (scm_string_less_p, "string<?", scm_tc7_rpsubr,
register unsigned char *c1, *c2; register unsigned char *c1, *c2;
register int c; register int c;
SCM_VALIDATE_ROSTRING(1,s1); SCM_VALIDATE_ROSTRING (1,s1);
SCM_VALIDATE_ROSTRING(2,s2); SCM_VALIDATE_ROSTRING (2,s2);
len = SCM_ROLENGTH (s1); len = SCM_ROLENGTH (s1);
s2len = SCM_ROLENGTH (s2); s2len = SCM_ROLENGTH (s2);
if (len>s2len) len = s2len; if (len>s2len) len = s2len;
@ -166,8 +166,8 @@ GUILE_PROC1 (scm_string_ci_less_p, "string-ci<?", scm_tc7_rpsubr,
register scm_sizet i, len, s2len; register scm_sizet i, len, s2len;
register unsigned char *c1, *c2; register unsigned char *c1, *c2;
register int c; register int c;
SCM_VALIDATE_ROSTRING(1,s1); SCM_VALIDATE_ROSTRING (1,s1);
SCM_VALIDATE_ROSTRING(2,s2); SCM_VALIDATE_ROSTRING (2,s2);
len = SCM_ROLENGTH (s1); len = SCM_ROLENGTH (s1);
s2len = SCM_ROLENGTH (s2); s2len = SCM_ROLENGTH (s2);
if (len>s2len) len = s2len; if (len>s2len) len = s2len;

View file

@ -295,7 +295,7 @@ SCM scm_strport_to_string (SCM port)
return scm_makfromstr (pt->read_buf, pt->read_buf_size, 0); return scm_makfromstr (pt->read_buf, pt->read_buf_size, 0);
} }
SCM_DEFINE(scm_call_with_output_string, "call-with-output-string", 1, 0, 0, SCM_DEFINE (scm_call_with_output_string, "call-with-output-string", 1, 0, 0,
(SCM proc), (SCM proc),
"Calls the one-argument procedure @var{proc} with a newly created output "Calls the one-argument procedure @var{proc} with a newly created output
port. When the function returns, the string composed of the characters port. When the function returns, the string composed of the characters
@ -337,7 +337,7 @@ scm_strprint_obj (SCM obj)
SCM_DEFINE(scm_call_with_input_string, "call-with-input-string", 2, 0, 0, SCM_DEFINE (scm_call_with_input_string, "call-with-input-string", 2, 0, 0,
(SCM str, SCM proc), (SCM str, SCM proc),
"Calls the one-argument procedure @var{proc} with a newly created input "Calls the one-argument procedure @var{proc} with a newly created input
port from which @var{string}'s contents may be read. The value yielded port from which @var{string}'s contents may be read. The value yielded

View file

@ -81,7 +81,7 @@ indicate that the field is a tail-array.")
#define FUNC_NAME s_scm_make_struct_layout #define FUNC_NAME s_scm_make_struct_layout
{ {
SCM new_sym; SCM new_sym;
SCM_VALIDATE_ROSTRING(1,fields); SCM_VALIDATE_ROSTRING (1,fields);
{ /* scope */ { /* scope */
char * field_desc; char * field_desc;
int len; int len;
@ -390,8 +390,8 @@ can not be initialized by Scheme programs.")
SCM * data; SCM * data;
SCM handle; SCM handle;
SCM_VALIDATE_VTABLE(1,vtable); SCM_VALIDATE_VTABLE (1,vtable);
SCM_VALIDATE_INUM(2,tail_array_size); SCM_VALIDATE_INUM (2,tail_array_size);
layout = SCM_STRUCT_DATA (vtable)[scm_vtable_index_layout]; layout = SCM_STRUCT_DATA (vtable)[scm_vtable_index_layout];
basic_size = SCM_LENGTH (layout) / 2; basic_size = SCM_LENGTH (layout) / 2;
@ -496,8 +496,8 @@ provided, it will be interpreted as a print call-back function.
SCM * data; SCM * data;
SCM handle; SCM handle;
SCM_VALIDATE_ROSTRING(1,extra_fields); SCM_VALIDATE_ROSTRING (1,extra_fields);
SCM_VALIDATE_INUM(2,tail_array_size); SCM_VALIDATE_INUM (2,tail_array_size);
fields = scm_string_append (scm_listify (required_vtable_fields, fields = scm_string_append (scm_listify (required_vtable_fields,
extra_fields, extra_fields,
@ -542,8 +542,8 @@ integer value small enough to fit in one machine word.")
unsigned char field_type = 0; unsigned char field_type = 0;
SCM_VALIDATE_STRUCT(1,handle); SCM_VALIDATE_STRUCT (1,handle);
SCM_VALIDATE_INUM(2,pos); SCM_VALIDATE_INUM (2,pos);
layout = SCM_STRUCT_LAYOUT (handle); layout = SCM_STRUCT_LAYOUT (handle);
data = SCM_STRUCT_DATA (handle); data = SCM_STRUCT_DATA (handle);
@ -619,8 +619,8 @@ SCM_DEFINE (scm_struct_set_x, "struct-set!", 3, 0, 0,
unsigned char * fields_desc; unsigned char * fields_desc;
unsigned char field_type = 0; unsigned char field_type = 0;
SCM_VALIDATE_STRUCT(1,handle); SCM_VALIDATE_STRUCT (1,handle);
SCM_VALIDATE_INUM(2,pos); SCM_VALIDATE_INUM (2,pos);
layout = SCM_STRUCT_LAYOUT (handle); layout = SCM_STRUCT_LAYOUT (handle);
data = SCM_STRUCT_DATA (handle); data = SCM_STRUCT_DATA (handle);
@ -686,7 +686,7 @@ SCM_DEFINE (scm_struct_vtable, "struct-vtable", 1, 0, 0,
"Return the vtable structure that describes the type of @var{struct}.") "Return the vtable structure that describes the type of @var{struct}.")
#define FUNC_NAME s_scm_struct_vtable #define FUNC_NAME s_scm_struct_vtable
{ {
SCM_VALIDATE_STRUCT(1,handle); SCM_VALIDATE_STRUCT (1,handle);
return SCM_STRUCT_VTABLE (handle); return SCM_STRUCT_VTABLE (handle);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -697,7 +697,7 @@ SCM_DEFINE (scm_struct_vtable_tag, "struct-vtable-tag", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_struct_vtable_tag #define FUNC_NAME s_scm_struct_vtable_tag
{ {
SCM_VALIDATE_VTABLE(1,handle); SCM_VALIDATE_VTABLE (1,handle);
return scm_long2num ((long) SCM_STRUCT_DATA (handle) >> 3); return scm_long2num ((long) SCM_STRUCT_DATA (handle) >> 3);
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -736,7 +736,7 @@ SCM_DEFINE (scm_struct_vtable_name, "struct-vtable-name", 1, 0, 0,
"") "")
#define FUNC_NAME s_scm_struct_vtable_name #define FUNC_NAME s_scm_struct_vtable_name
{ {
SCM_VALIDATE_VTABLE(1,vtable); SCM_VALIDATE_VTABLE (1,vtable);
return SCM_STRUCT_TABLE_NAME (SCM_CDR (scm_struct_create_handle (vtable))); return SCM_STRUCT_TABLE_NAME (SCM_CDR (scm_struct_create_handle (vtable)));
} }
#undef FUNC_NAME #undef FUNC_NAME
@ -746,8 +746,8 @@ SCM_DEFINE (scm_set_struct_vtable_name_x, "set-struct-vtable-name!", 2, 0, 0,
"") "")
#define FUNC_NAME s_scm_set_struct_vtable_name_x #define FUNC_NAME s_scm_set_struct_vtable_name_x
{ {
SCM_VALIDATE_VTABLE(1,vtable); SCM_VALIDATE_VTABLE (1,vtable);
SCM_VALIDATE_SYMBOL(2,name); SCM_VALIDATE_SYMBOL (2,name);
SCM_SET_STRUCT_TABLE_NAME (SCM_CDR (scm_struct_create_handle (vtable)), SCM_SET_STRUCT_TABLE_NAME (SCM_CDR (scm_struct_create_handle (vtable)),
name); name);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;

View file

@ -419,7 +419,7 @@ scm_symbol_value0 (const char *name)
return SCM_CDR (vcell); return SCM_CDR (vcell);
} }
SCM_DEFINE(scm_symbol_p, "symbol?", 1, 0, 0, SCM_DEFINE (scm_symbol_p, "symbol?", 1, 0, 0,
(SCM x), (SCM x),
"") "")
#define FUNC_NAME s_scm_symbol_p #define FUNC_NAME s_scm_symbol_p
@ -429,18 +429,18 @@ SCM_DEFINE(scm_symbol_p, "symbol?", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_symbol_to_string, "symbol->string", 1, 0, 0, SCM_DEFINE (scm_symbol_to_string, "symbol->string", 1, 0, 0,
(SCM s), (SCM s),
"") "")
#define FUNC_NAME s_scm_symbol_to_string #define FUNC_NAME s_scm_symbol_to_string
{ {
SCM_VALIDATE_SYMBOL(1,s); SCM_VALIDATE_SYMBOL (1,s);
return scm_makfromstr(SCM_CHARS(s), (scm_sizet)SCM_LENGTH(s), 0); return scm_makfromstr(SCM_CHARS(s), (scm_sizet)SCM_LENGTH(s), 0);
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_to_symbol, "string->symbol", 1, 0, 0, SCM_DEFINE (scm_string_to_symbol, "string->symbol", 1, 0, 0,
(SCM s), (SCM s),
"") "")
#define FUNC_NAME s_scm_string_to_symbol #define FUNC_NAME s_scm_string_to_symbol
@ -448,7 +448,7 @@ SCM_DEFINE(scm_string_to_symbol, "string->symbol", 1, 0, 0,
SCM vcell; SCM vcell;
SCM answer; SCM answer;
SCM_VALIDATE_ROSTRING(1,s); SCM_VALIDATE_ROSTRING (1,s);
vcell = scm_intern(SCM_ROCHARS(s), (scm_sizet)SCM_LENGTH(s)); vcell = scm_intern(SCM_ROCHARS(s), (scm_sizet)SCM_LENGTH(s));
answer = SCM_CAR (vcell); answer = SCM_CAR (vcell);
return answer; return answer;
@ -456,7 +456,7 @@ SCM_DEFINE(scm_string_to_symbol, "string->symbol", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_string_to_obarray_symbol, "string->obarray-symbol", 2, 1, 0, SCM_DEFINE (scm_string_to_obarray_symbol, "string->obarray-symbol", 2, 1, 0,
(SCM o, SCM s, SCM softp), (SCM o, SCM s, SCM softp),
"Intern a new symbol in @var{obarray}, a symbol table, with name "Intern a new symbol in @var{obarray}, a symbol table, with name
@var{string}. @var{string}.
@ -477,7 +477,7 @@ table; instead, simply return @code{#f}.")
SCM answer; SCM answer;
int softness; int softness;
SCM_VALIDATE_ROSTRING(2,s); SCM_VALIDATE_ROSTRING (2,s);
SCM_ASSERT((o == SCM_BOOL_F) SCM_ASSERT((o == SCM_BOOL_F)
|| (o == SCM_BOOL_T) || (o == SCM_BOOL_T)
|| (SCM_VECTORP(o)), || (SCM_VECTORP(o)),
@ -501,7 +501,7 @@ table; instead, simply return @code{#f}.")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_intern_symbol, "intern-symbol", 2, 0, 0, SCM_DEFINE (scm_intern_symbol, "intern-symbol", 2, 0, 0,
(SCM o, SCM s), (SCM o, SCM s),
"Add a new symbol to @var{obarray} with name @var{string}, bound to an "Add a new symbol to @var{obarray} with name @var{string}, bound to an
unspecified initial value. The symbol table is not modified if a symbol unspecified initial value. The symbol table is not modified if a symbol
@ -509,10 +509,10 @@ with this name is already present.")
#define FUNC_NAME s_scm_intern_symbol #define FUNC_NAME s_scm_intern_symbol
{ {
scm_sizet hval; scm_sizet hval;
SCM_VALIDATE_SYMBOL(2,s); SCM_VALIDATE_SYMBOL (2,s);
if (o == SCM_BOOL_F) if (o == SCM_BOOL_F)
o = scm_symhash; o = scm_symhash;
SCM_VALIDATE_VECTOR(1,o); SCM_VALIDATE_VECTOR (1,o);
hval = scm_strhash (SCM_UCHARS (s), SCM_LENGTH (s), SCM_LENGTH(o)); hval = scm_strhash (SCM_UCHARS (s), SCM_LENGTH (s), SCM_LENGTH(o));
/* If the symbol is already interned, simply return. */ /* If the symbol is already interned, simply return. */
SCM_REDEFER_INTS; SCM_REDEFER_INTS;
@ -538,7 +538,7 @@ with this name is already present.")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_unintern_symbol, "unintern-symbol", 2, 0, 0, SCM_DEFINE (scm_unintern_symbol, "unintern-symbol", 2, 0, 0,
(SCM o, SCM s), (SCM o, SCM s),
"Remove the symbol with name @var{string} from @var{obarray}. This "Remove the symbol with name @var{string} from @var{obarray}. This
function returns @code{#t} if the symbol was present and @code{#f} function returns @code{#t} if the symbol was present and @code{#f}
@ -546,10 +546,10 @@ otherwise.")
#define FUNC_NAME s_scm_unintern_symbol #define FUNC_NAME s_scm_unintern_symbol
{ {
scm_sizet hval; scm_sizet hval;
SCM_VALIDATE_SYMBOL(2,s); SCM_VALIDATE_SYMBOL (2,s);
if (o == SCM_BOOL_F) if (o == SCM_BOOL_F)
o = scm_symhash; o = scm_symhash;
SCM_VALIDATE_VECTOR(1,o); SCM_VALIDATE_VECTOR (1,o);
hval = scm_strhash (SCM_UCHARS (s), SCM_LENGTH (s), SCM_LENGTH(o)); hval = scm_strhash (SCM_UCHARS (s), SCM_LENGTH (s), SCM_LENGTH(o));
SCM_DEFER_INTS; SCM_DEFER_INTS;
{ {
@ -578,7 +578,7 @@ otherwise.")
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_symbol_binding, "symbol-binding", 2, 0, 0, SCM_DEFINE (scm_symbol_binding, "symbol-binding", 2, 0, 0,
(SCM o, SCM s), (SCM o, SCM s),
"Look up in @var{obarray} the symbol whose name is @var{string}, and "Look up in @var{obarray} the symbol whose name is @var{string}, and
return the value to which it is bound. If @var{obarray} is @code{#f}, return the value to which it is bound. If @var{obarray} is @code{#f},
@ -587,27 +587,27 @@ use the global symbol table. If @var{string} is not interned in
#define FUNC_NAME s_scm_symbol_binding #define FUNC_NAME s_scm_symbol_binding
{ {
SCM vcell; SCM vcell;
SCM_VALIDATE_SYMBOL(2,s); SCM_VALIDATE_SYMBOL (2,s);
if (o == SCM_BOOL_F) if (o == SCM_BOOL_F)
o = scm_symhash; o = scm_symhash;
SCM_VALIDATE_VECTOR(1,o); SCM_VALIDATE_VECTOR (1,o);
vcell = scm_sym2ovcell (s, o); vcell = scm_sym2ovcell (s, o);
return SCM_CDR(vcell); return SCM_CDR(vcell);
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_symbol_interned_p, "symbol-interned?", 2, 0, 0, SCM_DEFINE (scm_symbol_interned_p, "symbol-interned?", 2, 0, 0,
(SCM o, SCM s), (SCM o, SCM s),
"Return @var{#t} if @var{obarray} contains a symbol with name "Return @var{#t} if @var{obarray} contains a symbol with name
@var{string}, and @var{#f} otherwise.") @var{string}, and @var{#f} otherwise.")
#define FUNC_NAME s_scm_symbol_interned_p #define FUNC_NAME s_scm_symbol_interned_p
{ {
SCM vcell; SCM vcell;
SCM_VALIDATE_SYMBOL(2,s); SCM_VALIDATE_SYMBOL (2,s);
if (o == SCM_BOOL_F) if (o == SCM_BOOL_F)
o = scm_symhash; o = scm_symhash;
SCM_VALIDATE_VECTOR(1,o); SCM_VALIDATE_VECTOR (1,o);
vcell = scm_sym2ovcell_soft (s, o); vcell = scm_sym2ovcell_soft (s, o);
if (SCM_IMP(vcell) && (o == scm_symhash)) if (SCM_IMP(vcell) && (o == scm_symhash))
vcell = scm_sym2ovcell_soft (s, scm_weak_symhash); vcell = scm_sym2ovcell_soft (s, scm_weak_symhash);
@ -618,7 +618,7 @@ SCM_DEFINE(scm_symbol_interned_p, "symbol-interned?", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_symbol_bound_p, "symbol-bound?", 2, 0, 0, SCM_DEFINE (scm_symbol_bound_p, "symbol-bound?", 2, 0, 0,
(SCM o, SCM s), (SCM o, SCM s),
"Return @var{#t} if @var{obarray} contains a symbol with name "Return @var{#t} if @var{obarray} contains a symbol with name
@var{string} bound to a defined value. This differs from @var{string} bound to a defined value. This differs from
@ -628,10 +628,10 @@ been given any meaningful value.")
#define FUNC_NAME s_scm_symbol_bound_p #define FUNC_NAME s_scm_symbol_bound_p
{ {
SCM vcell; SCM vcell;
SCM_VALIDATE_SYMBOL(2,s); SCM_VALIDATE_SYMBOL (2,s);
if (o == SCM_BOOL_F) if (o == SCM_BOOL_F)
o = scm_symhash; o = scm_symhash;
SCM_VALIDATE_VECTOR(1,o); SCM_VALIDATE_VECTOR (1,o);
vcell = scm_sym2ovcell_soft (s, o); vcell = scm_sym2ovcell_soft (s, o);
return (( SCM_NIMP(vcell) return (( SCM_NIMP(vcell)
&& (SCM_CDR(vcell) != SCM_UNDEFINED)) && (SCM_CDR(vcell) != SCM_UNDEFINED))
@ -641,7 +641,7 @@ been given any meaningful value.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_symbol_set_x, "symbol-set!", 3, 0, 0, SCM_DEFINE (scm_symbol_set_x, "symbol-set!", 3, 0, 0,
(SCM o, SCM s, SCM v), (SCM o, SCM s, SCM v),
"Find the symbol in @var{obarray} whose name is @var{string}, and rebind "Find the symbol in @var{obarray} whose name is @var{string}, and rebind
it to @var{value}. An error is signalled if @var{string} is not present it to @var{value}. An error is signalled if @var{string} is not present
@ -649,10 +649,10 @@ in @var{obarray}.")
#define FUNC_NAME s_scm_symbol_set_x #define FUNC_NAME s_scm_symbol_set_x
{ {
SCM vcell; SCM vcell;
SCM_VALIDATE_SYMBOL(2,s); SCM_VALIDATE_SYMBOL (2,s);
if (o == SCM_BOOL_F) if (o == SCM_BOOL_F)
o = scm_symhash; o = scm_symhash;
SCM_VALIDATE_VECTOR(1,o); SCM_VALIDATE_VECTOR (1,o);
vcell = scm_sym2ovcell (s, o); vcell = scm_sym2ovcell (s, o);
SCM_SETCDR (vcell, v); SCM_SETCDR (vcell, v);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
@ -676,12 +676,12 @@ msymbolize (SCM s)
} }
SCM_DEFINE(scm_symbol_fref, "symbol-fref", 1, 0, 0, SCM_DEFINE (scm_symbol_fref, "symbol-fref", 1, 0, 0,
(SCM s), (SCM s),
"Return the contents of @var{symbol}'s @dfn{function slot}.") "Return the contents of @var{symbol}'s @dfn{function slot}.")
#define FUNC_NAME s_scm_symbol_fref #define FUNC_NAME s_scm_symbol_fref
{ {
SCM_VALIDATE_SYMBOL(1,s); SCM_VALIDATE_SYMBOL (1,s);
SCM_DEFER_INTS; SCM_DEFER_INTS;
if (SCM_TYP7(s) == scm_tc7_ssymbol) if (SCM_TYP7(s) == scm_tc7_ssymbol)
msymbolize (s); msymbolize (s);
@ -691,12 +691,12 @@ SCM_DEFINE(scm_symbol_fref, "symbol-fref", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_symbol_pref, "symbol-pref", 1, 0, 0, SCM_DEFINE (scm_symbol_pref, "symbol-pref", 1, 0, 0,
(SCM s), (SCM s),
"Return the @dfn{property list} currently associated with @var{symbol}.") "Return the @dfn{property list} currently associated with @var{symbol}.")
#define FUNC_NAME s_scm_symbol_pref #define FUNC_NAME s_scm_symbol_pref
{ {
SCM_VALIDATE_SYMBOL(1,s); SCM_VALIDATE_SYMBOL (1,s);
SCM_DEFER_INTS; SCM_DEFER_INTS;
if (SCM_TYP7(s) == scm_tc7_ssymbol) if (SCM_TYP7(s) == scm_tc7_ssymbol)
msymbolize (s); msymbolize (s);
@ -706,12 +706,12 @@ SCM_DEFINE(scm_symbol_pref, "symbol-pref", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_symbol_fset_x, "symbol-fset!", 2, 0, 0, SCM_DEFINE (scm_symbol_fset_x, "symbol-fset!", 2, 0, 0,
(SCM s, SCM val), (SCM s, SCM val),
"Change the binding of @var{symbol}'s function slot.") "Change the binding of @var{symbol}'s function slot.")
#define FUNC_NAME s_scm_symbol_fset_x #define FUNC_NAME s_scm_symbol_fset_x
{ {
SCM_VALIDATE_SYMBOL(1,s); SCM_VALIDATE_SYMBOL (1,s);
SCM_DEFER_INTS; SCM_DEFER_INTS;
if (SCM_TYP7(s) == scm_tc7_ssymbol) if (SCM_TYP7(s) == scm_tc7_ssymbol)
msymbolize (s); msymbolize (s);
@ -722,12 +722,12 @@ SCM_DEFINE(scm_symbol_fset_x, "symbol-fset!", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_symbol_pset_x, "symbol-pset!", 2, 0, 0, SCM_DEFINE (scm_symbol_pset_x, "symbol-pset!", 2, 0, 0,
(SCM s, SCM val), (SCM s, SCM val),
"Change the binding of @var{symbol}'s property slot.") "Change the binding of @var{symbol}'s property slot.")
#define FUNC_NAME s_scm_symbol_pset_x #define FUNC_NAME s_scm_symbol_pset_x
{ {
SCM_VALIDATE_SYMBOL(1,s); SCM_VALIDATE_SYMBOL (1,s);
SCM_DEFER_INTS; SCM_DEFER_INTS;
if (SCM_TYP7(s) == scm_tc7_ssymbol) if (SCM_TYP7(s) == scm_tc7_ssymbol)
msymbolize (s); msymbolize (s);
@ -738,13 +738,13 @@ SCM_DEFINE(scm_symbol_pset_x, "symbol-pset!", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_symbol_hash, "symbol-hash", 1, 0, 0, SCM_DEFINE (scm_symbol_hash, "symbol-hash", 1, 0, 0,
(SCM s), (SCM s),
"Return the hash value derived from @var{symbol}'s name, i.e. the integer "Return the hash value derived from @var{symbol}'s name, i.e. the integer
index into @var{symbol}'s obarray at which it is stored.") index into @var{symbol}'s obarray at which it is stored.")
#define FUNC_NAME s_scm_symbol_hash #define FUNC_NAME s_scm_symbol_hash
{ {
SCM_VALIDATE_SYMBOL(1,s); SCM_VALIDATE_SYMBOL (1,s);
if (SCM_TYP7(s) == scm_tc7_ssymbol) if (SCM_TYP7(s) == scm_tc7_ssymbol)
msymbolize (s); msymbolize (s);
return SCM_MAKINUM ((unsigned long)s ^ SCM_SYMBOL_HASH (s)); return SCM_MAKINUM ((unsigned long)s ^ SCM_SYMBOL_HASH (s));
@ -777,7 +777,7 @@ copy_and_prune_obarray (SCM from, SCM to)
} }
SCM_DEFINE(scm_builtin_bindings, "builtin-bindings", 0, 0, 0, SCM_DEFINE (scm_builtin_bindings, "builtin-bindings", 0, 0, 0,
(), (),
"Create and return a copy of the global symbol table, removing all "Create and return a copy of the global symbol table, removing all
unbound symbols.") unbound symbols.")
@ -791,7 +791,7 @@ unbound symbols.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_builtin_weak_bindings, "builtin-weak-bindings", 0, 0, 0, SCM_DEFINE (scm_builtin_weak_bindings, "builtin-weak-bindings", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_builtin_weak_bindings #define FUNC_NAME s_scm_builtin_weak_bindings
@ -818,7 +818,7 @@ prefix for the new symbol's name. The default prefix is @code{%%gensym}.")
if (SCM_UNBNDP (name)) if (SCM_UNBNDP (name))
name = gensym_prefix; name = gensym_prefix;
else else
SCM_VALIDATE_ROSTRING(1,name); SCM_VALIDATE_ROSTRING (1,name);
new = name; new = name;
if (SCM_UNBNDP (obarray)) if (SCM_UNBNDP (obarray))

View file

@ -526,7 +526,7 @@ scm_handle_by_throw (void *handler_data, SCM tag, SCM args)
/* the Scheme-visible CATCH and LAZY-CATCH functions */ /* the Scheme-visible CATCH and LAZY-CATCH functions */
SCM_DEFINE(scm_catch, "catch", 3, 0, 0, SCM_DEFINE (scm_catch, "catch", 3, 0, 0,
(SCM tag, SCM thunk, SCM handler), (SCM tag, SCM thunk, SCM handler),
"Invoke @var{thunk} in the dynamic context of @var{handler} for "Invoke @var{thunk} in the dynamic context of @var{handler} for
exceptions matching @var{key}. If thunk throws to the symbol @var{key}, exceptions matching @var{key}. If thunk throws to the symbol @var{key},
@ -569,7 +569,7 @@ this call to @code{catch}.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_lazy_catch, "lazy-catch", 3, 0, 0, SCM_DEFINE (scm_lazy_catch, "lazy-catch", 3, 0, 0,
(SCM tag, SCM thunk, SCM handler), (SCM tag, SCM thunk, SCM handler),
"") "")
#define FUNC_NAME s_scm_lazy_catch #define FUNC_NAME s_scm_lazy_catch
@ -598,7 +598,7 @@ SCM_DEFINE(scm_lazy_catch, "lazy-catch", 3, 0, 0,
/* throwing */ /* throwing */
SCM_DEFINE(scm_throw, "throw", 1, 0, 1, SCM_DEFINE (scm_throw, "throw", 1, 0, 1,
(SCM key, SCM args), (SCM key, SCM args),
"Invoke the catch form matching @var{key}, passing @var{args} to the "Invoke the catch form matching @var{key}, passing @var{args} to the
@var{handler}. @var{handler}.
@ -609,7 +609,7 @@ SCM_DEFINE(scm_throw, "throw", 1, 0, 1,
If there is no handler at all, an error is signaled.") If there is no handler at all, an error is signaled.")
#define FUNC_NAME s_scm_throw #define FUNC_NAME s_scm_throw
{ {
SCM_VALIDATE_SYMBOL(1,key); SCM_VALIDATE_SYMBOL (1,key);
/* May return if handled by lazy catch. */ /* May return if handled by lazy catch. */
return scm_ithrow (key, args, 1); return scm_ithrow (key, args, 1);
} }

View file

@ -237,7 +237,7 @@ scm_make_uve (long k, SCM prot)
return v; return v;
} }
SCM_DEFINE(scm_uniform_vector_length, "uniform-vector-length", 1, 0, 0, SCM_DEFINE (scm_uniform_vector_length, "uniform-vector-length", 1, 0, 0,
(SCM v), (SCM v),
"Returns the number of elements in @var{uve}.") "Returns the number of elements in @var{uve}.")
#define FUNC_NAME s_scm_uniform_vector_length #define FUNC_NAME s_scm_uniform_vector_length
@ -267,7 +267,7 @@ SCM_DEFINE(scm_uniform_vector_length, "uniform-vector-length", 1, 0, 0,
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_array_p, "array?", 1, 1, 0, SCM_DEFINE (scm_array_p, "array?", 1, 1, 0,
(SCM v, SCM prot), (SCM v, SCM prot),
"Returns @code{#t} if the @var{obj} is an array, and @code{#f} if not. "Returns @code{#t} if the @var{obj} is an array, and @code{#f} if not.
@ -335,7 +335,7 @@ loop:
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_array_rank, "array-rank", 1, 0, 0, SCM_DEFINE (scm_array_rank, "array-rank", 1, 0, 0,
(SCM ra), (SCM ra),
"Returns the number of dimensions of @var{obj}. If @var{obj} is not an "Returns the number of dimensions of @var{obj}. If @var{obj} is not an
array, @code{0} is returned.") array, @code{0} is returned.")
@ -370,7 +370,7 @@ array, @code{0} is returned.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_array_dimensions, "array-dimensions", 1, 0, 0, SCM_DEFINE (scm_array_dimensions, "array-dimensions", 1, 0, 0,
(SCM ra), (SCM ra),
"@code{Array-dimensions} is similar to @code{array-shape} but replaces "@code{Array-dimensions} is similar to @code{array-shape} but replaces
elements with a @code{0} minimum with one greater than the maximum. So: elements with a @code{0} minimum with one greater than the maximum. So:
@ -508,7 +508,7 @@ scm_shap2ra (SCM args, const char *what)
return ra; return ra;
} }
SCM_DEFINE(scm_dimensions_to_uniform_array, "dimensions->uniform-array", 2, 1, 0, SCM_DEFINE (scm_dimensions_to_uniform_array, "dimensions->uniform-array", 2, 1, 0,
(SCM dims, SCM prot, SCM fill), (SCM dims, SCM prot, SCM fill),
"@deffnx primitive make-uniform-vector length prototype [fill] "@deffnx primitive make-uniform-vector length prototype [fill]
Creates and returns a uniform array or vector of type corresponding to Creates and returns a uniform array or vector of type corresponding to
@ -619,7 +619,7 @@ scm_ra_set_contp (SCM ra)
} }
SCM_DEFINE(scm_make_shared_array, "make-shared-array", 2, 0, 1, SCM_DEFINE (scm_make_shared_array, "make-shared-array", 2, 0, 1,
(SCM oldra, SCM mapfunc, SCM dims), (SCM oldra, SCM mapfunc, SCM dims),
"@code{make-shared-array} can be used to create shared subarrays of other "@code{make-shared-array} can be used to create shared subarrays of other
arrays. The @var{mapper} is a function that translates coordinates in arrays. The @var{mapper} is a function that translates coordinates in
@ -644,8 +644,8 @@ it can be otherwise arbitrary. A simple example:
scm_sizet i, k; scm_sizet i, k;
long old_min, new_min, old_max, new_max; long old_min, new_min, old_max, new_max;
scm_array_dim *s; scm_array_dim *s;
SCM_VALIDATE_ARRAY(1,oldra); SCM_VALIDATE_ARRAY (1,oldra);
SCM_VALIDATE_PROC(2,mapfunc); SCM_VALIDATE_PROC (2,mapfunc);
ra = scm_shap2ra (dims, FUNC_NAME); ra = scm_shap2ra (dims, FUNC_NAME);
if (SCM_ARRAYP (oldra)) if (SCM_ARRAYP (oldra))
{ {
@ -745,7 +745,7 @@ it can be otherwise arbitrary. A simple example:
/* args are RA . DIMS */ /* args are RA . DIMS */
SCM_DEFINE(scm_transpose_array, "transpose-array", 0, 0, 1, SCM_DEFINE (scm_transpose_array, "transpose-array", 0, 0, 1,
(SCM args), (SCM args),
"Returns an array sharing contents with @var{array}, but with dimensions "Returns an array sharing contents with @var{array}, but with dimensions
arranged in a different order. There must be one @var{dim} argument for arranged in a different order. There must be one @var{dim} argument for
@ -857,7 +857,7 @@ examples:
#undef FUNC_NAME #undef FUNC_NAME
/* args are RA . AXES */ /* args are RA . AXES */
SCM_DEFINE(scm_enclose_array, "enclose-array", 0, 0, 1, SCM_DEFINE (scm_enclose_array, "enclose-array", 0, 0, 1,
(SCM axes), (SCM axes),
"@var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than "@var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than
the rank of @var{array}. @var{enclose-array} returns an array the rank of @var{array}. @var{enclose-array} returns an array
@ -960,7 +960,7 @@ examples:
SCM_DEFINE(scm_array_in_bounds_p, "array-in-bounds?", 0, 0, 1, SCM_DEFINE (scm_array_in_bounds_p, "array-in-bounds?", 0, 0, 1,
(SCM args), (SCM args),
"Returns @code{#t} if its arguments would be acceptable to array-ref.") "Returns @code{#t} if its arguments would be acceptable to array-ref.")
#define FUNC_NAME s_scm_array_in_bounds_p #define FUNC_NAME s_scm_array_in_bounds_p
@ -1043,7 +1043,7 @@ tail:
SCM_REGISTER_PROC(s_array_ref, "array-ref", 1, 0, 1, scm_uniform_vector_ref); SCM_REGISTER_PROC(s_array_ref, "array-ref", 1, 0, 1, scm_uniform_vector_ref);
SCM_DEFINE(scm_uniform_vector_ref, "uniform-vector-ref", 2, 0, 0, SCM_DEFINE (scm_uniform_vector_ref, "uniform-vector-ref", 2, 0, 0,
(SCM v, SCM args), (SCM v, SCM args),
"Returns the element at the @code{(index1, index2)} element in @var{array}.") "Returns the element at the @code{(index1, index2)} element in @var{array}.")
#define FUNC_NAME s_scm_uniform_vector_ref #define FUNC_NAME s_scm_uniform_vector_ref
@ -1071,7 +1071,7 @@ SCM_DEFINE(scm_uniform_vector_ref, "uniform-vector-ref", 2, 0, 0,
} }
else else
{ {
SCM_VALIDATE_INUM(2,args); SCM_VALIDATE_INUM (2,args);
pos = SCM_INUM (args); pos = SCM_INUM (args);
} }
SCM_ASRTGO (pos >= 0 && pos < SCM_LENGTH (v), outrng); SCM_ASRTGO (pos >= 0 && pos < SCM_LENGTH (v), outrng);
@ -1237,7 +1237,7 @@ SCM_REGISTER_PROC(s_uniform_array_set1_x, "uniform-array-set1!", 3, 0, 0, scm_ar
/* Note that args may be a list or an immediate object, depending which /* Note that args may be a list or an immediate object, depending which
PROC is used (and it's called from C too). */ PROC is used (and it's called from C too). */
SCM_DEFINE(scm_array_set_x, "array-set!", 2, 0, 1, SCM_DEFINE (scm_array_set_x, "array-set!", 2, 0, 1,
(SCM v, SCM obj, SCM args), (SCM v, SCM obj, SCM args),
"Sets the element at the @code{(index1, index2)} element in @var{array} to "Sets the element at the @code{(index1, index2)} element in @var{array} to
@var{new-value}. The value returned by array-set! is unspecified.") @var{new-value}. The value returned by array-set! is unspecified.")
@ -1261,7 +1261,7 @@ SCM_DEFINE(scm_array_set_x, "array-set!", 2, 0, 1,
} }
else else
{ {
SCM_VALIDATE_INUM_COPY(3,args,pos); SCM_VALIDATE_INUM_COPY (3,args,pos);
} }
SCM_ASRTGO (pos >= 0 && pos < SCM_LENGTH (v), outrng); SCM_ASRTGO (pos >= 0 && pos < SCM_LENGTH (v), outrng);
} }
@ -1343,7 +1343,7 @@ SCM_DEFINE(scm_array_set_x, "array-set!", 2, 0, 1,
returns the unrolled array or #f if it can't be done. */ returns the unrolled array or #f if it can't be done. */
/* if strict is not SCM_UNDEFINED, return #f if returned array /* if strict is not SCM_UNDEFINED, return #f if returned array
wouldn't have contiguous elements. */ wouldn't have contiguous elements. */
SCM_DEFINE(scm_array_contents, "array-contents", 1, 1, 0, SCM_DEFINE (scm_array_contents, "array-contents", 1, 1, 0,
(SCM ra, SCM strict), (SCM ra, SCM strict),
"@deffnx primitive array-contents array strict "@deffnx primitive array-contents array strict
If @var{array} may be @dfn{unrolled} into a one dimensional shared array If @var{array} may be @dfn{unrolled} into a one dimensional shared array
@ -1449,7 +1449,7 @@ scm_ra2contig (SCM ra, int copy)
SCM_DEFINE(scm_uniform_array_read_x, "uniform-array-read!", 1, 3, 0, SCM_DEFINE (scm_uniform_array_read_x, "uniform-array-read!", 1, 3, 0,
(SCM ra, SCM port_or_fd, SCM start, SCM end), (SCM ra, SCM port_or_fd, SCM start, SCM end),
"@deffnx primitive uniform-vector-read! uve [port-or-fdes] [start] [end] "@deffnx primitive uniform-vector-read! uve [port-or-fdes] [start] [end]
Attempts to read all elements of @var{ura}, in lexicographic order, as Attempts to read all elements of @var{ura}, in lexicographic order, as
@ -1609,7 +1609,7 @@ loop:
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_uniform_array_write, "uniform-array-write", 1, 3, 0, SCM_DEFINE (scm_uniform_array_write, "uniform-array-write", 1, 3, 0,
(SCM v, SCM port_or_fd, SCM start, SCM end), (SCM v, SCM port_or_fd, SCM start, SCM end),
"@deffnx primitive uniform-vector-write uve [port-or-fdes] [start] [end] "@deffnx primitive uniform-vector-write uve [port-or-fdes] [start] [end]
Writes all elements of @var{ura} as binary objects to Writes all elements of @var{ura} as binary objects to
@ -1734,14 +1734,14 @@ loop:
static char cnt_tab[16] = static char cnt_tab[16] =
{0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
SCM_DEFINE(scm_bit_count, "bit-count", 2, 0, 0, SCM_DEFINE (scm_bit_count, "bit-count", 2, 0, 0,
(SCM item, SCM seq), (SCM item, SCM seq),
"Returns the number occurrences of @var{bool} in @var{bv}.") "Returns the number occurrences of @var{bool} in @var{bv}.")
#define FUNC_NAME s_scm_bit_count #define FUNC_NAME s_scm_bit_count
{ {
long i; long i;
register unsigned long cnt = 0, w; register unsigned long cnt = 0, w;
SCM_VALIDATE_INUM(2,seq); SCM_VALIDATE_INUM (2,seq);
switch SCM_TYP7 (seq) switch SCM_TYP7 (seq)
{ {
default: default:
@ -1769,7 +1769,7 @@ SCM_DEFINE(scm_bit_count, "bit-count", 2, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_bit_position, "bit-position", 3, 0, 0, SCM_DEFINE (scm_bit_position, "bit-position", 3, 0, 0,
(SCM item, SCM v, SCM k), (SCM item, SCM v, SCM k),
"Returns the minimum index of an occurrence of @var{bool} in @var{bv} "Returns the minimum index of an occurrence of @var{bool} in @var{bv}
which is at least @var{k}. If no @var{bool} occurs within the specified which is at least @var{k}. If no @var{bool} occurs within the specified
@ -1779,7 +1779,7 @@ range @code{#f} is returned.")
long i, lenw, xbits, pos; long i, lenw, xbits, pos;
register unsigned long w; register unsigned long w;
SCM_VALIDATE_NIM (2,v); SCM_VALIDATE_NIM (2,v);
SCM_VALIDATE_INUM_COPY(3,k,pos); SCM_VALIDATE_INUM_COPY (3,k,pos);
SCM_ASSERT ((pos <= SCM_LENGTH (v)) && (pos >= 0), SCM_ASSERT ((pos <= SCM_LENGTH (v)) && (pos >= 0),
k, SCM_OUTOFRANGE, FUNC_NAME); k, SCM_OUTOFRANGE, FUNC_NAME);
if (pos == SCM_LENGTH (v)) if (pos == SCM_LENGTH (v))
@ -1837,7 +1837,7 @@ range @code{#f} is returned.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_bit_set_star_x, "bit-set*!", 3, 0, 0, SCM_DEFINE (scm_bit_set_star_x, "bit-set*!", 3, 0, 0,
(SCM v, SCM kv, SCM obj), (SCM v, SCM kv, SCM obj),
"If uve is a bit-vector @var{bv} and uve must be of the same length. If "If uve is a bit-vector @var{bv} and uve must be of the same length. If
@var{bool} is @code{#t}, uve is OR'ed into @var{bv}; If @var{bool} is @code{#f}, the @var{bool} is @code{#t}, uve is OR'ed into @var{bv}; If @var{bool} is @code{#f}, the
@ -1899,7 +1899,7 @@ The return value is unspecified.")
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_bit_count_star, "bit-count*", 3, 0, 0, SCM_DEFINE (scm_bit_count_star, "bit-count*", 3, 0, 0,
(SCM v, SCM kv, SCM obj), (SCM v, SCM kv, SCM obj),
"Returns "Returns
@example @example
@ -1967,7 +1967,7 @@ SCM_DEFINE(scm_bit_count_star, "bit-count*", 3, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_bit_invert_x, "bit-invert!", 1, 0, 0, SCM_DEFINE (scm_bit_invert_x, "bit-invert!", 1, 0, 0,
(SCM v), (SCM v),
"Modifies @var{bv} by replacing each element with its negation.") "Modifies @var{bv} by replacing each element with its negation.")
#define FUNC_NAME s_scm_bit_invert_x #define FUNC_NAME s_scm_bit_invert_x
@ -2050,7 +2050,7 @@ ra2l (SCM ra,scm_sizet base,scm_sizet k)
} }
SCM_DEFINE(scm_array_to_list, "array->list", 1, 0, 0, SCM_DEFINE (scm_array_to_list, "array->list", 1, 0, 0,
(SCM v), (SCM v),
"Returns a list consisting of all the elements, in order, of @var{array}.") "Returns a list consisting of all the elements, in order, of @var{array}.")
#define FUNC_NAME s_scm_array_to_list #define FUNC_NAME s_scm_array_to_list
@ -2157,7 +2157,7 @@ static char s_bad_ralst[] = "Bad scm_array contents list";
static int l2ra(SCM lst, SCM ra, scm_sizet base, scm_sizet k); static int l2ra(SCM lst, SCM ra, scm_sizet base, scm_sizet k);
SCM_DEFINE(scm_list_to_uniform_array, "list->uniform-array", 3, 0, 0, SCM_DEFINE (scm_list_to_uniform_array, "list->uniform-array", 3, 0, 0,
(SCM ndim, SCM prot, SCM lst), (SCM ndim, SCM prot, SCM lst),
"@deffnx procedure list->uniform-vector prot lst "@deffnx procedure list->uniform-vector prot lst
Returns a uniform array of the type indicated by prototype @var{prot} Returns a uniform array of the type indicated by prototype @var{prot}
@ -2170,7 +2170,7 @@ appropriate type, no coercions are done.")
SCM ra; SCM ra;
scm_sizet k; scm_sizet k;
long n; long n;
SCM_VALIDATE_INUM_COPY(1,ndim,k); SCM_VALIDATE_INUM_COPY (1,ndim,k);
while (k--) while (k--)
{ {
n = scm_ilength (row); n = scm_ilength (row);
@ -2512,7 +2512,7 @@ tail:
return 1; return 1;
} }
SCM_DEFINE(scm_array_prototype, "array-prototype", 1, 0, 0, SCM_DEFINE (scm_array_prototype, "array-prototype", 1, 0, 0,
(SCM ra), (SCM ra),
"Returns an object that would produce an array of the same type as "Returns an object that would produce an array of the same type as
@var{array}, if used as the @var{prototype} for @var{array}, if used as the @var{prototype} for

View file

@ -99,7 +99,7 @@ make_vcell_variable (SCM vcell)
SCM_RETURN_NEWSMOB (scm_tc16_variable, vcell); SCM_RETURN_NEWSMOB (scm_tc16_variable, vcell);
} }
SCM_DEFINE(scm_make_variable, "make-variable", 1, 1, 0, SCM_DEFINE (scm_make_variable, "make-variable", 1, 1, 0,
(SCM init, SCM name_hint), (SCM init, SCM name_hint),
"") "")
#define FUNC_NAME s_scm_make_variable #define FUNC_NAME s_scm_make_variable
@ -119,7 +119,7 @@ SCM_DEFINE(scm_make_variable, "make-variable", 1, 1, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_make_undefined_variable, "make-undefined-variable", 0, 1, 0, SCM_DEFINE (scm_make_undefined_variable, "make-undefined-variable", 0, 1, 0,
(SCM name_hint), (SCM name_hint),
"") "")
#define FUNC_NAME s_scm_make_undefined_variable #define FUNC_NAME s_scm_make_undefined_variable
@ -139,7 +139,7 @@ SCM_DEFINE(scm_make_undefined_variable, "make-undefined-variable", 0, 1, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_variable_p, "variable?", 1, 0, 0, SCM_DEFINE (scm_variable_p, "variable?", 1, 0, 0,
(SCM obj), (SCM obj),
"") "")
#define FUNC_NAME s_scm_variable_p #define FUNC_NAME s_scm_variable_p
@ -149,31 +149,31 @@ SCM_DEFINE(scm_variable_p, "variable?", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_variable_ref, "variable-ref", 1, 0, 0, SCM_DEFINE (scm_variable_ref, "variable-ref", 1, 0, 0,
(SCM var), (SCM var),
"") "")
#define FUNC_NAME s_scm_variable_ref #define FUNC_NAME s_scm_variable_ref
{ {
SCM_VALIDATE_VARIABLE(1,var); SCM_VALIDATE_VARIABLE (1,var);
return SCM_CDR (SCM_CDR (var)); return SCM_CDR (SCM_CDR (var));
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_variable_set_x, "variable-set!", 2, 0, 0, SCM_DEFINE (scm_variable_set_x, "variable-set!", 2, 0, 0,
(SCM var, SCM val), (SCM var, SCM val),
"") "")
#define FUNC_NAME s_scm_variable_set_x #define FUNC_NAME s_scm_variable_set_x
{ {
SCM_VALIDATE_VARIABLE(1,var); SCM_VALIDATE_VARIABLE (1,var);
SCM_SETCDR (SCM_CDR (var), val); SCM_SETCDR (SCM_CDR (var), val);
return SCM_UNSPECIFIED; return SCM_UNSPECIFIED;
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_builtin_variable, "builtin-variable", 1, 0, 0, SCM_DEFINE (scm_builtin_variable, "builtin-variable", 1, 0, 0,
(SCM name), (SCM name),
"") "")
#define FUNC_NAME s_scm_builtin_variable #define FUNC_NAME s_scm_builtin_variable
@ -181,7 +181,7 @@ SCM_DEFINE(scm_builtin_variable, "builtin-variable", 1, 0, 0,
SCM vcell; SCM vcell;
SCM var_slot; SCM var_slot;
SCM_VALIDATE_SYMBOL(1,name); SCM_VALIDATE_SYMBOL (1,name);
vcell = scm_sym2vcell (name, SCM_BOOL_F, SCM_BOOL_T); vcell = scm_sym2vcell (name, SCM_BOOL_F, SCM_BOOL_T);
if (vcell == SCM_BOOL_F) if (vcell == SCM_BOOL_F)
return SCM_BOOL_F; return SCM_BOOL_F;
@ -200,12 +200,12 @@ SCM_DEFINE(scm_builtin_variable, "builtin-variable", 1, 0, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_variable_bound_p, "variable-bound?", 1, 0, 0, SCM_DEFINE (scm_variable_bound_p, "variable-bound?", 1, 0, 0,
(SCM var), (SCM var),
"") "")
#define FUNC_NAME s_scm_variable_bound_p #define FUNC_NAME s_scm_variable_bound_p
{ {
SCM_VALIDATE_VARIABLE(1,var); SCM_VALIDATE_VARIABLE (1,var);
return SCM_NEGATE_BOOL(SCM_UNBNDP (SCM_CDR (SCM_VARVCELL (var)))); return SCM_NEGATE_BOOL(SCM_UNBNDP (SCM_CDR (SCM_VARVCELL (var))));
} }
#undef FUNC_NAME #undef FUNC_NAME

View file

@ -204,7 +204,7 @@ SCM_DEFINE (scm_make_vector, "make-vector", 1, 1, 0,
register long j; register long j;
register SCM *velts; register SCM *velts;
SCM_VALIDATE_INUM_MIN(1,k,0); SCM_VALIDATE_INUM_MIN (1,k,0);
if (SCM_UNBNDP(fill)) if (SCM_UNBNDP(fill))
fill = SCM_UNSPECIFIED; fill = SCM_UNSPECIFIED;
i = SCM_INUM(k); i = SCM_INUM(k);
@ -221,7 +221,7 @@ SCM_DEFINE (scm_make_vector, "make-vector", 1, 1, 0,
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_vector_to_list, "vector->list", 1, 0, 0, SCM_DEFINE (scm_vector_to_list, "vector->list", 1, 0, 0,
(SCM v), (SCM v),
"") "")
#define FUNC_NAME s_scm_vector_to_list #define FUNC_NAME s_scm_vector_to_list
@ -229,7 +229,7 @@ SCM_DEFINE(scm_vector_to_list, "vector->list", 1, 0, 0,
SCM res = SCM_EOL; SCM res = SCM_EOL;
long i; long i;
SCM *data; SCM *data;
SCM_VALIDATE_VECTOR(1,v); SCM_VALIDATE_VECTOR (1,v);
data = SCM_VELTS(v); data = SCM_VELTS(v);
for(i = SCM_LENGTH(v)-1;i >= 0;i--) res = scm_cons(data[i], res); for(i = SCM_LENGTH(v)-1;i >= 0;i--) res = scm_cons(data[i], res);
return res; return res;
@ -244,7 +244,7 @@ SCM_DEFINE (scm_vector_fill_x, "vector-fill!", 2, 0, 0,
{ {
register long i; register long i;
register SCM *data; register SCM *data;
SCM_VALIDATE_VECTOR(1,v); SCM_VALIDATE_VECTOR (1,v);
data = SCM_VELTS(v); data = SCM_VELTS(v);
for(i = SCM_LENGTH(v) - 1; i >= 0; i--) for(i = SCM_LENGTH(v) - 1; i >= 0; i--)
data[i] = fill_x; data[i] = fill_x;
@ -274,11 +274,11 @@ SCM_DEFINE (scm_vector_move_left_x, "vector-move-left!", 5, 0, 0,
long j; long j;
long e; long e;
SCM_VALIDATE_VECTOR(1,vec1); SCM_VALIDATE_VECTOR (1,vec1);
SCM_VALIDATE_INUM_COPY(2,start1,i); SCM_VALIDATE_INUM_COPY (2,start1,i);
SCM_VALIDATE_INUM_COPY(3,end1,e); SCM_VALIDATE_INUM_COPY (3,end1,e);
SCM_VALIDATE_VECTOR(4,vec2); SCM_VALIDATE_VECTOR (4,vec2);
SCM_VALIDATE_INUM_COPY(5,start2,j); SCM_VALIDATE_INUM_COPY (5,start2,j);
SCM_ASSERT (i <= SCM_LENGTH (vec1) && i >= 0, start1, SCM_OUTOFRANGE, FUNC_NAME); SCM_ASSERT (i <= SCM_LENGTH (vec1) && i >= 0, start1, SCM_OUTOFRANGE, FUNC_NAME);
SCM_ASSERT (j <= SCM_LENGTH (vec2) && j >= 0, start2, SCM_OUTOFRANGE, FUNC_NAME); SCM_ASSERT (j <= SCM_LENGTH (vec2) && j >= 0, start2, SCM_OUTOFRANGE, FUNC_NAME);
SCM_ASSERT (e <= SCM_LENGTH (vec1) && e >= 0, end1, SCM_OUTOFRANGE, FUNC_NAME); SCM_ASSERT (e <= SCM_LENGTH (vec1) && e >= 0, end1, SCM_OUTOFRANGE, FUNC_NAME);
@ -297,11 +297,11 @@ SCM_DEFINE (scm_vector_move_right_x, "vector-move-right!", 5, 0, 0,
long j; long j;
long e; long e;
SCM_VALIDATE_VECTOR(1,vec1); SCM_VALIDATE_VECTOR (1,vec1);
SCM_VALIDATE_INUM_COPY(2,start1,i); SCM_VALIDATE_INUM_COPY (2,start1,i);
SCM_VALIDATE_INUM_COPY(3,end1,e); SCM_VALIDATE_INUM_COPY (3,end1,e);
SCM_VALIDATE_VECTOR(4,vec2); SCM_VALIDATE_VECTOR (4,vec2);
SCM_VALIDATE_INUM_COPY(5,start2,j); SCM_VALIDATE_INUM_COPY (5,start2,j);
SCM_ASSERT (i <= SCM_LENGTH (vec1) && i >= 0, start1, SCM_OUTOFRANGE, FUNC_NAME); SCM_ASSERT (i <= SCM_LENGTH (vec1) && i >= 0, start1, SCM_OUTOFRANGE, FUNC_NAME);
SCM_ASSERT (j <= SCM_LENGTH (vec2) && j >= 0, start2, SCM_OUTOFRANGE, FUNC_NAME); SCM_ASSERT (j <= SCM_LENGTH (vec2) && j >= 0, start2, SCM_OUTOFRANGE, FUNC_NAME);
SCM_ASSERT (e <= SCM_LENGTH (vec1) && e >= 0, end1, SCM_OUTOFRANGE, FUNC_NAME); SCM_ASSERT (e <= SCM_LENGTH (vec1) && e >= 0, end1, SCM_OUTOFRANGE, FUNC_NAME);

View file

@ -52,7 +52,7 @@
/* Return a Scheme string containing Guile's major version number. */ /* Return a Scheme string containing Guile's major version number. */
SCM_DEFINE(scm_major_version, "major-version", 0, 0, 0, SCM_DEFINE (scm_major_version, "major-version", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_major_version #define FUNC_NAME s_scm_major_version
@ -63,7 +63,7 @@ SCM_DEFINE(scm_major_version, "major-version", 0, 0, 0,
/* Return a Scheme string containing Guile's minor version number. */ /* Return a Scheme string containing Guile's minor version number. */
SCM_DEFINE(scm_minor_version, "minor-version", 0, 0, 0, SCM_DEFINE (scm_minor_version, "minor-version", 0, 0, 0,
(), (),
"") "")
#define FUNC_NAME s_scm_minor_version #define FUNC_NAME s_scm_minor_version
@ -74,7 +74,7 @@ SCM_DEFINE(scm_minor_version, "minor-version", 0, 0, 0,
/* Return a Scheme string containing Guile's complete version. */ /* Return a Scheme string containing Guile's complete version. */
SCM_DEFINE(scm_version, "version", 0, 0, 0, SCM_DEFINE (scm_version, "version", 0, 0, 0,
(), (),
"@deffnx primitive major-version "@deffnx primitive major-version
@deffnx primitive minor-version @deffnx primitive minor-version

View file

@ -137,7 +137,7 @@ sf_close (SCM port)
SCM_DEFINE(scm_make_soft_port, "make-soft-port", 2, 0, 0, SCM_DEFINE (scm_make_soft_port, "make-soft-port", 2, 0, 0,
(SCM pv, SCM modes), (SCM pv, SCM modes),
"Returns a port capable of receiving or delivering characters as "Returns a port capable of receiving or delivering characters as
specified by the @var{modes} string (@pxref{File Ports, specified by the @var{modes} string (@pxref{File Ports,
@ -183,8 +183,8 @@ the port has reached end-of-file. For example:
{ {
scm_port *pt; scm_port *pt;
SCM z; SCM z;
SCM_VALIDATE_VECTOR_LEN(1,pv,5); SCM_VALIDATE_VECTOR_LEN (1,pv,5);
SCM_VALIDATE_ROSTRING(2,modes); SCM_VALIDATE_ROSTRING (2,modes);
SCM_COERCE_SUBSTR (modes); SCM_COERCE_SUBSTR (modes);
SCM_NEWCELL (z); SCM_NEWCELL (z);
SCM_DEFER_INTS; SCM_DEFER_INTS;

View file

@ -55,7 +55,7 @@
*/ */
SCM_DEFINE(scm_make_weak_vector, "make-weak-vector", 1, 1, 0, SCM_DEFINE (scm_make_weak_vector, "make-weak-vector", 1, 1, 0,
(SCM k, SCM fill), (SCM k, SCM fill),
"Return a weak vector with @var{size} elements. If the optional "Return a weak vector with @var{size} elements. If the optional
argument @var{fill} is given, all entries in the vector will be set to argument @var{fill} is given, all entries in the vector will be set to
@ -77,7 +77,7 @@ argument @var{fill} is given, all entries in the vector will be set to
SCM_REGISTER_PROC(s_list_to_weak_vector, "list->weak-vector", 1, 0, 0, scm_weak_vector); SCM_REGISTER_PROC(s_list_to_weak_vector, "list->weak-vector", 1, 0, 0, scm_weak_vector);
SCM_DEFINE(scm_weak_vector, "weak-vector", 0, 0, 1, SCM_DEFINE (scm_weak_vector, "weak-vector", 0, 0, 1,
(SCM l), (SCM l),
"@deffnx primitive list->weak-vector l "@deffnx primitive list->weak-vector l
Construct a weak vector from a list: @code{weak-vector} uses the list of Construct a weak vector from a list: @code{weak-vector} uses the list of
@ -103,7 +103,7 @@ its arguments while @code{list->weak-vector} uses its only argument
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_weak_vector_p, "weak-vector?", 1, 0, 0, SCM_DEFINE (scm_weak_vector_p, "weak-vector?", 1, 0, 0,
(SCM x), (SCM x),
"Return @var{#t} if @var{obj} is a weak vector. Note that all weak "Return @var{#t} if @var{obj} is a weak vector. Note that all weak
hashes are also weak vectors.") hashes are also weak vectors.")
@ -119,7 +119,7 @@ hashes are also weak vectors.")
SCM_DEFINE(scm_make_weak_key_hash_table, "make-weak-key-hash-table", 1, 0, 0, SCM_DEFINE (scm_make_weak_key_hash_table, "make-weak-key-hash-table", 1, 0, 0,
(SCM k), (SCM k),
"@deffnx primitive make-weak-value-hash-table size "@deffnx primitive make-weak-value-hash-table size
@deffnx primitive make-doubly-weak-hash-table size @deffnx primitive make-doubly-weak-hash-table size
@ -131,7 +131,7 @@ regular hash tables. (@pxref{Hash Tables})")
#define FUNC_NAME s_scm_make_weak_key_hash_table #define FUNC_NAME s_scm_make_weak_key_hash_table
{ {
SCM v; SCM v;
SCM_VALIDATE_INUM(1,k); SCM_VALIDATE_INUM (1,k);
v = scm_make_weak_vector (k, SCM_EOL); v = scm_make_weak_vector (k, SCM_EOL);
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
SCM_VELTS (v)[-1] = 1; SCM_VELTS (v)[-1] = 1;
@ -147,7 +147,7 @@ SCM_DEFINE (scm_make_weak_value_hash_table, "make-weak-value-hash-table", 1, 0,
#define FUNC_NAME s_scm_make_weak_value_hash_table #define FUNC_NAME s_scm_make_weak_value_hash_table
{ {
SCM v; SCM v;
SCM_VALIDATE_INUM(1,k); SCM_VALIDATE_INUM (1,k);
v = scm_make_weak_vector (k, SCM_EOL); v = scm_make_weak_vector (k, SCM_EOL);
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
SCM_VELTS (v)[-1] = 2; SCM_VELTS (v)[-1] = 2;
@ -164,7 +164,7 @@ SCM_DEFINE (scm_make_doubly_weak_hash_table, "make-doubly-weak-hash-table", 1, 0
#define FUNC_NAME s_scm_make_doubly_weak_hash_table #define FUNC_NAME s_scm_make_doubly_weak_hash_table
{ {
SCM v; SCM v;
SCM_VALIDATE_INUM(1,k); SCM_VALIDATE_INUM (1,k);
v = scm_make_weak_vector (k, SCM_EOL); v = scm_make_weak_vector (k, SCM_EOL);
SCM_ALLOW_INTS; SCM_ALLOW_INTS;
SCM_VELTS (v)[-1] = 3; SCM_VELTS (v)[-1] = 3;
@ -173,7 +173,7 @@ SCM_DEFINE (scm_make_doubly_weak_hash_table, "make-doubly-weak-hash-table", 1, 0
} }
#undef FUNC_NAME #undef FUNC_NAME
SCM_DEFINE(scm_weak_key_hash_table_p, "weak-key-hash-table?", 1, 0, 0, SCM_DEFINE (scm_weak_key_hash_table_p, "weak-key-hash-table?", 1, 0, 0,
(SCM x), (SCM x),
"@deffnx primitive weak-value-hash-table? obj "@deffnx primitive weak-value-hash-table? obj
@deffnx primitive doubly-weak-hash-table? obj @deffnx primitive doubly-weak-hash-table? obj