mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-20 02:30:23 +02:00
Changes from arch/CVS synchronization
This commit is contained in:
parent
cbea802b37
commit
b89c494395
20 changed files with 1607 additions and 343 deletions
|
@ -1,3 +1,40 @@
|
|||
2006-11-18 Ludovic Courtès <ludovic.courtes@laas.fr>
|
||||
|
||||
* Makefile.am (lib_LTLIBRARIES): Added `libguile-i18n-v-XX.la'.
|
||||
(libguile_la_SOURCES): Added `gettext.c', removed `i18n.c'.
|
||||
(libguile_i18n_v_XX_la_SOURCES, libguile_i18n_v_XX_la_CFLAGS,
|
||||
libguile_i18n_v_XX_la_LIBADD, libguile_i18n_v_XX_la_LDFLAGS): New.
|
||||
(DOT_X_FILES): Added `gettext.x'.
|
||||
(DOT_DOC_FILES): Likewise.
|
||||
(EXTRA_libguile_la_SOURCES): Added `locale-categories.h'.
|
||||
(modinclude_HEADERS): Added `gettext.h'.
|
||||
(EXTRA_DIST): Added `libgettext.h'.
|
||||
|
||||
* gettext.h: Renamed to...
|
||||
* libgettext.h: New file.
|
||||
|
||||
* i18n.c: Renamed to...
|
||||
* gettext.c: New file.
|
||||
|
||||
* i18n.h: Renamed to...
|
||||
* gettext.h: New file.
|
||||
|
||||
* i18n.c, i18n.h, locale-categories.h: New files.
|
||||
|
||||
* init.c: Include "libguile/gettext.h" instead of
|
||||
"libguile/i18n.h".
|
||||
(scm_i_init_guile): Invoke `scm_init_gettext ()' instead of
|
||||
`scm_init_i18n ()'.
|
||||
|
||||
* posix.c: Include "libguile/gettext.h" instead of
|
||||
"libguile/i18n.h" Test `HAVE_NEWLOCALE' and `HAVE_STRCOLL_L'.
|
||||
(USE_GNU_LOCALE_API): New macro.
|
||||
(scm_i_locale_mutex): New variable.
|
||||
(scm_setlocale): Lock and unlock it around `setlocale ()' calls.
|
||||
|
||||
* posix.h: Include "libguile/threads.h".
|
||||
(scm_i_locale_mutex): New declaration.
|
||||
|
||||
2006-11-17 Neil Jerram <neil@ossau.uklinux.net>
|
||||
|
||||
* script.c (scm_shell_usage): Note need for subscription to bug-guile@gnu.org.
|
||||
|
|
|
@ -31,7 +31,8 @@ INCLUDES = -I.. -I$(top_srcdir)
|
|||
ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
|
||||
--regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
|
||||
|
||||
lib_LTLIBRARIES = libguile.la
|
||||
lib_LTLIBRARIES = libguile.la \
|
||||
libguile-i18n-v-@LIBGUILE_I18N_MAJOR@.la
|
||||
bin_PROGRAMS = guile
|
||||
|
||||
noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig
|
||||
|
@ -97,9 +98,10 @@ libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \
|
|||
deprecated.c discouraged.c dynwind.c eq.c error.c \
|
||||
eval.c evalext.c extensions.c feature.c fluids.c fports.c \
|
||||
futures.c gc.c gc-mark.c gc-segment.c gc-malloc.c gc-card.c \
|
||||
gc-freelist.c gc_os_dep.c gdbint.c gh_data.c gh_eval.c gh_funcs.c \
|
||||
gc-freelist.c gc_os_dep.c gdbint.c gettext.c \
|
||||
gh_data.c gh_eval.c gh_funcs.c \
|
||||
gh_init.c gh_io.c gh_list.c gh_predicates.c goops.c gsubr.c \
|
||||
guardians.c hash.c hashtab.c hooks.c i18n.c init.c inline.c \
|
||||
guardians.c hash.c hashtab.c hooks.c init.c inline.c \
|
||||
ioext.c keywords.c lang.c list.c load.c macros.c mallocs.c \
|
||||
modules.c numbers.c objects.c objprop.c options.c pairs.c ports.c \
|
||||
print.c procprop.c procs.c properties.c random.c rdelim.c read.c \
|
||||
|
@ -109,11 +111,21 @@ libguile_la_SOURCES = alist.c arbiters.c async.c backtrace.c boolean.c \
|
|||
throw.c values.c variable.c vectors.c version.c vports.c weaks.c \
|
||||
ramap.c unif.c
|
||||
|
||||
libguile_i18n_v_@LIBGUILE_I18N_MAJOR@_la_SOURCES = i18n.c
|
||||
libguile_i18n_v_@LIBGUILE_I18N_MAJOR@_la_CFLAGS = \
|
||||
$(libguile_la_CFLAGS)
|
||||
libguile_i18n_v_@LIBGUILE_I18N_MAJOR@_la_LIBADD = \
|
||||
libguile.la
|
||||
libguile_i18n_v_@LIBGUILE_I18N_MAJOR@_la_LDFLAGS = \
|
||||
-module -L$(builddir) -lguile \
|
||||
-version-info @LIBGUILE_I18N_INTERFACE@
|
||||
|
||||
DOT_X_FILES = alist.x arbiters.x async.x backtrace.x boolean.x chars.x \
|
||||
continuations.x debug.x deprecation.x deprecated.x discouraged.x \
|
||||
dynl.x dynwind.x eq.x error.x eval.x evalext.x \
|
||||
extensions.x feature.x fluids.x fports.x futures.x gc.x gc-mark.x \
|
||||
gc-segment.x gc-malloc.x gc-card.x goops.x gsubr.x guardians.x \
|
||||
gc-segment.x gc-malloc.x gc-card.x gettext.x goops.x \
|
||||
gsubr.x guardians.x \
|
||||
hash.x hashtab.x hooks.x i18n.x init.x ioext.x keywords.x lang.x \
|
||||
list.x load.x macros.x mallocs.x modules.x numbers.x objects.x \
|
||||
objprop.x options.x pairs.x ports.x print.x procprop.x procs.x \
|
||||
|
@ -131,7 +143,8 @@ DOT_DOC_FILES = alist.doc arbiters.doc async.doc backtrace.doc \
|
|||
eq.doc error.doc eval.doc evalext.doc \
|
||||
extensions.doc feature.doc fluids.doc fports.doc futures.doc \
|
||||
gc.doc goops.doc gsubr.doc gc-mark.doc gc-segment.doc \
|
||||
gc-malloc.doc gc-card.doc guardians.doc hash.doc hashtab.doc \
|
||||
gc-malloc.doc gc-card.doc gettext.doc \
|
||||
guardians.doc hash.doc hashtab.doc \
|
||||
hooks.doc i18n.doc init.doc ioext.doc keywords.doc lang.doc \
|
||||
list.doc load.doc macros.doc mallocs.doc modules.doc numbers.doc \
|
||||
objects.doc objprop.doc options.doc pairs.doc ports.doc print.doc \
|
||||
|
@ -153,8 +166,9 @@ EXTRA_libguile_la_SOURCES = _scm.h \
|
|||
inet_aton.c memmove.c putenv.c strerror.c \
|
||||
dynl.c regex-posix.c \
|
||||
filesys.c posix.c net_db.c socket.c \
|
||||
debug-malloc.c mkstemp.c \
|
||||
win32-uname.c win32-dirent.c win32-socket.c
|
||||
debug-malloc.c mkstemp.c \
|
||||
win32-uname.c win32-dirent.c win32-socket.c \
|
||||
locale-categories.h
|
||||
|
||||
## delete guile-snarf.awk from the installation bindir, in case it's
|
||||
## lingering there due to an earlier guile version not having been
|
||||
|
@ -187,7 +201,8 @@ modinclude_HEADERS = __scm.h alist.h arbiters.h async.h backtrace.h \
|
|||
deprecation.h deprecated.h discouraged.h dynl.h dynwind.h \
|
||||
eq.h error.h eval.h evalext.h extensions.h \
|
||||
feature.h filesys.h fluids.h fports.h futures.h gc.h \
|
||||
gdb_interface.h gdbint.h goops.h gsubr.h guardians.h hash.h \
|
||||
gdb_interface.h gdbint.h gettext.h goops.h \
|
||||
gsubr.h guardians.h hash.h \
|
||||
hashtab.h hooks.h i18n.h init.h inline.h ioext.h iselect.h \
|
||||
keywords.h lang.h list.h load.h macros.h mallocs.h modules.h \
|
||||
net_db.h numbers.h objects.h objprop.h options.h pairs.h ports.h \
|
||||
|
@ -212,7 +227,7 @@ EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads \
|
|||
cpp_errno.c cpp_err_symbols.in cpp_err_symbols.c \
|
||||
cpp_sig_symbols.c cpp_sig_symbols.in cpp_cnvt.awk \
|
||||
c-tokenize.lex version.h.in \
|
||||
scmconfig.h.top gettext.h
|
||||
scmconfig.h.top libgettext.h
|
||||
# $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
|
||||
# guile-procedures.txt guile.texi
|
||||
|
||||
|
|
|
@ -1,69 +1,41 @@
|
|||
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||
Copyright (C) 1995-1998, 2000-2002, 2006 Free Software Foundation, Inc.
|
||||
/* classes: h_files */
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
#ifndef SCM_GETTEXT_H
|
||||
#define SCM_GETTEXT_H
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
/* Copyright (C) 2004, 2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
|
||||
USA. */
|
||||
#include "libguile/__scm.h"
|
||||
|
||||
#ifndef _LIBGETTEXT_H
|
||||
#define _LIBGETTEXT_H 1
|
||||
SCM_API SCM scm_gettext (SCM msgid, SCM domainname, SCM category);
|
||||
SCM_API SCM scm_ngettext (SCM msgid, SCM msgid_plural, SCM n, SCM domainname, SCM category);
|
||||
SCM_API SCM scm_textdomain (SCM domainname);
|
||||
SCM_API SCM scm_bindtextdomain (SCM domainname, SCM directory);
|
||||
SCM_API SCM scm_bind_textdomain_codeset (SCM domainname, SCM encoding);
|
||||
|
||||
/* NLS can be disabled through the configure --disable-nls option. */
|
||||
#if ENABLE_NLS
|
||||
SCM_API int scm_i_to_lc_category (SCM category, int allow_lc_all);
|
||||
|
||||
/* Get declarations of GNU message catalog functions. */
|
||||
# include <libintl.h>
|
||||
SCM_API void scm_init_gettext (void);
|
||||
|
||||
#else
|
||||
#endif /* SCM_GETTEXT_H */
|
||||
|
||||
/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
|
||||
chokes if dcgettext is defined as a macro. So include it now, to make
|
||||
later inclusions of <locale.h> a NOP. We don't include <libintl.h>
|
||||
as well because people using "gettext.h" will not include <libintl.h>,
|
||||
and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
|
||||
is OK. */
|
||||
#if defined(__sun)
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
/* Disabled NLS.
|
||||
The casts to 'const char *' serve the purpose of producing warnings
|
||||
for invalid uses of the value returned from these functions.
|
||||
On pre-ANSI systems without 'const', the config.h file is supposed to
|
||||
contain "#define const". */
|
||||
# define gettext(Msgid) ((const char *) (Msgid))
|
||||
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
|
||||
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
|
||||
# define ngettext(Msgid1, Msgid2, N) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define dngettext(Domainname, Msgid1, Msgid2, N) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define textdomain(Domainname) ((const char *) (Domainname))
|
||||
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
|
||||
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
|
||||
|
||||
#endif
|
||||
|
||||
/* A pseudo function call that serves as a marker for the automated
|
||||
extraction of messages, but does not call gettext(). The run-time
|
||||
translation is done at a different place in the code.
|
||||
The argument, String, should be a literal string. Concatenated strings
|
||||
and other string expressions won't work.
|
||||
The macro's expansion is not parenthesized, so that it is suitable as
|
||||
initializer for static 'char[]' or 'const char[]' variables. */
|
||||
#define gettext_noop(String) String
|
||||
|
||||
#endif /* _LIBGETTEXT_H */
|
||||
/*
|
||||
Local Variables:
|
||||
c-file-style: "gnu"
|
||||
End:
|
||||
*/
|
||||
|
|
1300
libguile/i18n.c
1300
libguile/i18n.c
File diff suppressed because it is too large
Load diff
|
@ -3,7 +3,7 @@
|
|||
#ifndef SCM_I18N_H
|
||||
#define SCM_I18N_H
|
||||
|
||||
/* Copyright (C) 2004, 2006 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -22,13 +22,24 @@
|
|||
|
||||
#include "libguile/__scm.h"
|
||||
|
||||
SCM_API SCM scm_gettext (SCM msgid, SCM domainname, SCM category);
|
||||
SCM_API SCM scm_ngettext (SCM msgid, SCM msgid_plural, SCM n, SCM domainname, SCM category);
|
||||
SCM_API SCM scm_textdomain (SCM domainname);
|
||||
SCM_API SCM scm_bindtextdomain (SCM domainname, SCM directory);
|
||||
SCM_API SCM scm_bind_textdomain_codeset (SCM domainname, SCM encoding);
|
||||
|
||||
SCM_API int scm_i_to_lc_category (SCM category, int allow_lc_all);
|
||||
SCM_API SCM scm_make_locale (SCM category_mask, SCM locale_name, SCM base_locale);
|
||||
SCM_API SCM scm_locale_p (SCM obj);
|
||||
SCM_API SCM scm_string_locale_lt (SCM s1, SCM s2, SCM locale);
|
||||
SCM_API SCM scm_string_locale_gt (SCM s1, SCM s2, SCM locale);
|
||||
SCM_API SCM scm_string_locale_ci_lt (SCM s1, SCM s2, SCM locale);
|
||||
SCM_API SCM scm_string_locale_ci_gt (SCM s1, SCM s2, SCM locale);
|
||||
SCM_API SCM scm_string_locale_ci_eq (SCM s1, SCM s2, SCM locale);
|
||||
SCM_API SCM scm_char_locale_lt (SCM c1, SCM c2, SCM locale);
|
||||
SCM_API SCM scm_char_locale_gt (SCM c1, SCM c2, SCM locale);
|
||||
SCM_API SCM scm_char_locale_ci_lt (SCM c1, SCM c2, SCM locale);
|
||||
SCM_API SCM scm_char_locale_ci_gt (SCM c1, SCM c2, SCM locale);
|
||||
SCM_API SCM scm_char_locale_ci_eq (SCM c1, SCM c2, SCM locale);
|
||||
SCM_API SCM scm_char_locale_upcase (SCM chr, SCM locale);
|
||||
SCM_API SCM scm_char_locale_downcase (SCM chr, SCM locale);
|
||||
SCM_API SCM scm_string_locale_upcase (SCM chr, SCM locale);
|
||||
SCM_API SCM scm_string_locale_downcase (SCM chr, SCM locale);
|
||||
SCM_API SCM scm_locale_string_to_integer (SCM str, SCM base, SCM locale);
|
||||
SCM_API SCM scm_locale_string_to_inexact (SCM str, SCM locale);
|
||||
|
||||
SCM_API void scm_init_i18n (void);
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
#include "libguile/hash.h"
|
||||
#include "libguile/hashtab.h"
|
||||
#include "libguile/hooks.h"
|
||||
#include "libguile/i18n.h"
|
||||
#include "libguile/gettext.h"
|
||||
#include "libguile/iselect.h"
|
||||
#include "libguile/ioext.h"
|
||||
#include "libguile/keywords.h"
|
||||
|
@ -479,7 +479,7 @@ scm_i_init_guile (SCM_STACKITEM *base)
|
|||
scm_init_properties ();
|
||||
scm_init_hooks (); /* Requires smob_prehistory */
|
||||
scm_init_gc (); /* Requires hooks, async */
|
||||
scm_init_i18n ();
|
||||
scm_init_gettext ();
|
||||
scm_init_ioext ();
|
||||
scm_init_keywords ();
|
||||
scm_init_list ();
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include "libguile/validate.h"
|
||||
#include "libguile/posix.h"
|
||||
#include "libguile/i18n.h"
|
||||
#include "libguile/gettext.h"
|
||||
#include "libguile/threads.h"
|
||||
|
||||
|
||||
|
@ -115,6 +115,10 @@ extern char ** environ;
|
|||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#if (defined HAVE_NEWLOCALE) && (defined HAVE_STRCOLL_L)
|
||||
# define USE_GNU_LOCALE_API
|
||||
#endif
|
||||
|
||||
#if HAVE_CRYPT_H
|
||||
# include <crypt.h>
|
||||
#endif
|
||||
|
@ -1380,7 +1384,15 @@ SCM_DEFINE (scm_putenv, "putenv", 1, 0, 0,
|
|||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
#ifndef USE_GNU_LOCALE_API
|
||||
/* This mutex is used to serialize invocations of `setlocale ()' on non-GNU
|
||||
systems (i.e., systems where a reentrant locale API is not available).
|
||||
See `i18n.c' for details. */
|
||||
scm_i_pthread_mutex_t scm_i_locale_mutex;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
|
||||
SCM_DEFINE (scm_setlocale, "setlocale", 1, 1, 0,
|
||||
(SCM category, SCM locale),
|
||||
"If @var{locale} is omitted, return the current value of the\n"
|
||||
|
@ -1409,7 +1421,14 @@ SCM_DEFINE (scm_setlocale, "setlocale", 1, 1, 0,
|
|||
scm_dynwind_free (clocale);
|
||||
}
|
||||
|
||||
#ifndef USE_GNU_LOCALE_API
|
||||
scm_i_pthread_mutex_lock (&scm_i_locale_mutex);
|
||||
#endif
|
||||
rv = setlocale (scm_i_to_lc_category (category, 1), clocale);
|
||||
#ifndef USE_GNU_LOCALE_API
|
||||
scm_i_pthread_mutex_unlock (&scm_i_locale_mutex);
|
||||
#endif
|
||||
|
||||
if (rv == NULL)
|
||||
{
|
||||
/* POSIX and C99 don't say anything about setlocale setting errno, so
|
||||
|
@ -1943,9 +1962,13 @@ SCM_DEFINE (scm_gethostname, "gethostname", 0, 0, 0,
|
|||
#endif /* HAVE_GETHOSTNAME */
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
scm_init_posix ()
|
||||
{
|
||||
#ifndef USE_GNU_LOCALE_API
|
||||
scm_i_pthread_mutex_init (&scm_i_locale_mutex, NULL);
|
||||
#endif
|
||||
|
||||
scm_add_feature ("posix");
|
||||
#ifdef HAVE_GETEUID
|
||||
scm_add_feature ("EIDs");
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
|
||||
#include "libguile/__scm.h"
|
||||
|
||||
|
||||
#include "libguile/threads.h"
|
||||
|
||||
|
||||
|
||||
|
@ -87,6 +86,8 @@ SCM_API SCM scm_sethostname (SCM name);
|
|||
SCM_API SCM scm_gethostname (void);
|
||||
SCM_API void scm_init_posix (void);
|
||||
|
||||
SCM_API scm_i_pthread_mutex_t scm_i_locale_mutex;
|
||||
|
||||
#endif /* SCM_POSIX_H */
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue