1/*
2 * Copyright 2010, Oliver Tappe, zooey@hirschkaefer.de
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5
6
7#include <langinfo.h>
8
9#include "LocaleBackend.h"
10
11#include <PosixLanginfo.h>
12
13
14using BPrivate::Libroot::gLocaleBackend;
15using BPrivate::Libroot::gPosixLanginfo;
16
17
18extern "C" char*
19nl_langinfo(nl_item item)
20{
21	if (item < 0 || item >= _NL_LANGINFO_LAST)
22		return const_cast<char*>("");
23
24	if (gLocaleBackend != NULL)
25		return const_cast<char*>(gLocaleBackend->GetLanginfo(item));
26
27	return const_cast<char*>(gPosixLanginfo[item]);
28}
29