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

114 commits

Author SHA1 Message Date
Andy Wingo
0607ebbfcf locking for putc, puts
* libguile/ports.c (scm_putc, scm_puts):
* libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into
  _unlocked and locked variants.  Change all callers to use the
  _unlocked versions.
2011-11-08 00:55:05 +01:00
Michael Gran
0f1fd214f1 More descriptive error for dynamic-pointer
* libguile/dynl.c (sysdep_dynl_value): Failure to find a symbol is not
  an error, so raise our own, more appropriate error.

* test-suite/tests/foreign.test ("dynamic-pointer"): Add a test.
2011-03-31 12:34:47 +02:00
Ludovic Courtès
e66ff09adb Make sure we don't override the user's extension search path.
* libguile/dynl.c (augment_env): New function.
  (sysdep_dynl_init): Use it instead of `lt_dladdsearchdir'.

* configure.ac: Define `SHARED_LIBRARY_PATH_VARIABLE'.
2011-02-12 12:25:18 +01:00
Andy Wingo
ba270f8c26 remove type discusison from dynamic-pointer docstring
* doc/ref/api-foreign.texi:
* libguile/dynl.c (scm_dynamic_pointer): Remove discussion of types from
  the docstring.
2010-08-06 13:41:58 +02:00
Ludovic Courtès
183a2a224b Update the FFI doc.
* doc/ref/api-foreign.texi (Foreign Types): Remove bits about typed
  foreign pointers.  Add `void'.
  (Foreign Variables): Update the doc of `dynamic-pointer' and the
  `numptob' example.  Remove `foreign-set!' and `foreign-ref'.  Add
  `pointer-address', `make-pointer', `%null-pointer', and
  `null-pointer?'
  (Void Pointers and Byte Access): Make it clear that wrapped pointers
  are untyped.  Remove `void' from here.  Replace `foreign->bytevector'
  and `bytevector->foreign' by `pointer->bytevector' and
  `bytevector->pointer'.  Add `dereference-pointer' and the rest of the
  `numptob' example.
  (Dynamic FFI): Update examples.  Remove `%null-pointer' from here.

* libguile/dynl.c (scm_dynamic_pointer): Update docstring.

* libguile/foreign.c (scm_dereference_pointer,
  scm_pointer_to_bytevector): Likewise.

* module/system/foreign.scm (null-pointer?): Add docstring.
2010-07-28 12:24:25 +02:00
Ludovic Courtès
5b46a8c2c8 Use "pointer" instead of "foreign" when dealing with wrapped pointers.
* libguile/foreign.h (scm_t_foreign_finalizer): Rename to...
  (scm_t_pointer_finalizer): ... this.
  (SCM_FOREIGN_P): Rename to...
  (SCM_POINTER_P): this.
  (SCM_VALIDATE_FOREIGN): Rename to...
  (SCM_VALIDATE_POINTER): ... this.
  (SCM_FOREIGN_HAS_FINALIZER): Rename to...
  (SCM_POINTER_HAS_FINALIZER): ... this.
  (scm_take_foreign_pointer): Rename to...
  (scm_from_pointer): ... this.
  (scm_foreign_address): Rename to...
  (scm_pointer_address): ... this.
  (scm_foreign_to_bytevector): Rename to...
  (scm_pointer_to_bytevector): ... this.
  (scm_foreign_set_finalizer_x): Rename to...
  (scm_set_pointer_finalizer_x): ... this.
  (scm_bytevector_to_foreign): Rename to...
  (scm_bytevector_to_pointer): ... this.
  (scm_i_foreign_print): Rename to...
  (scm_i_pointer_print): ... this.

* libguile/foreign.c: Update accordingly.

* libguile/tags.h (scm_tc7_foreign): Rename to...
  (scm_tc7_pointer): ... this.

* libguile/foreign.c, libguile/deprecated.c, libguile/dynl.c,
  libguile/evalext.c, libguile/gc.c, libguile/goops.c, libguile/gsubr.c,
  libguile/gsubr.h, libguile/print.c, libguile/snarf.h,
  libguile/vm-i-system.c, module/system/foreign.scm,
  test-suite/standalone/test-ffi, test-suite/tests/foreign.test: Update
  accordingly.
2010-07-28 12:24:25 +02:00
Ludovic Courtès
d4149a510e Simplify the (system foreign) API.
Suggested by Neil Jerram.

* libguile/foreign.h (SCM_FOREIGN_TYPE, SCM_FOREIGN_VALUE_REF,
  SCM_FOREIGN_VALUE_SET, SCM_FOREIGN_LEN, SCM_FOREIGN_TYPED_P,
  SCM_FOREIGN_VALUE_P, SCM_VALIDATE_FOREIGN_VALUE, scm_foreign_set_x,
  scm_foreign_type): Remove.
  (scm_foreign_ref): Rename to...
  (scm_foreign_address): ... this.
  (scm_take_foreign_pointer): Update.
  (SCM_FOREIGN_POINTER): Remove CTYPE argument.  Update callers.
  (scm_make_pointer): New declaration.

* libguile/foreign.c (scm_to_uintptr, scm_from_uintptr): New macros.
  (scm_make_pointer): New function.
  (scm_take_foreign_pointer): Remove TYPE and LEN arguments.  Update
  callers.
  (scm_foreign_ref): Remove to...
  (scm_foreign_address): ... this.  Remove type-related code.
  (scm_foreign_set_x): Remove.
  (scm_foreign_to_bytevector): Change argument order; make LEN argument
  compulsory.
  (scm_i_foreign_print): Remove type printing.
  (unpack): Remove foreign-type checking.

* libguile/deprecated.c (scm_dynamic_args_call): Update accordingly.

* libguile/dynl.c (scm_dynamic_pointer): Remove the TYPE and LEN
  arguments; update callers.  Update to the new foreign API.

* libguile/dynl.h (scm_dynamic_pointer): Update.

* libguile/gsubr.c (create_gsubr): Update to the new foreign API.

* libguile/gsubr.h (SCM_SUBRF, SCM_SUBR_GENERIC): Ditto.

* libguile/snarf.h (SCM_IMMUTABLE_FOREIGN): Ditto.

* libguile/vm-i-system.c (subr_call): Ditto.

* module/system/foreign.scm (null-pointer?): New procedure.

* test-suite/standalone/test-ffi: Update to the new
  `bytevector->foreign' signature.

* test-suite/tests/foreign.test ("null pointer")["null pointer
  identity", "null-pointer? %null-pointer"]: New tests.
  ["foreign-set! other-null-pointer", "foreign->bytevector
  other-null-pointer"]: Remove.
  ("make-pointer", "foreign<->bytevector"): New test prefixes.
2010-07-26 19:38:52 +02:00
Andy Wingo
cd038da546 remove libguile/lang.h, deprecate %nil (in favor of #nil)
* libguile/Makefile.am:
* libguile/init.c:
* libguile/lang.c:
* libguile/lang.h: Remove lang.c and lang.h.

* libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here.

* module/ice-9/deprecated.scm (%nil): %nil definition moved here.

* libguile/alist.c:
* libguile/async.c:
* libguile/backtrace.c:
* libguile/boolean.c:
* libguile/dynl.c:
* libguile/eval.c:
* libguile/filesys.c:
* libguile/fluids.c:
* libguile/list.c:
* libguile/load.c:
* libguile/options.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/promises.c:
* libguile/sort.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/vectors.c:
* libguile/vm.c:
* libguile/weaks.c:
* srfi/srfi-1.c: <libguile/lang.h> references removed.
2010-04-09 14:26:31 +02:00
Andy Wingo
43cd9cec23 deprecate dynamic-args-call, and update docs some more
* libguile/deprecated.h (scm_dynamic_args_call): Deprecate.
* libguile/deprecated.c:
* libguile/dynl.h:
* libguile/dynl.c:

* doc/ref/api-foreign.texi: More doc updates.
2010-04-02 00:34:49 +02:00
Ludovic Courtès
d12f974b43 Change `dynamic-link' to return a global handle when the argument is omitted.
* libguile/dynl.c (sysdep_dynl_link): Handle FNAME == NULL.
  (scm_dynamic_link): Make argument optional.  Adjust body accordingly.

* test-suite/standalone/test-ffi (global, strerror, strlen): New
  bindings.
  Add test for these bindings.

* doc/ref/api-modules.texi (Low level dynamic linking): Update
  description of `dynamic-link'.
2010-03-17 00:54:01 +01:00
Ludovic Courtès
3023e7b0c9 Fix doc string of `dynamic-pointer'.
* libguile/dynl.c (scm_dynamic_pointer): Fix doc string.  Reformat body.
2010-03-17 00:54:00 +01:00
Andy Wingo
52fd9639fd foreign.h presents a more pointer-centric interface
* libguile/foreign.c:
* libguile/foreign.h: Rework interface to be more pointer-centric.
  Details are:
  (SCM_FOREIGN_TYPE_STRUCT, SCM_FOREIGN_TYPE_POINTER): Removed; now the
  pointer in a foreign is first-class. If it points to a native type
  like uint32, then it still has a tag; but if it points to something
  else, like a struct or a pointer or something, then its type is VOID
  (i.e., void*).
  (SCM_FOREIGN_POINTER): Rename from SCM_FOREIGN_OBJECT.
  (SCM_FOREIGN_VALUE_REF, SCM_FOREIGN_VALUE_SET): Rename from
  SCM_FOREIGN_OBJECT_REF and SCM_FOREIGN_OBJECT_SET, to indicate that
  they only work with value types.
  (SCM_FOREIGN_HAS_FINALIZER): Reserve a bit to indicate if the foreign
  pointer in question has a finalizer registered.
  (SCM_FOREIGN_LEN): For void* pointers, optionally store the length in
  bytes of the associated memory region.
  (SCM_FOREIGN_VALUE_P): Rename from SCM_FOREIGN_SIMPLE_P.
  (SCM_VALIDATE_FOREIGN_VALUE): Rename from SCM_VALIDATE_FOREIGN_SIMPLE.
  (scm_take_foreign_pointer): Rename from scm_c_take_foreign. Remove
  scm_c_from_foreign.
  (scm_foreign_type): New accessor.
  (scm_foreign_ref, scm_foreign_set_x): Take some optional args, used
  when dereferencing void pointers.

* libguile/dynl.h:
* libguile/dynl.c (scm_dynamic_pointer): New function, used by
  scm_dynamic_func. Adapt code to foreign.h changes.

* libguile/goops.c (scm_enable_primitive_generic_x)
  (scm_set_primitive_generic_x): Use the SCM_SET_SUBR_GENERIC macro.

* libguile/gsubr.c (create_gsubr): Adapt to API change.
* libguile/gsubr.h (SCM_SUBRF, SCM_SUBR_GENERIC): Store the pointer
  directly, not indirected.

* libguile/snarf.h (SCM_DEFINE, SCM_IMMUTABLE_FOREIGN): Store subr
  pointers directly. Adapt to SCM_FOREIGN_TYPE_VOID change.

* libguile/vm-i-system.c (subr-call): Access the void* directly.
2010-01-26 22:56:41 +01:00
Andy Wingo
e773b1e6ce dynamic-func returns foreign objects, not bignums
* libguile/dynl.c (scm_dynamic_func, scm_dynamic_call)
  (scm_dynamic_args_call): Change the representation of dynamic
  functions to be foreign objects. Shouldn't affect any users, as people
  should be treating the return value of dynamic-func as an opaque
  object.
2010-01-04 12:39:21 +01:00
Andy Wingo
28af5ee5ec add $libir to the ltdl path, not $pkglibdir; add extensionsdir
* libguile/Makefile.am (libpath.h): Fix SCM_LIB_DIR to point to the
  libdir, not pkglibdir. Add SCM_EXTENSIONS_DIR, for a dir to put in the
  dynamic-link search path that's not managed by ldconfig or the like;
  and put this dir in the "extensionsdir" key of %guile-build-info.

* libguile/dynl.c (sysdep_dynl_init): Rename the installed-libdir
  environment var to GUILE_SYSTEM_EXTENSIONS_PATH (from
  GUILE_SYSTEM_LTDL_PATH). Also add SCM_EXTENSIONS_DIR to the ltdl
  search path in the default case.
* meta/uninstalled-env.in: Adapt override to match.

* meta/guile-2.0.pc.in: Add extensionsdir, so you can pkg-config
  --variable=extensionsdir guile-2.0.
2009-10-13 11:31:02 +02:00
Andy Wingo
eb350124a8 add the libdir to the ltdl lib search path
* libguile/Makefile.am (libpath.h): Fix pkgdatadir, pkglibdir, and
  pkgincludedir entries. Add a new define, SCM_LIB_DIR.

* libguile/dynl.c (sysdep_dynl_init): Add the libdir to the libltdl
  search path. Should fix
  http://thread.gmane.org/gmane.lisp.guile.bugs/4289/focus=4296 -- that
  is, it should allow guile to be invoked from whereever it is
  installed, without munging LTDL_LIBRARY_PATH or the like variables.

  There is a trick though -- during the build, we don't want to be
  looking in the $libdir for loadable modules. So as with
  GUILE_SYSTEM_PATH, we have GUILE_SYSTEM_LTDL_PATH.

* meta/uninstalled-env.in: Set GUILE_SYSTEM_LTDL_PATH to "" when
  building.
2009-09-16 18:10:19 +02:00
Ludovic Courtès
fbb857a472 Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
	lib/Makefile.am
	libguile/Makefile.am
	libguile/frames.c
	libguile/gc-card.c
	libguile/gc-freelist.c
	libguile/gc-mark.c
	libguile/gc-segment.c
	libguile/gc_os_dep.c
	libguile/load.c
	libguile/macros.c
	libguile/objcodes.c
	libguile/programs.c
	libguile/strings.c
	libguile/vm.c
	m4/gnulib-cache.m4
	m4/gnulib-comp.m4
	m4/inline.m4
2009-08-18 00:06:45 +02:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Ludovic Courtès
2a77682322 Use scm_gc malloc_pointerless ()' in scm_i allocate_string_pointers ()'.
* libguile/dynl.c (free_string_pointers): Remove.
  (scm_dynamic_args_call): Remove reference to `free_string_pointers ()'
  and remove dynwind.

* libguile/posix.c (free_string_pointers): Remove.
  (scm_execl, scm_execlp, scm_execle, scm_environ): Remove references
  to `free_string_pointers ()'.

* libguile/simpos.c (free_string_pointers): Remove.
  (scm_system_star): Remove reference to `free_string_pointers ()',
  remove enclosing dynwind.

* libguile/strings.c (scm_i_allocate_string_pointers): Use
  `scm_gc_malloc_pointerless ()' and `scm_gc_malloc ()'
  instead of `scm_malloc ()' and `scm_to_locale_string ()',
  so that the result is automatically GC'd when no longer
  referenced.  Remove unneeded dynwind.
  (scm_i_free_string_pointers): Remove.

* libguile/strings.h (scm_i_free_string_pointers): Remove declaration.
2009-01-18 16:02:04 +01:00
Ludovic Courtès
44e268898b Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
	lib/Makefile.am
	libguile/gc-card.c
	libguile/gc-freelist.c
	libguile/gc-mark.c
	libguile/gc-segment.c
	libguile/gc.c
	libguile/gc.h
	libguile/gc_os_dep.c
	libguile/private-gc.h
	m4/.cvsignore
	m4/gnulib-cache.m4
	m4/gnulib-comp.m4
2008-09-13 22:51:27 +02:00
Ludovic Courtès
dbb605f575 Include <config.h> in all C files; use #ifdef HAVE_CONFIG_H' rather than #if'. 2008-09-13 15:35:27 +02:00
Ludovic Courtes
a4a141f679 Removed a lot of now-useless SMOB mark/free functions.
* libguile/arbiters.c (scm_init_arbiters): Don't invoke `scm_set_smob_mark'.

* libguile/async.c (async_gc_mark): Removed.
  (scm_init_async): Don't invoke `scm_set_smob_mark'.

* libguile/coop-pthreads.c (thread_mark): Removed.
  (create_thread): Use `scm_gc_malloc' instead of `scm_malloc' when
  allocating `launch_data'.
  (mutex_mark): Removed.
  (scm_threads_init): Don't invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/debug.c (scm_init_debug): Don't invoke `scm_set_smob_mark'.

* libguile/dynl.c (dynl_obj_mark): Removed.
  (scm_init_dynamic_linking): Don't invoke `scm_set_smob_mark'.

* libguile/dynwind.c (winder_mark): Removed.
  (scm_init_dynwind): Don't invoke `scm_set_smob_mark'.

* libguile/environments.c (environment_mark): Removed.
  (environment_free): Removed.
  (observer_mark): Removed.
  (core_environments_mark): Removed.
  (core_environments_finalize): Removed.
  (leaf_environment_mark): Removed.
  (leaf_environment_free): Removed.
  (leaf_environment_funcs): Don't refer to the above funcs.
  (eval_environment_mark): Removed.
  (eval_environment_free): Removed.
  (eval_environment_funcs): Don't refer to the above funcs.
  (import_environment_mark): Removed.
  (import_environment_free): Removed.
  (import_environment_funcs): Don't refer to the above funcs.
  (export_environment_mark): Removed.
  (export_environment_free): Removed.
  (export_environment_funcs): Don't refer to the above funcs.
  (scm_environments_prehistory): Don't invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/environments.h (scm_environment_funcs)[mark]: Removed.
  [free]: Removed.

* libguile/eval.c (promise_mark): Removed.
  (promise_free): Removed.
  (scm_init_eval): Don't invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/fluids.c (fluid_free): Removed.
  (scm_fluids_prehistory): Don't invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/futures.c (future_mark): Removed.
  (scm_init_futures): Don't invoke `scm_set_smob_mark'.

* libguile/hashtab.c (hashtable_free): Removed.
  (scm_hashtab_prehistory): Don't invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/hooks.c (scm_init_hooks): Don't invoke `scm_set_smob_mark'.

* libguile/keywords.c (scm_init_keywords): Don't invoke
  `scm_set_smob_mark'.

* libguile/macros.c (scm_init_macros): Don't invoke `scm_set_smob_mark'.

* libguile/modules.c (scm_init_modules): Don't invoke
  `scm_set_smob_mark'.

* libguile/print.c (scm_init_print): Don't invoke `scm_set_smob_mark'.

* libguile/random.c (scm_i_copy_rstate): Use `scm_gc_malloc' instead of
  `scm_malloc'.
  (scm_c_make_rstate): Likewise.
  (rstate_free): Removed.
  (scm_init_random): Don't invoke `scm_set_smob_free'.

* libguile/srcprop.c (srcprops_mark): Removed.
  (scm_init_srcprop): Don't invoke `srcprops_mark'.

* libguile/srfi-14.c (charset_free): Removed.
  (scm_init_srfi_14): Don't invoke `scm_set_smob_free'.

* libguile/srfi-4.c (uvec_mark): Removed.
  (uvec_free): Removed.
  (scm_init_srfi_4): Don't invoke `scm_set_smob_free' and
  `scm_set_smob_mark'.

* libguile/threads.c (thread_mark): Removed.
  (fat_mutex_mark): Removed.
  (fat_cond_mark): Removed.
  (scm_init_threads): Dont invoke `scm_set_smob_mark' and
  `scm_set_smob_free'.

* libguile/unif.c (bitvector_free): Removed.
  (array_mark): Removed.
  (array_free): Removed.
  (scm_init_unif): Don't invoke `scm_set_smob_free' and
  `scm_set_smob_mark'.

git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-28
2008-09-05 09:34:23 +02:00
Marius Vollmer
661ae7ab6b Renamed the "frames" that are related to dynamic-wind to "dynamic
contexts.  Renamed all functions from scm_frame_ to scm_dynwind_.
Updated documentation.
2006-01-29 00:23:28 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Neil Jerram
e45947bf06 Critical section review 2005-03-30 18:32:19 +00:00
Marius Vollmer
9de87eea47 See ChangeLog from 2005-03-02. 2005-03-02 20:42:01 +00:00
Marius Vollmer
a8255dca08 * Makefile.am (INCLUDES): Use @LTDLINC@ instead of
"-I$(top_srcdir)/libguile-ltdl".
(libguile_la_LIBADD): Use @LIBLTDL@ instead of
"../libguile-ltdl/libguile-ltdl.a".

* guile.c, dynl.c: Switched to using libltdl directly.  Replaced
all references to scm_lt_* with just lt_*.  Include <ltdl.h>
instead of <libguile-ltdl.h>.
2004-10-22 13:01:59 +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
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
Marius Vollmer
b9bd8526f0 * numbers.h, numbers.c, discouraged.h, discouraged.c (scm_short2num,
scm_ushort2num, scm_int2num, scm_uint2num, scm_long2num,
scm_ulong2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
scm_num2ushort, scm_num2int, scm_num2uint, scm_num2long,
scm_num2ulong, scm_num2size, scm_num2ptrdiff, scm_long_long2num,
scm_ulong_long2num, scm_num2long_long, scm_num2ulong_long):
Discouraged by moving to discouraged.h and discouraged.c and
reimplementing in terms of scm_from_* and scm_to_*.  Changed all uses
to the new scm_from_* and scm_to_* functions.
2004-08-02 16:14:04 +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
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
Dirk Herrmann
2ff0840571 * dynl.c (SET_DYNL_HANDLE): Add cast to scm_t_bits to make
explicit what happens.

	* guardians.c (TCONC_IN): Use SCM_SET_CELL_OBJECT_x rather than
	SCM_SET_CELL_WORD_x when writing scheme objets to cell elements.
2004-05-15 15:39:27 +00:00
Marius Vollmer
f5710d53b1 Use SCM_SMOB_* instead of SCM_CELL_* as appropriate. Use
SCM_SMOB_FLAGS and SCM_SET_SMOB_FLAGS instead of accessing the
zeroth word directly.  Use SCM_SMOB_PREDICATE as appropriate.
2004-05-06 16:43:14 +00:00
Kevin Ryde
4d3526d096 Add a copyright year. 2003-11-08 22:18:33 +00:00
Kevin Ryde
9e37591017 (scm_dynamic_unlink): Need scm_list_1 on error message
argument.  Reported by Mike Gran.
2003-11-08 22:18:01 +00:00
Marius Vollmer
73be1d9e8e Changed license terms to the plain LGPL thru-out. 2003-04-05 19:15:35 +00:00
Rob Browning
66d4f5ccaa * dynl.c (sysdep_dynl_link): switch to scm_lt_dlhandle,
scm_lt_dlopenext, and scm_lt_dlerror.
(sysdep_dynl_unlink): switch to scm_lt_dlhandle, scm_lt_dlclose,
and scm_lt_dlerror.
(sysdep_dynl_func): switch to scm_lt_dlhandle, scm_lt_dlsym,
and scm_lt_dlerror.
(sysdep_dynl_init): switch to scm_lt_dlinit();
2002-10-05 04:55:22 +00:00
Marius Vollmer
8e583c6e1b Use scm_lt_ prefix for libltdl functions. 2002-10-03 22:44:48 +00:00
Han-Wen Nienhuys
c2cbcc5768 gc statistic tweaks 2002-08-04 14:09:14 +00:00
Gary Houston
4f6f9ae3d3 * dynl.c: Don't define stub procedures if DYNAMIC_LINKING is not
defined.  They don't do anything useful, especially since the
	only case where DYNAMIC_LINKING is undefined seems to be
	when --with-modules=no is given to configure, which is basically
	requesting that the "dynamic linking module" be omitted.

	* Makefile.am (libguile_la_SOURCES): move dynl.c from
	libguile_la_SOURCES to EXTRA_libguile_la_SOURCES.

	* extensions.c (load_extension): check DYNAMIC_LINKING for
	scm_dynamic_call.
	* init.c (scm_init_guile_1): check DYNAMIC_LINKING for
	scm_init_dynamic_linking.

	* configure.in: check dynamic linking before modules.  Add dynl.c
	if dynamic linking is available, i.e., unless --with-modules=no
	was given to configure.
2002-07-12 17:46:15 +00:00
Gary Houston
ee95d597c7 * dynl.c: docstring editing. 2002-07-10 22:20:16 +00:00
Gary Houston
46732b5441 * dynl.c (scm_dynamic_call): docstring editing. 2002-07-09 22:40:03 +00:00
Gary Houston
732b932732 * dynl.c: Removed all SCM_DEFER_INTS/SCM_ALLOW_INTS, which won't
do anything useful.  Added a comment about need for a mutex if
	pre-emptive threading is supported.
2002-06-30 20:34:38 +00:00
Gary Houston
2ee08a2833 * posix.c (scm_convert_exec_args), dynl.c
(scm_make_argv_from_stringlist): static procs: 1) renamed both to
	allocate_string_pointers.  2) simplified: don't reallocate the
	strings, just make an array of pointers 3) avoid memory leaks on
	error 4) let the procedure report errors in its own name.
	Consequences: 1) the procedures now assume that SCM strings are
	nul-terminated, which should always be the case.  2) Since strings
	are not reallocated, it's now possible for strings passed to
	dynamic-args-call to be mutated.
2002-06-30 19:27:18 +00:00
Thien-Thi Nguyen
a6b844c224 Retire inclusion guard macro SCM_MAGIC_SNARFER. 2002-03-14 03:47:43 +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
Neil Jerram
c96d76b88d * First batch of libguile changes for Elisp support.
* Fixed a few typos.
* Minor rationalization of macros relating to source breakpoints.
2002-01-22 23:31:39 +00:00
Dirk Herrmann
8c494e9973 * Removed lots of deprecated stuff. 2001-08-31 14:42:31 +00:00
Martin Grabmüller
58ade1022c * 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