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

8572 commits

Author SHA1 Message Date
Kevin Ryde
5b4dba24ef Typo in:
(SRFI-13 Predicates): Add string-any and
string-every support for char and charset predicates.
2004-08-14 00:51:57 +00:00
Kevin Ryde
6ae50c7153 (SRFI-13 Predicates): Add string-any and
string-every support for char and charset predicates.
2004-08-14 00:48:32 +00:00
Kevin Ryde
3ff0e986f3 *** empty log message *** 2004-08-14 00:44:29 +00:00
Kevin Ryde
967c0904a0 (string-any, string-every): Exercise char and charset predicate cases. 2004-08-14 00:43:56 +00:00
Kevin Ryde
038a7484b6 *** empty log message *** 2004-08-14 00:39:01 +00:00
Kevin Ryde
788dafed64 (scm_string_any, scm_string_every): Add support for char
and charset as predicates, per SRFI-13 spec.
2004-08-14 00:37:53 +00:00
Marius Vollmer
fa0c0a4b12 *** empty log message *** 2004-08-13 12:28:38 +00:00
Marius Vollmer
11c5e0bf6b (scm_init_load_path): Do not pass NULL to scm_to_locale_string, which
would happen when GUILE_LOAD_PATH is not set.  Thanks to Bill
Schottstaedt.
2004-08-13 12:28:23 +00:00
Marius Vollmer
c41acab35c *** empty log message *** 2004-08-12 17:52:49 +00:00
Marius Vollmer
57d4d32fa3 (MY_VALIDATE_SUBSTRING_SPEC_COPY, MY_VALIDATE_STRING_COPY): Modernized
clones of the deprecated validation macros.  Replaced every use.
2004-08-12 17:49:59 +00:00
Marius Vollmer
8824ac88f0 * socket.c, rw.c, deprecated.h, validate.h
(SCM_VALIDATE_STRING_COPY): Deprecated.  Replaced all uses with
SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or
scm_to_locale_string, etc.
(SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated.  Replaced as
above, plus scm_i_get_substring_spec.

* regex-posix.c, read.c, random.c, ramap.c, print.c, numbers.c,
hash.c, gc.c, gc-card.c, convert.i.c, backtrace.c, strop.c,
strorder.c, strports.c, struct.c, symbols.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:45:03 +00:00
Marius Vollmer
70f7ee4188 *** empty log message *** 2004-08-12 17:44:43 +00:00
Marius Vollmer
6f14f578d2 * strings.h, strings.c (scm_i_get_substring_spec): New.
* socket.c, rw.c, deprecated.h, validate.h
(SCM_VALIDATE_STRING_COPY): Deprecated.  Replaced all uses with
SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or
scm_to_locale_string, etc.
(SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated.  Replaced as
above, plus scm_i_get_substring_spec.
2004-08-12 17:43:41 +00:00
Marius Vollmer
396e5506d6 * socket.c (scm_inet_aton, scm_inet_pton): Convert SCM strings to
locale strings instead of accessing their internals.
(scm_recv, scm_send, scm_recvfrom, scm_sendto): Use
SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH instead of
SCM_STRING_CHARS and SCM_STRING_LENGTH.

* socket.c, rw.c, deprecated.h, validate.h
(SCM_VALIDATE_STRING_COPY): Deprecated.  Replaced all uses with
SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or
scm_to_locale_string, etc.
(SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated.  Replaced as
above, plus scm_i_get_substring_spec.
2004-08-12 17:43:17 +00:00
Marius Vollmer
ddae95259d (scm_system): Convert SCM strings to locale strings instead of
accessing their internals.
2004-08-12 17:38:52 +00:00
Marius Vollmer
0d189573e5 Convert version to locale string before printing it. 2004-08-12 17:35:53 +00:00
Marius Vollmer
3eb1e2aa88 (scm_read_delimited_x): Avoid
SCM_VALIDATE_SUBSTRING_SPEC_COPY and use scm_from_size_t instead
of scm_from_long for the returned number of read characters.
2004-08-12 17:32:15 +00:00
Marius Vollmer
1299a0f17b (STRING_SYSCALL, STRING2_SYSCALL): New helper macros.
Use them instead of SCM_SYSCALL when one or two strings need to be
converted into locale strings.
(my_rename): New, gathers platform dependent code for renaming.
(scm_rename): Use it.
(scm_readlink, scm_copy_file): Convert SCM strings to locale
strings instead of accessing their internals.
(scm_basename, scm_dirname): Use SCM_I_STRING_CHARS and
SCM_I_STRING_LENGTH instead of SCM_STRING_CHARS and
SCM_STRING_LENGTH.
2004-08-12 17:32:07 +00:00
Marius Vollmer
f015614ae0 (WITH_STRING): New helper macro. Use it where one
locale string is needed for a short piece of code.
(STRING_SYSCALL): New helper macro.  Use it instead of SCM_SYSCALL
when one locale string is needed.
(scm_mkstemp): Convert tmpl to a locale string.
(scm_putenv): Rewritten to use only C strings.
(scm_setlocale, scm_crpt): Convert argument strings to locale
strings.
2004-08-12 17:28:06 +00:00
Marius Vollmer
86e14f5c3b (scm_fdopen): Use scm_i_fdes_to_port together with scm_i_mode_bits to
avoid accessing internals of SCM string from C.
2004-08-12 17:16:49 +00:00
Marius Vollmer
4695c75947 (load_extension): Convert lib and init to locale
strings instead of accessing the internals directly.
(scm_c_load_extension): Use scm_from_locale_string instead of
scm_makfrom0str.
2004-08-12 17:06:37 +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
ffa747a6ea (scm_primitive_load_path): Do not check for absolute filenames when
scm_sys_search_load_path returns false, which will return absolute
filenames unchanged.
2004-08-12 11:57:42 +00:00
Marius Vollmer
bb26cc2d28 *** empty log message *** 2004-08-11 19:39:44 +00:00
Marius Vollmer
82c76fd357 (scm_init_storage, scm_stand_in_procs, scm_stand_in_proc): Use a
hastable for scm_stand_in_procs instead of an alist.  Thanks to
Matthias Koeppe!
2004-08-11 19:38:58 +00:00
Marius Vollmer
35da08ee37 (scm_c_round, scm_c_truncate): Docs for'em. 2004-08-11 19:36:55 +00:00
Marius Vollmer
214195e127 Removed commented out debugging fprintfs. 2004-08-10 15:59:31 +00:00
Marius Vollmer
c88453e881 Typos. 2004-08-10 15:58:57 +00:00
Marius Vollmer
44825fffb0 *** empty log message *** 2004-08-10 15:45:58 +00:00
Marius Vollmer
9bd10f4617 (test_locale_strings): New. 2004-08-10 15:45:49 +00:00
Marius Vollmer
f9751e8660 *** empty log message *** 2004-08-10 14:16:46 +00:00
Marius Vollmer
273167608a Updated example to use scm_to_locale_string
instead of roll-your-own scm_to_string.  Also showcase
scm_frame_free.
2004-08-10 14:16:34 +00:00
Marius Vollmer
91210d629f Docs for scm_is_string, scm_to_locale_string*, and
scm_from_locale_string*.
2004-08-10 14:15:33 +00:00
Marius Vollmer
a90968fabb Docs for scm_frame_free. 2004-08-10 14:14:46 +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
02573e4c7a *** empty log message *** 2004-08-10 14:07:35 +00:00
Marius Vollmer
ebea155a3c (scm_mkstrport): Use SCM_I_STRING_UCHARS instead of SCM_STRING_UCHARS.
Use SCM_I_STRINGP instead of SCM_STRINGP.
2004-08-10 14:06:59 +00:00
Marius Vollmer
7fd0a36919 (scm_i_index): Replaced SCM_STRINGP, SCM_STRING_CHARS, and
SCM_STRING_LENGTH with SCM_I_STRINGP, SCM_I_STRING_CHARS, and
SCM_I_STRING_LENGTH, respectively.  Pass string object directly, not
as a pointer.  Use scm_remember_upto_here_1 to protect it.
2004-08-10 14:05:14 +00:00
Marius Vollmer
7f03f97036 * 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.

* posix.c (allocate_string_pointers, environ_list_to_c): Removed,
replaced all uses with scm_i_allocate_string_pointers.
2004-08-10 13:54:16 +00:00
Marius Vollmer
29a837fd27 (scm_input_error): Use a SCM value for 'fn', not a C string. This
avoids a conversion round-trip.
2004-08-10 13:54:01 +00:00
Marius Vollmer
79c98b33fe Replaced SCM_STRINGP, SCM_STRING_CHARS, and
SCM_STRING_LENGTH with SCM_I_STRINGP, SCM_I_STRING_CHARS, and
SCM_I_STRING_LENGTH, respectively.
(gh_scm2newstr): Implement in terms of scm_to_locale_string.
2004-08-10 13:43:55 +00:00
Marius Vollmer
24d1f17168 (scm_error_scm): Throw directly instead of calling
scm_error, this avoids the back and forth conversion of SUBR and
MESSAGE and also plugs a memory leak.
(scm_error): Call scm_error_scm.
2004-08-10 13:37:11 +00:00
Marius Vollmer
18f9d34373 Instead calling scm_puts on the SCM_STRING_CHARS of a string, call
scm_display on the string itself.
2004-08-10 13:36:45 +00:00
Marius Vollmer
6d5649b7b8 (scm_frame_free): New. 2004-08-10 13:35:28 +00:00
Marius Vollmer
3b9ee0a4f8 * backtrace.c: Replaced SCM_STRINGP with scm_is_string.
(display_header): Print FNAME when it is true, not
merely when it is a string.
2004-08-10 13:31:22 +00:00
Marius Vollmer
7d04d68bf7 (scm_internal_parse_path): Removed.
(scm_parse_path): Use scm_string_split to do the work.
(scm_init_load_path): Use scm_parse_path instead of
scm_internal_parse_path.
(scm_search_path): Rewritten string handling part of the code in
terms of scm_to_locale_stringbuf and so that it is thread safe.
2004-08-10 13:30:12 +00:00
Marius Vollmer
c829a4274f * strings.h, deprecated.h (SCM_STRING_COERCE_0TERMINATION_X):
Moved from string.h to deprecated.h.

* deprecated.c, deprecated.h (SCM_CHARS, SCM_LENGTH): Removed.

* strings.h, strings.c (SCM_MAKE_STRING_TAG): Rename dto
SCM_I_MAKE_STRING_TAG, changed all uses.
(SCM_STRING_CHARS, SCM_STRING_UCHARS, SCM_STRING_LENGTH): Renamed
to SCM_I_STRING_CHARS, SCM_I_STRING_UCHARS, and SCM_I_LENGTH
respectively.  For a short time, the old names are still there as
aliases.  Not all uses have been changed yet, but the ones in
strings.c have.
(SCM_STRING_MAX_LEN): Do not hardcode to 24 bits, compute from
SCM_T_BITS_MAX.
(scm_is_string, scm_from_locale_string, scm_from_locale_stringn,
scm_take_locale_string, scm_take_locale_stringn,
scm_to_locale_string, scm_to_locale_stringn,
scm_to_locale_stringbuf): New.
(scm_c_string2str, scm_c_substring2str): Deprecated by moving to
deprecated.[hc]. Implemented in terms of the new functions above.
(scm_take_str, scm_take0str, scm_mem2string, scm_str2string,
scm_makfrom0str): Reimplemented in terms of the new functions from
above.  They will be discouraged shortly.
(scm_substring): Do not use scm_mem2string.
(scm_i_allocate_string_pointers, scm_i_free_string_pointers): New,
to replace similar code from posix.c, simpos.c, and dynl.c.
(scm_string_append): Use memcpy instead of explicit loop.  Do not
use register keyword.  Use plain 'char' instead of 'unsigned
char'.
2004-08-10 13:20:59 +00:00
Marius Vollmer
8d3fd10b91 *** empty log message *** 2004-08-10 12:20:02 +00:00
Marius Vollmer
ee3e40b78e Replaced all uses of scm_round with scm_c_round. 2004-08-10 12:19:49 +00:00
Kevin Ryde
c065f32614 More of: New file. 2004-08-10 00:52:50 +00:00