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

1865 commits

Author SHA1 Message Date
Greg J. Badros
c52f46abf7 *** empty log message *** 1999-12-12 21:25:12 +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
1006486ec2 *** empty log message *** 1999-12-12 19:25:11 +00:00
Greg J. Badros
156dcb091b * *.c, srcprop.h: Use SCM_BOOL(f) instead of (f? SCM_BOOL_T:
SCM_BOOL_F) and use SCM_NEGATE_BOOL(f) instead of (f? SCM_BOOL_F:
SCM_BOOL_T).
1999-12-12 19:24:29 +00:00
Greg J. Badros
a9967b3dbf * boolean.h: Added SCM_BOOL, SCM_NEGATE_BOOL, SCM_BOOLP to here,
from scm_validate.h.

* scm_validate.h: Moved above out into boolean.h, fix typo in
SCM_VALIDATE_NIM macro.
1999-12-12 19:09:46 +00:00
Greg J. Badros
a30fd26753 *** empty log message *** 1999-12-12 18:31:03 +00:00
Greg J. Badros
6b5a304f6b * *.c, scm_validate.h: Use SCM_VALIDATE_NIM, not SCM_VALIDATE_NIMP
(none of the other validate macros have the trailing P).
1999-12-12 18:30:09 +00:00
Greg J. Badros
5bff3127b5 * scm_validate.h: Added the FSF copyright to the top.
* strings.c: Use SCM_ASSERT_RANGE in a couple of places instead of
SCM_ASSERT w/ SCM_OUT_OF_RANGE.
1999-12-12 18:08:24 +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
Greg J. Badros
6e7069385d *** empty log message *** 1999-12-10 03:06:51 +00:00
Mikael Djurfeldt
d795d02c10 *** empty log message *** 1999-12-09 22:35:28 +00:00
Mikael Djurfeldt
9eb8500a86 * vectors.c (scm_vector_length, scm_vector_ref, scm_vector_set_x):
Turned into primitive generics.
1999-12-09 22:35:18 +00:00
Gary Houston
60d0643dbf * ports.c (scm_port_closed_p): new procedure, implements
"port-closed?" suggested by Bernard Urban.
	ports.h: added prototype, removed the SCM_P macros.
1999-12-04 22:59:10 +00:00
Gary Houston
1d7bdb2562 * unif.h: added some comments, removed the SCM_P macros.
* vports.c (sf_write): use scm_makfromstr, not scm_makfrom0str
	(thanks to Daniel Skarda).
1999-11-30 18:23:52 +00:00
Jim Blandy
82b211bbdb *** empty log message *** 1999-11-22 13:28:25 +00:00
Jim Blandy
4eb68f08bf * gscm.c, gscm.h: Deleted. They were unused. 1999-11-22 13:28:10 +00:00
Gary Houston
d12feca34d * unif.c (scm_list_to_uniform_array): call
scm_dimensions_to_uniform_array with a third argument of
	SCM_UNDEFINED instead of SCM_EOL.
1999-11-20 19:21:37 +00:00
Gary Houston
afe5177e7f * acconfig.h: add HAVE_ARRAYS.
* configure.in: add --disable-arrays option, probably temporary.

	* the following changes allow guile to be built with the array
	"module" omitted.  some of this stuff is just tc7 type support,
	which wouldn't be needed if uniform array types were converted
	to smobs.

	* tag.c (scm_utag_bvect ... scm_utag_cvect): don't define unless
	HAVE_ARRAYS.
	(scm_tag): don't check array types unless HAVE_ARRAYS.

	* sort.c (scm_restricted_vector_sort_x, scm_sorted_p):
	remove the unused array types.
	* (scm_stable_sort, scm_sort): don't support vectors if not
	HAVE_ARRAYS.  a bit excessive.

	* random.c (vector_scale, vector_sum_squares,
	scm_random_solid_sphere_x, scm_random_hollow_sphere_x,
	scm_random_normal_vector_x): don't define unless HAVE_ARRAYS.

	* gh_data.c (makvect, gh_chars2byvect, gh_shorts2svect,
	gh_longs2ivect,	gh_ulongs2uvect, gh_floats2fvect, gh_doubles2dvect,
	gh_uniform_vector_length, gh_uniform_vector_ref):
	don't define unless HAVE_ARRAYS.
	(gh_scm2chars, gh_scm2shorts, gh_scm2longs, gh_scm2floats,
	gh_scm2doubles):
	don't check vector types if not HAVE_ARRAYS.

	* eq.c (scm_equal_p), eval.c (SCM_CEVAL), print.c (scm_iprin1),
	gc.c (scm_gc_mark, scm_gc_sweep), objects.c (scm_class_of):
	don't support the array types unless HAVE_ARRAYS is defined.

	* tags.h: make nine tc7 types conditional on HAVE_ARRAYS.

	* read.c (scm_lreadr): don't check for #* unless HAVE_ARRAYS is
	defined (this should use read-hash-extend).

	* ramap.c, unif.c: don't check whether ARRAYS is defined.

	* vectors.c (scm_vector_set_length_x): moved here from unif.c.  call
	scm_uniform_element_size if HAVE_ARRAYS.
	vectors.h: prototype too.

	* unif.c (scm_uniform_element_size): new procedure.

	* init.c (scm_boot_guile_1): don't call scm_init_ramap or
	scm_init_unif unless HAVE_ARRAYS is defined.

	* __scm.h: don't define ARRAYS.

	* Makefile.am (EXTRA_libguile_la_SOURCES): unif.c and ramap.c
	moved here from	libguile_la_SOURCES.


	* Makefile.am (ice9_sources): add arrays.scm.

	* boot-9.scm: load arrays.scm if 'array is provided.

	* arrays.scm: new file with stuff from boot-9.scm.
1999-11-19 18:16:19 +00:00
Gary Houston
5c11cc9deb * configure.in: check for hstrerror.
* socket.c (scm_htons, scm_ntohs, scm_htonl, scm_ntohl): new
	functions for network data conversion.

	* numbers.c (scm_num2long, scm_num2longlong):
	throw out-of-range instead of wrong-type-arg if appropriate.
	(scm_iint2str): handle -2^31 correctly.
	(scm_num2long): handle -2^31 bignum correctly.
	(scm_num2long_long): rewrite the bigdig case: basically copied
	from scm_num2long.
	numbers.h: (SCM_BITSPERLONGLONG): deleted.

	* unif.c (rapr1): use sprintf instead of intprint for unsigned
	longs: intprint can't cope with large values.

	* numbers.c (scm_num2ulong): check more consistently that the
	input is not negative.  if it is, throw out-of-range instead of
	wrong-type-arg.

	* ramap.c (scm_array_fill_int): don't limit fill to INUM for
	uvect, ivect or llvect.
	Check that fill doesn't overflow short uniform array.

	* __scm.h: add another long to the definition of long_long and
	ulong_long.

	* unif.c (scm_raprin1): use 'l' instead of "long_long" in the
	print representation of llvect.  read can't handle more than
	one character.
	(scm_dimensions_to_uniform_array): make "fill" an optional argument
	instead of a rest argument.

	* tags.h (scm_tc7_llvect): wasn't defined anywhere, so use the free
	tag 29 for now.

	* __scm.h: don't mention LONGLONGS.

	* unif.c, numbers.c, eq.c, gc.c, print.c, eval.c, ramap.c:
	replace LONGLONGS with HAVE_LONG_LONGS as set by configure.

	* net_db.c (scm_inet_aton): throw errors using the misc-error key
	instead of system-error.  inet_aton doesn't set errno.
	system-error isn't right in gethost either, since it's throwing
	the value of h_errno instead of errno. so:
	(scm_host_not_found_key, scm_try_again_key,
	scm_no_recovery_key, scm_no_data_key): new error keys.
	(scm_resolv_error): new procedure, use the new keys.
	(scm_gethost): call scm_resolv_error not scm_syserror_msg.

	* error.c: (various): use scm_cons instead of scm_listify
	to build short lists.

	* boot-9.scm (read-hash-extend to set up arrays): add 'l' for
	long_long uniform vectors.

	* networking.scm (sethostent, setnetent, setprotoent, setservent):
	take an optional argument STAYOPEN.  default is #f.

	* readline.c (scm_init_readline): set rl_readline_name to Guile,
	to allow conditionals in  .inputrc.
1999-11-18 22:36:28 +00:00
Gary Houston
93a6b6f5a7 * socket.c (scm_fill_sockaddr): zero the address structure before
use, in case it has a sin_len field and the OS doesn't like random
	values (thanks to Bertrand Petit).
1999-11-04 20:04:18 +00:00
Mark Galassi
4921140c64 1999-10-26 Mark Galassi <rosalia@lanl.gov>
* gh.h, gh_data.c (gh_symbol2scm): changed gh_symbol2scm() to take
	a const char * argument, upon suggestion from Lynn Winebarger.
1999-10-26 19:38:05 +00:00
Gary Houston
cd19d608b1 * strports.c (st_end_input): avoid dubious pointer arithmetic. 1999-10-26 18:42:11 +00:00
Gary Houston
7dcb364d3b * Move the responsibility for resetting port buffers from the
caller of the ptob seek procedure to the implementation.  This
	gives more control in general to the ptob seek: in particular the
	change of 1999-10-20 can be made to work without breaking seek on
	string ports.  There's a comment in NEWS about upgrading port
	types.

	* ports.c (scm_seek): don't reset the port buffers here.

	* fports.c (fport_seek): reset the buffers, except for the
	0 SEEK_CUR case.

	* strports.c (st_end_input): (bug fix): decrement pt->read_pos by
	offset.  check that it's not less than read_buf.
	(st_seek): reset the buffers first, unless it's the 0 SEEK_CUR
	case and currently reading.
1999-10-24 11:25:31 +00:00
Gary Houston
e9c66ab079 * ports.c (scm_seek): Add a special case for SEEK_CUR, offset 0,
so that unread chars are not needlessly discarded.  (thanks to
	Roland Orre).
1999-10-20 21:03:09 +00:00
Gary Houston
0de97b83c0 * fports.c (scm_fdes_to_port): always set rw_random if the fdes is
random access.  rw_active needs to be maintained even for single
	directional ports, otherwise scm_seek and probably other things are
	broken.  (thanks to Roland Orre).

	* strports.c (scm_mkstrport): set rw_random to 1 unconditionally.

	* ports.c (scm_add_to_port_table): initialise rw_random to 0.

	* ports.h (scm_port): change the comments on rw_random and rw_active.
1999-10-18 20:49:29 +00:00
Mikael Djurfeldt
e173f7f18b *** empty log message *** 1999-10-11 17:42:01 +00:00
Mikael Djurfeldt
5390d7c79c Regenerated 1999-10-11 17:41:05 +00:00
Mikael Djurfeldt
b3ad310304 * Makefile.am (libguile_la_LDFLAGS): Bumped libguile version. 1999-10-11 17:40:45 +00:00
Mikael Djurfeldt
453e9dac93 * tags.h (SCM_IM_DELAY): New immediate symbol. 1999-10-11 17:40:32 +00:00
Mikael Djurfeldt
ccd0e478a6 * print.c (scm_isymnames): Printed representation. 1999-10-11 17:40:19 +00:00
Mikael Djurfeldt
c85897471a * ioext.c: Added #include "feature.h". 1999-10-11 17:40:06 +00:00
Mikael Djurfeldt
6b10ed8be1 * eval.c, eval.h (scm_sym_delay): New global symbol. 1999-10-11 17:39:37 +00:00
Mikael Djurfeldt
a570e93a25 * eval.c, eval.h (scm_sym_delay): New global symbol.
* eval.c (unmemocopy, SCM_CEVAL): Handle SCM_IM_DELAY.
(scm_m_delay): Turned into a memoizing macro.
1999-10-11 17:39:24 +00:00
Jim Blandy
1ab45872f0 *** empty log message *** 1999-10-11 16:54:05 +00:00
Jim Blandy
0acef67a14 * gh_data.c (gh_ints2scm, gh_doubles2scm): Make sure elements are
protected from GC while building the vector.  (Thanks to Bernard
Urban and Greg Harvey.)
1999-10-11 16:53:50 +00:00
Mikael Djurfeldt
0573ddaea3 *** empty log message *** 1999-10-08 10:46:38 +00:00
Mikael Djurfeldt
8569180634 * throw.c (handler_message): Display backtrace if backtraces
enabled.
1999-10-08 10:46:26 +00:00
Jim Blandy
0cbedb5b2b *** empty log message *** 1999-10-05 22:36:14 +00:00
Jim Blandy
0c1221ab9c *** empty log message *** 1999-10-05 20:49:29 +00:00
Jim Blandy
a65750a309 * Makefile.in, scmconfig.h.in: Deleted from CVS repository. Run
the autogen.sh script to create generated files like these.
1999-10-05 19:08:37 +00:00
Jim Blandy
80f2710274 *** empty log message *** 1999-10-05 19:00:38 +00:00
Jim Blandy
3eb7e6ee5e * numbers.c (scm_string_to_number): Signal an error if radix is
less than two.  (Thanks to Jorgen Schaefer.)

* print.c (scm_write, scm_display, scm_newline, scm_write_char):
Don't assume that the current output port is valid.  Somebody
might close it.  (Thanks to Bernard Urban.)
1999-10-05 18:57:31 +00:00
Jim Blandy
dc4d930b43 *** empty log message *** 1999-10-02 23:53:13 +00:00
Jim Blandy
3b307d439d * Makefile.am (EXTRA_libguile_la_SOURCES): fix typo. 1999-10-02 23:01:46 +00:00
Jim Blandy
eb33e4d702 * scmconfig.h.in: Add comments for HAVE_POSIX and HAVE_NETWORKING. 1999-10-02 23:01:14 +00:00
Jim Blandy
7b7148d8ef Revert back to text generated by automake 1.4. 1999-10-02 22:57:38 +00:00
Greg J. Badros
fca7547b1a Fix my last commit -- DEBUG_FREELIST renamed to GUILE_DEBUG_FREELIST 1999-09-28 00:54:26 +00:00
Greg J. Badros
0b307a34d1 *** empty log message *** 1999-09-28 00:18:34 +00:00
Greg J. Badros
bfc69694be * __scm.h: Fix a bunch of macros that were missing do-while(0)
sandwiches.

* debug.c, eval.c: Fix buggy uses of SCM_ALLOW_INTS (missing
semicolon) exposed by the above change.
1999-09-28 00:18:16 +00:00
Greg J. Badros
155265386a *** empty log message *** 1999-09-27 23:35:33 +00:00