* alist.c, arbiters.c, async.h, backtrace.h, boolean.c, chars.c,
chars.h, continuations.h, debug-malloc.h, dynl.c, feature.c,
feature.h, filesys.h, fluids.h, fports.h, gc_os_dep.c,
gdb_interface.h, gh_eval.c, gh_funcs.c, gh_io.c, gh_list.c,
gh_predicates.c, gsubr.c, gsubr.h, guardians.h,
guile-func-name-check.in, guile-snarf-docs-texi.in,
guile-snarf-docs.in, guile-snarf.awk.in, guile-snarf.in,
hashtab.h, iselect.h, keywords.h, lang.c, list.h, load.h,
objprop.c, objprop.h, options.c, options.h, random.h,
regex-posix.h, root.c, root.h, script.c, snarf.h, stackchk.c,
strerror.c, strop.h, strports.h, threads.h, values.c, values.h,
version.c, version.h: Updated copyright notice.
2001-07-19 21:08:49 +00:00
|
|
|
|
/* Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation
|
1996-08-20 17:06:04 +00:00
|
|
|
|
*
|
|
|
|
|
|
* 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
|
|
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
|
* any later version.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
*
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
|
* along with this software; see the file COPYING. If not, write to
|
1997-05-26 22:34:48 +00:00
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
|
|
|
|
* Boston, MA 02111-1307 USA
|
1996-08-20 17:06:04 +00:00
|
|
|
|
*
|
|
|
|
|
|
* As a special exception, the Free Software Foundation gives permission
|
|
|
|
|
|
* for additional uses of the text contained in its release of GUILE.
|
|
|
|
|
|
*
|
|
|
|
|
|
* The exception is that, if you link the GUILE library with other files
|
|
|
|
|
|
* to produce an executable, this does not by itself cause the
|
|
|
|
|
|
* resulting executable to be covered by the GNU General Public License.
|
|
|
|
|
|
* Your use of that executable is in no way restricted on account of
|
|
|
|
|
|
* linking the GUILE library code into it.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This exception does not however invalidate any other reasons why
|
|
|
|
|
|
* the executable file might be covered by the GNU General Public License.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This exception applies only to the code released by the
|
|
|
|
|
|
* Free Software Foundation under the name GUILE. If you copy
|
|
|
|
|
|
* code from other Free Software Foundation releases into a copy of
|
|
|
|
|
|
* GUILE, as the General Public License permits, the exception does
|
|
|
|
|
|
* not apply to the code that you add in this way. To avoid misleading
|
|
|
|
|
|
* anyone as to the status of such modified files, you must delete
|
|
|
|
|
|
* this exception notice from them.
|
|
|
|
|
|
*
|
|
|
|
|
|
* If you write modifications of your own for GUILE, it is your choice
|
|
|
|
|
|
* whether to permit this exception to apply to your modifications.
|
|
|
|
|
|
* If you do not wish that, delete this exception notice.
|
|
|
|
|
|
*
|
|
|
|
|
|
* The author can be reached at djurfeldt@nada.kth.se
|
1997-05-26 22:34:48 +00:00
|
|
|
|
* Mikael Djurfeldt, SANS/NADA KTH, 10044 STOCKHOLM, SWEDEN */
|
1999-12-12 20:35:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
1996-08-20 17:06:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#include "libguile/_scm.h"
|
|
|
|
|
|
#include "libguile/strings.h"
|
1996-08-20 17:06:04 +00:00
|
|
|
|
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#include "libguile/options.h"
|
1996-08-20 17:06:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* {Run-time options}
|
|
|
|
|
|
*
|
|
|
|
|
|
* This is the basic interface for low-level configuration of the
|
|
|
|
|
|
* Guile library. It is used for configuring the reader, evaluator,
|
|
|
|
|
|
* printer and debugger.
|
1996-08-23 01:19:52 +00:00
|
|
|
|
*
|
|
|
|
|
|
* Motivation:
|
|
|
|
|
|
*
|
|
|
|
|
|
* 1. Altering option settings can have side effects.
|
|
|
|
|
|
* 2. Option values can be stored in native format.
|
|
|
|
|
|
* (Important for efficiency in, e. g., the evaluator.)
|
|
|
|
|
|
* 3. Doesn't use up name space.
|
|
|
|
|
|
* 4. Options can be naturally grouped => ease of use.
|
1996-08-20 17:06:04 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
1996-08-23 01:19:52 +00:00
|
|
|
|
/* scm_options is the core of all options interface procedures.
|
|
|
|
|
|
*
|
|
|
|
|
|
* Some definitions:
|
|
|
|
|
|
*
|
|
|
|
|
|
* Run time options in Guile are arranged in groups. Each group
|
|
|
|
|
|
* affects a certain aspect of the behaviour of the library.
|
|
|
|
|
|
*
|
|
|
|
|
|
* An "options interface procedure" manages one group of options. It
|
|
|
|
|
|
* can be used to check or set options, or to get documentation for
|
|
|
|
|
|
* all options of a group. The options interface procedure is not
|
|
|
|
|
|
* intended to be called directly by the user. The user should
|
|
|
|
|
|
* instead call
|
|
|
|
|
|
*
|
|
|
|
|
|
* (<group>-options)
|
|
|
|
|
|
* (<group>-options 'help)
|
|
|
|
|
|
* (<group>-options 'full)
|
|
|
|
|
|
*
|
|
|
|
|
|
* to display current option settings (The second version also
|
|
|
|
|
|
* displays documentation. The third version also displays
|
|
|
|
|
|
* information about programmer's options.), and
|
|
|
|
|
|
*
|
|
|
|
|
|
* (<group>-enable '<option-symbol>)
|
|
|
|
|
|
* (<group>-disable '<option-symbol>)
|
|
|
|
|
|
* (<group>-set! <option-symbol> <value>)
|
|
|
|
|
|
* (<group>-options <option setting>)
|
|
|
|
|
|
*
|
|
|
|
|
|
* to alter the state of an option (The last version sets all
|
|
|
|
|
|
* options according to <option setting>.) where <group> is the name
|
|
|
|
|
|
* of the option group.
|
|
|
|
|
|
*
|
|
|
|
|
|
* An "option setting" represents the state of all low-level options
|
|
|
|
|
|
* managed by one options interface procedure. It is a list of
|
|
|
|
|
|
* single symbols and symbols followed by a value.
|
|
|
|
|
|
*
|
|
|
|
|
|
* For boolean options, the presence of the symbol of that option in
|
|
|
|
|
|
* the option setting indicates a true value. If the symbol isn't a
|
1996-09-18 19:34:14 +00:00
|
|
|
|
* member of the option setting this represents a false value.
|
1996-08-23 01:19:52 +00:00
|
|
|
|
*
|
1996-09-18 19:34:14 +00:00
|
|
|
|
* Other options are represented by a symbol followed by the value.
|
1996-08-23 01:19:52 +00:00
|
|
|
|
*
|
|
|
|
|
|
* If scm_options is called without arguments, the current option
|
|
|
|
|
|
* setting is returned. If the argument is an option setting, options
|
|
|
|
|
|
* are altered and the old setting is returned. If the argument isn't
|
|
|
|
|
|
* a list, a list of sublists is returned, where each sublist contains
|
|
|
|
|
|
* option name, value and documentation string.
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
SCM_SYMBOL (scm_yes_sym, "yes");
|
|
|
|
|
|
SCM_SYMBOL (scm_no_sym, "no");
|
|
|
|
|
|
|
1998-11-03 16:09:11 +00:00
|
|
|
|
static SCM protected_objects;
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-08-20 17:06:04 +00:00
|
|
|
|
SCM
|
2001-06-14 19:50:43 +00:00
|
|
|
|
scm_options (SCM arg, scm_t_option options[], int n, const char *s)
|
1996-08-20 17:06:04 +00:00
|
|
|
|
{
|
2000-04-18 14:12:07 +00:00
|
|
|
|
int i, docp = (!SCM_UNBNDP (arg) && !SCM_NULLP (arg) && !SCM_CONSP (arg));
|
1998-11-03 16:09:11 +00:00
|
|
|
|
/* Let `arg' GC protect the arguments */
|
|
|
|
|
|
SCM new_mode = arg, ans = SCM_EOL, ls;
|
1996-08-20 17:06:04 +00:00
|
|
|
|
for (i = 0; i < n; ++i)
|
|
|
|
|
|
{
|
1996-08-23 01:19:52 +00:00
|
|
|
|
ls = docp ? scm_cons ((SCM) options[i].doc, SCM_EOL) : ans;
|
|
|
|
|
|
switch (options[i].type)
|
|
|
|
|
|
{
|
|
|
|
|
|
case SCM_OPTION_BOOLEAN:
|
|
|
|
|
|
if (docp)
|
|
|
|
|
|
ls = scm_cons ((int) options[i].val
|
|
|
|
|
|
? scm_yes_sym
|
|
|
|
|
|
: scm_no_sym,
|
|
|
|
|
|
ls);
|
|
|
|
|
|
break;
|
|
|
|
|
|
case SCM_OPTION_INTEGER:
|
* validate.h
(SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,BITS,UBITS,INT,UINT}[_DEF]):
new macros.
* unif.h: type renaming:
scm_array -> scm_array_t
scm_array_dim -> scm_array_dim_t
the old names are deprecated, all in-Guile uses changed.
* tags.h (scm_ubits_t): new typedef, representing unsigned
scm_bits_t.
* stacks.h: type renaming:
scm_info_frame -> scm_info_frame_t
scm_stack -> scm_stack_t
the old names are deprecated, all in-Guile uses changed.
* srcprop.h: type renaming:
scm_srcprops -> scm_srcprops_t
scm_srcprops_chunk -> scm_srcprops_chunk_t
the old names are deprecated, all in-Guile uses changed.
* gsubr.c, procs.c, print.c, ports.c, read.c, rdelim.c, ramap.c,
rw.c, smob.c, sort.c, srcprop.c, stacks.c, strings.c, strop.c,
strorder.c, strports.c, struct.c, symbols.c, unif.c, values.c,
vectors.c, vports.c, weaks.c:
various int/size_t -> size_t/scm_bits_t changes.
* random.h: type renaming:
scm_rstate -> scm_rstate_t
scm_rng -> scm_rng_t
scm_i_rstate -> scm_i_rstate_t
the old names are deprecated, all in-Guile uses changed.
* procs.h: type renaming:
scm_subr_entry -> scm_subr_entry_t
the old name is deprecated, all in-Guile uses changed.
* options.h (scm_option_t.val): unsigned long -> scm_bits_t.
type renaming:
scm_option -> scm_option_t
the old name is deprecated, all in-Guile uses changed.
* objects.c: various long -> scm_bits_t changes.
(scm_i_make_class_object): flags: unsigned long -> scm_ubits_t
* numbers.h (SCM_FIXNUM_BIT): deprecated, renamed to
SCM_I_FIXNUM_BIT.
* num2integral.i.c: new file, multiply included by numbers.c, used
to "templatize" the various integral <-> num conversion routines.
* numbers.c (scm_mkbig, scm_big2num, scm_adjbig, scm_normbig,
scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl):
deprecated.
(scm_i_mkbig, scm_i_big2inum, scm_i_adjbig, scm_i_normbig,
scm_i_copybig, scm_i_short2big, scm_i_ushort2big, scm_i_int2big,
scm_i_uint2big, scm_i_long2big, scm_i_ulong2big, scm_i_bits2big,
scm_i_ubits2big, scm_i_size2big, scm_i_ptrdiff2big,
scm_i_long_long2big, scm_i_ulong_long2big, scm_i_dbl2big,
scm_i_big2dbl, scm_short2num, scm_ushort2num, scm_int2num,
scm_uint2num, scm_bits2num, scm_ubits2num, scm_size2num,
scm_ptrdiff2num, scm_num2short, scm_num2ushort, scm_num2int,
scm_num2uint, scm_num2bits, scm_num2ubits, scm_num2ptrdiff,
scm_num2size): new functions.
* modules.c (scm_module_reverse_lookup): i, n: int -> scm_bits_t.x
* load.c: change int -> size_t in various places (where the
variable is used to store a string length).
(search-path): call scm_done_free, not scm_done_malloc.
* list.c (scm_ilength): return a scm_bits_t, not long.
some other {int,long} -> scm_bits_t changes.
* hashtab.c: various [u]int -> scm_bits_t changes.
scm_ihashx_closure -> scm_ihashx_closure_t (and made a typedef).
(scm_ihashx): n: uint -> scm_bits_t
use scm_bits2num instead of scm_ulong2num.
* gsubr.c: various int -> scm_bits_t changes.
* gh_data.c (gh_scm2double): no loss of precision any more.
* gh.h (gh_str2scm): len: int -> size_t
(gh_{get,set}_substr): start: int -> scm_bits_t,
len: int -> size_t
(gh_<num>2scm): n: int -> scm_bits_t
(gh_*vector_length): return scm_[u]size_t, not unsigned long.
(gh_length): return scm_bits_t, not unsigned long.
* fports.h: type renaming:
scm_fport -> scm_fport_t
the old name is deprecated, all in-Guile uses changed.
* fports.c (fport_fill_input): count: int -> scm_bits_t
(fport_flush): init_size, remaining, count: int -> scm_bits_t
* debug.h (scm_lookup_cstr, scm_lookup_soft, scm_evstr): removed
those prototypes, as the functions they prototype don't exist.
* fports.c (default_buffer_size): int -> size_t
(scm_fport_buffer_add): read_size, write_size: int -> scm_bits_t
default_size: int -> size_t
(scm_setvbuf): csize: int -> scm_bits_t
* fluids.c (n_fluids): int -> scm_bits_t
(grow_fluids): old_length, i: int -> scm_bits_t
(next_fluid_num, scm_fluid_ref, scm_fluid_set_x): n: int ->
scm_bits_t
(scm_c_with_fluids): flen, vlen: int -> scm_bits_t
* filesys.c (s_scm_open_fdes): changed calls to SCM_NUM2LONG to
the new and shiny SCM_NUM2INT.
* extensions.c: extension -> extension_t (and made a typedef).
* eval.h (SCM_IFRAME): cast to scm_bits_t, not int. just so
there are no nasty surprises if/when the various deeply magic tag
bits move somewhere else.
* eval.c: changed the locals used to store results of SCM_IFRAME,
scm_ilength and such to be of type scm_bits_t (and not int/long).
(iqq): depth, edepth: int -> scm_bits_t
(scm_eval_stack): int -> scm_bits_t
(SCM_CEVAL): various vars are not scm_bits_t instead of int.
(check_map_args, scm_map, scm_for_each): len: long -> scm_bits_t
i: int -> scm_bits_t
* environments.c: changed the many calls to scm_ulong2num to
scm_ubits2num.
(import_environment_fold): proc_as_ul: ulong -> scm_ubits_t
* dynwind.c (scm_dowinds): delta: long -> scm_bits_t
* debug.h: type renaming:
scm_debug_info -> scm_debug_info_t
scm_debug_frame -> scm_debug_frame_t
the old names are deprecated, all in-Guile uses changed.
(scm_debug_eframe_size): int -> scm_bits_t
* debug.c (scm_init_debug): use scm_c_define instead of the
deprecated scm_define.
* continuations.h: type renaming:
scm_contregs -> scm_contregs_t
the old name is deprecated, all in-Guile uses changed.
(scm_contregs_t.num_stack_items): size_t -> scm_bits_t
(scm_contregs_t.num_stack_items): ulong -> scm_ubits_t
* continuations.c (scm_make_continuation): change the type of
stack_size form long to scm_bits_t.
* ports.h: type renaming:
scm_port_rw_active -> scm_port_rw_active_t (and made a typedef)
scm_port -> scm_port_t
scm_ptob_descriptor -> scm_ptob_descriptor_t
the old names are deprecated, all in-Guile uses changed.
(scm_port_t.entry): int -> scm_bits_t.
(scm_port_t.line_number): int -> long.
(scm_port_t.putback_buf_size): int -> size_t.
* __scm.h (long_long, ulong_long): deprecated (they pollute the
global namespace and have little value besides that).
(SCM_BITS_LENGTH): new, is the bit size of scm_bits_t (i.e. of an
SCM handle).
(ifdef spaghetti): include sys/types.h and sys/stdtypes.h, if they
exist (for size_t & ptrdiff_t)
(scm_sizet): deprecated.
* Makefile.am (noinst_HEADERS): add num2integral.i.c
2001-05-24 00:50:51 +00:00
|
|
|
|
ls = scm_cons (SCM_MAKINUM (options[i].val), ls);
|
1996-08-23 01:19:52 +00:00
|
|
|
|
break;
|
|
|
|
|
|
case SCM_OPTION_SCM:
|
|
|
|
|
|
ls = scm_cons ((SCM) options[i].val, ls);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!((options[i].type == SCM_OPTION_BOOLEAN)
|
|
|
|
|
|
&& !docp
|
|
|
|
|
|
&& ! (int) options[i].val))
|
|
|
|
|
|
ls = scm_cons ((SCM) options[i].name, ls);
|
|
|
|
|
|
ans = docp ? scm_cons (ls, ans) : ls;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!(SCM_UNBNDP (new_mode) || docp))
|
|
|
|
|
|
{
|
|
|
|
|
|
unsigned long *flags;
|
|
|
|
|
|
flags = (unsigned long *) scm_must_malloc (n * sizeof (unsigned long),
|
|
|
|
|
|
"mode buffer");
|
1996-08-20 17:06:04 +00:00
|
|
|
|
for (i = 0; i < n; ++i)
|
|
|
|
|
|
if (options[i].type == SCM_OPTION_BOOLEAN)
|
|
|
|
|
|
flags[i] = 0;
|
|
|
|
|
|
else
|
1996-08-23 01:19:52 +00:00
|
|
|
|
flags[i] = (unsigned long) options[i].val;
|
1996-08-20 17:06:04 +00:00
|
|
|
|
while (SCM_NNULLP (new_mode))
|
|
|
|
|
|
{
|
1999-12-16 20:48:05 +00:00
|
|
|
|
SCM_ASSERT (SCM_CONSP (new_mode),
|
1996-08-20 17:06:04 +00:00
|
|
|
|
new_mode,
|
|
|
|
|
|
SCM_ARG1,
|
|
|
|
|
|
s);
|
|
|
|
|
|
for (i = 0; i < n; ++i)
|
1996-08-23 01:19:52 +00:00
|
|
|
|
if (SCM_CAR (new_mode) == (SCM) options[i].name)
|
1996-08-20 17:06:04 +00:00
|
|
|
|
switch (options[i].type)
|
|
|
|
|
|
{
|
|
|
|
|
|
case SCM_OPTION_BOOLEAN:
|
|
|
|
|
|
flags[i] = 1;
|
|
|
|
|
|
goto cont;
|
|
|
|
|
|
case SCM_OPTION_INTEGER:
|
|
|
|
|
|
new_mode = SCM_CDR (new_mode);
|
2000-01-04 22:23:42 +00:00
|
|
|
|
SCM_ASSERT ( SCM_CONSP (new_mode)
|
1996-08-20 17:06:04 +00:00
|
|
|
|
&& SCM_INUMP (SCM_CAR (new_mode)),
|
|
|
|
|
|
new_mode,
|
|
|
|
|
|
SCM_ARG1,
|
|
|
|
|
|
s);
|
1996-08-23 01:19:52 +00:00
|
|
|
|
flags[i] = (unsigned long) SCM_INUM (SCM_CAR (new_mode));
|
|
|
|
|
|
goto cont;
|
|
|
|
|
|
case SCM_OPTION_SCM:
|
|
|
|
|
|
new_mode = SCM_CDR (new_mode);
|
2000-05-23 22:23:56 +00:00
|
|
|
|
flags[i] = SCM_UNPACK (SCM_CAR (new_mode));
|
1996-08-20 17:06:04 +00:00
|
|
|
|
goto cont;
|
|
|
|
|
|
}
|
* (__scm.h, alist.c, eval.c, feature.c, gsubr.c, numbers.c,
options.c): Rename RECKLESS -> SCM_RECKLESS, CAUTIOUS ->
SCM_CAUTIOUS; this way, 1) there's only one version of each flag
to define (we used to have both RECKLESS and SCM_RECKLESS), and 2)
if we want to use them in a header file some day, we can. (Thanks
to Michael Livshin.)
1998-10-14 07:32:13 +00:00
|
|
|
|
#ifndef SCM_RECKLESS
|
1996-08-20 17:06:04 +00:00
|
|
|
|
scm_must_free ((char *) flags);
|
2001-03-04 17:09:34 +00:00
|
|
|
|
scm_misc_error (s, "Unknown mode flag: ~S",
|
* list.h (scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5,
scm_list_n): New functions.
(SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5,
SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify): Deprecated.
(lots of files): Use the new functions.
* goops.c (CALL_GF1, CALL_GF2, CALL_GF3, CALL_GF4): Use scm_call_N.
* strings.c: #include "libguile/deprecation.h".
2001-06-28 01:11:59 +00:00
|
|
|
|
scm_list_1 (SCM_CAR (new_mode)));
|
1996-08-20 17:06:04 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
cont:
|
|
|
|
|
|
new_mode = SCM_CDR (new_mode);
|
|
|
|
|
|
}
|
1998-11-03 16:09:11 +00:00
|
|
|
|
for (i = 0; i < n; ++i)
|
|
|
|
|
|
{
|
2000-03-20 14:39:23 +00:00
|
|
|
|
/* scm_option doesn't know if its a long or an SCM */
|
1998-11-03 16:09:11 +00:00
|
|
|
|
if (options[i].type == SCM_OPTION_SCM)
|
|
|
|
|
|
SCM_SETCDR (protected_objects,
|
2000-03-12 18:30:33 +00:00
|
|
|
|
scm_cons (SCM_PACK(flags[i]),
|
|
|
|
|
|
scm_delq1_x (SCM_PACK(options[i].val),
|
1998-11-03 16:09:11 +00:00
|
|
|
|
SCM_CDR (protected_objects))));
|
|
|
|
|
|
options[i].val = flags[i];
|
|
|
|
|
|
}
|
1996-08-20 17:06:04 +00:00
|
|
|
|
scm_must_free ((char *) flags);
|
|
|
|
|
|
}
|
1996-08-23 01:19:52 +00:00
|
|
|
|
return ans;
|
1996-08-20 17:06:04 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-08-20 17:06:04 +00:00
|
|
|
|
void
|
2001-06-14 19:50:43 +00:00
|
|
|
|
scm_init_opts (SCM (*func) (SCM), scm_t_option options[], int n)
|
1996-08-20 17:06:04 +00:00
|
|
|
|
{
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < n; ++i)
|
1996-08-23 01:19:52 +00:00
|
|
|
|
{
|
2000-12-11 14:48:23 +00:00
|
|
|
|
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);
|
1998-11-03 16:09:11 +00:00
|
|
|
|
if (options[i].type == SCM_OPTION_SCM)
|
|
|
|
|
|
SCM_SETCDR (protected_objects,
|
2000-03-12 18:30:33 +00:00
|
|
|
|
scm_cons (SCM_PACK(options[i].val), SCM_CDR (protected_objects)));
|
1996-08-23 01:19:52 +00:00
|
|
|
|
}
|
1996-08-20 17:06:04 +00:00
|
|
|
|
func (SCM_UNDEFINED);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-08-20 17:06:04 +00:00
|
|
|
|
void
|
|
|
|
|
|
scm_init_options ()
|
|
|
|
|
|
{
|
1998-11-03 16:09:11 +00:00
|
|
|
|
protected_objects = scm_permanent_object (scm_cons (SCM_UNDEFINED, SCM_EOL));
|
* alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c,
environments.c, eq.c, error.c, eval.c, evalext.c, feature.c,
filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c,
hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c,
list.c, load.c, macros.c, modules.c, net_db.c, numbers.c,
objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c,
print.c, procprop.c, procs.c, properties.c, ramap.c, random.c,
read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c,
socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c,
strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c,
tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c,
version.c, vports.c, weaks.c: Makes sure the snarfer output
inclusion is disabled when the snarfer is run on the file. Thanks
to Lars J. Aas!
* Makefile.am: Install guile-procedures.txt in version-specific
directory to enable multiple installed guile versions. Suggested
by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-11-17 16:25:05 +00:00
|
|
|
|
#ifndef SCM_MAGIC_SNARFER
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#include "libguile/options.x"
|
* alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c,
environments.c, eq.c, error.c, eval.c, evalext.c, feature.c,
filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c,
hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c,
list.c, load.c, macros.c, modules.c, net_db.c, numbers.c,
objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c,
print.c, procprop.c, procs.c, properties.c, ramap.c, random.c,
read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c,
socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c,
strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c,
tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c,
version.c, vports.c, weaks.c: Makes sure the snarfer output
inclusion is disabled when the snarfer is run on the file. Thanks
to Lars J. Aas!
* Makefile.am: Install guile-procedures.txt in version-specific
directory to enable multiple installed guile versions. Suggested
by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-11-17 16:25:05 +00:00
|
|
|
|
#endif
|
1996-08-20 17:06:04 +00:00
|
|
|
|
}
|
2000-03-19 19:01:16 +00:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
|
c-file-style: "gnu"
|
|
|
|
|
|
End:
|
|
|
|
|
|
*/
|