1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-07-05 17:20:18 +02:00
guile/libguile/i18n-internal.h
Andy Wingo db13048459 Add i18n-internal.h
* libguile/i18n-internal.h: New file.
* libguile/Makefile.am: Add file.
* libguile/i18n.c:
* libguile/finalizers.c:
* libguile/init.c: Use new file.
2025-06-30 15:30:43 +02:00

65 lines
1.7 KiB
C

#ifndef SCM_I18N_INTERNAL_H
#define SCM_I18N_INTERNAL_H
/* Copyright 2006,2008-2009,2018,2025
Free Software Foundation, Inc.
This file is part of Guile.
Guile 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 3 of the License, or
(at your option) any later version.
Guile 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 Guile. If not, see
<https://www.gnu.org/licenses/>. */
#include "libguile/scm.h"
#include "libguile/error.h"
#include "libguile/i18n.h"
struct scm_locale
{
scm_t_bits tag;
locale_t locale;
};
static inline int
scm_is_locale (SCM x)
{
return SCM_HAS_TYP16 (x, scm_tc16_locale);
}
static inline struct scm_locale *
scm_to_locale (SCM x)
{
if (!scm_is_locale (x))
abort ();
return (struct scm_locale *) SCM_UNPACK_POINTER (x);
}
static inline SCM
scm_from_locale (struct scm_locale *x)
{
return SCM_PACK_POINTER (x);
}
#define SCM_LOCALE_P(x) (scm_is_locale (x))
#define SCM_VALIDATE_LOCALE(pos, x) \
SCM_MAKE_VALIDATE_MSG (pos, x, LOCALE_P, "locale")
SCM_INTERNAL SCM scm_nl_langinfo (SCM item, SCM locale);
SCM_INTERNAL void scm_i_finalize_locale (struct scm_thread *thread, SCM locale);
SCM_INTERNAL void scm_init_i18n (void);
SCM_INTERNAL void scm_bootstrap_i18n (void);
#endif /* SCM_I18N_INTERNAL_H */