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

181 commits

Author SHA1 Message Date
Marius Vollmer
0345e278f4 * variable.c, threads.c, struct.c, stackchk.c, smob.c, root.c,
print.c, ports.c, mallocs.c, hooks.c, hashtab.c, fports.c,
guardians.c, filesys.c, coop-pthreads.c, continuations.c: Use
scm_uintprint to print unsigned integers, raw heap words, and
adresses, using a cast to scm_t_bits to turn pointers into
integers.
2004-10-22 15:13:12 +00:00
Marius Vollmer
cc95e00ac6 * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to
replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH.  Updated all
uses.
(scm_i_make_string, scm_c_make_string): New, to replace
scm_allocate_string.  Updated all uses.
(SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS,
SCM_STRING_LENGTH): Deprecated.
(scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string,
scm_str2string, scm_makfrom0str, scm_makfrom0str_opt):
Discouraged.  Replaced all uses with scm_from_locale_string or
similar, as appropriate.
(scm_c_string_length, scm_c_string_ref, scm_c_string_set_x,
scm_c_substring, scm_c_substring_shared, scm_c_substring_copy,
scm_substring_shared, scm_substring_copy): New.

* symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC,
SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS,
SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol,
scm_str2symbol, scm_mem2uninterned_symbol): Discouraged.
(SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str):
Deprecated.
(SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS,
SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed.
(scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln):
New, to replace scm_str2symbol and scm_mem2symbol, respectively.
Updated all uses.
(scm_gensym): Generate only the number suffix in the buffer, just
string-append the prefix.
2004-08-19 17:19:44 +00:00
Kevin Ryde
eb37258527 (fport_print): Use scm_ttyname instead of ttyname directly,
to get thread safety of scm_ttyname.
2004-08-17 23:27:11 +00:00
Marius Vollmer
d617ee1895 * fports.h, fports.c (scm_i_fdes_to_port): New, like
scm_fdes_to_port, but take mode bits directly instead of as a C
string.
(scm_i_fdes_to_port): Implement using above.
(scm_open_file): Use scm_i_fdes_to_port together with
scm_i_mode_bits to avoid accessing internals of SCM string from C.
* vports.c (scm_make_soft_port): Use scm_i_fdes_to_port together
with scm_i_mode_bits to avoid accessing internals of SCM string
from C.

* ports.h (scm_i_mode_bits): New, same as scm_mode_bits but with a
SCM string as argument.

* ports.c (scm_i_void_port): New, like scm_void_port but take mode
bits directly instead of C string.
(scm_void_port): Implement using above.
(scm_sys_make_void_port): Use scm_i_void_port together with
scm_i_mode_bits to avoid accessing internals of SCM string.

* convert.i.c, backtrace.c, strop.c, strorder.c, strports.c,
struct.c, unif.c, ports.c: Use SCM_I_STRING_CHARS,
SCM_I_STRING_UCHARS, and SCM_I_STRING_LENGTH instead of
SCM_STRING_CHARS, SCM_STRING_UCHARS, and SCM_STRING_LENGTH,
respectively.  Also, replaced scm_return_first with more explicit
scm_remember_upto_here_1, etc, or introduced them in the first
place.
2004-08-12 17:03:36 +00:00
Marius Vollmer
7f9994d904 * stime.c, socket.c, simpos.c, procs.c, posix.c, ports.c,
net_db.c, fports.c, filesys.c, eval.c, deprecation.c, dynl.c:
Replaced uses of SCM_STRING_CHARS with proper uses of
scm_to_locale_string.  Replaced SCM_STRINGP with scm_is_string.
Replaced scm_mem2string with scm_from_locale_string.

* simpos.c, posix.c (allocate_string_pointers, environ_list_to_c):
Removed, replaced all uses with scm_i_allocate_string_pointers.
2004-08-10 14:08:02 +00:00
Kevin Ryde
fd08c23657 * error.c (scm_strerror): Use scm_i_misc_mutex around strerror since
it's not thread safe.
	(scm_syserror): Use scm_strerror rather than SCM_I_STRERROR, to take
	advantage of this.
	* fports.c (scm_open_file): Use scm_strerror likewise.
2004-07-31 01:12:24 +00:00
Marius Vollmer
e11e83f3d9 * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP
and SCM_I_INUM, respectively and adding deprecated versions to
deprecated.h and deprecated.c.  Changed all uses to either use the
SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
2004-07-23 15:43:02 +00:00
Marius Vollmer
a55c2b6809 * validate.h, deprecated.h (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY,
SCM_VALIDATE_BIGINT, SCM_VALIDATE_INUM_MIN,
SCM_VALIDATE_INUM_MIN_COPY,
SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF,
SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE,
SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the
fixnum/bignum distinction visible.  Changed all uses to scm_to_size_t
or similar.
2004-07-10 14:35:36 +00:00
Marius Vollmer
93ccaef0c6 * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
SCM_I_MAKINUM and changed all uses.
2004-07-08 15:58:11 +00:00
Marius Vollmer
7888309be8 * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h".
Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and
scm_is_bool, respectively.
2004-07-06 10:59:25 +00:00
Stefan Jahn
2e945bccca 2003-05-29 Stefan Jahn <stefan@lkcc.org>
* configure.in: Removed -lm check and added a cached check for
        __libc_stack_end to get it building for mingw32 hosts.

2003-05-29  Stefan Jahn  <stefan@lkcc.org>

        * win32-dirent.c: Use malloc() instead of scm_malloc().

        * stime.c (s_scm_strftime): Add a type cast to avoid compiler
        warning.

        * posix.c (s_scm_putenv): Disable use of unsetenv() for the
        mingw32 build.

        * modules.c (s_scm_module_import_interface): Renamed local
        variable interface to _interface.  Seems like 'interface'
        is a special compiler directive for the mingw32 compiler.

        * mkstemp.c: Provide prototype to avoid compiler warning.

        * load.c (s_scm_search_path): Fixed absolute and relative
        path detections for native Windows platforms.

        * gc.h, threads.h: Export some more symbols using SCM_API
	(necessary to build on mingw32).

        * gc-freelist.c ("s_scm_map_free_list",
        "s_scm_gc_set_debug_check_freelist_x"): Fixed use of FUNC_NAME.

        * fports.c (fport_fill_input): Disable use of
        fport_wait_for_input() on Win32 platforms.

        * filesys.c (s_scm_basename): Fixed __MINGW32__ code.

        * Makefile.am: Modified some rules for cross compiling.

2003-05-29  Stefan Jahn  <stefan@lkcc.org>

        * raw-ltdl.c: Some more modifications for mingw32 platforms.

2003-05-29  Stefan Jahn  <stefan@lkcc.org>

        * Makefile.am (libguile_srfi_srfi_1_la_LDFLAGS,
        libguile_srfi_srfi_4_la_LDFLAGS,
        libguile_srfi_srfi_13_14__la_LDFLAGS): Added the -no-undefined
        option for the mingw32 build.

2003-05-29  Stefan Jahn  <stefan@lkcc.org>

        * standalone/Makefile.am: Setup to build on mingw32.
2003-05-29 14:39:13 +00:00
Mikael Djurfeldt
b9ad392e86 * ports.c, ports.h (scm_i_port_table_mutex): New mutex.
* fports.c (scm_evict_ports): Lock/unlock scm_i_port_table_mutex.

* ports.c (scm_close_port, scm_flush_all_ports): Ditto.

* ioext.c (scm_fdes_to_ports): Ditto.

* vports.c (scm_make_soft_port): Changed SCM_DEFER/ALLOW_INTS into
lock/unlock scm_i_port_table_mutex.

* strports.c (scm_mkstrport): Ditto.

* ports.c (scm_void_port, scm_port_for_each): Ditto.

* fports.c (scm_fdes_to_port): Ditto.
2003-04-24 16:02:04 +00:00
Marius Vollmer
73be1d9e8e Changed license terms to the plain LGPL thru-out. 2003-04-05 19:15:35 +00:00
Rob Browning
85286595b5 * fports.c: #include <config.h> if HAVE_CONFIG_H. 2003-03-25 23:55:09 +00:00
Marius Vollmer
3d7f708f21 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
SCM_DEBUG_DEPRECATED.  Removed their use thru-out Guile.
2002-11-03 22:09:20 +00:00
Han-Wen Nienhuys
67329a9eef * mallocs.c (scm_malloc_obj): use scm_gc_malloc in stead of
malloc.

* gc-segment.c (scm_i_get_new_heap_segment): remove cluster cruft:
only use SCM_MIN_HEAP_SEG_SIZE.

* ports.c (scm_add_to_port_table): add backwards compatibility
function

* ports.h: use scm_i_ prefix for port table and port table size.
2002-08-16 22:01:10 +00:00
Han-Wen Nienhuys
da220f2794 ("scm_new_port_table_entry"): return a boxed SCM in
stead of scm_t_port*. The function now takes a tag argument.
2002-08-08 23:02:28 +00:00
Han-Wen Nienhuys
402788a938 port GC fix 2002-08-04 15:25:07 +00:00
Neil Jerram
387d418c55 * Manual updates on hooks and features.
* Fix scm_t_c_hookype_t corruption.
2002-03-16 00:27:25 +00:00
Thien-Thi Nguyen
a6b844c224 Retire inclusion guard macro SCM_MAGIC_SNARFER. 2002-03-14 03:47:43 +00:00
Neil Jerram
04a98cff96 * iselect.c (collisionp, gnfds, greadfds, gwritefds, gexceptfds,
rreadfds, rwritefds, rexceptfds): Made static.

	* gc.c (terminating), fports.c (terminating): Renamed
	scm_i_terminating.
2002-03-12 21:12:25 +00:00
Dirk Herrmann
228a24ef30 Changes in doc/ref:
* api.txt, data-rep.texi: Renamed the struct scm_cell to
scm_t_cell.

* data-rep.texi: Renamed scm_alloc_cell to scm_cell and
scm_alloc_double_cell to scm_double_cell.

Changes in libguile:

* gc.c (SCM_HEAP_SEG_SIZE, CELL_UP, CELL_DN, NEXT_DATA_CELL,
init_heap_seg, alloc_some_heap), gc.h (struct scm_cell, struct
scm_t_cell, SCM_CELLPTR, SCM_GC_CARD_SIZE,
SCM_GC_IN_CARD_HEADERP), tags.h (SCM_CELLP):  Renamed the struct
scm_cell and all its uses to scm_t_cell in accordance to Guile's
naming scheme for types.

* alist.c (scm_acons), convert.i.c (CTYPES2UVECT,
CTYPES2UVECT_OPTIONAL), coop-threads.c (scm_call_with_new_thread,
scm_spawn_thread), debug.c (scm_make_debugobj), environments.c
(scm_make_environment), eval.c (scm_closure), fports.c
(scm_fdes_to_port), gc.c (scm_deprecated_newcell,
scm_deprecated_newcell2), inline.h (scm_alloc_cell, scm_cell),
list.c (SCM_I_CONS), numbers.c (scm_i_mkbig), pairs.c (scm_cons),
ports.c (scm_void_port), procs.c (scm_c_make_subr, scm_makcclo),
smob.c (scm_make_smob), smob.h (SCM_NEWSMOB), strings.c
(scm_take_str, scm_allocate_string), strports.c (scm_mkstrport),
unif.c (scm_make_uve), variable.c (make_variable), vectors.c
(scm_c_make_vector), vports.c (scm_make_soft_port): Renamed
scm_alloc_cell to scm_cell.

* environments.c (core_environments_observe), gc.c
(scm_deprecated_newcell2), goops.c (wrap_init, scm_wrap_object),
inline.h (scm_alloc_double_cell, scm_double_cell), num2float.i.c
(FLOAT2NUM), numbers.c (scm_make_real), procs.c
(scm_make_procedure_with_setter), smob.h (SCM_NEWSMOB2,
SCM_NEWSMOB3), struct.c (scm_make_struct, scm_make_vtable_vtable),
symbols.c (scm_mem2symbol, scm_mem2uninterned_symbol), weaks.c
(allocate_weak_vector): Renamed scm_alloc_double_cell to
scm_double_cell.
2002-03-01 00:19:20 +00:00
Stefan Jahn
edb810bb84 2002-02-27 Stefan Jahn <stefan@lkcc.org>
* Makefile.am (SUBDIRS): Added the `am' directory.

2002-02-27  Stefan Jahn  <stefan@lkcc.org>

        * gh.texi (scm transition summary): Documented some more
        gh equivalents and removed appropriate FIXME's.

2002-02-27  Stefan Jahn  <stefan@lkcc.org>

        * Makefile.am (EXTRA_DIST): Added the `LIBGUILEREADLINE-VERSION'
        file.

2002-02-27  Stefan Jahn  <stefan@lkcc.org>

        * convert.i.c, convert.c: Better range checking.

        * inet_aton.c, fports.c: Commented the inclusion of <winsock2.h>.

        * deprecation.c (vsnprintf): Define to `_vsnprintf' for
        Windows (MinGW).
2002-02-27 15:41:01 +00:00
Marius Vollmer
4c9419ac31 * gc.h, gc.c (scm_gc_sweep): Issue deprecation warning when
non-zero is returned from a port or smob free function.
(scm_malloc, scm_realloc, scm_strndup, scm_strdup,
scm_gc_register_collectable_memory,
scm_gc_unregister_collectable_memory, scm_gc_malloc,
scm_gc_realloc, scm_gc_free, scm_gc_strndup, scm_gc_strdup): New.

* backtrace.c, continuations.c, convert.i.c, coop-threads.c,
debug-malloc.c, dynl.c, environments.c, environments.h,
extensions.c, filesys.c, fports.c, gc.c, gc.h, gh_data.c, goops.c,
guardians.c, hooks.c, init.c, keywords.c, load.c, numbers.c,
ports.c, posix.c, procs.c, rdelim.c, regex-posix.c, root.c,
smob.c, stime.c, strings.c, struct.c, struct.h, symbols.c, unif.c,
vectors.c, weaks.c: Use scm_gc_malloc/scm_malloc and
scm_gc_free/free instead of scm_must_malloc and scm_must_free, as
appropriate.  Return zero from smob and port free functions.

* debug-malloc.c (scm_malloc_reregister): Handle "old == NULL".

* fports.c (scm_setvbuf): Reset read buffer to saved values when
it is pointing to the putback buffer.
2002-02-11 18:06:50 +00:00
Marius Vollmer
16d4699b6b Replaced SCM_NEWCELL and SCM_NEWCELL2 with scm_alloc_cell and
scm_alloc_double_cell, respectively.
2001-11-25 15:21:07 +00:00
Stefan Jahn
8f99e3f38b 2001-11-04 Stefan Jahn <stefan@lkcc.org>
* NEWS: Corrected remarks about SCM_API.

        * configure.in: Defining USE_DLL_IMPORT definition to indicate
        usage of DLL import macros in `libguile/__scm.h'.
        (LIBOBJS): Removed `fileblocks.o' from the list of object files.
        Somehow Jim Blandy's patch from 1997 did not survive.

2001-11-04  Stefan Jahn  <stefan@lkcc.org>

        * configure.in (EXTRA_DEFS): Follow-up patch.  Using SCM_IMPORT
        instead of __SCM_IMPORT__.

        * readline.c (scm_readline_init_ports): Disable input/output
        stream redirection for Win32.  The readline package for Win32
        does not support this.  The guile-readline library works fine
        for command line editing.

        * readline.h (SCM_RL_API): Renamed __FOO__ macros into FOO.

2001-11-04  Stefan Jahn  <stefan@lkcc.org>

        * Makefile.am (libguile_la_LIBADD): Added $(THREAD_LIBS_LOCAL)
        here (was at guile_LDADD) which describes the dependency
        correctly and allows a clean build on Win32.

        * __scm.h (SCM_API): Follow-up patch.  Renamed __FOO__ macros
        into FOO.

        * __scm.h: USE_DLL_IMPORT indicates the usage of the DLL
        import macros for external libraries (libcrypt, libqthreads,
        libreadline and libregex).

        * coop-defs.h: Include <winsock2.h> for `struct timeval'.

        * posix.c (flock): Added support for flock() in M$-Windows.

        * guile.c (SCM_IMPORT): Follow-up patch.  Use SCM_IMPORT instead
        of __SCM_IMPORT__.

        * fports.c (getflags): Differentiate reading and writing pipes
        descriptors.

        * filesys.c (S_IS*): Redefine all of the S_IS*() macros for
        M$-Windows.

        * coop.c (coop_condition_variable_timed_wait_mutex): Use
        conditionalized error code if `ETIMEDOUT' is not available.
        (scm_thread_usleep): Remove bogus declaration of `struct timeval
        timeout'.

        * numbers.c (PTRDIFF_MIN): Moved this definition where it actually
        belongs.  That is because NO_PREPRO_MAGIC gets undefined after
        each inclusion of `num2integral.i.c'.
        (SIZE_MAX): Define NO_PREPRO_MAGIC if SIZE_MAX is undefined.

2001-11-04  Stefan Jahn  <stefan@lkcc.org>

        * md/Makefile.am (EXTRA_DIST): Added `i386.asm'.

        * md/i386.asm: New file.  Contains the Intel syntax version for
        nasm/tasm/masm of the file `i386.s'.

        * qt.h.in: Definition of QT_API, QT_IMPORT and QT_EXPORT.
        Prefixed each symbols which is meant to go into a DLL.

        * Makefile.am (libqthreads_la_LDFLAGS):  Put `-no-undefined'
        into LDFLAGS to support linkers which do not allow unresolved
        symbols inside shared libraries.
        (EXTRA_DIST): Add `libqthreads.def', which is an export file
        definition for M$-Windows.  It defines exported symbols.  This is
        necessary because the M$VC linker does not know how to export
        assembler symbols into a DLL.

2001-11-04  Stefan Jahn  <stefan@lkcc.org>

        * srfi-13.h, srfi-14.h, srfi-4.h: Follow-up patch.  Renamed
        __FOO__ macros into FOO.

2001-11-04  Stefan Jahn  <stefan@lkcc.org>

        * tests/ports.test: Run (close-port) before (delete-file) if
        necessary/advisory.
2001-11-04 15:52:30 +00:00
Marius Vollmer
b8b17bfd31 Include io.h' is possible. Put *fp' into referring
statement block in `scm_fport_buffer_add()'.
Some corrections in `getflags()'.
2001-11-02 00:09:14 +00:00
Dirk Herrmann
8c494e9973 * Removed lots of deprecated stuff. 2001-08-31 14:42:31 +00:00
Marius Vollmer
f5fd8aa2a7 Replaced "scm_t_portable" with "scm_port_table" which was an artifact
from the great "scm_*_t -> scm_t_" renaming.
2001-08-26 21:54:11 +00:00
Dirk Herrmann
63bcad1964 * Minor changes. 2001-07-16 10:22:38 +00:00
Thien-Thi Nguyen
a06e3a75b2 Remove "face-lift" comment. 2001-07-09 07:36:48 +00:00
Martin Grabmüller
82893676f4 Make compilation under Windows easier. 2001-06-26 17:53:09 +00:00
Marius Vollmer
92c2555f69 replace "scm_*_t" with "scm_t_*". 2001-06-14 19:50:43 +00:00
Dirk Herrmann
e81d98ec2d * Introduce SCM_UNUSED and mark unused function parameters.
* Introduce SCM_DEBUG_PAIR_ACCESSES.
* Extend the possibilities of SCM_DEBUG_CELL_ACCESSES.
2001-06-07 21:12:19 +00:00
Rob Browning
f47a5239d4 * fports.c: HAVE_ST_BLKSIZE changed to
HAVE_STRUCT_STAT_ST_BLKSIZE.
(scm_fport_buffer_add): HAVE_ST_BLKSIZE changed to
HAVE_STRUCT_STAT_ST_BLKSIZE.
2001-06-02 20:30:20 +00:00
Michael Livshin
c014a02eec revert the ill-considered part of the 2001-05-24 changes 2001-05-26 20:51:22 +00:00
Michael Livshin
1be6b49ccb * 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
Marius Vollmer
86d31dfe7d Merge from mvo-vcell-cleanup-1-branch. 2001-05-15 14:57:22 +00:00
Martin Grabmüller
1e6808ea20 Correct, update, improve and clean up a lot of docstrings in order to make
the documentation much more consistent.
2001-04-03 13:19:05 +00:00
Gary Houston
c6c79933b5 * gc.c (scm_must_malloc): changed the comment explaining when
scm_must variants of malloc/free etc., should be used, based on
	explanation from Dirk Herrmann.
	* fports.c (scm_fport_buffer_add): use FUNC_NAME instead of a local
	string with procedure name.  use scm_must_malloc instead of malloc.
	(scm_setvbuf, scm_fdes_to_port, fport_close): use scm_must variants
	of malloc/free.
	* ports.c (scm_add_to_port_table, scm_remove_from_port_table,
	scm_ungetc): use scm_must variants of malloc/realloc/free.
	(scm_add_to_port_table, scm_ungetc): define FUNC_NAME.
2001-03-17 16:59:48 +00:00
Neil Jerram
2069af3835 * Minor docstring updates. 2001-02-23 20:24:15 +00:00
Dirk Herrmann
efa40607b1 * Added a file-port? primitive. 2001-01-25 17:40:50 +00:00
Dirk Herrmann
a98bddfd12 * Made the port implementations less tightly coupled within guile. 2001-01-25 17:18:41 +00:00
Gary Houston
c2da26487a * ioext.c (scm_read_string_x_partial): new procedure, implements
read-string!/partial.
	* ports.c (scm_take_from_input_buffers): new procedure used by
	scm_read_string_x_partial.
	(scm_drain_input): use scm_take_from_input_buffers.
2001-01-06 22:03:07 +00:00
Gary Houston
0c6d2191ef * fports.c (fport_write): bugfix: handle short writes for
unbuffered ports too.  optimize the buffered case by minimizing
	the number of write/flush calls.
	(write_all): new helper procedure.
2001-01-02 00:38:41 +00:00
Keisuke Nishida
e841c3e0c0 Smob-related creanup. 2000-12-08 17:32:56 +00:00
Marius Vollmer
8dc9439fc6 * 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
Gary Houston
6b72ac1d10 * fports.c: include gc.h.
(fport_flush, fport_close): silently ignore I/O errors when
	closing a port during gc.  it's better than aborting in scm_error.

	* throw.c (scm_handle_by_message): remove obsolete comment.
2000-11-13 23:16:38 +00:00
Gary Houston
9f561420d3 * fports.c (scm_open_file): fix the 'b' option. Thanks
to George Caswell.
2000-11-12 12:20:52 +00:00
Dirk Herrmann
b24b5e13bf * Get rid of calls to SCM_ROSTRINGP.
* Fix some string/symbol output problems with regards to substrings.
* Fix error output to prefer procedure name parameters over stack data.
* Use SCM_(SET_)?FILENAME where appropriate.
* Prefer calling scm_remember over scm_protect/unprotect_object calls.
2000-11-02 10:36:31 +00:00