1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

87 commits

Author SHA1 Message Date
Dirk Herrmann
2d349e67ac * Added type-specific replacement macros for SCM_LENGTH. 2000-10-06 13:35:58 +00:00
Dirk Herrmann
322ac0c5cc * Eliminated all calls to SCM_UCHARS. 2000-09-26 22:15:13 +00:00
Dirk Herrmann
405aaef932 * Eliminated all remaining calls to SCM_CHARS. 2000-09-26 21:53:49 +00:00
Dirk Herrmann
a002f1a2cb * Replaced a lot of references to SCM_CHARS. 2000-09-26 18:37:26 +00:00
Dirk Herrmann
c1aef03710 * Added SCM_STRING_CHARS and SCM_SYMBOL_CHARS in order to, in the long run,
get rid of SCM_CHARS, which is shared between a large number of types, and
  thus makes it difficult to change the implementation of a single type.
2000-09-22 16:44:42 +00:00
Dirk Herrmann
28b06554ca * Unified ssymbols and msymbols to a single symbol type 'scm_tc7_symbol'.
* Added scm_string_hash and deprecated scm_strhash.
2000-09-12 12:30:36 +00:00
Mikael Djurfeldt
5382d876c8 * symbols.h (scm_gentemp): Declared. 2000-09-12 05:44:12 +00:00
Mikael Djurfeldt
26795895e2 Deprecated scm_top_level_lookup_closure_var 2000-08-11 08:45:19 +00:00
Mikael Djurfeldt
5b99c4a9e7 Layout fix 2000-06-20 02:38:19 +00:00
Mikael Djurfeldt
f2c9fcb07e Updated copyrights 2000-06-12 12:28:24 +00:00
Dirk Herrmann
cf551a2be9 The msymbol slots are now a field of scm_bits_t values. 2000-04-12 12:48:11 +00:00
Dirk Herrmann
3210f49a6f Use SCM_{SET_}?CELL_WORD_[01] to access length and char * fields
of strings and symbols.
2000-03-28 10:16:16 +00:00
Mikael Djurfeldt
61abe7cf63 * symbols.h (SCM_SETCHARS): Cast second arg into SCM. 2000-03-23 13:04:35 +00:00
Dirk Herrmann
95c9e176a6 Make scm_strhash's string parameter constant. 2000-03-21 15:49:53 +00:00
Michael Livshin
89e00824a0 * *.[hc]: add Emacs magic at the end of file, to ensure GNU
indentation style.
2000-03-19 19:01:16 +00:00
Greg J. Badros
7866a09b5b * list.c: Moved append docs to append! Thanks Dirk Hermann. Also,
added append docs from R4RS.

* strings.c: Docstring typo fix, + eliminate unneeded IMP tests.
Thanks Dirk Hermann!

* chars.h: Provide SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR and
deprecate SCM_ICHRP, SCM_ICHR, SCM_MAKICHR.  Thanks Dirk Hermann!

* *.h, *.c: Use SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR throughout.
Drop use of SCM_P for function prototypes... assume an ANSI C
compiler.  Thanks Dirk Hermann!
2000-03-02 20:54:43 +00:00
Greg J. Badros
3093947745 * tags.h (SCM_CONSP, SCM_NCONSP): Define these in terms of
SCM_SLOPPY_CONSP and SCM_SLOPPY_NCONSP.  (SCM_CONSP) Define this
in terms of SCM_SLOPPY_NCONSP instead of repeating the
expression.

* symbols.h (SCM_SLOPPY_SUBSTRP, SCM_SUBSTRP): Added former, and
define latter in terms of sloppy variant.

* strings.h (SCM_SLOPPY_STRINGP, SCM_STRINGP): Added former, and
define latter in terms of sloppy variant.

* scm_validate.h (SCM_MAKE_VALIDATE): Added this macro to factor
out the commonality of the various basic SCM_VALIDATE_foop
macros. Use SCM_MAKE_VALIDATE macro where possible.  Fix
SCM_VALIDATE_INT_COPY to not use scm_num2ulong -- that does
coercion to an integer which is more advanced than desired and
SCM_NUM2ULONG provides that functionality.  Use SCM_ASSERT_RANGE
appropriately for the various _MIN, _MAX, _RANGE macros.  Drop
some superfluous "SCM_NIMP &&" where possible. Eliminate obsoleted
SCM_VALIDATE_NIMCONS (SCM_VALIDATE_CONS now does the NIMP test as
part of its SCM_CONSP test).

* socket.c, ports.c, pairs.c, list.c, lang.c, async.c: Use
SCM_VALIDATE_CONS, not obsoleted SCM_VALIDATE_NIMCONS.
1999-12-19 01:04:37 +00:00
Greg J. Badros
cfaba30ebd * tags.h (SCM_ECONSP, SCM_NECONSP): Fix these macros to have the
SCM_NIMP test integrated into an || clause that I'd missed before
and was causing a segfault in the regression tests.

* symbols.h (SCM_ROUCHARS): Make cast be to (unsigned char *), not
(char *);  fixes a problem reported by the regression test
ports.test.

* ports.c: Fixed a couple of arg/number mismatches in
SCM_VALIDATE_ macros.

Now passes the (not-comprehensive) guile-modules test-suite again!
1999-12-17 20:11:34 +00:00
Greg J. Badros
d3a6bc9484 * *.h: Use SCM_NIMP(X) && in all the FOOP macros.
* *.[ch]: Use do { ... } while (0) idiom in macros that expanded
to a bare block.
1999-12-16 03:46:42 +00:00
Jim Blandy
3eeba8d4f5 * chars.c (scm_lowers, scm_uppers, scm_charnames, scm_charnums),
eval.c (s_expression, s_test, s_body, s_bindings, s_variable,
s_clauses, s_formals): Variables now const.
* eval.c (promsmob): Now const.
* macros.c (macrosmob): Now const.
* smob.c (scm_newsmob): Smobfuns argument now points to const.
(freecell, flob, bigob): Now const.
* dynl.c (scm_make_argv_from_stringlist, scm_coerce_rostring),
error.c (scm_error, scm_syserror, scm_syserror_msg,
scm_num_overflow, scm_out_of_range, scm_wrong_type_arg,
scm_memory_error, scm_misc_error, scm_wta), macros.c
(scm_make_synt), feature.c (scm_add_feature), filesys.c
(scm_input_waiting_p), gc.c (scm_gc_start, scm_igc,
scm_must_malloc, scm_must_realloc), gsubr.c (scm_make_gsubr),
numbers.c (scm_num2dbl, scm_two_doubles, scm_num2long,
scm_num2long_long, scm_num2ulong),
options.c (scm_options), posix.c (scm_convert_exec_args,
environ_list_to_c), procs.c (scm_make_subr_opt, scm_make_subr),
ramap.c (scm_ramapc), read.c (scm_flush_ws), socket.c
(scm_sock_fd_to_port, scm_fill_sockaddr, scm_addr_vector), stime.c
(setzone, restorezone, bdtime2c), strop.c (scm_i_index),
strports.c (scm_mkstrport), symbols.c (scm_intern_obarray_soft,
scm_intern_obarray, scm_intern, scm_intern0,
scm_sysintern0_no_module_lookup, scm_sysintern, scm_sysintern0,
scm_symbol_value0), unif.c (scm_aind, scm_shap2ra): Argument
indicating calling subr, error message text, reason for error,
symbol name or feature name are now pointer to const.
* snarf.h (SCM_PROC, SCM_PROC1): String variables are now const.
* procs.c (scm_init_iprocs): iproc argument now points to const.
* pairs.c (cxrs): Now const.
* chars.h, error.h, feature.h, filesys.h, gc.h, gsubr.h, macros.h,
numbers.h, options.h, procs.h, ramap.h, read.h, smob.h,
strports.h, symbols.h, unif.h: Update variable declarations and
function prototypes for above changes.
* dynl.c, dynl-dld.c, dynl-dl.c, dynl-shl.c (sysdep_dynl_link,
sysdep_dynl_unlink, sysdep_dynl_func): Arguments FNAME, SUBR, and
SYMB now point to const.
1999-02-06 12:31:04 +00:00
Jim Blandy
7dc6e7547a * __scm.h, alist.c, async.c, async.h, backtrace.h, chars.c,
continuations.c, debug.c, debug.h, dynl-dl.c, dynl.c, dynl.h,
dynwind.c, dynwind.h, eq.c, error.c, error.h, eval.c, eval.h,
feature.c, filesys.c, filesys.h, fports.c, fports.h, gc.c, gc.h,
genio.c, genio.h, gh.h, gh_data.c, gsubr.c, gsubr.h, hash.c,
hashtab.c, init.c, init.h, ioext.c, ioext.h, kw.c, libguile.h,
list.c, list.h, load.c, load.h, mallocs.c, markers.c,
mit-pthreads.c, net_db.c, numbers.c, numbers.h, options.c,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, regex-posix.c,
regex-posix.h, root.c, root.h, scmsigs.c, scmsigs.h, script.c,
script.h, simpos.c, simpos.h, smob.c, smob.h, snarf.h, socket.c,
srcprop.c, stackchk.c, stackchk.h, stacks.c, stime.c, stime.h,
strings.c, strings.h, strports.c, struct.c, struct.h, symbols.c,
symbols.h, tags.h, threads.c, throw.h, unif.c, variable.c,
vectors.c, vectors.h, version.h, vports.c, weaks.c: Update
copyright years.
1998-10-19 21:36:50 +00:00
Jim Blandy
8a04c1a215 Warning fixes from Maciej Stachowiak:
* backtrace.h (scm_display_application, scm_backtrace): Add
prototypes.
* debug.c (scm_m_start_stack): Make this function static.
* fluids.h (scm_fluid_p): Add prototype.
* procprop.c (scm_i_procedure_arity): Make this function static.
* regex-posix.c (scm_regexp_error_msg): Make this function static.
* regex-posix.h (scm_init_regex_posix): Use prototype, not K&R decl.
* root.h (scm_dynamic_root): Add external prototype.
* scmsigs.h (scm_usleep): Add external prototype.
* script.h (scm_init_script): Use prototype, not K&R decl.
* stacks.h (scm_stack_id): Add external prototype.
* symbols.h (scm_sysintern0_no_module_lookup): Add external prototype.
1998-09-30 10:14:59 +00:00
Jim Blandy
c2cb25006b Minor problems with substring-related tag changes.
* symbols.h (SCM_SUBSTRP): Don't mask off the S bit; that's
exactly what we want to leave in to detect substrings.
(SCM_ROSTRINGP, ROUCHARS): Formatting tweaks.
* tags.h: Fix diagrams and comments describing the S tag bit;
remove vestigial remarks about the D tag bit.
(SCM_TYP7, SCM_TYP7S): Rephrased for readability.
* strings.c: Formatting tweaks.
1997-10-25 06:53:47 +00:00
Tom Tromey
b7f3516f99 * Makefile.in: Rebuilt.
* Makefile.am (libguile_la_SOURCES): Removed extchrs.c,
	mbstrings.c.
	(modinclude_HEADERS): Removed extchrs.h, mbstrings.h.
	* unif.c (scm_vector_set_length_x): Don't handle multibyte
	strings.
	* tag.c (scm_utag_mb_string, scm_utag_mb_substring): Removed.
	(scm_tag): Don't handle multibyte strings.
	* read.c: Don't include mbstrings.h.
	(scm_lreadr): Don't handle multibyte ports.
	* kw.c: Don't include mbstrings.h.
	* init.c: Don't include mbstrings.h.
	(scm_boot_guile_1): Don't init mbstrings module.
	* hash.c (scm_hasher): Don't handle mbstrings.
	* gscm.c (gscm_run_scm): Don't init mbstrings module.
	* gc.c (scm_gc_mark): Don't handle mbstrings.
	(scm_gc_sweep): Likewise.
	* eval.c (SCM_CEVAL): Don't handle mbstrings.
	* eq.c (scm_equal_p): Use SCM_TYP7S, not SCM_TYP7SD.
	* tags.h (SCM_TYP7SD): Removed.
	(SCM_TYP7D): Removed.
	(scm_tc7_mb_string): Removed.
	(scm_tc7_mb_substring): Removed.
	* print.c (scm_iprin1): Handle char printing directly.  Don't
	handle mbstrings.
	Don't include "mbstrings.h".
	* symbols.c (scm_intern_obarray_soft, scm_string_to_symbol,
	scm_string_to_obarray_symbol, msymbolize): Don't set symbol's
	multi-byte flag.
	Don't include "mbstrings.h".
	* symbols.h (SCM_SYMBOL_MULTI_BYTE_STRINGP): Removed.
	(SCM_SYMBOL_SLOTS): Define as 4.
	(SCM_ROSTRINGP): Use SCM_TYP7S, not SCM_TYP7SD.
	* arbiters.c, backtrace.c, debug.c, dynl.c, eval.c, fluids.c,
	gc.c, gsubr.c, ioext.c, kw.c, mallocs.c, numbers.c, ports.c,
	print.c, read.c, regex-posix.c, root.c, srcprop.c, stackchk.c,
	struct.c, threads.c, throw.c, unif.c, variable.c: Use new
	("gen"-less) I/O function names.
	* ports.c (scm_add_to_port_table): Don't set port's
	representation.
	* ports.h (scm_port_representation_type): Removed.
	(scm_string_representation_type): Removed.
	(struct scm_port_table ): Removed representation field.
	(SCM_PORT_REPRESENTATION): Removed.
	(SCM_SET_PORT_REPRESENTATION): Removed.
	* genio.h: Use new function names.
	* genio.c: Don't include "extchrs.h".
	(scm_gen_putc, scm_gen_puts, scm_gen_write, scm_get_getc):
	Removed.
	(scm_putc, scm_puts, scm_lfwrite): No longer static.
	(scm_getc): No longer static; handle line and column changes.
	(scm_ungetc): Renamed from scm_gen_ungetc.
	(scm_do_read_line): Renamed from scm_gen_read_line.
	* libguile.h: Don't include "extchrs.h" or "mbstrings.h"
	* extchrs.h, extchrs.c, mbstrings.h, mbstrings.c: Removed.
1997-10-15 17:18:32 +00:00
Mikael Djurfeldt
1ff4df7a83 * symbols.h (scm_builtin_bindings, scm_builtin_weak_bindings,
scm_gensym): Added prototypes.

* symbols.c (scm_gensym): New function.  This will speed up
certain types of applications (such as macro systems) which
generate lots of symbols.
1997-09-01 22:28:49 +00:00
Jim Blandy
82892beda5 * Lots of files: New address for FSF. 1997-05-26 22:34:48 +00:00
Jim Blandy
89958ad0ef Ensure that shared substrings are handled properly when passed to
a system call or other foreign function.  Many thanks to Tim
Pierce!
* symbols.h (SCM_COERCE_SUBSTR): new macro.
* filesys.c (scm_chmod, scm_rename, scm_delete_file, scm_mkdir,
scm_rmdir, scm_opendir, scm_chdir, scm_symlink, scm_readlink,
scm_lstat), ports.c (scm_sys_make_void_port), posix.c (scm_utime,
scm_putenv, scm_setlocale, scm_mknod), stime.c (setzone,
scm_strftime), vports.c (scm_make_soft_port), backtrace.c
(scm_display_error_message): use RO macros when strings may be RO.
* error.c (scm_error_scm), filesys.c (scm_chown, scm_chmod,
scm_rename, scm_delete_file, scm_mkdir, scm_rmdir, scm_opendir,
scm_chdir, scm_symlink, scm_readlink, scm_lstat), ioext.c
(scm_freopen, scm_duplicate_port, scm_fdopen), net_db.c
(scm_gethost, scm_getnet, scm_getproto, scm_getserv), ports.c
(scm_sys_make_void_port), posix.c (scm_getgrgid, scm_utime,
scm_setlocale, scm_mknod), stime.c (setzone, scm_strptime,
scm_strftime), vports.c (scm_make_soft_port): use
SCM_COERCE_SUBSTR to make sure shared substrings are
null-terminated.
1997-05-12 22:43:10 +00:00
Mikael Djurfeldt
1dd28b3d65 * symbols.c, symbols.h (scm_symbol_value0): New function. Can be
used from C to easily lookup the value of a symbol in the current
module.
1997-02-26 12:08:26 +00:00
Mikael Djurfeldt
5aab5d961c * symbols.c (scm_sysintern0): New function. Contains the core of
old scm_sysintern but doesn't take a second value argument.
(scm_sysintern): Now uses scm_sysintern0.
(scm_sysintern_no_module_lookup): Renamed to
scm_sysintern0_no_module_lookup and doesn't take a second value
argument any longer.

* symbols.h (scm_sysintern0: Added declaration.

* options.c (scm_init_opts): Use scm_sysintern0 instead of
scm_sysintern when interning option keys.  Otherwise we risk
destroying the values of already interned variables.

* symbols.c (scm_sym2vcell): Bugfix: Treat definedp as
scheme-level boolean (use SCM_NFALSEP).

* backtrace.c (scm_init_backtrace): Make Scheme-level variable
`the-last-stack'.
(scm_backtrace): New function. (C version of old function from
boot-9.scm) Motivation: Make it possible to display backtraces
without depending on boot-9.scm.  (I'm uncertain if this
motivation is good enough...)

* root.h (scm_root_state): Add member the_last_stack_var.
(scm_the_stack_var): Defined to scm_root->the_last_stack_var.

* root.c (mark_root): Mark scm_the_last_stack_var.

* init.c (scm_start_stack): Initialize scm_the_last_stack_var to
SCM_BOOL_F.
1997-02-10 01:01:54 +00:00
Marius Vollmer
9b8d32883e * symbols.c (scm_sysintern): Renamed to
scm_sysintern_no_module_lookup.
(scm_sysintern): New function to take the place of the old
scm_sysintern. It uses the current toplevel lookup closure to give
the symbol its value.  This is a temporary hack to put packages
like gtcltk into their own module.
(scm_can_use_top_level_lookup_closure_var): New variable to tell
us whether `scm_top_level_lookup_closure_var' has been initialized
and is usable.
* eval.c (scm_init_eval): Set it.
1997-01-18 11:49:35 +00:00
Jim Blandy
1cc91f1b29 * __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
Jim Blandy
8ce9450492 * symbols.c (scm_intern_obarray_soft, scm_sysintern): Doc fixes.
* symbols.h, tags.h: Doc fixes.
1996-10-11 07:57:35 +00:00
Mikael Djurfeldt
08b5b88cdf * __scm.h, chars.c, debug.c, eval.c, eval.h, extchrs.c, extchrs.h,
fdsocket.c, feature.c, mbstrings.c, mbstrings.h, numbers.c,
numbers.h, print.c, scmhob.h, simpos.h, symbols.c, symbols.h,
tags.h, throw.c, variable.h: Name cleanup.  Lots of xxxSCM_yyy
removed.  (These were introduced by unsupervised name
substitution.)
1996-09-13 13:31:50 +00:00
Mikael Djurfeldt
836669b8eb * symbols.h (SCM_SETLENGTH): Use SCM_SETCAR. 1996-09-11 22:03:44 +00:00
Jim Blandy
b4309c3c5a * alist.h, append.h, arbiters.h, async.h, boolean.h, chars.h,
continuations.h, debug.h, dynwind.h, error.h, eval.h, fdsocket.h,
feature.h, filesys.h, fports.h, gc.h, gdbint.h, genio.h, gsubr.h,
hash.h, init.h, ioext.h, kw.h, list.h, markers.h, marksweep.h,
mbstrings.h, numbers.h, objprop.h, options.h, pairs.h, ports.h,
posix.h, print.h, procprop.h, procs.h, ramap.h, read.h, root.h,
sequences.h, smob.h, socket.h, srcprop.h, stackchk.h, stime.h,
strings.h, strop.h, strorder.h, strports.h, struct.h, symbols.h,
tag.h, throw.h, unif.h, variable.h, vectors.h, version.h,
vports.h, weaks.h: #include "libguile/__scm.h", not
<libguile/__scm.h>.  This allows 'gcc -MM' to determine which
dependencies are within libguile properly.
1996-09-05 21:19:08 +00:00
Jim Blandy
cd4f61de2f Don't install the unwashed masses of Guile header files in the
main #include path; put most of them in a subdirectory called
'libguile'.  This avoids naming conflicts between Guile header
files and system header files (of which there were a few).
* Makefile.in (pkgincludedir): Deleted.
(innerincludedir): New variable; this and $(includedir) are enough.
(INCLUDE_CFLAGS): Search for headers in "-I$(srcdir)/..".
(installed_h_files): Divide this up.  Now this variable lists
those header files which should go into $(includedir) (i.e. appear
directly in the #include path), and ...
(inner_h_files): ... this new variable says which files appear in
a subdirectory, and are referred to as <libguile/mumble.h>.
(h_files): List them both.
(install): Create innerincludedir, not pkgincludedir.  Put
the installed_h_files and inner_h_files in their proper places.
(uninstall): Corresponding changes.
* alist.h, append.h, arbiters.h, async.h, boolean.h, chars.h,
continuations.h, debug.h, dynwind.h, error.h, eval.h, fdsocket.h,
feature.h, fports.h, gc.h, genio.h, gsubr.h, hash.h, init.h,
ioext.h, kw.h, libguile.h, list.h, markers.h, marksweep.h,
mbstrings.h, numbers.h, options.h, pairs.h, ports.h, posix.h,
print.h, procprop.h, procs.h, ramap.h, read.h, root.h,
sequences.h, smob.h, socket.h, srcprop.h, stackchk.h, stime.h,
strings.h, strop.h, strorder.h, strports.h, struct.h, symbols.h,
tag.h, throw.h, unif.h, variable.h, vectors.h, version.h,
vports.h, weaks.h: Find __scm.h in its new location.
* __scm.h: Find scmconfig.h and tags.h in their new locations
(they're both "inner" files).
1996-09-04 06:21:08 +00:00
Jim Blandy
0f2d19dd46 maintainer changed: was lord, now jimb; first import 1996-07-25 22:56:11 +00:00