]> pd.if.org Git - pdclib/blobdiff - includes/wchar.h
Re-import from Subversion.
[pdclib] / includes / wchar.h
index 300b0f04c1ed88bcb524e41e3b008822be129ed2..1be74dce28933cfa0372e0505dd19fb78c4005b1 100644 (file)
@@ -1,39 +1,56 @@
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
-// Extended multibyte and wide character utilities
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * ----------------------------------------------------------------------------
+ * Extended multibyte and wide character utilities
+ * --------------------------------------------------------------------------*/
 
-#ifndef __WCHAR_H
-#define __WCHAR_H __WCHAR_H
+#ifndef _WCHAR_H
+#define _WCHAR_H _CHAR_H
 
-// TODO: Documentation, C++ handling
+#ifndef _NULL
+#include "__intern.h"
+#endif
 
-// ----------------------------------------------------------------------------
-// MACROS
+/* TODO: Documentation */
 
-#define NULL       0
-#define WCHAR_MAX  // TODO - personality?
-#define WCHAR_MIN  // TODO - personality?
-#define WEOF       // TODO - personality?
+/* ----------------------------------------------------------------------------
+ * MACROS
+ * --------------------------------------------------------------------------*/
 
-// ----------------------------------------------------------------------------
-// TYPEDEFS
+#define NULL _NULL
+#define WCHAR_MAX _WCHAR_MAX
+#define WCHAR_MIN _WCHAR_MIN
+#define WEOF _WEOF
 
-typedef mbstate_t; // TODO - personality?
-typedef size_t;    // TODO - personality?
-typedef wint_t;    // TODO - personality?
-struct tm;         // TODO - personality?
+/* ----------------------------------------------------------------------------
+ * TYPEDEFS
+ * --------------------------------------------------------------------------*/
 
-#ifndef __cplusplus
-typedef wchar_t;   // TODO - personality?
-#endif // __cplusplus
+/* TODO: Get struct tm into __intern.h */
 
-// ----------------------------------------------------------------------------
-// FUNCTIONS
+#ifndef _SIZE_T
+#define _SIZE_T _SIZE_T
+typedef __size_t size_t;
+#endif /* _SIZE_T */
+
+#ifndef _WCHAR_T
+#define _WCHAR_T _WCHAR_T
+typedef __wchar_t wchar_t;
+#endif /* _WCHAR_T */
+
+#ifndef _WINT_T
+#define _WINT_T _WINT_T
+typedef __wint_t wint_t;
+#endif /* _WINT_T */
+
+typedef mbstate_t; /* TODO - to __intern.h / __personality.h? */
+
+/* ----------------------------------------------------------------------------
+ * FUNCTIONS
+ * --------------------------------------------------------------------------*/
 
 wint_t fgetwc( FILE * stream );
 wchar_t * fgetws( wchar_t * restrict s, int n, FILE * restrict stream );
@@ -95,27 +112,10 @@ wchar_t * wmemcpy( wchar_t * restrict s1, const wchar_t * restrict s2, size_t n
 wchar_t * wmemmove( wchar_t * s1, const wchar_t * s2, size_t n );
 wchar_t * wmemset( wchar_t * s, wchar_t c, size_t n );
 
-#ifdef __cplusplus
-
-const wchar_t * wcschr( const wchar_t * s, wchar_t c );
-wchar_t * wcschr( wchar_t * s, wchar_t c );
-const wchar_t * wcspbrk( const wchar_t * s1, const wchar_t * s2 );
-wchar_t * wcspbrk( wchar_t * s1, const wchar_t * s2 );
-const wchar_t * wcsrchr( const wchar_t * s, wchar_t c );
-wchar_t * wcsrchr( wchar_t * s, wchar_t c );
-const wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 );
-wchar_t * wcsstr( wchar_t * s1, const wchar_t * s2 );
-const wchar_t * wmemchr( const wchar_t * s, wchar_t c, size_t n );
-wchar_t * wmemchr( wchar_t * s, wchar_t c, size_t n );
-
-#else
-
 wchar_t * wcschr( const wchar_t * s, wchar_t c ); 
 wchar_t * wcspbrk( const wchar_t * s1, const wchar_t * s2 );
 wchar_t * wcsrchr( const wchar_t * s, wchar_t c );
 wchar_t * wcsstr( const wchar_t * s1, const wchar_t * s2 );
 wchar_t * wmemchr( const wchar_t * s, wchar_t c, size_t n);
 
-#endif // __cplusplus
-
-#endif // __WCHAR_H
+#endif /* _WCHAR_H */