Changeset 74
- Timestamp:
- 03/23/07 01:18:13 (20 months ago)
- Location:
- NEWT0/trunk
- Files:
-
- 1 added
- 6 modified
-
platform/VisualC6/newt_app.dsp (modified) (1 diff)
-
platform/VisualC6/newt_lib.dsp (modified) (4 diffs)
-
src/newt_core/NewtIconv.c (modified) (1 diff)
-
src/newt_core/incs/VC6/config.h (modified) (2 diffs)
-
src/newt_core/incs/VC6/iconv.h (added)
-
src/newt_core/incs/VC6/stdbool.h (modified) (2 diffs)
-
src/newt_core/incs/platform.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
NEWT0/trunk/platform/VisualC6/newt_app.dsp
r73 r74 110 110 # Begin Source File 111 111 112 SOURCE=..\..\src\newt_core\incs\VC6\iconv.h 113 # End Source File 114 # Begin Source File 115 112 116 SOURCE=..\..\src\newt_core\incs\VC6\stdbool.h 113 117 # End Source File -
NEWT0/trunk/platform/VisualC6/newt_lib.dsp
r73 r74 42 42 # PROP Target_Dir "" 43 43 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c 44 # ADD CPP /nologo / W3 /GX /O2 /I "../../src" /I "../../src/newt_core/incs" /I "../../src/newt_core/incs/VC6" /I "../../src/parser" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /YX /FD /c44 # ADD CPP /nologo /MD /W3 /GX /O2 /I "../../src" /I "../../src/newt_core/incs" /I "../../src/newt_core/incs/VC6" /I "../../src/parser" /D "NDEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /YX /FD /c 45 45 # ADD BASE RSC /l 0x409 /d "NDEBUG" 46 46 # ADD RSC /l 0x409 /d "NDEBUG" … … 65 65 # PROP Target_Dir "" 66 66 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c 67 # ADD CPP /nologo / W3 /Gm /GX /ZI /Od /I "../../src" /I "../../src/newt_core/incs" /I "../../src/newt_core/incs/VC6" /I "../../src/parser" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /YX /FD /GZ /c67 # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../src" /I "../../src/newt_core/incs" /I "../../src/newt_core/incs/VC6" /I "../../src/parser" /D "_DEBUG" /D "WIN32" /D "_MBCS" /D "_LIB" /D "HAVE_CONFIG_H" /YX /FD /GZ /c 68 68 # ADD BASE RSC /l 0x409 /d "_DEBUG" 69 69 # ADD RSC /l 0x409 /d "_DEBUG" … … 107 107 # Begin Source File 108 108 109 SOURCE=..\..\src\newt_core\incs\VC6\iconv.h 110 # End Source File 111 # Begin Source File 112 109 113 SOURCE=..\..\src\newt_core\incs\VC6\stdbool.h 110 114 # End Source File … … 330 334 331 335 SOURCE=..\..\src\main.c 336 # PROP Exclude_From_Build 1 332 337 # End Source File 333 338 # Begin Source File -
NEWT0/trunk/src/newt_core/NewtIconv.c
r68 r74 69 69 } 70 70 71 #if _MSC_VER 72 73 #include <string.h> 74 75 /* 76 * This is a minimalistic "iconv" version which simply maps into WIN32 77 * native calls (not even at this point!). 78 * 79 * Requested conversions are: 80 * UTF-16BE to UTF-8 and back 81 * MACROMAN to UTF-8 and back 82 * where UTF-8 is defined at runtime and could be something else... 83 */ 84 iconv_t iconv_open(const char *tocode, const char *fromcode) 85 { 86 iconv_t mode = 0; 87 if (!tocode || !fromcode) 88 return mode; 89 if (strcmp(fromcode, "UTF-16BE")==0) 90 mode |= 1; 91 if (strcmp(tocode, "UTF-16BE")==0) 92 mode |= 2; 93 //printf("Requested iconv form '%s' to '%s' (our code: %d)\n", fromcode, tocode, mode); 94 return mode; 95 } 96 97 size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) 98 { 99 int i, n; 100 const char *s; 101 char *d; 102 103 if (!inbuf || !*inbuf || !outbuf || !*outbuf) 104 return 0; 105 106 n = *inbytesleft; 107 s = *inbuf; 108 d = *outbuf; 109 110 switch (cd) { 111 case 0: 112 case 3: 113 memmove(*outbuf, *inbuf, n); 114 *inbytesleft -= n; 115 *inbuf += n; 116 *outbytesleft -= n; 117 *outbuf += n; 118 break; 119 case 1: // from 16bit to 8bit 120 for (i=0; i<n; i++) { 121 s++; 122 *d++ = *s++; 123 } 124 *inbytesleft -= 2*n; 125 *inbuf += 2*n; 126 *outbytesleft -= n; 127 *outbuf += n; 128 break; 129 case 2: // from 8bit to 16bit 130 for (i=0; i<n; i++) { 131 *d++ = 0; 132 *d++ = *s++; 133 } 134 *inbytesleft -= n; 135 *inbuf += n; 136 *outbytesleft -= 2*n; 137 *outbuf += 2*n; 138 break; 139 } 140 return 0; 141 } 142 143 int iconv_close(iconv_t type) 144 { 145 return 0; 146 } 147 148 #endif 149 150 71 151 #endif /* HAVE_LIBICONV */ -
NEWT0/trunk/src/newt_core/incs/VC6/config.h
r71 r74 13 13 #define CONFIG_H 14 14 15 16 15 /* �}�N���� */ 17 16 #undef HAVE_INTTYPES_H … … 23 22 #undef HAVE_TERMIOS_H 24 23 25 # undef HAVE_LIBICONV24 #define HAVE_LIBICONV 1 26 25 #undef HAVE_DLOPEN 27 26 #undef HAVE_MMAP -
NEWT0/trunk/src/newt_core/incs/VC6/stdbool.h
r71 r74 13 13 #define _NEWT_VC6_STD_BOOL_H_ 14 14 15 #ifndef __cplusplus 16 15 17 typedef __int8 bool; 16 18 static const bool true = 1; … … 19 21 #endif 20 22 23 #endif 24 -
NEWT0/trunk/src/newt_core/incs/platform.h
r68 r74 28 28 #endif 29 29 30 #ifndef NEWT_EXPORT 31 #define NEWT_EXPORT 32 #endif 33 30 34 31 35 #endif /* PLATFORM_H */
