Print this page
2964 need POSIX 2008 locale object support
@@ -1,10 +1,15 @@
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2004 Tim J. Robbins.
* All rights reserved.
*
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ * Portions of this software were developed by David Chisnall
+ * under sponsorship from the FreeBSD Foundation.
+ *
* 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.
@@ -27,15 +32,36 @@
#ifndef _MBLOCAL_H_
#define _MBLOCAL_H_
#include "runetype.h"
+#include "xlocale_private.h"
+
+/*
+ * Conversion function pointers for current encoding.
+ */
+struct xlocale_ctype {
+ struct xlocale_component header;
+ _RuneLocale *runes;
+ size_t (*__mbrtowc)(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
+ size_t, mbstate_t *_RESTRICT_KYWD);
+ int (*__mbsinit)(const mbstate_t *);
+ size_t (*__mbsnrtowcs)(wchar_t *_RESTRICT_KYWD, const char **_RESTRICT_KYWD,
+ size_t, size_t, mbstate_t *_RESTRICT_KYWD);
+ size_t (*__wcrtomb)(char *_RESTRICT_KYWD, wchar_t, mbstate_t *_RESTRICT_KYWD);
+ size_t (*__wcsnrtombs)(char *_RESTRICT_KYWD, const wchar_t **_RESTRICT_KYWD,
+ size_t, size_t, mbstate_t *_RESTRICT_KYWD);
+ int __mb_cur_max;
+ int __mb_sb_limit;
+};
+#define XLOCALE_CTYPE(x) ((struct xlocale_ctype*)(x)->components[XLC_CTYPE])
+extern struct xlocale_ctype __xlocale_global_ctype;
/*
* Rune initialization function prototypes.
*/
-int _none_init(_RuneLocale *);
+int _none_init(struct xlocale_ctype *, _RuneLocale *);
int _UTF8_init(_RuneLocale *);
int _EUC_CN_init(_RuneLocale *);
int _EUC_JP_init(_RuneLocale *);
int _EUC_KR_init(_RuneLocale *);
int _EUC_TW_init(_RuneLocale *);