-/* Copyright (C) 1995, 1996, 1998 Free Software Foundation
+/* Copyright (C) 1995, 1996, 1998, 2000 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
\f
-#include <stdio.h>
-#include "_scm.h"
+#include "libguile/_scm.h"
+#include "libguile/strings.h"
-#include "options.h"
+#include "libguile/options.h"
\f
/* {Run-time options}
SCM
scm_options (SCM arg, scm_option options[], int n, const char *s)
{
- int i, docp = (!SCM_UNBNDP (arg)
- && !SCM_NULLP (arg)
- && (SCM_IMP (arg) || SCM_NCONSP (arg)));
+ int i, docp = (!SCM_UNBNDP (arg) && !SCM_NULLP (arg) && !SCM_CONSP (arg));
/* Let `arg' GC protect the arguments */
SCM new_mode = arg, ans = SCM_EOL, ls;
for (i = 0; i < n; ++i)
goto cont;
case SCM_OPTION_SCM:
new_mode = SCM_CDR (new_mode);
- flags[i] = SCM_CARW (new_mode);
+ flags[i] = SCM_UNPACK (SCM_CAR (new_mode));
goto cont;
}
#ifndef SCM_RECKLESS
scm_must_free ((char *) flags);
- scm_wta (SCM_CAR (new_mode), "Unknown mode flag", s);
+ scm_misc_error (s, "Unknown mode flag: ~S",
+ SCM_LIST1 (SCM_CAR (new_mode)));
#endif
cont:
new_mode = SCM_CDR (new_mode);
}
for (i = 0; i < n; ++i)
{
- // scm_option doesn't know if its a long or an SCM
+ /* scm_option doesn't know if its a long or an SCM */
if (options[i].type == SCM_OPTION_SCM)
SCM_SETCDR (protected_objects,
- scm_cons (SCM_ASSCM(flags[i]),
- scm_delq1_x (SCM_ASSCM(options[i].val),
+ scm_cons (SCM_PACK(flags[i]),
+ scm_delq1_x (SCM_PACK(options[i].val),
SCM_CDR (protected_objects))));
options[i].val = flags[i];
}
for (i = 0; i < n; ++i)
{
- options[i].name = (char *) SCM_CAR (scm_sysintern0 (options[i].name));
- options[i].doc = (char *) scm_permanent_object (scm_take0str
- (options[i].doc));
+ SCM name;
+ SCM doc;
+
+ name = scm_str2symbol (options[i].name);
+ options[i].name = (char *) name;
+ scm_permanent_object (name);
+ doc = scm_take0str (options[i].doc);
+ options[i].doc = (char *) doc;
+ scm_permanent_object (doc);
if (options[i].type == SCM_OPTION_SCM)
SCM_SETCDR (protected_objects,
- scm_cons (SCM_ASSCM(options[i].val), SCM_CDR (protected_objects)));
+ scm_cons (SCM_PACK(options[i].val), SCM_CDR (protected_objects)));
}
func (SCM_UNDEFINED);
}
scm_init_options ()
{
protected_objects = scm_permanent_object (scm_cons (SCM_UNDEFINED, SCM_EOL));
-#include "options.x"
+#ifndef SCM_MAGIC_SNARFER
+#include "libguile/options.x"
+#endif
}
+
+/*
+ Local Variables:
+ c-file-style: "gnu"
+ End:
+*/