? debug ? doconf ? guile-config/libtool.m4 ? guile-config/ltdl.m4 ? guile-readline/ice-9 ? guile-readline/libtool.m4 ? libguile/i18n.c ? libguile/i18n.h ? libguile/init.loT Index: ChangeLog =================================================================== RCS file: /cvsroot/guile/guile/guile-core/ChangeLog,v retrieving revision 1.444 diff -p -u -r1.444 ChangeLog --- ChangeLog 27 Aug 2004 01:10:20 -0000 1.444 +++ ChangeLog 1 Sep 2004 16:17:14 -0000 @@ -1,3 +1,7 @@ +2004-09-01 Jan Nieuwenhuizen + + * configure.in: Add i18n checks. + 2004-08-27 Kevin Ryde * configure.in (AC_CHECK_MEMBERS): Add struct sockaddr.sin_len and Index: configure.in =================================================================== RCS file: /cvsroot/guile/guile/guile-core/configure.in,v retrieving revision 1.251 diff -p -u -r1.251 configure.in --- configure.in 27 Aug 2004 01:09:48 -0000 1.251 +++ configure.in 1 Sep 2004 16:17:14 -0000 @@ -637,6 +637,14 @@ AC_TRY_LINK([#include ], [mpz_import (0, 0, 0, 0, 0, 0, 0);] , , [AC_MSG_ERROR([At least GNU MP 4.1 is required, see http://swox.com/gmp])]) +dnl i18n tests +AC_CHECK_HEADERS([gettext.h libintl.h]) +AC_CHECK_FUNCS(gettext) +if test $ac_cv_func_gettext = no; then + AC_CHECK_LIB(intl, gettext) +fi +AC_CHECK_FUNCS([bindtextdomain textdomain]) + ### Some systems don't declare some functions. On such systems, we ### need to at least provide our own K&R-style declarations. Index: libguile/ChangeLog =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/ChangeLog,v retrieving revision 1.2137 diff -p -u -r1.2137 ChangeLog --- libguile/ChangeLog 27 Aug 2004 12:46:11 -0000 1.2137 +++ libguile/ChangeLog 1 Sep 2004 16:17:17 -0000 @@ -1,3 +1,8 @@ +2004-09-01 Jan Nieuwenhuizen + + * i18n.h: + * i18n.c: New file. + 2004-08-27 Marius Vollmer * strings.c (SCM_STRINGP): Accept all strings. Index: libguile/Makefile.am =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/Makefile.am,v retrieving revision 1.191 diff -p -u -r1.191 Makefile.am --- libguile/Makefile.am 24 Aug 2004 22:11:35 -0000 1.191 +++ libguile/Makefile.am 1 Sep 2004 16:17:17 -0000 @@ -97,7 +97,7 @@ libguile_la_SOURCES = alist.c arbiters.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 gh_init.c \ gh_io.c gh_list.c gh_predicates.c goops.c gsubr.c guardians.c hash.c \ - hashtab.c hooks.c init.c inline.c ioext.c keywords.c \ + hashtab.c hooks.c i18n.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 \ @@ -113,7 +113,7 @@ DOT_X_FILES = alist.x arbiters.x async.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 hash.x hashtab.x hooks.x init.x ioext.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 properties.x random.x rdelim.x read.x root.x rw.x \ @@ -187,7 +187,7 @@ modinclude_HEADERS = __scm.h alist.h arb 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 hashtab.h hooks.h init.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 posix.h \ Index: libguile/init.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/init.c,v retrieving revision 1.159 diff -p -u -r1.159 init.c --- libguile/init.c 24 Aug 2004 22:13:07 -0000 1.159 +++ libguile/init.c 1 Sep 2004 16:17:17 -0000 @@ -477,6 +477,7 @@ scm_init_guile_1 (SCM_STACKITEM *base) scm_init_properties (); scm_init_hooks (); /* Requires smob_prehistory */ scm_init_gc (); /* Requires hooks, async */ + scm_init_i18n (); scm_init_ioext (); scm_init_keywords (); scm_init_list (); Index: libguile/numbers.c =================================================================== RCS file: /cvsroot/guile/guile/guile-core/libguile/numbers.c,v retrieving revision 1.260 diff -p -u -r1.260 numbers.c --- libguile/numbers.c 24 Aug 2004 16:43:50 -0000 1.260 +++ libguile/numbers.c 1 Sep 2004 16:17:18 -0000 @@ -5848,8 +5848,8 @@ scm_init_numbers () scm_dblprec[10-2] = (DBL_DIG > 20) ? 20 : DBL_DIG; #endif -#ifdef GUILE_DEBUG - check_sanity (); +#ifdef FIXME__GUILE_DEBUG + check_sanity (); #endif exactly_one_half = scm_permanent_object (scm_divide (SCM_I_MAKINUM (1), --- ../ugh-cvs/libguile/libguile.h 1970-01-01 01:00:00 +0100 +++ libguile/i18n.h 2004-09-01 18:12:57 +0200 @@ -0,0 +1,43 @@ +/* classes: h_files */ + +#ifndef SCM_I18N_H +#define SCM_I18N_H + +/* Copyright (C) 2004 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + + +#include "libguile/__scm.h" + + + + + + +SCM_API SCM scm_gettext (SCM string); +SCM_API SCM scm_textdomain (SCM domainname); +SCM_API SCM scm_bindtextdomain (SCM domainname, SCM directory); +SCM_API void scm_init_i18n (void); + +#endif /* SCM_I18N_H */ + +/* + Local Variables: + c-file-style: "gnu" + End: +*/ --- ../ugh-cvs/libguile/libguile.c 1970-01-01 01:00:00 +0100 +++ libguile/i18n.c 2004-09-01 17:38:29 +0200 @@ -0,0 +1,116 @@ +/* Copyright (C) 2004 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#if HAVE_CONFIG_H +# include +#endif + +#ifdef HAVE_GETEXT_H +# include +#endif + +#ifdef HAVE_LIBINTL_H +# include +#endif + +#include "libguile/_scm.h" +#include "libguile/discouraged.h" +#include "libguile/feature.h" +#include "libguile/i18n.h" +#include "libguile/strings.h" + + + +#ifdef HAVE_GETTEXT +SCM_DEFINE (scm_gettext, "gettext", 1, 0, 0, + (SCM string), + "Return gettext lookup of @var{string}.") +#define FUNC_NAME s_scm_gettext +{ + SCM_VALIDATE_STRING (1, string); + return scm_makfrom0str (gettext (SCM_STRING_CHARS (string))); +} +#undef FUNC_NAME +#endif /* HAVE_GETTEXT */ + +#ifdef HAVE_TEXTDOMAIN +SCM_DEFINE (scm_textdomain, "textdomain", 0, 1, 0, + (SCM domainname), + "If optional argument @var{domainname} is supplied, " + "set textdomain." + "Return the textdomain.") +#define FUNC_NAME s_scm_textdomain +{ + char *rv; + char *n; + + if (SCM_UNBNDP (domainname)) + n = NULL; + else + { + SCM_VALIDATE_STRING (1, domainname); + n = SCM_STRING_CHARS (domainname); + } + rv = textdomain (n); + if (rv == NULL) + SCM_SYSERROR; + return scm_makfrom0str (rv); +} +#undef FUNC_NAME +#endif /* HAVE_TEXTDOMAIN */ + +#ifdef HAVE_BINDTEXTDOMAIN +SCM_DEFINE (scm_bindtextdomain, "bindtextdomain", 1, 1, 0, + (SCM domainname, SCM directory), + "Set message catalogs for domain @var{domainname} " + "to directory @{directory}." + "Return the bound directory.") +#define FUNC_NAME s_scm_bindtextdomain +{ + char *rv; + char *d; + + SCM_VALIDATE_STRING (1, domainname); + if (SCM_UNBNDP (directory)) + d = NULL; + else + { + SCM_VALIDATE_STRING (2, directory); + d = SCM_STRING_CHARS (directory); + } + rv = bindtextdomain (SCM_STRING_CHARS (domainname), d); + if (rv == NULL) + SCM_SYSERROR; + return scm_makfrom0str (rv); +} +#undef FUNC_NAME +#endif /* HAVE_BINDTEXTDOMAIN */ + +void +scm_init_i18n () +{ + scm_add_feature ("i18n"); +#include "libguile/i18n.x" +} + + +/* + Local Variables: + c-file-style: "gnu" + End: +*/