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

61 commits

Author SHA1 Message Date
Andy Wingo
6a5b44de68 Check for strtod_l before using it.
Based on a patch by Andy Stormont <astormont@racktopsystems.com>.

* configure.ac: Check for strtod_l.
* libguile/i18n.c (scm_locale_string_to_integer): Fix style.
  (scm_locale_string_to_inexact): Check for strtod_l.
2016-06-24 17:52:30 +02:00
Andy Wingo
d84f25c271 Remove unused internal i18n functions
* libguile/i18n.c (str_upcase, str_downcase, str_upcase_l)
  (str_downcase_l): Remove unused inline functions.  Based on a patch by
  Pedro Aguilar <paguilar@paguilar.org>.  Fixes #19172.
2016-06-22 16:47:40 +02:00
Natanael Copa
7413430fd7 i18n: Check for non-POSIX strtol_l.
* configure.ac: Check for strtol_l.
* libguile/i18n.c: Check HAVE_STRTOL_L before using strtol_l.
2016-05-22 19:29:17 +02:00
Mark H Weaver
30c5982a95 i18n: Add HAVE_USELOCALE as a requirement for USE_GNU_LOCALE_API.
* configure.ac: Check for uselocale.
* libguile/i18n.c: Add HAVE_USELOCALE to the list of requirements
  before defining USE_GNU_LOCALE_API.
2014-10-14 20:36:19 -04:00
Mark H Weaver
cfefef6bd9 Copy the result from 'nl_langinfo' before it can be overwritten.
Based on a patch by Eli Zaretskii <eliz@gnu.org>.

* libguile/i18n.c (copy_string_or_null): New static function.
  (scm_nl_langinfo): Use 'copy_string_or_null' to copy the result from
  'nl_langinfo' and 'nl_langinfo_l' before the next call and before
  releasing the locale mutex.
2014-08-13 22:47:32 -04:00
Eli Zaretskii
c7161ee334 Fix compilation of scm_nl_langinfo when some nl_langinfo items are missing.
* i18n.c (scm_nl_langinfo): Don't assume that both INT_* and
  the corresponding non-INT_* items are always either all defined
  or all undefined.
2014-06-22 19:11:30 +03:00
Ludovic Courtès
4a0fb276a9 i18n: Fix null pointer dereference when locale info is missing.
* libguile/i18n.c (scm_nl_langinfo): Check whether C_RESULT is NULL
  before calling 'strdup'.
2013-11-13 14:25:02 +01:00
Andy Wingo
14b59d6102 silence mingw32 warning in i18n.c
* libguile/i18n.c (scm_make_locale): Silence a warning.
2013-03-09 22:34:06 +01:00
Andy Wingo
4fbbf346a6 i18: avoid freelocale (NULL)
* libguile/i18n.c (smob_locale_free): Don't freelocale (NULL).
2012-02-08 12:20:47 +01:00
Ludovic Courtès
a0919aefee i18n: Use Gnulib's `nl_langinfo' module.
* configure.ac: Remove checks for <langinfo.h> and <nl_types.h>, and
  `nl_langinfo'.

* libguile/i18n.c: Remove #ifdefs for HAVE_LANGINFO_H, HAVE_NL_TYPES_H,
  HAVE_NL_ITEM, and HAVE_LANGINFO_CODESET.
  (SCM_VALIDATE_OPTIONAL_LOCALE_COPY): Use `SCM_UNBNDP'.

* m4/gnulib-cache.m4 (gl_MODULES): Add `nl_langinfo'.

* module/ice-9/i18n.scm (define-vector-langinfo-mapping): Remove
  `defaults' parameter; assume (provided? 'nl-langinfo) is always true.
  Update users accordingly.
  (define-simple-langinfo-mapping): Likewise.
  (define-monetary-langinfo-mapping): Likewise, but do not assume
  LOCAL-ITEM and INTL-ITEM are always defined.
2012-02-03 14:14:14 +01:00
Chris K. Jester-Young
e22ad42bdb Fix double-free error on non-GNU systems.
* libguile/i18n.c (scm_make_locale): Null out c_locale_name after it's
  freed, so it doesn't get freed again. While this only has effect if
  USE_GNU_LOCALE_API is unset, the nulling out happens in both cases,
  to be consistent and robust.
  (scm_nl_langinfo): Free c_result in all switch cases, in particular
  P_SIGN_POSN, N_SIGN_POSN, INT_P_SIGN_POSN, and INT_N_SIGN_POSN.
2012-01-28 15:23:16 -05:00
Chris K. Jester-Young
1bd9a697b1 Add #ifdefs for langinfo items that don't exist on OpenBSD.
* libguile/i18n.c (define_langinfo_items): Add #ifdefs for ERA_* and
  ALT_DIGITS, as those constants don't exist on OpenBSD.
2012-01-15 14:01:55 -05:00
Ludovic Courtès
94a751bdcc i18n: Fix gc_malloc/free mismatch on non-GNU systems.
* libguile/i18n.c (scm_i_locale_free): Remove.
  (smob_locale_free): Define only when USE_GNU_LOCALE_API.
  (scm_make_locale)[!USE_GNU_LOCALE_API]: Allocate
  `c_locale->locale_name' with `scm_gc_strdup', not `malloc'.
2012-01-09 21:23:46 +01:00
Andy Wingo
0b4f77192d fix scm_gc_strdup invocation
* libguile/i18n.c (get_current_locale): Fix scm_gc_strdup invocation.
2011-08-29 22:20:39 +02:00
Andy Wingo
42f9581238 fix leak in get_current_locale()
* libguile/i18n.c (get_current_locale): Hold the locale name in a
  GC-managed string, not a mallocated string.  Thanks to Stefan
  Israelsson Tampe for the report.
2011-08-16 13:16:21 +02:00
Ludovic Courtès
e780c14fd0 i18n: Don't use `!=' to compare SCMs.
* libguile/i18n.c (install_locale)[!USE_GNU_LOCALE_API]: Use
  `SCM_UNBNDP' instead of `!='.
2011-07-01 15:29:51 +02:00
Andy Wingo
4d40bea6c2 i18n error return type fix
* libguile/i18n.c (chr_to_case, str_to_case): Return #f in error case
  instead of 0.
2011-05-13 15:33:48 +02:00
Andy Wingo
393baa8a44 scm_is_false instead of == SCM_BOOL_F; also is_null, is_true, etc
* libguile/deprecation.c (scm_issue_deprecation_warning)
* libguile/eval.c (CAPTURE_ENV):
* libguile/goops.c (make_dispatch_procedure, make_class_from_symbol):
  (create_smob_classes):
* libguile/guardians.c (finalize_guarded, scm_i_get_one_zombie):
* libguile/hashtab.c (scm_fixup_weak_alist, scm_internal_hash_fold):
* libguile/i18n.c (scm_nl_langinfo)
* libguile/load.c (scm_primitive_load)
* libguile/posix.c (scm_setrlimit)
* libguile/socket.c (scm_to_sockaddr):
* libguile/srcprop.c (scm_make_srcprops): Use scm_is_false / scm_is_true
  / scm_is_null instead of comparing against SCM_BOOL_F et al.
2011-05-13 15:28:41 +02:00
Andy Wingo
d223c3fcdd scm_is_eq for SCM vals, not == or !=
* libguile/bytevectors.c (scm_make_bytevector, STRING_TO_UTF)
  (UTF_TO_STRING):
* libguile/continuations.c (scm_i_check_continuation):
* libguile/expand.h (SCM_EXPANDED_P):
* libguile/fluids.c (scm_i_make_with_fluids):
* libguile/generalized-vectors.c (scm_make_generalized_vector):
* libguile/goops.c (SCM_GOOPS_UNBOUNDP, slot_definition_using_name):
  (scm_c_extend_primitive_generic, more_specificp, scm_make)
* libguile/i18n.c (SCM_VALIDATE_OPTIONAL_LOCALE_COPY):
  (scm_locale_string_to_integer)
* libguile/modules.c (resolve_duplicate_binding):
  (scm_module_reverse_lookup)
* libguile/posix.c (scm_to_resource):
* libguile/r6rs-ports.c (scm_put_bytevector):
* libguile/socket.c (scm_connect, scm_bind, scm_sendto
* libguile/stacks.c (find_prompt):
* libguile/variable.c (scm_variable_ref, scm_variable_bound_p):
* libguile/vm-engine.h (ASSERT_BOUND_VARIABLE, ASSERT_BOUND)
* libguile/vm-i-system.c (VARIABLE_BOUNDP, local_bound)
  (long_local_bound, fluid_ref): Use scm_is_eq to compare, not == / !=.
2011-05-13 13:49:32 +02:00
Ludovic Courtès
073167ef7b Allow compilation with `--disable-posix'.
Reported by Dmitry Dzhus <dima@dzhus.org>.

* configure.ac: Remove `AC_LIBOBJ([filesys])'.  Document
  `--disable-posix' as omitting non-essential POSIX interfaces.

* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  Add `filesys.c'.
  (DOT_DOC_FILES): Add `filesys.doc'.
  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES): Remove
  `filesys.c'.

* libguile/posix.c (scm_mkstemp, scm_access): Move to `filesys.c'.
  (scm_init_posix): Move `R_OK' etc. to `filesys.c'.

* libguile/filesys.c (scm_chown, scm_chmod, scm_umask, scm_open_fdes,
  scm_open, scm_close, scm_close_fdes, scm_link, scm_tc16_dir,
  scm_directory_stream_p, scm_opendir, scm_readdir, scm_rewinddir,
  scm_closedir, scm_dir_print, scm_dir_free, scm_chdir, scm_getcwd,
  set_element, fill_select_type, get_element, retrieve_select_type,
  scm_select, scm_fcntl, scm_fsync, scm_symlink, scm_readlink,
  scm_lstat, scm_copy_file): Conditionalize on HAVE_POSIX.
  (scm_mkstemp, scm_access): New functions.
  (scm_init_filesys): Conditionalize `scm_tc16_dir', `O_RDONLY', etc. on
  HAVE_POSIX.  Define `R_OK', `W_OK', etc.

* libguile/fports.c (fport_print): Use `scm_ttyname' only when
  HAVE_POSIX.

* libguile/i18n.c (lock_locale_mutex, unlock_locale_mutex): New
  functions.  Update users of `scm_i_locale_mutex' to use them.

* libguile/init.c (scm_i_init_guile): Always call `scm_init_filesys'.

* meta/guile-tools.in (main): Use `setlocale' only when it is defined.

* module/ice-9/boot-9.scm: Always load `ice-9/posix'.
2011-04-15 00:09:16 +02:00
Bruno Haible
96c71c589a Update comment about uc_locale_language.
* libguile/i18n.c (locale_language): Update comment.
2011-03-26 23:33:00 +01:00
Ludovic Courtès
190d4b0d93 Make VM string literals immutable.
* libguile/strings.c (scm_i_make_string, scm_i_make_wide_string): Add
  `read_only_p' parameter.  All callers updated.

* libguile/vm-i-loader.c (load_string, load_wide_string): Push read-only
  strings.

* test-suite/tests/strings.test ("literals"): New test prefix.
2011-03-20 23:34:42 +01:00
Andy Wingo
03976fee3b fix code that causes warnings on gcc 4.6
* libguile/arrays.c (scm_i_read_array):
* libguile/backtrace.c (display_backtrace_body):
* libguile/filesys.c (scm_readdir)
* libguile/i18n.c (chr_to_case):
* libguile/ports.c (register_finalizer_for_port):
* libguile/posix.c (scm_nice):
* libguile/stacks.c (scm_make_stack): Clean up a number of
  set-but-unused vars.  Thanks to Douglas Mencken for the report.

* libguile/numbers.c (scm_log, scm_exp): Fix a few #if cases that should
  be #ifdef.
2011-03-17 12:39:53 +01:00
Ludovic Courtès
914c4300b2 Make `locale-digit-grouping' more robust.
* libguile/i18n.c (scm_nl_langinfo)[GROUPING]: Consider negative numbers
  like `CHAR_MAX'.  Reported by David Fang <fang@csl.cornell.edu>.
  Fix suggested by Bruno Haible <bruno@clisp.org>.
2011-02-24 23:17:06 +01:00
Andy Wingo
4a655e50a3 use scm_from_latin1_symboln for string literals and load-symbol
* libguile/bytevectors.c:
* libguile/eval.c:
* libguile/goops.c:
* libguile/i18n.c:
* libguile/load.c:
* libguile/memoize.c:
* libguile/modules.c:
* libguile/ports.c:
* libguile/print.c:
* libguile/procs.c:
* libguile/programs.c:
* libguile/read.c:
* libguile/script.c:
* libguile/srfi-14.c:
* libguile/stacks.c:
* libguile/strings.c:
* libguile/throw.c:
* libguile/vm.c: Use scm_from_latin1_symboln to make symbols from string
  literals, because they aren't in the user's locale -- they are in
  ASCII, and we can optimize this case.

* libguile/vm-i-loader.c: Also use scm_from_latin1_symboln when loading
  narrow symbols.
2011-01-07 09:18:41 -08:00
U-Cain\Mike
24deb6d018 DAY_1 nl_langinfo constants don't require <nl_types.h>
There is an incorrect conditional compilation requirement that
<nl_types.h> be present for DAY_1 to be defined.  This doesn't
agree with the LSB and causes make check to fail on Cygwin.

* libguile/i18n.c [HAVE_NL_TYPES_H]: modify conditional compilatiion
2010-06-17 13:31:28 -07:00
Andy Wingo
44602b0868 rename libguile to libguile-@EFFECTIVE_VERSION@, currently libguile-2.0
* libguile/Makefile.am (lib_LTLIBRARIES): Instead of just "libguile.la",
  make "libguile-@EFFECTIVE_VERSION@.la". This allows multiple versions
  of Guile to be installed at once. See
  http://www106.pair.com/rhp/parallel.html for a rationale.

  (libguile_@GUILE_EFFECTIVE_VERSION@_la_CFLAGS):
  (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
  (libguile_@GUILE_EFFECTIVE_VERSION@_la_DEPENDENCIES):
  (libguile_@GUILE_EFFECTIVE_VERSION@_la_LIBADD):
  (libguile_@GUILE_EFFECTIVE_VERSION@_la_LDFLAGS): Fixup automake vars
  to include the effective version.
  (guile_LDADD): Fix up the spelling of libguile.

* libguile/bytevectors.c (scm_bootstrap_bytevectors):
* libguile/foreign.c (scm_register_foreign):
* libguile/i18n.c (scm_bootstrap_i18n):
* libguile/instructions.c (scm_bootstrap_instructions):
* libguile/objcodes.c (scm_bootstrap_objcodes):
* libguile/programs.c (scm_bootstrap_programs):
* libguile/vm.c (scm_bootstrap_vm): Register extensions using e.g.
  "libguile-2.0" as the libname -- i.e., including the effective version
  in the libname.

* module/ice-9/i18n.scm:
* module/rnrs/bytevector.scm:
* module/rnrs/io/ports.scm:
* module/system/foreign.scm:
* module/system/vm/instruction.scm:
* module/system/vm/objcode.scm:
* module/system/vm/program.scm:
* module/system/vm/vm.scm: When doing a load-extension for something in
  Guile, use the effective version also.

* meta/guile-2.0-uninstalled.pc.in (Libs):
* meta/guile-2.0.pc.in (Libs): Use -lguile-@EFFECTIVE_VERSION@. This
  change should mean that code built against Guile should not be
  affected by the libguile rename.

* guile-readline/Makefile.am (libguilereadline_v_@LIBGUILEREADLINE_MAJOR@_la_LIBADD):
* srfi/Makefile.am
  (libguile_srfi_srfi_1_v_@LIBGUILE_SRFI_SRFI_1_MAJOR@_la_LIBADD):
  (libguile_srfi_srfi_4_v_@LIBGUILE_SRFI_SRFI_4_MAJOR@_la_LIBADD):
  (libguile_srfi_srfi_13_14_v_@LIBGUILE_SRFI_SRFI_13_14_MAJOR@_la_LIBADD):
  (libguile_srfi_srfi_60_v_@LIBGUILE_SRFI_SRFI_60_MAJOR@_la_LIBADD):
* test-suite/standalone/Makefile.am (test_num2integral_LDADD):
  (test_round_LDADD):
  (libtest_asmobs_la_LIBADD):
  (libtest_ffi_la_LIBADD):
  (test_list_LDADD):
  (test_unwind_LDADD):
  (test_conversion_LDADD):
  (test_loose_ends_LDADD):
  (test_scm_c_read_LDADD):
  (test_scm_take_locale_symbol_LDADD):
  (test_scm_take_u8vector_LDADD):
  (libtest_extensions_la_LIBADD):
  (test_with_guile_module_LDADD):
  (test_scm_with_guile_LDADD): Fix up the spelling of libguile.la.
2010-03-16 21:20:34 +01:00
Ludovic Courtès
56d288b844 i18n: Define `nl_item' when it's not available (needed for Cygwin).
* configure.ac: Add check for `nl_item'.

* libguile/i18n.c: Separate check for `HAVE_LANGINFO_H' and
  `HAVE_NL_TYPES_H'.
  [!HAVE_NL_ITEM]: Define `nl_item'.
2010-02-16 20:57:13 +01:00
Ludovic Courtès
44d3d11144 Fix builds of `i18n.c' on non-GNU systems.
* libguile/i18n.c (chr_to_case, str_to_case): Add `func_name' argument
  and `FUNC_NAME' macro.  Update callers.
2010-02-15 19:40:42 +01:00
Julian Graham
820f33aaed Improved support for Unicode title case in Guile's string and character APIs.
* doc/ref/api-data.texi (Characters): Documentation for `char-titlecase'.
* doc/ref/api-i18n.texi (Character Case Mapping): Documentation for
  `char-locale-titlecase' and `string-locale-titlecase'.

* libguile/chars.c, libguile/chars.h (scm_char_titlecase, scm_c_titlecase): New
  functions.

* libguile/i18n.c, libguile/i18n.h (chr_to_case, scm_char_locale_titlecase,
  str_to_case, scm_string_locale_titlecase): New functions.
* libguile/i18n.c (scm_char_locale_downcase, scm_char_locale_upcase,
  scm_string_locale_downcase, scm_string_locale_upcase): Refactor to share code
  via chr_to_case and str_to_case, as appropriate.
* module/ice-9/i18n.scm (char-locale-title-case, string-locale-titlecase): New
  functions.

* libguile/srfi-13.c (string_titlecase_x): Use uc_totitle instead of uc_toupper.

* test-suite/tests/chars.test: Tests for `char-titlecase'.
* test-suite/tests/i18n.test: Tests for `char-locale-titlecase' and
  `string-locale-titlecase'.
* test-suite/tests/srfi-13.test: Tests for `string-titlecase'.
2009-12-22 00:19:56 -05:00
Ludovic Courtès
c3b16a5d8e Use Gnulib's `duplocale' module.
* libguile/i18n.c (scm_make_locale): Simplify global locale handling,
  using duplocale(3) for all kinds of locales.
  (scm_init_i18n): Comment on why we don't just use `LC_GLOBAL_LOCALE'
  for `global_locale_smob'.

* m4/gnulib-cache.m4: Add `duplocale'.
2009-11-23 23:51:02 +01:00
Ludovic Courtès
414e44412c Use Gnulib's `locale' module.
* configure.ac: Remove test for <xlocale.h>.

* libguile/i18n.c: Remove conditional <xlocale.h> inclusion on
  `HAVE_XLOCALE_H'.

* m4/gnulib-cache.m4: Add `locale' module.
2009-11-23 23:51:02 +01:00
Ludovic Courtès
c291b58835 Fix stylistic issues revealed by "make syntax-check".
* libguile/gc-malloc.c (scm_must_free): Remove unnecessary `if' before
  `free ()'.

* libguile/stime.c (scm_localtime, scm_mktime): Likewise.

* libguile/eval.i.c (ceval): Don't cast the result of alloca(3).

* libguile/i18n.c (SCM_STRING_TO_U32_BUF): Likewise.

* test-suite/standalone/test-unwind.c: Likewise.

* libguile/strings.c (scm_i_deprecated_string_chars): Don't end error
  message in period.
2009-11-17 23:42:36 +01:00
Michael Gran
03d80c0327 Revert changes that gather thread-specific local language
The method used was not portable.  However, the underlying problem
still exists: the uc_locale_language used by libunistring does not
work with thread-specific locale_t locales.

* libguile/i18n.c (locale_language): avoid unpacking semi-opaque type
  locale_t.

* test-suite/tests/i18n.test: set Turkish string and char locale upcase
  and downcase tests to throw untested
2009-10-09 07:06:14 -07:00
Michael Gran
b8fc11d287 Missing free in nl-langinfo
This is a regression.

* libguile/i18n.c (scm_nl_langinfo): free c_result
2009-09-25 07:47:56 -07:00
Michael Gran
52642040e2 Fix encoding of strings returned by nl-langinfo
Strings returned by nl-langinfo were always being encoded using the
global setlocale and not the scm_t_locale passed to the function.

* libguile/i18n.c (scm_nl_langinfo): fix encoding of strings
2009-09-25 07:27:11 -07:00
Michael Gran
aafb5062b8 Language-specific case-conversion doesn't honor locale
Libunistring uses a function uc_locale_language to extract the
current language from the locale information.  It does this by calling
setlocale.  This makes incompatible with Guile functions that use the
locale_t thread-specific locale API, because the values returned by the
call to setlocale ignore the locale set by uselocale.

As a workaround, this patch extracts the language from the locale_t
structure's __names field.

A more complete solution is needed.  Perhaps that solution would test
that the __names field exists in the configure step and revert to
!USE_GNU_LOCALE_API in that case.

* libguile/i18n.c (locale_language): new function that performs the
  same job as uc_locale_language but is compatible with uselocale
  (u32_locale_casecoll, u32_locale_tocase): replace uc_locale_language
  with locale_language
2009-09-24 08:15:31 -07:00
Michael Gran
2c48e4d5b7 Try to adjust i18n for strict aliasing
* libguile/i18n.c (u32_locale_tocase, scm_char_locale_downcase)
  (scm_char_locale_upcase, scm_string_locale_downcase)
  (scm_string_locale_upcase): use the scm_t_uint32 type for buffers
  that are used primarily for libunistring and not for Guile strings.
2009-09-24 08:15:20 -07:00
Michael Gran
27f3413eb8 Modify char and string locale upcase and downcase for Unicode
* libguile/i18n.c (u32_locale_tocase): new helper function
  (scm_char_locale_downcase, scm_char_locale_upcase): add capability
  for UCS-4 characters.
  (scm_string_locale_downcase, scm_string_locale_upcase): modify for
  the new scheme strings.
2009-09-22 21:08:29 -07:00
Ludovic Courtès
c543e41eb4 i18n: Remove non-local exists from `u32_locale_casecoll ()'.
* libguile/i18n.c (u32_locale_casecoll): Add RESULT argument.  Return
  zero or ERRNO.
  (compare_u32_strings_ci): Adjust accordingly.
2009-09-18 12:58:54 +02:00
Ludovic Courtès
cdf52ff020 i18n: Always use locale-dependent string collation.
* libguile/i18n.c (compare_u32_strings, compare_u32_strings_ci): Always
  use locale-dependent string collation.

* test-suite/tests/i18n.test: Recoded in UTF-8.
  (%french-utf8-locale-name): New.
  (under-locale-or-unresolved): New.  Don't catch errors on GNU systems.
  (under-french-locale-or-unresolved): Use it.
  (under-french-utf8-locale-or-unresolved): New.
  ("text collation (French)")["string-locale-ci=? (2 args, wide
  strings)", "string-locale-ci=? (3 args, wide strings)",
  "string-locale-ci<>? (wide strings)", "string-locale-ci<>? (wide and
  narrow strings)", "char-locale-ci<>? (wide)"]: New tests.
2009-09-18 12:55:49 +02:00
Ludovic Courtès
df047aa2b1 i18n: Avoid needless heap allocation.
* libguile/i18n.c (SCM_STRING_TO_U32_BUF): Allocate buffers on the stack
  rather on the heap.
  (SCM_U32_BUF_FREE): Remove.  Callers updated.
2009-09-18 12:21:22 +02:00
Ludovic Courtès
12f0c3e547 i18n: Simplify `RUN_IN_LOCALE_SECTION' (GNU version).
* libguile/i18n.c (RUN_IN_LOCALE_SECTION)[USE_GNU_LOCALE_API]: Remove
  extraneous uselocale(3) call.
2009-09-18 12:15:26 +02:00
Michael Gran
5b87844575 Adapt i18n string and char comparison funcs for Unicode
* libguile/i18n.c (RUN_IN_LOCALE_SECTION) [USE_GNU_LOCALE_API]: new
  macro for this define.  Should work the same as the !USE_GNU_LOCAL_API
  version
  (SCM_STRING_TO_U32_BUF, SCM_U32_BUF_FREE): helper macros
  (compare_u32_strings, compare_u32_strings_ci): new functions that
  compare scheme strings in the presence of the locale
  (u32_locale_casecoll): new helper function for compare_u32_strings_ci
  (compare_strings, compare_strings_ci): removed and replaced by
  compare_u32_strings and compare_u32_strings_ci
  (scm_string_locale_lt, scm_string_locale_gt, scm_string_locale_ci_lt)
  (scm_string_locale_ci_gt, scm_string_locale_ci_eq): modified to
  use new compare_u32_strings and compare_u32_strings_ci comparison
  functions
  (scm_char_locale_lt, scm_char_locale_gt, scm_char_locale_ci_lt)
  (scm_char_locale_ci_gt, scm_char_locale_ci_eq): modified to use
  new compare_u32_strings and compare_u32_strings_ci comparison
  functions
2009-09-17 08:22:11 -07:00
Ludovic Courtès
756e8a3acf Merge libguile-i18n' into libguile'.
* GUILE-VERSION (LIBGUILE_I18N_MAJOR, LIBGUILE_I18N_INTERFACE_CURRENT,
  LIBGUILE_I18N_INTERFACE_REVISION, LIBGUILE_I18N_INTERFACE_AGE,
  LIBGUILE_I18N_INTERFACE): Remove.

* doc/ref/api-i18n.texi (i18n Introduction): Don't mention
  `libguile-i18n'.

* libguile.h: Include "libguile/i18n.h".

* libguile/Makefile.am (lib_LTLIBRARIES): Remove `libguile-i18n-v*'.
  (libguile_la_SOURCES): Add `i18n.c'.
  (libguile_i18n_v_*_SOURCES, libguile_i18n_v_*_CFLAGS,
  libguile_i18n_v_*_LIBADD, libguile_i18n_v_*_LDFLAGS): Remove.

* libguile/i18n.c (scm_bootstrap_i18n): New function.

* libguile/i18n.h (scm_nl_langinfo, scm_init_i18n): Made internal.
  (scm_bootstrap_i18n): New declaration.

* libguile/init.c (scm_i_init_guile): Invoke `scm_bootstrap_i18n ()'.

* module/ice-9/i18n.scm: Load from `libguile' instead of
  `libguile-i18n-v-0'.
2009-09-14 00:42:25 +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
49c9839eae Remove unneeded SMOB mark procedure in `i18n.c'.
* libguile/i18n.c (smob_locale_mark): Remove.
  (scm_init_i18n): Remove `scm_set_smob_mark ()' call.
2009-03-22 16:20:53 +01:00
Ludovic Courtès
83fda4707c i18n: Add comment about standardization of the `locale_t' API.
* libguile/i18n.c: Add pointer to the POSIX 2008 standardization of the
  API.
2008-12-10 11:05:50 +01: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