Changeset 1705 for trunk/src/emx/include
- Timestamp:
- Dec 6, 2004, 3:19:54 AM (21 years ago)
- Location:
- trunk/src/emx/include
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/include/InnoTekLIBC/locale.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1704 r1705 31 31 32 32 #include <sys/cdefs.h> 33 #include <sys/_types.h> 33 34 #include <locale.h> 34 35 #include <uconv.h> … … 45 46 /** MBCS prefixes. Two bits per character. */ 46 47 unsigned char au2MBCSPrefixs[256/4]; 48 #ifdef __OS2__ 47 49 /** The converter object to convert to and from selected codepage 48 50 (used with MBCS codepages only). */ … … 50 52 /** The locale object. */ 51 53 LocaleObject lobj; 54 #endif 52 55 /** Non-zero if there are any MBCS prefix characters in codepage. */ 53 56 char mbcs; … … 56 59 typedef __LIBC_LOCALECOLLATE *__LIBC_PLOCALECOLLATE; 57 60 61 /** 62 * Multibyte to/from wide character conversion functions. 63 */ 64 typedef struct __libc_localeCTypeFuncs 65 { 66 int (*pfnmbsinit)(const __mbstate_t *); 67 size_t (*pfnmbrtowc)(__wchar_t * __restrict, const char * __restrict, size_t, __mbstate_t * __restrict); 68 size_t (*pfnmbsnrtowcs)(__wchar_t * __restrict, const char ** __restrict, size_t, size_t, __mbstate_t * __restrict); 69 size_t (*pfnwcrtomb)(char * __restrict, __wchar_t, __mbstate_t * __restrict); 70 size_t (*pfnwcsnrtombs)(char * __restrict, const __wchar_t ** __restrict, size_t, size_t, __mbstate_t * __restrict); 71 } __LIBC_LOCALECTYPEFUNCS; 72 /** Pointer to multibyte/wide character conversion functions. */ 73 typedef __LIBC_LOCALECTYPEFUNCS *__LIBC_PLOCALECTYPEFUNCS; 74 /** Pointer to const multibyte/wide character conversion functions. */ 75 typedef const __LIBC_LOCALECTYPEFUNCS *__LIBC_PCLOCALECTYPEFUNCS; 58 76 59 77 /** … … 63 81 { 64 82 /** All uppercased characters. */ 65 unsigned char auchUpper[256];83 unsigned char auchUpper[256]; 66 84 /** All lowercased characters. */ 67 unsigned char auchLower[256];85 unsigned char auchLower[256]; 68 86 /** Bit flags for every character (for isXXX() function series). */ 69 unsigned short ausfType[256]; 87 unsigned aufType[256]; 88 89 /* part which we don't 'expose': */ 70 90 /** MBCS prefixes. Two bits per character. */ 71 unsigned char au2MBCSPrefixs[256/4]; 91 unsigned char au2MBCSPrefixs[256/4]; 92 /** Unicode translation. (0xffff means not translation.) */ 93 unsigned short aucUnicode[256]; 94 /** Unicode -> SBCS conversion: 0..128. */ 95 unsigned char auchToSBCS0To128[128]; 96 /** Unicode -> SBCS conversion: Custom regions. */ 97 struct 98 { 99 /** First unicode code point. */ 100 unsigned short usStart; 101 /** Number of entries used. */ 102 unsigned short cChars; 103 /** Array SBCS chars corresponding to (wc - usStart). 0 means no conversion. */ 104 unsigned char auch[28]; 105 } aSBCSs[8]; 106 /** Number of aSBCS regions in use. */ 107 unsigned cSBCSs; 108 /** Conversion functions. */ 109 __LIBC_LOCALECTYPEFUNCS CtypeFuncs; 110 #ifdef __OS2__ 72 111 /** The converter object to convert to and from selected codepage 73 112 (used with MBCS codepages only). */ 74 UconvObject uobj;113 UconvObject uobj; 75 114 /** The locale object. */ 76 LocaleObject lobj; 115 LocaleObject lobj; 116 #endif 77 117 /** Non-zero if there are any MBCS prefix characters in codepage. */ 78 char mbcs;118 char mbcs; 79 119 } __LIBC_LOCALECTYPE; 80 120 /** Pointer to the Ctype locale struct. */ … … 83 123 84 124 /** 85 * This structure contains the flags for the default (C/POSIX) locale. 86 */ 87 typedef struct __libc_LocaleCtypeDefault 88 { 89 /** Bit flags for every character (for isXXX() function series). */ 90 unsigned short ausfType[256]; 91 } __LIBC_LOCALECTYPEDEFAULT; 92 /** Pointer to the Ctype locale struct. */ 93 typedef __LIBC_LOCALECTYPEDEFAULT *__LIBC_PLOCALECTYPEDEFAULT; 94 125 * Unicode CType data. 126 * The structure contains information for the first 256 unicode chars. 127 */ 128 typedef struct __libc_localeWCType 129 { 130 /** All uppercased characters. */ 131 __wchar_t awcUpper[256]; 132 /** All lowercased characters. */ 133 __wchar_t awcLower[256]; 134 /** Bit flags for every character (for iswXXX() function series). */ 135 unsigned aufType[256]; 136 } __LIBC_LOCALEWCTYPE; 137 /** Pointer to the Ctype unicode struct. */ 138 typedef __LIBC_LOCALEWCTYPE *__LIBC_PLOCALEWCTYPE; 95 139 96 140 /** … … 101 145 { 102 146 /** Short month names. */ 103 char *smonths[12];147 char *smonths[12]; 104 148 /** Long month names. */ 105 char *lmonths[12];149 char *lmonths[12]; 106 150 /** Short weekday names. */ 107 char *swdays[7];151 char *swdays[7]; 108 152 /** Long weekday names. */ 109 char *lwdays[7];153 char *lwdays[7]; 110 154 /** Date and time format. */ 111 char *date_time_fmt;155 char *date_time_fmt; 112 156 /** Date format. */ 113 char *date_fmt;157 char *date_fmt; 114 158 /** Time format. */ 115 char *time_fmt;159 char *time_fmt; 116 160 /** AM strings. */ 117 char *am;161 char *am; 118 162 /** PM strings. */ 119 char *pm; 163 char *pm; 164 /** AM/PM format. (T_FMT_AMPM) */ 165 char *ampm_fmt; 166 /** ERA */ 167 char *era; 168 /** ERA_D_FMT. */ 169 char *era_date_fmt; 170 /** ERA_D_T_FMT. */ 171 char *era_date_time_fmt; 172 /** ERA_T_FMT. */ 173 char *era_time_fmt; 174 /** ALT_DIGITS. */ 175 char *alt_digits; 176 /** DATESEP. */ 177 char *datesep; 178 /** TIMESEP. */ 179 char *timesep; 180 /** LISTSEP. */ 181 char *listsep; 120 182 /** If set all the strings are consts and shall not be free()ed. */ 121 int 183 int fConsts; 122 184 } __LIBC_LOCALETIME; 123 185 /** Pointer to time locale data. */ … … 135 197 /** The lconv structure. */ 136 198 struct lconv s; 199 /** CRNCYSTR. */ 200 char *pszCrncyStr; 137 201 /** Indicates that all the numeric members are readonly const strings. */ 138 202 int fNumericConsts; … … 145 209 146 210 /** String collation information. */ 147 extern __LIBC_LOCALECOLLATE __libc_gLocaleCollate;211 extern __LIBC_LOCALECOLLATE __libc_gLocaleCollate; 148 212 /** Character case conversion tables. */ 149 extern __LIBC_LOCALECTYPE __libc_GLocaleCtype;213 extern __LIBC_LOCALECTYPE __libc_GLocaleCtype; 150 214 /** Character case conversion tables for the default 'C'/'POSIX' locale. */ 151 extern const __LIBC_LOCALECTYPEDEFAULT __libc_GLocaleCtypeDefault; 215 extern const __LIBC_LOCALECTYPE __libc_GLocaleCtypeDefault; 216 /** Cached Unicode (__wchar_t) case conversion tables and flags. */ 217 extern const __LIBC_LOCALEWCTYPE __libc_GLocaleWCtype; 152 218 /** Locale information structure. */ 153 extern __LIBC_LOCALELCONV __libc_gLocaleLconv;219 extern __LIBC_LOCALELCONV __libc_gLocaleLconv; 154 220 /** Date / time formatting rules. */ 155 extern __LIBC_LOCALETIME __libc_gLocaleTime; 156 221 extern __LIBC_LOCALETIME __libc_gLocaleTime; 222 223 /** Macros to lock the different locale structures. 224 * @{ 225 */ 226 #define LOCALE_LOCK() do {} while (0) 227 #define LOCALE_UNLOCK() do {} while (0) 228 #define LOCALE_CTYPE_RW_LOCK() do {} while (0) 229 #define LOCALE_CTYPE_RW_UNLOCK() do {} while (0) 230 #define LOCALE_CTYPE_RW_LOCK() do {} while (0) 231 #define LOCALE_CTYPE_RW_UNLOCK() do {} while (0) 232 /** @} */ 157 233 158 234 /** Convert a string to Unicode, apply some transform and convert back. */ … … 165 241 extern void __libc_TranslateCodepage(const char *cp, UniChar *ucp); 166 242 243 extern int __libc_localeCreateObjects(const char *pszLocale, const char *pszCodepage, char *pszCodepageActual, LocaleObject *plobj, UconvObject *puobj); 244 245 extern void __libc_localeFuncsSBCS(__LIBC_PLOCALECTYPEFUNCS pFuncs); 246 extern void __libc_localeFuncsDBCS(__LIBC_PLOCALECTYPEFUNCS pFuncs); 247 extern void __libc_localeFuncsMBCS(__LIBC_PLOCALECTYPEFUNCS pFuncs); 248 extern void __libc_localeFuncsUCS2(__LIBC_PLOCALECTYPEFUNCS pFuncs); 249 extern void __libc_localeFuncsUTF8(__LIBC_PLOCALECTYPEFUNCS pFuncs); 250 extern void __libc_localeFuncsDefault(__LIBC_PLOCALECTYPEFUNCS pFuncs); 251 252 extern size_t __libc_localeFuncsGeneric_mbsnrtowcs(size_t (*pfnmbrtowc)(__wchar_t * __restrict, const char * __restrict, size_t, __mbstate_t * __restrict), 253 __wchar_t * __restrict dst, const char ** __restrict src, size_t nms, size_t len, __mbstate_t * __restrict ps); 254 extern size_t __libc_localeFuncsGeneric_wcsnrtombs(size_t (*pfnwcrtomb)(char * __restrict, __wchar_t, __mbstate_t * __restrict), 255 char * __restrict dst, const __wchar_t ** __restrict src, size_t nwc, size_t len, __mbstate_t * __restrict ps); 256 257 extern void __libc_localeFuncsNone(__LIBC_PLOCALECTYPEFUNCS pFuncs); 258 extern size_t __libc_locale_none_mbrtowc(__wchar_t * __restrict, const char * __restrict, size_t, __mbstate_t * __restrict); 259 extern int __libc_locale_none_mbsinit(const __mbstate_t *); 260 extern size_t __libc_locale_none_mbsnrtowcs(__wchar_t * __restrict dst, const char ** __restrict src, size_t nms, size_t len, __mbstate_t * __restrict ps __unused); 261 extern size_t __libc_locale_none_wcrtomb(char * __restrict, __wchar_t, __mbstate_t * __restrict); 262 extern size_t __libc_locale_none_wcsnrtombs(char * __restrict, const __wchar_t ** __restrict, size_t, size_t, __mbstate_t * __restrict); 167 263 168 264 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/_ctype.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1704 r1705 34 34 __BEGIN_DECLS 35 35 /** 36 * Simplified Ctype structure for inline functions.36 * Simplified Ctype structures for inline functions. 37 37 */ 38 38 extern struct … … 43 43 unsigned char auchLower[256]; 44 44 /** Bit flags for every character (for isXXX() function series). */ 45 unsigned short ausfType[256];45 unsigned aufType[256]; 46 46 } __libc_GLocaleCtype; 47 47 48 48 /** 49 * Simplified Default Ctype structure for inline functions.49 * Simplified Default Ctype structures for inline functions. 50 50 */ 51 51 extern const struct 52 52 { 53 /** All uppercased characters. */ 54 unsigned char auchUpper[256]; 55 /** All lowercased characters. */ 56 unsigned char auchLower[256]; 53 57 /** Bit flags for every character (for isXXX() function series). */ 54 unsigned short ausfType[256];58 unsigned aufType[256]; 55 59 } __libc_GLocaleCtypeDefault; 60 61 /** 62 * Unicode CType data. 63 * The structure contains information for the first 256 unicode chars. 64 */ 65 extern const struct __libc_localeWCType 66 { 67 /** All uppercased characters. */ 68 __wchar_t awcUpper[256]; 69 /** All lowercased characters. */ 70 __wchar_t awcLower[256]; 71 /** Bit flags for every character (for iswXXX() function series). */ 72 unsigned aufType[256]; 73 } __libc_GLocaleWCtype; 56 74 __END_DECLS 57 75 #endif /* !__InnoTekLIBC_locale_h__ */ 58 76 59 77 60 /** Bit masks for the au sfType member of __libc_GLocaleCtype78 /** Bit masks for the aufType member of __libc_GLocaleCtype 61 79 * and __libc_GLocaleCtypeDefault 62 80 * 63 * @remark These have identical values to the CT_* to speed up setlocale(). 81 * @remark These have values identical values to the CT_* << 8 to speed up 82 * setlocale() and to make us compatible with the BSD scheme. In addition 83 * values C3_IDEOGRAPH and the C2_* << 24 are converted into the value. The 84 * screen width stuff is attempted derived from other info provided by the 85 * unicode libraries. 64 86 * @{ 65 87 */ 66 #define __UPPER 0x0001 /** Upper case alphabetic character. */ 67 #define __LOWER 0x0002 /** Lower case alphabetic character. */ 68 #define __DIGIT 0x0004 /** Digits 0-9. */ 69 #define __SPACE 0x0008 /** White space and line ends. */ 70 #define __PUNCT 0x0010 /** Punctuation marks. */ 71 #define __CNTRL 0x0020 /** Control and format characters. */ 72 #define __BLANK 0x0040 /** Space and tab. */ 73 #define __XDIGIT 0x0080 /** Hex digits. */ 74 #define __ALPHA 0x0100 /** Letters and linguistic marks. */ 75 #define __ALNUM 0x0200 /** Alphanumeric. */ 76 #define __GRAPH 0x0400 /** All except controls and space. */ 77 #define __PRINT 0x0800 /** Everything except controls. */ 78 #define __NUMBER 0x1000 /** Integral number. */ 79 #define __SYMBOL 0x2000 /** Symbol. */ 80 #define __ASCII 0x8000 /** In standard ASCII set. */ 81 82 /* BSD compatability */ 83 #define _CTYPE_A __ALPHA 84 #define _CTYPE_C __CNTRL 85 #define _CTYPE_D __DIGIT 86 #define _CTYPE_G __GRAPH 87 #define _CTYPE_L __LOWER 88 #define _CTYPE_P __PUNCT 89 #define _CTYPE_S __SPACE 90 #define _CTYPE_U __UPPER 91 #define _CTYPE_X __XDIGIT 92 #define _CTYPE_B __BLANK 93 #define _CTYPE_R __PRINT 94 #if 0 //later 95 #define _CTYPE_I 0x00080000L /* Ideogram */ 96 #define _CTYPE_T 0x00100000L /* Special */ 97 #define _CTYPE_Q 0x00200000L /* Phonogram */ 98 99 #define _CTYPE_SW0 0x20000000L /* 0 width character */ 100 #define _CTYPE_SW1 0x40000000L /* 1 width character */ 101 #define _CTYPE_SW2 0x80000000L /* 2 width character */ 102 #define _CTYPE_SW3 0xc0000000L /* 3 width character */ 103 #define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */ 104 #define _CTYPE_SWS 30 /* Bits to shift to get width */ 88 #define __CT_NUM_MASK 0x000000ffU /** Numberic value for digit to int conversion. */ 89 90 #define __CT_UPPER 0x00000100U /** Upper case alphabetic character. */ 91 #define __CT_LOWER 0x00000200U /** Lower case alphabetic character. */ 92 #define __CT_DIGIT 0x00000400U /** Digits 0-9. */ 93 #define __CT_SPACE 0x00000800U /** White space and line ends. */ 94 #define __CT_PUNCT 0x00001000U /** Punctuation marks. */ 95 #define __CT_CNTRL 0x00002000U /** Control and format characters. */ 96 #define __CT_BLANK 0x00004000U /** Space and tab. */ 97 #define __CT_XDIGIT 0x00008000U /** Hex digits. */ 98 #define __CT_ALPHA 0x00010000U /** Letters and linguistic marks. */ 99 #define __CT_ALNUM 0x00020000U /** Alphanumeric - obsolete (__CT_ALPHA | __CT_DIGIT) is the same. */ 100 #define __CT_GRAPH 0x00040000U /** All except controls and space. */ 101 #define __CT_PRINT 0x00080000U /** Everything except controls. */ 102 #define __CT_NUMBER 0x00100000U /** Integral number. */ 103 #define __CT_SYMBOL 0x00200000U /** Symbol. */ 104 #define __CT_ASCII 0x00800000U /** In standard ASCII set. */ 105 106 #define __CT_IDEOGRAM 0x00400000U /** Ideogram. (C3_IDEOGRAPH?) (Unused/known CT_ bit.) */ 107 108 /* #define __CT_BIDI_MASK 0x0f000000U - not implemented */ /** Bidi mask C2_*. */ 109 110 #define __CT_SCRW0 0x20000000U /** 0 width character. (Just indicator for SW data when width is 0.) */ 111 #define __CT_SCRW1 0x40000000U /** 1 width character. */ 112 #define __CT_SCRW2 0x80000000U /** 2 width character. */ 113 #define __CT_SCRW3 0xc0000000U /** 3 width character. */ 114 #define __CT_SCRW_MASK 0xe0000000U /** Mask for screen width data. */ 115 #define __CT_SCRW_SHIFT 30 /** Bits to shift to get width. */ 116 117 /** BSD compatability. 118 * @{ */ 119 #define _CTYPE_A __CT_ALPHA 120 #define _CTYPE_C __CT_CNTRL 121 #define _CTYPE_D __CT_DIGIT 122 #define _CTYPE_G __CT_GRAPH 123 #define _CTYPE_L __CT_LOWER 124 #define _CTYPE_P __CT_PUNCT 125 #define _CTYPE_S __CT_SPACE 126 #define _CTYPE_U __CT_UPPER 127 #define _CTYPE_X __CT_XDIGIT 128 #define _CTYPE_B __CT_BLANK 129 #define _CTYPE_R __CT_PRINT 130 #define _CTYPE_I __CT_IDEOGRAM 131 #if 0 /* We don't have this info :/ */ 132 #define _CTYPE_T 0x00100000L /* Special */ 133 #define _CTYPE_Q 0x00200000L /* Phonogram */ 105 134 #endif 106 107 /** @} */ 108 109 110 __BEGIN_DECLS 111 int ___istype(__ct_rune_t, unsigned); 112 __ct_rune_t ___tolower(__ct_rune_t); 113 __ct_rune_t ___toupper(__ct_rune_t); 114 __END_DECLS 135 #define _CTYPE_SW0 __CT_SCRW0 136 #define _CTYPE_SW1 __CT_SCRW1 137 #define _CTYPE_SW2 __CT_SCRW2 138 #define _CTYPE_SW3 __CT_SCRW3 139 #define _CTYPE_SWM __CT_SCRW_MASK 140 #define _CTYPE_SWS __CT_SCRW_SHIFT 141 /** @} */ 142 /** @} */ 143 144 145 /** Functions for handling runes outside the 0-255 range. 146 * @{ */ 147 __BEGIN_DECLS 148 unsigned ___wctype(__wchar_t); 149 __wchar_t ___towlower(__wchar_t); 150 __wchar_t ___towupper(__wchar_t); 151 __END_DECLS 152 /** @} */ 153 115 154 116 155 #if !defined(_DONT_USE_CTYPE_INLINE_) && \ 117 156 (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus)) 118 157 119 __BEGIN_DECLS 120 static inline int __istype(__ct_rune_t _c, unsigned _f) 121 { 122 return !(_c & 0xffffff00) ? (__libc_GLocaleCtype.ausfType[_c & 0xff] & (_f)) != 0 : ___istype(_c, _f); 123 } 124 125 static inline int __isctype(__ct_rune_t _c, unsigned _f) 126 { 127 return (__libc_GLocaleCtypeDefault.ausfType[_c & 0xff] & (_f)) != 0; 128 } 129 130 static inline int __toupper(__ct_rune_t _c) 131 { 132 return !(_c & 0xffffff00) ? __libc_GLocaleCtype.auchUpper[_c & 0xff] : ___toupper(_c); 133 } 134 135 static inline int __tolower(__ct_rune_t _c) 136 { 137 return !(_c & 0xffffff00) ? __libc_GLocaleCtype.auchLower[_c & 0xff] : ___tolower(_c); 138 } 139 __END_DECLS 158 /** Inlined function versions. 159 * @{ 160 */ 161 __BEGIN_DECLS 162 static inline unsigned __ctype(__ct_rune_t __ch, unsigned __f) 163 { 164 return !((__ch) & ~0xffU) 165 ? __libc_GLocaleCtype.aufType[(__ch)/* & 0xff*/] & (__f) 166 : 0; 167 } 168 169 static inline int __istype(__ct_rune_t __ch, unsigned __f) 170 { 171 return !!__ctype((__ch), (__f)); 172 } 173 174 static inline int __isctype(__ct_rune_t __ch, unsigned __f) 175 { 176 return !((__ch) & ~0xffU) 177 ? !!(__libc_GLocaleCtypeDefault.aufType[(__ch)/* & 0xff*/] & (__f)) 178 : 0; 179 } 180 181 static inline __ct_rune_t __toupper(__ct_rune_t __ch) 182 { 183 return !((__ch) & ~0xffU) 184 ? __libc_GLocaleCtype.auchUpper[(__ch)/* & 0xff*/] 185 : (__ch); 186 } 187 188 static inline __ct_rune_t __tolower(__ct_rune_t __ch) 189 { 190 return !((__ch) & ~0xffU) 191 ? __libc_GLocaleCtype.auchLower[(__ch)/* & 0xff*/] 192 : (__ch); 193 } 194 195 196 static inline unsigned __wctype(__wint_t __wc, unsigned __f) 197 { 198 return !((__wc) & ~0xffU) 199 ? __libc_GLocaleWCtype.aufType[(__wc)] & (__f) 200 : ___wctype(__wc) & (__f); 201 } 202 203 static inline int __iswtype(__wint_t __wc, unsigned __f) 204 { 205 return !!__wctype((__wc), (__f)); 206 } 207 208 static inline __wint_t __towupper(__wint_t __wc) 209 { 210 return !((__wc) & ~0xffU) 211 ? __libc_GLocaleWCtype.awcUpper[(__wc)] 212 : ___towupper(__wc); 213 } 214 215 static inline __wint_t __towlower(__wint_t __wc) 216 { 217 return !((__wc) & ~0xffU) 218 ? __libc_GLocaleWCtype.awcLower[(__wc)] 219 : ___towlower(__wc); 220 } 221 222 223 static inline int __wcwidth(__wint_t __wc) 224 { 225 if ((__wc) != 0) 226 { 227 unsigned __f = __wctype((__wc), __CT_SCRW_MASK | __CT_PRINT); 228 return ((__f) & __CT_SCRW_MASK) 229 ? ((__f) & __CT_SCRW_MASK) >> __CT_SCRW_SHIFT 230 : ((__f) & __CT_PRINT) ? 1 : -1; 231 } 232 else 233 return 0; 234 } 235 __END_DECLS 236 /** @} */ 140 237 141 238 #else 142 239 143 __BEGIN_DECLS 144 int __istype(int, unsigned); 145 int __isctype(int, unsigned); 146 int __toupper(int); 147 int __tolower(int); 148 149 __END_DECLS 240 /** Non-inlined function versions. 241 * @{ 242 */ 243 __BEGIN_DECLS 244 unsigned __ctype(__ct_rune_t, unsigned); 245 int __istype(__ct_rune_t, unsigned); 246 __ct_rune_t __isctype(__ct_rune_t, unsigned); 247 __ct_rune_t __toupper(__ct_rune_t); 248 int __tolower(__ct_rune_t); 249 250 unsigned __wctype(__wint_t, unsigned); 251 int __iswtype(__wint_t, unsigned); 252 __wint_t __towupper(__wint_t); 253 __wint_t __towlower(__wint_t); 254 int __wcwidth(__wint_t); 255 __END_DECLS 256 /** @} */ 150 257 151 258 #endif -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/ctype.h
-
Property cvs2svn:cvs-rev
changed from
1.15
to1.16
r1704 r1705 4 4 * InnoTek LIBC - Character type querying. 5 5 * 6 * Copyright (c ) 2004 knut st. osmundsen <bird@innotek.de>6 * Copyright (ch) 2004 knut st. osmundsen <bird@innotek.de> 7 7 * 8 8 * … … 53 53 54 54 #if __BSD_VISIBLE 55 /* @todo int digittoint(int); */ 55 int digittoint(int); 56 56 int isblank(int); 57 57 int ishexnumber(int); 58 /* @todo int isideogram(int); */ 58 int isideogram(int); 59 59 int isnumber(int); 60 60 /* @todo int isphonogram(int); */ 61 /* @todo int isrune(int); */ 61 int isrune(int); 62 62 /* @todo int isspecial(int); */ 63 63 #endif 64 64 __END_DECLS 65 65 66 #define isalnum(c) __istype((c), (__UPPER)|(__LOWER)|(__DIGIT)) 67 #define isalpha(c) __istype((c), (__UPPER)|(__LOWER)) 68 #define iscntrl(c) __istype((c), (__CNTRL)) 69 #define isgraph(c) __istype((c), (__PUNCT)|(__UPPER)|(__LOWER)|(__DIGIT)) 70 #define islower(c) __istype((c), (__LOWER)) 71 #define isprint(c) __istype((c), (__PRINT)) 72 #define ispunct(c) __istype((c), (__PUNCT)) 73 #define isspace(c) __istype((c), (__SPACE)) 74 #define isupper(c) __istype((c), (__UPPER)) 75 #ifdef __UNIX_CHAR_CLASS__ 76 /* BSD and some other UNIXes have non-standard definitions of these two at least. */ 77 #define isdigit(c) __isctype((c),(__DIGIT)) 78 #define isxdigit(c) __isctype((c),(__XDIGIT)) 66 #define isalnum(ch) __istype((ch), (__CT_ALPHA)|(__CT_DIGIT)) 67 #define isalpha(ch) __istype((ch), (__CT_ALPHA)) 68 #define iscntrl(ch) __istype((ch), (__CT_CNTRL)) 69 #define isgraph(ch) __istype((ch), (__CT_GRAPH)) 70 #define islower(ch) __istype((ch), (__CT_LOWER)) 71 #define isprint(ch) __istype((ch), (__CT_PRINT)) 72 #define ispunct(ch) __istype((ch), (__CT_PUNCT)) 73 #define isspace(ch) __istype((ch), (__CT_SPACE)) 74 #define isupper(ch) __istype((ch), (__CT_UPPER)) 75 #ifdef __UNIX_CHAR_CLASS__ /* BSD and some other UNIXes have non-standard definitions of these two at least. */ 76 #define isdigit(ch) __isctype((ch),(__CT_DIGIT)) 77 #define isxdigit(ch) __isctype((ch),(__CT_XDIGIT)) 79 78 #else 80 #define isdigit(c ) __istype((c),(__DIGIT))81 #define isxdigit(c ) __istype((c),(__XDIGIT))79 #define isdigit(ch) __istype((ch), (__CT_DIGIT)) 80 #define isxdigit(ch) __istype((ch), (__CT_XDIGIT)) 82 81 #endif 83 #define tolower(c ) __tolower(c)84 #define toupper(c ) __toupper(c)82 #define tolower(ch) __tolower(ch) 83 #define toupper(ch) __toupper(ch) 85 84 86 85 #if __XSI_VISIBLE 87 #define _toupper(c ) __toupper(c)88 #define _tolower(c ) __tolower(c)89 #define isascii(c ) (((c) & ~0x7F) == 0)90 #define toascii(c ) ((c) & 0x7F)86 #define _toupper(ch) __toupper(ch) 87 #define _tolower(ch) __tolower(ch) 88 #define isascii(ch) (((ch) & ~0x7F) == 0) 89 #define toascii(ch) ((ch) & 0x7F) 91 90 #endif 92 91 93 92 #if __BSD_VISIBLE 94 #define isblank(c) __istype((c), (__BLANK)) 95 #define ishexnumber(c) __istype((c), (__XDIGIT)) 96 #define isnumber(c) __istype((c), (__DIGIT)) 93 #define isblank(ch) __istype((ch), (__CT_BLANK)) 94 #define ishexnumber(ch) __istype((ch), (__CT_XDIGIT)) 95 #define isideogram(ch) __istype((ch), (__CT_IDEOGRAM)) 96 #define isnumber(ch) __istype((ch), (__CT_DIGIT)) 97 #define isrune(ch) __istype((ch), ~(__CT_NUM_MASK)) 98 #define digittoint(ch) __ctype((ch), (__CT_NUM_MASK)) 97 99 #endif 98 100 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/stdlib.h
-
Property cvs2svn:cvs-rev
changed from
1.29
to1.30
r1704 r1705 84 84 #define RAND_MAX 0x7fffffff 85 85 86 extern int _ mb_cur_max; /* bird: one underscore, not two for us. */87 #define MB_CUR_MAX _ mb_cur_max /* bird: one underscore, not two for us. */86 extern int __mb_cur_max; 87 #define MB_CUR_MAX __mb_cur_max 88 88 89 89 __BEGIN_DECLS -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/sys/cdefs.h
-
Property cvs2svn:cvs-rev
changed from
1.10
to1.11
r1704 r1705 31 31 * 32 32 * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 33 * $FreeBSD: src/sys/sys/cdefs.h,v 1.8 1 2004/04/07 04:19:49 impExp $33 * $FreeBSD: src/sys/sys/cdefs.h,v 1.84 2004/08/13 00:53:40 julian Exp $ 34 34 */ 35 35 … … 155 155 #define __pure2 __attribute__((__const__)) 156 156 #define __unused __attribute__((__unused__)) 157 #define __used __attribute__((__used__)) 157 158 #define __packed __attribute__((__packed__)) 158 159 #define __aligned(x) __attribute__((__aligned__(x))) … … 163 164 #define __pure2 __attribute__((__const__)) 164 165 #define __unused __attribute__((__unused__)) 166 #define __used __attribute__((__used__)) 165 167 #define __packed __attribute__((__packed__)) 166 168 #define __aligned(x) __attribute__((__aligned__(x))) 167 169 #define __section(x) __attribute__((__section__(x))) 168 170 #endif 171 #endif 172 173 #if __GNUC_PREREQ__(2, 96) 174 #define __pure __attribute__((__pure__)) 175 #else 176 #define __pure 169 177 #endif 170 178 … … 245 253 */ 246 254 #define __offsetof(type, field) ((size_t)(&((type *)0)->field)) 255 #define __rangeof(type, start, end) \ 256 (__offsetof(type, end) - __offsetof(type, start)) 247 257 248 258 /* … … 310 320 * more recent ELF binutils, we use .ident allowing the ID to be stripped. 311 321 * Usage: 312 * __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.8 1 2004/04/07 04:19:49 impExp $");322 * __FBSDID("$FreeBSD: src/sys/sys/cdefs.h,v 1.84 2004/08/13 00:53:40 julian Exp $"); 313 323 */ 314 324 #ifndef __FBSDID -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/wchar.h
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r1704 r1705 1 1 /** @file 2 2 * FreeBSD 5.3 3 * @changed bird: Disabled most of it.3 * @changed bird: Disabled all stream related and some other stuff we don't do yet. 4 4 */ 5 5 /*- … … 76 76 #include <sys/_types.h> 77 77 #include <machine/_limits.h> 78 #if 0 /* bird */79 78 #include <_ctype.h> 80 #endif /* bird */81 79 82 80 #ifndef _MBSTATE_T_DECLARED … … 112 110 #endif 113 111 114 #if 0 /* bird */ 115 struct __sFILE; 116 #endif /* bird */ 112 /** @todo struct __sFILE; */ 117 113 struct tm; 118 114 119 115 __BEGIN_DECLS 120 #if 0 /* bird */121 116 wint_t btowc(int); 122 wint_t fgetwc(struct __sFILE *); 123 wchar_t *124 fgetws(wchar_t * __restrict, int, struct __sFILE * __restrict); 125 wint_t fputwc(wchar_t, struct __sFILE *); 126 int fputws(const wchar_t * __restrict, struct __sFILE * __restrict); 127 int fwide(struct __sFILE *, int); 128 int fwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, ...); 129 int fwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, ...); 130 wint_t getwc(struct __sFILE *); 131 wint_t getwchar(void); 117 /** @todo wint_t fgetwc(struct __sFILE *); */ 118 /** @todo wchar_t * 119 fgetws(wchar_t * __restrict, int, struct __sFILE * __restrict); */ 120 /** @todo wint_t fputwc(wchar_t, struct __sFILE *); */ 121 /** @todo int fputws(const wchar_t * __restrict, struct __sFILE * __restrict); */ 122 /** @todo int fwide(struct __sFILE *, int); */ 123 /** @todo int fwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, ...); */ 124 /** @todo int fwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, ...); */ 125 /** @todo wint_t getwc(struct __sFILE *); */ 126 /** @todo wint_t getwchar(void); */ 132 127 size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict); 133 #endif /* bird */134 128 size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t, 135 129 mbstate_t * __restrict); 136 #if 0 /* bird */137 130 int mbsinit(const mbstate_t *); 138 131 size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t, 139 132 mbstate_t * __restrict); 140 wint_t putwc(wchar_t, struct __sFILE *); 141 wint_t putwchar(wchar_t); 142 int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, 143 ...); 144 int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...); 145 wint_t ungetwc(wint_t, struct __sFILE *); 146 int vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, 147 __va_list); 148 int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, 149 __va_list); 150 int vwprintf(const wchar_t * __restrict, __va_list); 151 #endif /* bird */ 133 /** @todo wint_t putwc(wchar_t, struct __sFILE *); */ 134 /** @todo wint_t putwchar(wchar_t); */ 135 /** @todo int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, 136 ...); */ 137 /** @todo int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...); */ 138 /** @todo wint_t ungetwc(wint_t, struct __sFILE *); */ 139 /** @todo int vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, 140 __va_list); */ 141 /** @todo int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, 142 __va_list); */ 143 /** @todo int vwprintf(const wchar_t * __restrict, __va_list); */ 152 144 size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); 153 #if 0 /* bird */154 145 wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict); 155 146 wchar_t *wcschr(const wchar_t *, wchar_t) __pure; … … 185 176 wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t); 186 177 wchar_t *wmemset(wchar_t *, wchar_t, size_t); 187 int wprintf(const wchar_t * __restrict, ...); 188 int wscanf(const wchar_t * __restrict, ...); 189 190 #ifndef _STDSTREAM_DECLARED 191 extern struct __sFILE *__stdinp; 192 extern struct __sFILE *__stdoutp; 193 extern struct __sFILE *__stderrp; 194 #define _STDSTREAM_DECLARED 195 #endif 196 197 #define getwc(fp) fgetwc(fp) 198 #define getwchar() fgetwc(__stdinp) 199 #define putwc(wc, fp) fputwc(wc, fp) 200 #define putwchar(wc) fputwc(wc, __stdoutp) 178 /** @todo int wprintf(const wchar_t * __restrict, ...); */ 179 /** @todo int wscanf(const wchar_t * __restrict, ...); */ 180 181 /** @todo #ifndef _STDSTREAM_DECLARED */ 182 /** @todo extern struct __sFILE *__stdinp; */ 183 /** @todo extern struct __sFILE *__stdoutp; */ 184 /** @todo extern struct __sFILE *__stderrp; */ 185 /** @todo #define _STDSTREAM_DECLARED */ 186 /** @todo #endif */ 187 188 /** @todo #define getwc(fp) fgetwc(fp) */ 189 /** @todo #define getwchar() fgetwc(__stdinp) */ 190 /** @todo #define putwc(wc, fp) fputwc(wc, fp) */ 191 /** @todo #define putwchar(wc) fputwc(wc, __stdoutp) */ 201 192 202 193 #if __ISO_C_VISIBLE >= 1999 203 int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict,204 __va_list); 205 int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,206 __va_list); 207 int vwscanf(const wchar_t * __restrict, __va_list); 194 /** @todo int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, 195 __va_list); */ 196 /** @todo int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict, 197 __va_list); */ 198 /** @todo int vwscanf(const wchar_t * __restrict, __va_list); */ 208 199 float wcstof(const wchar_t * __restrict, wchar_t ** __restrict); 209 200 long double … … 226 217 227 218 #if __BSD_VISIBLE 228 wchar_t *fgetwln(struct __sFILE * __restrict, size_t * __restrict); 219 /** @todo wchar_t *fgetwln(struct __sFILE * __restrict, size_t * __restrict); */ 229 220 size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t, 230 221 size_t, mbstate_t * __restrict); … … 234 225 size_t wcslcpy(wchar_t *, const wchar_t *, size_t); 235 226 #endif 236 #endif /* bird */237 227 __END_DECLS 238 228 -
Property cvs2svn:cvs-rev
changed from
-
trunk/src/emx/include/wctype.h
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1704 r1705 1 1 /** @file 2 2 * FreeBSD 5.3 3 * @changed bird: Disabled most of it. 3 * @changed bird: hid a few bsd things and changed it to __isw* & __tow*. 4 * No __iscwtype on OS/2 since it's all unicode. 5 * @remark Take greate care when merging new versions into this file. 4 6 */ 5 7 /*- … … 63 65 int iswalnum(wint_t); 64 66 int iswalpha(wint_t); 65 #if 0 /* bird */66 67 int iswblank(wint_t); 67 68 int iswcntrl(wint_t); 68 #endif /* bird */69 69 int iswctype(wint_t, wctype_t); 70 #if 0 /* bird */71 70 int iswdigit(wint_t); 72 71 int iswgraph(wint_t); 73 #endif /* bird */74 72 int iswlower(wint_t); 75 #if 0 /* bird */76 73 int iswprint(wint_t); 77 74 int iswpunct(wint_t); 78 75 int iswspace(wint_t); 79 #endif /* bird */80 76 int iswupper(wint_t); 81 #if 0 /* bird */82 77 int iswxdigit(wint_t); 83 78 wint_t towctrans(wint_t, wctrans_t); 84 #endif /* bird */85 79 wint_t towlower(wint_t); 86 80 wint_t towupper(wint_t); 87 #if 0 /* bird */88 81 wctrans_t 89 82 wctrans(const char *); 90 #endif /* bird */91 83 wctype_t 92 84 wctype(const char *); 93 #if 0 /* bird */94 85 95 86 #if __BSD_VISIBLE … … 98 89 wint_t iswideogram(wint_t); 99 90 wint_t iswnumber(wint_t); 100 wint_t iswphonogram(wint_t); 91 /** @todo wint_t iswphonogram(wint_t); */ 101 92 wint_t iswrune(wint_t); 102 wint_t iswspecial(wint_t); 103 wint_t nextwctype(wint_t, wctype_t); 93 /** @todo wint_t iswspecial(wint_t); */ 94 /** @todo wint_t nextwctype(wint_t, wctype_t); */ 104 95 #endif 105 #endif /* bird */106 96 __END_DECLS 107 97 108 #define iswalnum(wc) __istype((wc), _CTYPE_A|_CTYPE_D) 109 #define iswalpha(wc) __istype((wc), _CTYPE_A) 110 #if 0 /* bird */ 111 #define iswblank(wc) __istype((wc), _CTYPE_B) 112 #define iswcntrl(wc) __istype((wc), _CTYPE_C) 113 #endif /* bird */ 114 #define iswctype(wc, charclass) __istype((wc), (charclass)) 115 #if 0 /* bird */ 116 #define iswdigit(wc) __isctype((wc), _CTYPE_D) 117 #define iswgraph(wc) __istype((wc), _CTYPE_G) 118 #endif /* bird */ 119 #define iswlower(wc) __istype((wc), _CTYPE_L) 120 #if 0 /* bird */ 121 #define iswprint(wc) __istype((wc), _CTYPE_R) 122 #define iswpunct(wc) __istype((wc), _CTYPE_P) 123 #define iswspace(wc) __istype((wc), _CTYPE_S) 124 #endif /* bird */ 125 #define iswupper(wc) __istype((wc), _CTYPE_U) 126 #if 0 /* bird */ 127 #define iswxdigit(wc) __isctype((wc), _CTYPE_X) 128 #endif /* bird */ 129 #define towlower(wc) __tolower(wc) 130 #define towupper(wc) __toupper(wc) 131 #if 0 /* bird */ 98 #define iswalnum(wc) __iswtype((wc), _CTYPE_A|_CTYPE_D) 99 #define iswalpha(wc) __iswtype((wc), _CTYPE_A) 100 #define iswblank(wc) __iswtype((wc), _CTYPE_B) 101 #define iswcntrl(wc) __iswtype((wc), _CTYPE_C) 102 #define iswctype(wc, charclass) __iswtype((wc), (charclass)) 103 #define iswdigit(wc) __iswtype((wc), _CTYPE_D) 104 #define iswgraph(wc) __iswtype((wc), _CTYPE_G) 105 #define iswlower(wc) __iswtype((wc), _CTYPE_L) 106 #define iswprint(wc) __iswtype((wc), _CTYPE_R) 107 #define iswpunct(wc) __iswtype((wc), _CTYPE_P) 108 #define iswspace(wc) __iswtype((wc), _CTYPE_S) 109 #define iswupper(wc) __iswtype((wc), _CTYPE_U) 110 111 #define iswxdigit(wc) __iswtype((wc), _CTYPE_X) 112 #define towlower(wc) __towlower(wc) 113 #define towupper(wc) __towupper(wc) 132 114 133 115 #if __BSD_VISIBLE 134 116 #define iswascii(wc) (((wc) & ~0x7F) == 0) 135 #define iswhexnumber(wc) __is type((wc), _CTYPE_X)136 #define iswideogram(wc) __is type((wc), _CTYPE_I)137 #define iswnumber(wc) __is type((wc), _CTYPE_D)138 #define iswphonogram(wc) __istype((wc), _CTYPE_Q) 139 #define iswrune(wc) __is type((wc), 0xFFFFFF00L)140 #define iswspecial(wc) __istype((wc), _CTYPE_T) 117 #define iswhexnumber(wc) __iswtype((wc), _CTYPE_X) 118 #define iswideogram(wc) __iswtype((wc), _CTYPE_I) 119 #define iswnumber(wc) __iswtype((wc), _CTYPE_D) 120 /** @todo #define iswphonogram(wc) __iswtype((wc), _CTYPE_Q) */ 121 #define iswrune(wc) __iswtype((wc), 0xFFFFFF00L) 122 /** @todo #define iswspecial(wc) __iswtype((wc), _CTYPE_T) */ 141 123 #endif 142 #endif /* bird */ 124 143 125 #endif /* _WCTYPE_H_ */ -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.