Annotation of mstools/h/wchar.h, revision 1.1.1.2

1.1       root        1: /***
                      2: *wchar.h - declarations for wide character functions
                      3: *
                      4: *      Copyright (c) 1992, Microsoft Corporation. All rights reserved.
                      5: *
                      6: *Purpose:
                      7: *      This file contains the types, macros and function declarations for
                      8: *      all wide character-related functions.  They may also be declared in
                      9: *      individual header files on a functional basis.
                     10: *      [ISO]
                     11: *
                     12: *      Note: keep in sync with ctype.h, stdio.h, stdlib.h, string.h, time.h.
                     13: *
                     14: ****/
                     15: 
                     16: #ifndef _INC_WCHAR
                     17: #define _INC_WCHAR
                     18: 
                     19: #ifdef __cplusplus
                     20: extern "C" {
                     21: #endif
                     22: 
                     23: 
1.1.1.2 ! root       24: 
        !            25: /*
        !            26:  * Conditional macro definition for function calling type and variable type
        !            27:  * qualifiers.
        !            28:  */
        !            29: #if   ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
        !            30: 
        !            31: /*
        !            32:  * Definitions for MS C8-32 (386/486) compiler
        !            33:  */
        !            34: #define _CRTAPI1 __cdecl
        !            35: #define _CRTAPI2 __cdecl
        !            36: 
        !            37: #elif ( _MSC_VER == 600 )
        !            38: 
        !            39: /*
        !            40:  * Definitions for old MS C6-386 compiler
        !            41:  */
        !            42: #define _CRTAPI1 _cdecl
        !            43: #define _CRTAPI2 _cdecl
        !            44: #define _M_IX86  300
        !            45: 
        !            46: #else
        !            47: 
        !            48: /*
        !            49:  * Other compilers (e.g., MIPS)
        !            50:  */
        !            51: #define _CRTAPI1
        !            52: #define _CRTAPI2
        !            53: 
1.1       root       54: #endif
                     55: 
1.1.1.2 ! root       56: 
1.1       root       57: #ifndef _SIZE_T_DEFINED
                     58: typedef unsigned int size_t;
                     59: #define _SIZE_T_DEFINED
                     60: #endif
                     61: 
                     62: 
                     63: #ifndef _WCHAR_T_DEFINED
                     64: typedef unsigned short wchar_t;
                     65: #define _WCHAR_T_DEFINED
                     66: #endif
                     67: 
                     68: #ifndef _WCTYPE_T_DEFINED
                     69: typedef wchar_t wint_t;
                     70: typedef wchar_t wctype_t;
                     71: #define _WCTYPE_T_DEFINED
                     72: #endif
                     73: 
                     74: #ifndef _VA_LIST_DEFINED
                     75: typedef char * va_list;
                     76: #define _VA_LIST_DEFINED
                     77: #endif
                     78: 
                     79: #ifndef WEOF
                     80: #define WEOF (wint_t)(0xFFFF)
                     81: #endif
                     82: 
                     83: #ifndef _FILE_DEFINED
                     84: struct _iobuf {
                     85:        char *_ptr;
                     86:        int   _cnt;
                     87:        char *_base;
                     88:        int   _flag;
                     89:        int   _file;
                     90:        int   _charbuf;
                     91:        int   _bufsiz;
                     92:        char *_tmpfname;
                     93:        };
                     94: typedef struct _iobuf FILE;
                     95: #define _FILE_DEFINED
                     96: #endif
                     97: 
                     98: /* UNDONE: define struct tm */
                     99: 
                    100: /* define NULL pointer value */
                    101: 
                    102: #ifndef NULL
                    103: #ifdef __cplusplus
                    104: #define NULL   0
                    105: #else
                    106: #define NULL   ((void *)0)
                    107: #endif
                    108: #endif
                    109: 
                    110: /* function prototypes */
                    111: 
                    112: #ifndef _WCTYPE_DEFINED
                    113: 
                    114: /*
                    115:  * This declaration allows the user access to the ctype look-up
                    116:  * array _ctype defined in ctype.obj by simply including ctype.h
                    117:  */
                    118: 
                    119: #ifndef _NEWCTYPETABLE
                    120: 
                    121: #ifdef _DLL
                    122: extern unsigned char * _ctype;
                    123: #else
                    124: extern unsigned char  _ctype[];
                    125: #endif
                    126: 
                    127: extern unsigned char  *_pctype;
                    128: extern unsigned char  *_pwctype;
                    129: 
                    130: #else
                    131: 
                    132: #ifdef _DLL
                    133: extern unsigned short * _ctype;
                    134: #else
                    135: extern unsigned short _ctype[];
                    136: #endif
                    137: 
                    138: extern unsigned short *_pctype;
                    139: extern wctype_t *_pwctype;
                    140: 
                    141: #endif
                    142: 
                    143: 
                    144: /* set bit masks for the possible character types */
                    145: 
                    146: #define _UPPER         0x1     /* upper case letter */
                    147: #define _LOWER         0x2     /* lower case letter */
                    148: #define _DIGIT         0x4     /* digit[0-9] */
                    149: #define _SPACE         0x8     /* tab, carriage return, newline, */
                    150:                                /* vertical tab or form feed */
                    151: #define _PUNCT         0x10    /* punctuation character */
                    152: #define _CONTROL       0x20    /* control character */
                    153: #define _BLANK         0x40    /* space char */
                    154: #define _HEX           0x80    /* hexadecimal digit */
                    155: 
                    156: 
                    157: 
                    158: /* character classification function prototypes */
                    159: 
1.1.1.2 ! root      160: int _CRTAPI1 iswalpha(wint_t);
        !           161: int _CRTAPI1 iswupper(wint_t);
        !           162: int _CRTAPI1 iswlower(wint_t);
        !           163: int _CRTAPI1 iswdigit(wint_t);
        !           164: int _CRTAPI1 iswxdigit(wint_t);
        !           165: int _CRTAPI1 iswspace(wint_t);
        !           166: int _CRTAPI1 iswpunct(wint_t);
        !           167: int _CRTAPI1 iswalnum(wint_t);
        !           168: int _CRTAPI1 iswprint(wint_t);
        !           169: int _CRTAPI1 iswgraph(wint_t);
        !           170: int _CRTAPI1 iswcntrl(wint_t);
        !           171: int _CRTAPI1 iswascii(wint_t);
1.1       root      172: 
1.1.1.2 ! root      173: wchar_t _CRTAPI1 towupper(wchar_t);
        !           174: wchar_t _CRTAPI1 towlower(wchar_t);
1.1       root      175: 
                    176: /* UNDONE: add wctype_t set_wctype(const char* property); */
1.1.1.2 ! root      177: int _CRTAPI1 is_wctype(wint_t, wctype_t);
1.1       root      178: 
                    179: #define isleadbyte(_c) (0)
                    180: /* #define is_wctype(_c,_t) ((_c) < 256 ? _pwctype[_c] & _t : 0 ) */
                    181: 
                    182: #define _WCTYPE_DEFINED
                    183: #endif
                    184: 
                    185: #define iswalpha(_c)   ((_c) < 256 ? _pwctype[_c] &_ALPHA:is_wctype(_c,_ALPHA))
                    186: #define iswupper(_c)   ((_c) < 256 ? _pwctype[_c] &_UPPER:is_wctype(_c,_UPPER))
                    187: #define iswlower(_c)   ((_c) < 256 ? _pwctype[_c] &_LOWER:is_wctype(_c,_LOWER))
                    188: #define iswdigit(_c)   ((_c) < 256 ? _pwctype[_c] &_DIGIT:is_wctype(_c,_DIGIT))
                    189: #define iswxdigit(_c)  ((_c) < 256 ? _pwctype[_c] &_HEX:is_wctype(_c,_HEX))
                    190: #define iswspace(_c)   ((_c) < 256 ? _pwctype[_c] &_SPACE:is_wctype(_c,_SPACE))
                    191: #define iswpunct(_c)   ((_c) < 256 ? _pwctype[_c] &_PUNCT:is_wctype(_c,_PUNCT))
                    192: #define iswalnum(_c)   ((_c) < 256 ? _pwctype[_c] &(_ALPHA|_DIGIT):is_wctype(_c,_ALPHA|_DIGIT))
                    193: #define iswprint(_c)   ((_c) < 256 ? _pwctype[_c] &(_BLANK|_PUNCT|_ALPHA|_DIGIT):is_wctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT))
                    194: #define iswgraph(_c)   ((_c) < 256 ? _pwctype[_c] &(_PUNCT|_ALPHA|_DIGIT):is_wctype(_c,_PUNCT|_ALPHA|_DIGIT))
                    195: #define iswcntrl(_c)   ((_c) < 256 ? _pwctype[_c] &_CONTROL:is_wctype(_c,_CONTROL))
                    196: #define iswascii(_c)   ( (unsigned)(_c) < 0x80 )
                    197: 
                    198: 
                    199: 
                    200: #ifndef _WSTDIO_DEFINED
1.1.1.2 ! root      201: int _CRTAPI2 fwprintf(FILE *, const wchar_t *, ...);
        !           202: int _CRTAPI2 wprintf(const wchar_t *, ...);
        !           203: int _CRTAPI2 _snwprintf(wchar_t *, size_t, const wchar_t *, ...);
        !           204: int _CRTAPI2 swprintf(wchar_t *, const wchar_t *, ...);
        !           205: int _CRTAPI1 vfwprintf(FILE *, const wchar_t *, va_list);
        !           206: int _CRTAPI1 vwprintf(const wchar_t *, va_list);
        !           207: int _CRTAPI1 _vsnwprintf(wchar_t *, size_t, const wchar_t *, va_list);
        !           208: int _CRTAPI1 vswprintf(wchar_t *, const wchar_t *, va_list);
        !           209: int _CRTAPI2 fwscanf(FILE *, const wchar_t *, ...);
        !           210: int _CRTAPI2 swscanf(const wchar_t *, const wchar_t *, ...);
        !           211: int _CRTAPI2 wscanf(const wchar_t *, ...);
1.1       root      212: #define _WSTDIO_DEFINED
                    213: #endif
                    214: 
                    215: 
                    216: #ifndef _WSTDLIB_DEFINED
1.1.1.2 ! root      217: /* also defined in stdlib.h */
        !           218: double _CRTAPI1 wcstod(const wchar_t *, wchar_t **);
        !           219: long   _CRTAPI1 wcstol(const wchar_t *, wchar_t **, int);
        !           220: unsigned long _CRTAPI1 wcstoul(const wchar_t *, wchar_t **, int);
        !           221: #define _WSTDLIB_DEFINED
1.1       root      222: #endif
                    223: 
                    224: 
                    225: #ifndef _WSTRING_DEFINED
1.1.1.2 ! root      226: wchar_t * _CRTAPI1 wcscat(wchar_t *, const wchar_t *);
        !           227: wchar_t * _CRTAPI1 wcschr(const wchar_t *, wchar_t);
        !           228: int _CRTAPI1 wcscmp(const wchar_t *, const wchar_t *);
        !           229: wchar_t * _CRTAPI1 wcscpy(wchar_t *, const wchar_t *);
        !           230: size_t _CRTAPI1 wcscspn(const wchar_t *, const wchar_t *);
        !           231: size_t _CRTAPI1 wcslen(const wchar_t *);
        !           232: wchar_t * _CRTAPI1 wcsncat(wchar_t *, const wchar_t *, size_t);
        !           233: int _CRTAPI1 wcsncmp(const wchar_t *, const wchar_t *, size_t);
        !           234: wchar_t * _CRTAPI1 wcsncpy(wchar_t *, const wchar_t *, size_t);
        !           235: wchar_t * _CRTAPI1 wcspbrk(const wchar_t *, const wchar_t *);
        !           236: wchar_t * _CRTAPI1 wcsrchr(const wchar_t *, wchar_t);
        !           237: size_t _CRTAPI1 wcsspn(const wchar_t *, const wchar_t *);
        !           238: wchar_t * _CRTAPI1 wcsstr(const wchar_t *, const wchar_t *);
        !           239: wchar_t * _CRTAPI1 wcstok(wchar_t *, const wchar_t *);
        !           240: 
        !           241: wchar_t * _CRTAPI1 _wcsdup(const wchar_t *);
        !           242: int _CRTAPI1 _wcsicmp(const wchar_t *, const wchar_t *);
        !           243: int _CRTAPI1 _wcsnicmp(const wchar_t *, const wchar_t *, size_t);
        !           244: wchar_t * _CRTAPI1 _wcsnset(wchar_t *, wchar_t, size_t);
        !           245: wchar_t * _CRTAPI1 _wcsrev(wchar_t *);
        !           246: wchar_t * _CRTAPI1 _wcsset(wchar_t *, wchar_t);
        !           247: 
        !           248: wchar_t * _CRTAPI1 _wcslwr(wchar_t *);
        !           249: wchar_t * _CRTAPI1 _wcsupr(wchar_t *);
        !           250: size_t _CRTAPI1 wcsxfrm(wchar_t *, const wchar_t *, size_t);
        !           251: int _CRTAPI1 wcscoll(const wchar_t *, const wchar_t *);
        !           252: int _CRTAPI1 _wcsicoll(const wchar_t *, const wchar_t *);
1.1       root      253: 
                    254: /* old names */
                    255: #define wcswcs wcsstr
                    256: 
                    257: #if !__STDC__
                    258: /* Non-ANSI names for compatibility */
                    259: #define wcsdup _wcsdup
                    260: #define wcsicmp        _wcsicmp
                    261: #define wcsnicmp _wcsnicmp
                    262: #define wcsnset        _wcsnset
                    263: #define wcsrev _wcsrev
                    264: #define wcsset _wcsset
                    265: #define wcslwr _wcslwr
                    266: #define wcsupr _wcsupr
                    267: #define wcsicoll _wcsicoll
                    268: #endif
                    269: 
                    270: #define _WSTRING_DEFINED
                    271: #endif
                    272: 
                    273: 
                    274: #ifndef _WTIME_DEFINED
                    275: /* UNDONE: add wcsftime, etc.  */
                    276: /* #define _WTIME_DEFINED */
                    277: #endif
                    278: 
                    279: 
                    280: #ifdef __cplusplus
                    281: }
                    282: #endif
                    283: 
                    284: #endif /* _INC_WCHAR */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.