Print this page
2964 need POSIX 2008 locale object support
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Approved by: TBD

*** 1,6 **** --- 1,7 ---- /* + * Copyright 2013 Garrett D'Amore <garrett@damore.org> * Copyright 2010 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2002 Tim J. Robbins. * All rights reserved. * * Redistribution and use in source and binary forms, with or without
*** 27,40 **** #include "lint.h" #include <ctype.h> #include <string.h> #include <wctype.h> #include "_ctype.h" wctype_t ! wctype(const char *property) { static const struct { const char *name; wctype_t mask; } props[] = { --- 28,48 ---- #include "lint.h" #include <ctype.h> #include <string.h> #include <wctype.h> + #include <note.h> + #include <locale.h> #include "_ctype.h" + /* + * For now, we don't support locale specific character classes. This is + * a capability that needs to be added (locales should be able to define + * their own character classes.) + */ wctype_t ! wctype_l(const char *property, locale_t loc) { static const struct { const char *name; wctype_t mask; } props[] = {
*** 55,66 **** --- 63,81 ---- { "phonogram", _CTYPE_Q }, /* BSD extension */ { "rune", -1 }, /* BSD extension */ { NULL, 0 }, /* Default */ }; int i; + _NOTE(ARGUNUSED(loc)); i = 0; while (props[i].name != NULL && strcmp(props[i].name, property) != 0) i++; return (props[i].mask); + } + + wctype_t + wctype(const char *property) + { + return (wctype_l(property, uselocale(NULL))); }