]> pd.if.org Git - pdclib.old/commitdiff
PDCLIB-1
authorOwen Shepherd <owen.shepherd@e43.eu>
Sat, 16 Mar 2013 16:37:40 +0000 (16:37 +0000)
committerOwen Shepherd <owen.shepherd@e43.eu>
Sat, 16 Mar 2013 16:37:40 +0000 (16:37 +0000)
* Rename _PDCLIB_wctype_t -> _PDCLIB_wcinfo_t in order to avoid conflict with wctype_t in <wctype.h>.
* Add testdriver to generated _PDCLIB_unicodedata.c

functions/locale/UnicodeData.py
functions/locale/_PDCLIB_unicodedata.c
internals/_PDCLIB_locale.h

index 30fe562d8a6d4a629e0d5ec67625b877e2b1c942..42a8f9f3bad916923fe1013ad8afd3ade0863164 100644 (file)
@@ -69,9 +69,10 @@ try:
  * in Exhibit 1 of the Unicode Terms of Use, found at\r
  *   http://www.unicode.org/copyright.html#Exhibit1\r
  */\r
+ #ifndef REGTEST\r
  #include <_PDCLIB_locale.h>\r
 \r
- _PDCLIB_wctype_t _PDCLIB_wctype[] = {\r
+ _PDCLIB_wcinfo_t _PDCLIB_wcinfo[] = {\r
 //   { value,\tflags,\tlower,\tupper\t}, // name\r
  """)\r
     for line in in_file:\r
@@ -90,7 +91,19 @@ try:
         out_file.write("    { 0x%X,\t0x%X,\t0x%X,\t0x%X }, // %s\n" % (\r
             num, bits, lower_case, upper_case, name))\r
     out_file.write('};\n\n')\r
-    out_file.write('size_t _PDCLIB_wctype_size = sizeof(_PDCLIB_wctype) / sizeof(_PDCLIB_wctype[0]);\n\n')\r
+    out_file.write("""\r
+size_t _PDCLIB_wcinfo_size = sizeof(_PDCLIB_wcinfo) / sizeof(_PDCLIB_wcinfo[0]);\r
+#endif\r
+\r
+#ifdef TEST\r
+#include <_PDCLIB_test.h>\r
+int main( void )\r
+{\r
+    return TEST_RESULTS;\r
+}\r
+#endif\r
+\r
+""")\r
 except:\r
     in_file.close()\r
     out_file.close()\r
index 868b5a66a6b200b3387aca285fafee16b43ec3b8..e4e9c83b48ac5f8c8de8792b3b459ecaec1d8f11 100644 (file)
  * in Exhibit 1 of the Unicode Terms of Use, found at\r
  *   http://www.unicode.org/copyright.html#Exhibit1\r
  */\r
+ #ifndef REGTEST\r
  #include <_PDCLIB_locale.h>\r
 \r
- _PDCLIB_wctype_t _PDCLIB_wctype[] = {\r
+ _PDCLIB_wcinfo_t _PDCLIB_wcinfo[] = {\r
 //   { value,  flags,  lower,  upper   }, // name\r
      { 0x0,    0x4,    0x0,    0x0 }, // <control>\r
     { 0x1,     0x4,    0x1,    0x1 }, // <control>\r
     { 0x10FFFD,        0x0,    0x10FFFD,       0x10FFFD }, // <Plane 16 Private Use, Last>\r
 };\r
 \r
-size_t _PDCLIB_wctype_size = sizeof(_PDCLIB_wctype) / sizeof(_PDCLIB_wctype[0]);\r
+\r
+size_t _PDCLIB_wcinfo_size = sizeof(_PDCLIB_wcinfo) / sizeof(_PDCLIB_wcinfo[0]);\r
+#endif\r
+\r
+#ifdef TEST\r
+#include <_PDCLIB_test.h>\r
+int main( void )\r
+{\r
+    return TEST_RESULTS;\r
+}\r
+#endif\r
 \r
index 9c008e0ad43c745afc6ef5abc77a5c84fb4aba9a..09fa3c0128f877e4e85108fc02dcec839fcf2450 100644 (file)
@@ -67,13 +67,13 @@ typedef struct _PDCLIB_ctype
     unsigned char collation;
 } _PDCLIB_ctype_t;
 
-typedef struct _PDCLIB_wctype
+typedef struct _PDCLIB_wcinfo
 {
     _PDCLIB_uint32_t num;
     _PDCLIB_uint16_t flags;
     _PDCLIB_uint32_t lower;
     _PDCLIB_uint32_t upper;
-} _PDCLIB_wctype_t;
+} _PDCLIB_wcinfo_t;
 
 struct _PDCLIB_locale {
     _PDCLIB_charcodec_t          _Codec;