1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 12:20:26 +02:00
Commit graph

94 commits

Author SHA1 Message Date
Marius Vollmer
e1fbffa9f4 (SCM_FUNC_CAST_ARBITRARY_ARGS): Use "SCM (*)()" for C++
as well.  "SCM (*)(...)" does not work on RedHat 7.1.
2001-05-06 21:19:53 +00:00
Keisuke Nishida
a9205f0774 * snarf.h (SCM_CONST_LONG): Deprecated.
* tag.c (CONST_INUM): New macro.  Use it to define scm_utag_*.
2001-03-16 05:11:34 +00:00
Dirk Herrmann
a3fc3be99d * Make the creation of bindings more straightforward. 2000-12-12 14:07:06 +00:00
Dirk Herrmann
38ae064c6e * Use scm_mem2symbol or scm_str2symbol to create symbol objects. 2000-12-08 17:08:34 +00:00
Dirk Herrmann
3c6d9d717f * Renamed SCM__X tokens to better readable ones that also follow the
SCM_SNARF_ prefix convention.
2000-06-21 08:43:12 +00:00
Mikael Djurfeldt
94a708591f * snarf.h (SCM_SNARF_HERE, SCM_SNARF_INIT, SCM_SNARF_DOCS):
Renamed from SCM_HERE, SCM_INIT, SCM_DOCS.
2000-06-12 11:59:57 +00:00
Mikael Djurfeldt
d80f396e99 * snarf.h, guile-snarf.awk.in, guile-snarf.in: Replaced snarf
markers with identifiers (SCM__I, SCM__D, SCM__S, SCM__E).
(Thanks to Bernard Urban.)
2000-06-08 18:48:24 +00:00
Dirk Herrmann
54778cd312 Lots of fixes to make guile (at some time) compile with strict typing. 2000-04-03 08:47:51 +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
Mikael Djurfeldt
e282f286eb * alist.c, eval.c, net_db.c, posix.c, print.c, snarf.h, struct.c,
tags.h: Fixed copyright notices.
2000-03-12 16:08:24 +00:00
Mikael Djurfeldt
fd61ba9ee2 * snarf.h (SCM_PROC1): Replaced SCM (*) (...) with
SCM_FUNC_CAST_ARBITRARY_ARGS.
2000-01-12 01:29:42 +00:00
Greg J. Badros
2fdcf8bdf0 * backtrace.c: Fix spelling typo in a comment.
* snarf.h: Use new SCM_DOCS macro to encapsulate the non SCM_INIT
text.  Reformatted some of the expansions.
2000-01-09 01:07:17 +00:00
Greg J. Badros
1e76143f0f * scm_validate.h (SCM_OUT_OF_RANGE): Use scm_out_of_range_pos to
report the position of the argument.

* error.h, error.c (scm_out_of_range_pos):  Added this function to
take extra "pos" argument, the position number of the errant
argument.

* debug.c: Use SCM_OUT_OF_RANGE instead of scm_out_of_range.

* snarf.h: Use SCM_HERE and SCM_INIT as names, not SCM_NOTSNARF
and SCM_SNARFING.  Also put the %%% in the SCM_INIT since Mikael
prefers that and I'm reasonably indifferent.
2000-01-07 23:53:20 +00:00
Mikael Djurfeldt
73d8385e9f * snarf.h (SCM_INSITU, SCM_INIT): Resurrected. 2000-01-07 23:33:29 +00:00
Greg J. Badros
4b4d0898a6 * snarf.h: Factor out differences between C++ and non-C++ into
SCM_FUNC_CAST_ARBITRARY_ARGS macro.  Modify all the snarf macro
definitions to use SCM_NOTSNARF and SCM_SNARFING macros (like
Mikael's macros, below, but changed names and SCM_SNARFING no
longer expands to include %%% -- that must appear in the argument
so that the token appears at the call-site as a reminder).
2000-01-07 23:05:04 +00:00
Mikael Djurfeldt
03ec84b88b Added extra newline in SCM_INIT macro. 2000-01-07 00:51:16 +00:00
Mikael Djurfeldt
bfe19b466f * snarf.h (SCM_INSITU, SCM_INIT): New snarf macros for use in user
snarf macro definitions.
2000-01-07 00:29:28 +00:00
Greg J. Badros
c3ee75204c * *.c, snarf.h: Replace GUILE_PROC1 with SCM_DEFINE1 throughout. 2000-01-06 19:51:45 +00:00
Greg J. Badros
a1ec69163d *.[ch]: Replace GUILE_PROC w/ SCM_DEFINE. 2000-01-05 19:05:23 +00:00
Greg J. Badros
5a237c9d5d * snarf.h (SCM_ASSERT): Give new definition of SCM_ASSERT when in
snarfing mode to output a lexically-identifiable sequence that the
guile-snarf.awk script uses to verify argument/position matching.
2000-01-05 18:19:54 +00:00
Mikael Djurfeldt
8f151b4264 Completed last change 1999-12-14 21:47:03 +00:00
Greg J. Badros
9b1594fd19 * snarf.h: Put SCM_PROC and SCM_PROC1 back in for
backward-compatibility of packages that use Guile.  Internally
Guile should not use them, though.  (Maybe enforce this with a new
-DBUILDING_GUILE compile-time flag?).
1999-12-14 18:54:31 +00:00
Greg J. Badros
eff08ab65d * scm_validate.h: Drop the SCM_DOCSTRING_SNARF for turning off
SCM_VALIDATE macros;  the SCM_VALIDATE macros should be checked
for argument mismatches (along with the FUNC_NAME macro checking)
by a static tool that runs directly over the .c files.

* snarf.h: Handle SCM_REGISTER_PROC better when snarfing.  The
docstring is still missing from the .doc file;  it just gives the
name of the C function that gets called instead.

* guile-doc-snarf.awk: Be sure to touch the output files to help
make out.  Also handle SCM_REGISTER_PROC better, and change the
output format slightly.
1999-12-13 00:52:43 +00:00
Greg J. Badros
3dc81fbace * snarf.h: Drop SCM_PROC, SCM_PROC1. Added extra output for
guile-doc-snarf script.

* guile-doc-snarf.in, guile-doc-snarf.awk: New, simple doc
extraction system.  Builds foo.x, foo.doc from foo.{c,cc}.
There are dependencies between these files and snarf.h.  This
replaces guile-snarf.

* guile-snarf.in: Drop everything after $$$ for the new snarf.h
macros.  This is obsoleted by guile-doc-snarf, but kept here for
now for good measure.

* Makefile.am: Added guile-doc-snarf, guile-doc-snarf.awk to
bin_SCRIPTS.  Added .doc to SUFFIXES, and give rule for creating
.doc files to use guile-doc-snarf.  Update the rule for creating
.x files to use guile-doc-snarf.
1999-12-12 23:37:40 +00:00
Greg J. Badros
6e8d25a695 * *.c: Finish replacing K&R style prototypes with ANSI C
prototypes.

* eval.c: Make scm_m_mody's 3rd argument be a const char *, not a
char *.  ANSI prototypes caught this.

* strorder.c: Use GUILE_PROC1 for the couple SCM_PROC1 expansions
that I missed.

* scm_validate.h: Use SCM_BOOLP for validating bools.  Do not
expand macros if SCM_DOCSTRING_SNARF.
1999-12-12 20:35:02 +00:00
Greg J. Badros
1bbd0b849f * *.c: Pervasive software-engineering-motivated rewrite of
function headers and argument checking.  Switched SCM_PROC,
SCM_PROC1 macros to be GUILE_PROC, GUILE_PROC1 (may change names
later, but was useful to keep old versions around while migrate)
that has docstrings and argument lists embedded in the GUILE_PROC
macro invocations that expand into a function header.  Use lots of
new SCM_VALIDATE_* macros to simplify error checking and reduce
tons of redundancy.  This is very similar to what I did for Scwm.

Note that none of the extraction of the docstrings, nor software
engineering checks of Scwm is yet added to Guile.  I'll work on
that tomorrow, I expect.

* Makefile.am: Added scm_validate.h to modinclude_HEADERS.

* chars.c: Added docstrings for the primitives defined in here.

* snarf.h:  Added GUILE_PROC, GUILE_PROC1.  Added
SCM_REGISTER_PROC to be like old SCM_PROC, though old SCM_PROC
still remains for now.  Changed naming convention for the s_foo
string name of the primitive to be s_scm_foo for ease of use with
the macro.

* scm_validate.h: Lots of new SCM_VALIDATE macros to simplify
argument checking through guile.  Maybe some of these should be
folded into the header file for the types they check, but for now
it was easiest to just stick them all in one place.
1999-12-12 02:36:16 +00:00
Jim Blandy
1bf17bb472 * snarf.h (SCM_GLOBAL_KEYWORD): Call scm_c_make_keyword, not
scm_makekey, which doesn't exist any more.  Guess nobody's using
this.
1999-09-05 12:41:52 +00:00
Mikael Djurfeldt
9de33deb2e * procs.c, procs.h (scm_subr_entry): New type: Stores data
associated with subrs.
(SCM_SUBRNUM, SCM_SUBR_ENTRY, SCM_SUBR_GENERIC, SCM_SUBR_PROPS,
SCM_SUBR_DOC): New macros.
(scm_subr_table): New variable.
(scm_mark_subr_table): New function.

* init.c (scm_boot_guile_1): Call scm_init_subr_table.

* gc.c (scm_gc_mark): Don't mark subr names here.
(scm_igc): Call scm_mark_subr_table.

* snarf.h (SCM_GPROC, SCM_GPROC1): New macros.

* procs.c, procs.h (scm_subr_p): New function (used internally).

* gsubr.c, gsubr.h (scm_make_gsubr_with_generic): New function.

* objects.c, objects.h (scm_primitive_generic): New class.

* objects.h (SCM_CMETHOD_CODE, SCM_CMETHOD_ENV): New macros.

* print.c (scm_iprin1): Print primitive-generics.

* __scm.h (SCM_WTA_DISPATCH_1, SCM_GASSERT1,
SCM_WTA_DISPATCH_2, SCM_GASSERT2): New macros.

* eval.c (SCM_CEVAL, SCM_APPLY): Replace scm_wta -->
SCM_WTA_DISPATCH_1 for scm_cxr's (unary floating point
primitives).  NOTE: This means that it is now *required* to use
SCM_GPROC1 when creating float scm_cxr's (float scm_cxr's is an
obscured representation that will be removed in the future anyway,
so backward compatibility is no problem here).

* numbers.c: Converted most numeric primitives (all but bit
comparison operations and bit operations) to dispatch on generic
if args don't match.

* eval.c, eval.h (scm_eval_body): New function.

* objects.c (scm_call_generic_0, scm_call_generic_1,
scm_call_generic_2, scm_call_generic_3, scm_apply_generic): New
functions.

* eval.c (SCM_CEVAL): Apply the cmethod directly after having
called scm_memoize_method instead of doing a second lookup.

* objects.h (scm_memoize_method): Now returns the memoized cmethod.

* procs.c (scm_make_subr_opt): Use scm_sysintern0 instead of
scm_sysintern so that the binding connected with the subr name
isn't cleared when we give set = 0.
1999-08-26 04:24:42 +00:00
Jim Blandy
af68fb843b * snarf.h (SCM_CONST_LONG): Remove trailing semicolon from
definition.
1999-07-19 07:53:51 +00:00
Jim Blandy
37a33fed28 Patch from Greg Badros:
* snarf.h (SCM_PROC, SCM_PROC1): Use __cplusplus or
GUILE_CPLUSPLUS_SNARF macros to force adding a cast to the last
(function pointer) argument to scm_make_gsubr and scm_make_subr
calls.  This avoids warnings in C++ programs using guile-snarf.
1999-07-17 05:49:20 +00:00
Mikael Djurfeldt
37b83f68b0 * snarf.h (SCM_KEYWORD, SCM_GLOBAL_KEYWORD): New macros. 1999-06-23 11:16:52 +00:00
Jim Blandy
e4755e5c7b * numbers.c (s_bignum): Renamed to s_bignum, and made static.
Libguile should not be exporting random little strings.
* numbers.h (s_bignum): Extern declaration removed.
More const changes from Ken Raeburn.
* numbers.c (scm_s_bignum, fx): Now const.
(scm_logtab, scm_ilentab, s_adjbig): Now static and const.
* numbers.h (scm_s_bignum): Update declaration.
* eval.c (bodycheck): Argument WHAT now points to const.
* snarf.h (SCM_SYNTAX): Name is const.
* eval.c (scm_i_let): Make this globally visible, to avoid dynamic
linking crashes on NetBSD.  (Thanks to Ken Raeburn.)
1999-04-17 16:03:32 +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
Maciej Stachowiak
b8229a3bab * snarf.h (SCM_SYNTAX): New macro to allow convenient declaration of
syntactic forms, similar to SCM_PROC.
* debug.c, eval.c, evalext.c: use SCM_SYNTAX to declare all special
forms, and SCM_SYMBOL or SCM_GLOBAL_SYMBOL to delcare C variables for
the name symbols when needed.
1998-12-14 15:19:59 +00:00
Jim Blandy
e9b6a0fb97 Bug reports from Russ McManus:
* guile-snarf.in: If the CPP environment variable is set, use that
as the C preprocessor, instead of the preprocessor autoconf
found.
* snarf.h (SCM_PROC): Cast the function pointer passed to
scm_make_gsubr, to satisfy C++.
1998-10-24 20:55:23 +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
d021129f24 * snarf.h (SCM_PROC, SCM_PROC1): Remove very odd code in #ifdef
__cplusplus clause.  I seriously doubt this ever worked the way
the author seems to have intended.
1998-10-06 13:01:46 +00:00
Jim Blandy
2e07d03336 * snarf.h: Add SCM_VCELL_INIT and SCM_GLOBAL_VCELL_INIT macros;
these are analogous to SCM_VCELL and SCM_GLOBAL_VCELL but take a
third argument, a C expression that should result in a SCM value,
which is used to initialize the variable. Reimplemented
SCM_CONST_LONG in terms of SCM_VCELL_INIT.  (Thanks to Maciej
Stachowiak.)
1998-09-29 19:57:22 +00:00
Jim Blandy
82892beda5 * Lots of files: New address for FSF. 1997-05-26 22:34:48 +00:00
Jim Blandy
1e598865e9 * backtrace.c, backtrace.h, debug.c, debug.h, eq.c,
gdb_interface.h, gdbint.c, gdbint.h, gh_data.c, gh_init.c,
gh_io.c, gh_list.c, gh_predicates.c, gh_test_c.c, gh_test_repl.c,
init.c, net_db.c, options.c, options.h, ports.c, print.c, read.c,
script.h, snarf.h, srcprop.c, srcprop.h, stacks.c, stacks.h,
throw.c: Update copyright years; these files have been worked on
significantly in 1997, but only had copyright years for 1996.
Also, change name of copyright holder on some from Mikael
Djurfeldt to Free Software Foundation; he has signed papers
assigning the changes to the FSF.
1997-05-16 09:14:28 +00:00
Mikael Djurfeldt
78f9f47bb5 * snarf.h, backtrace.c: Name change SCM_GLOBAL --> SCM_VCELL.
* snarf.h: Added new macros SCM_GLOBAL_SYMBOL and SCM_GLOBAL_VCELL
which defines C variables with global linkage.
1997-03-21 22:53:08 +00:00
Mikael Djurfeldt
d0104d7e04 * snarf.h (SCM_PROC1): Bugfix: Use (void) rather than (...) for
zero arg subrs.
1997-03-17 05:01:13 +00:00
Mikael Djurfeldt
dfa84eae7b * snarf.h: g++ says it's non-portable not to specify the first
argument in a varargs declaration.  I introduced the first
argument by using preprocessor conditionals.
1997-03-14 23:06:42 +00:00
Jim Blandy
5b4215a8b5 * snarf.h: New file.
* guile-snarf.sh: New file.
* Makefile.in (inner_h_files): Added snarf.h
(ancillary, install, uninstall, distclean): Added actions for
guile-snarf.
(.c.x): Use guile-snarf.
(guile-snarf): New rule, to produce guile-snarf from guile-snarf.sh.
(gen_c_files): Note that these depend on guile-snarf.
* _scm.h: Removed the snarfing macros (SCM_PROC, etc). They are
now in "snarf.h".  Added #include "snarf.h" to get them.
* configure.in: Added guile-snarf to AC_OUTPUT
* libguile.h: Added #include "snarf.h".
(Patches applied and tweaked by Jim Blandy.)
1996-10-29 20:49:56 +00:00