nl_langinfo.c revision 4297a3b0d0a35d80f86fff155e288e885a100e6d
/*
* Copyright (c) 2001, 2003 Alexey Zelkin <phantom@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "lint.h"
#include <langinfo.h>
#include <limits.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include "lnumeric.h"
#include "lmessages.h"
#include "lmonetary.h"
#include "timelocal.h"
#define MONETARY (__get_current_monetary_locale())
#define TIME (__get_current_time_locale())
#define MESSAGES (__get_current_messages_locale())
#define NUMERIC (__get_current_numeric_locale())
char *
{
switch (item) {
case CODESET:
ret = "";
/*
* The codeset is the suffix of a locale, for most it will
* will be UTF-8, as in "en.UTF-8". Short form locales are
* not supported. Note also that although FreeBSD uses
* US-ASCII, Solaris historically has reported "646" for the
* C locale.
*/
ret = "646";
}
break;
case D_T_FMT:
break;
case D_FMT:
break;
case T_FMT:
break;
case T_FMT_AMPM:
break;
case AM_STR:
break;
case PM_STR:
break;
break;
break;
break;
break;
case ERA:
/* XXX: need to be implemented */
ret = "";
break;
case ERA_D_FMT:
/* XXX: need to be implemented */
ret = "";
break;
case ERA_D_T_FMT:
/* XXX: need to be implemented */
ret = "";
break;
case ERA_T_FMT:
/* XXX: need to be implemented */
ret = "";
break;
case ALT_DIGITS:
/* XXX: need to be implemented */
ret = "";
break;
case RADIXCHAR:
break;
case THOUSEP:
break;
case YESEXPR:
break;
case NOEXPR:
break;
/*
* YESSTR and NOSTR items marked with LEGACY are available, but not
* recomended by SUSv2 to be used in portable applications since
* they're subject to remove in future specification editions.
*/
case YESSTR: /* LEGACY */
break;
case NOSTR: /* LEGACY */
break;
/*
* SUSv2 special formatted currency string
*/
case CRNCYSTR:
ret = "";
if (*cs != '\0') {
char psn = '\0';
MONETARY->mon_decimal_point) == 0)
psn = '.';
} else
if (psn != '\0') {
char *newc;
}
}
}
}
break;
case _DATE_FMT: /* Solaris specific extension */
break;
/*
* Note that FreeBSD also had a private D_MD_ORDER, but that appears
* to have been specific to FreeBSD, so we have not included it here.
*/
default:
ret = "";
}
return (ret);
}