/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2010,2011 Nexenta Systems, Inc. All rights reserved.
* Copyright 2012 Garrett D'Amore <garrett@damore.org>
* Copyright 2013 DEY Storage Systems, Inc.
*/
/*
* LC_CTYPE database generation routines for localedef.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <ctype.h>
#include <wctype.h>
#include <unistd.h>
#include "_ctype.h"
#include "localedef.h"
#include "parser.tab.h"
#include "runefile.h"
typedef struct ctype_node {
} ctype_node_t;
typedef struct width_node {
} width_node_t;
static int
{
}
void
init_ctype(void)
{
}
static void
{
switch (last_kw) {
case T_ISUPPER:
break;
case T_ISLOWER:
break;
case T_ISALPHA:
break;
case T_ISDIGIT:
break;
case T_ISSPACE:
break;
case T_ISCNTRL:
break;
case T_ISGRAPH:
break;
case T_ISPRINT:
break;
case T_ISPUNCT:
break;
case T_ISXDIGIT:
break;
case T_ISBLANK:
break;
case T_ISPHONOGRAM:
break;
case T_ISIDEOGRAM:
break;
case T_ISENGLISH:
break;
case T_ISNUMBER:
break;
case T_ISSPECIAL:
break;
case T_ISALNUM:
/*
* We can't do anything with this. The character
* should already be specified as a digit or alpha.
*/
break;
default:
errf(_("not a valid character class"));
}
}
static ctype_node_t *
{
errf(_("out of memory"));
return (NULL);
}
}
return (ctn);
}
void
{
return;
}
}
void
{
if (end < last_ctype) {
errf(_("malformed character range (%u ... %u))"),
last_ctype, end);
return;
}
return;
}
}
last_ctype = end;
}
/*
* A word about widths: if the width mask is specified, then libc
* unconditionally honors it. Otherwise, it assumes printable
* characters have width 1, and non-printable characters have width
* -1 (except for NULL which is special with with 0). Hence, we have
* no need to inject defaults here -- the "default" unset value of 0
* indicates that libc should use its own logic in wcwidth as described.
*/
void
{
return;
}
switch (width) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
}
}
void
{
}
}
void
{
return;
}
switch (last_kw) {
case T_TOUPPER:
break;
case T_TOLOWER:
break;
default:
break;
}
}
void
dump_ctype(void)
{
FILE *f;
if ((f = open_category()) == NULL)
return;
/*
* Initialize the identity map.
*/
}
int conflict = 0;
/*
* POSIX requires certain portable characters have
* certain types. Add them if they are missing.
*/
if (wc == ' ')
/*
* Technically these settings are only
* required for the C locale. However, it
* turns out that because of the historical
* version of isprint(), we need them for all
* locales as well. Note that these are not
* necessarily valid punctation characters in
* the current language, but ispunct() needs
* to return TRUE for them.
*/
if (strchr("!\"'#$%&()*+,-./:;<=>?@[\\]^_`{|}~",
(char)wc))
}
/*
* POSIX also requires that certain types imply
* others. Add any inferred types here.
*/
/*
* Finally, POSIX requires that certain combinations
* are invalid. We don't flag this as a fatal error,
* but we will warn about.
*/
conflict++;
conflict++;
conflict++;
conflict++;
conflict++;
if (conflict) {
warn("conflicting classes for character 0x%x (%x)",
}
/*
* Handle the lower 256 characters using the simple
* optimization. Note that if we have not defined the
*/
if ((unsigned)wc < _CACHED_RUNES) {
continue;
}
} else {
}
} else {
}
} else {
}
}
return;
}
close_category(f);
}