From 952977a19029dba56d38c912c93e7de34f18e410 Mon Sep 17 00:00:00 2001 From: Daniel Reinhold Date: Sat, 26 Oct 2002 21:41:49 +0000 Subject: [PATCH] initial locale support git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1705 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/libroot/posix/locale/Jamfile | 1 + src/kernel/libroot/posix/locale/localeconv.c | 57 ++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 src/kernel/libroot/posix/locale/localeconv.c diff --git a/src/kernel/libroot/posix/locale/Jamfile b/src/kernel/libroot/posix/locale/Jamfile index 133b995db6..0531a7457c 100644 --- a/src/kernel/libroot/posix/locale/Jamfile +++ b/src/kernel/libroot/posix/locale/Jamfile @@ -2,6 +2,7 @@ SubDir OBOS_TOP src kernel libroot posix locale ; KernelObjects <$(SOURCE_GRIST)>ctype.c + <$(SOURCE_GRIST)>localeconv.c : -fPIC -DPIC ; diff --git a/src/kernel/libroot/posix/locale/localeconv.c b/src/kernel/libroot/posix/locale/localeconv.c new file mode 100644 index 0000000000..9c4be82bdd --- /dev/null +++ b/src/kernel/libroot/posix/locale/localeconv.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2002, OpenBeOS Project. + * All rights reserved. + * Distributed under the terms of the OpenBeOS license. + * + * + * localeconv.c: + * defines the structure containing the current locale + * and the single access function 'localeconv()' + * + * + * Author(s): + * Daniel Reinhold (danielre@users.sf.net) + * + */ + +#include +#include + + +/* + * the values below initialize the struct to the "C" locale + * which is the default (and only required) locale + */ + +struct lconv _Locale = { + ".", // decimal point + + "", // thousands separator + "", // grouping + "", // international currency symbol + "", // local currency symbol + "", // monetary decimal point + "", // monetary thousands separator + "", // monetary grouping + "", // positive sign + "", // negative sign + + CHAR_MAX, // int_frac_digits + CHAR_MAX, // frac_digits + CHAR_MAX, // p_cs_precedes + CHAR_MAX, // p_sep_by_space + CHAR_MAX, // n_cs_precedes + CHAR_MAX, // n_sep_by_space + CHAR_MAX, // p_sign_posn + CHAR_MAX // n_sign_posn +}; + + + +struct lconv * +localeconv(void) +{ + // return pointer to the current locale + return &_Locale; +} +