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

1.1       root        1: /***
                      2: *wchar.h - declarations for wide character functions
                      3: *
1.1.1.3 ! root        4: *      Copyright (c) 1992-1993, Microsoft Corporation. All rights reserved.
1.1       root        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: #else
                     38: 
                     39: /*
                     40:  * Other compilers (e.g., MIPS)
                     41:  */
                     42: #define _CRTAPI1
                     43: #define _CRTAPI2
                     44: 
1.1       root       45: #endif
                     46: 
1.1.1.2   root       47: 
1.1       root       48: #ifndef _SIZE_T_DEFINED
                     49: typedef unsigned int size_t;
                     50: #define _SIZE_T_DEFINED
                     51: #endif
                     52: 
                     53: #ifndef _WCHAR_T_DEFINED
                     54: typedef unsigned short wchar_t;
                     55: #define _WCHAR_T_DEFINED
                     56: #endif
                     57: 
                     58: #ifndef _WCTYPE_T_DEFINED
                     59: typedef wchar_t wint_t;
                     60: typedef wchar_t wctype_t;
                     61: #define _WCTYPE_T_DEFINED
                     62: #endif
                     63: 
                     64: #ifndef _VA_LIST_DEFINED
1.1.1.3 ! root       65: #if    defined(_ALPHA_)
        !            66: typedef struct {
        !            67:        char *a0;       /* pointer to first homed integer argument */
        !            68:        int offset;     /* byte offset of next parameter */
        !            69: } va_list;
        !            70: #else
        !            71: typedef char * va_list;
        !            72: #endif
1.1       root       73: #define _VA_LIST_DEFINED
                     74: #endif
                     75: 
                     76: #ifndef WEOF
                     77: #define WEOF (wint_t)(0xFFFF)
                     78: #endif
                     79: 
                     80: #ifndef _FILE_DEFINED
                     81: struct _iobuf {
                     82:        char *_ptr;
                     83:        int   _cnt;
                     84:        char *_base;
                     85:        int   _flag;
                     86:        int   _file;
                     87:        int   _charbuf;
                     88:        int   _bufsiz;
                     89:        char *_tmpfname;
                     90:        };
                     91: typedef struct _iobuf FILE;
                     92: #define _FILE_DEFINED
                     93: #endif
                     94: 
                     95: /* define NULL pointer value */
                     96: 
                     97: #ifndef NULL
                     98: #ifdef __cplusplus
                     99: #define NULL   0
                    100: #else
                    101: #define NULL   ((void *)0)
                    102: #endif
                    103: #endif
                    104: 
                    105: /*
                    106:  * This declaration allows the user access to the ctype look-up
                    107:  * array _ctype defined in ctype.obj by simply including ctype.h
                    108:  */
                    109: 
1.1.1.3 ! root      110: #ifdef _DLL
1.1       root      111: 
1.1.1.3 ! root      112: extern unsigned short * _ctype;
1.1       root      113: 
1.1.1.3 ! root      114: #define _pctype     (*_pctype_dll)
        !           115: extern unsigned short **_pctype_dll;
1.1       root      116: 
1.1.1.3 ! root      117: #define _pwctype    (*_pwctype_dll)
        !           118: extern unsigned short **_pwctype_dll;
        !           119: 
        !           120: #else /* _DLL */
1.1       root      121: 
                    122: 
1.1.1.3 ! root      123: extern unsigned short _ctype[];
1.1       root      124: extern unsigned short *_pctype;
                    125: extern wctype_t *_pwctype;
                    126: 
1.1.1.3 ! root      127: #endif /* _DLL */
1.1       root      128: 
                    129: /* set bit masks for the possible character types */
                    130: 
                    131: #define _UPPER         0x1     /* upper case letter */
                    132: #define _LOWER         0x2     /* lower case letter */
                    133: #define _DIGIT         0x4     /* digit[0-9] */
                    134: #define _SPACE         0x8     /* tab, carriage return, newline, */
                    135:                                /* vertical tab or form feed */
                    136: #define _PUNCT         0x10    /* punctuation character */
                    137: #define _CONTROL       0x20    /* control character */
                    138: #define _BLANK         0x40    /* space char */
                    139: #define _HEX           0x80    /* hexadecimal digit */
                    140: 
1.1.1.3 ! root      141: #define _LEADBYTE      0x8000                  /* multibyte leadbyte */
        !           142: #define _ALPHA         (0x0100|_UPPER|_LOWER)  /* alphabetic character */
        !           143: 
1.1       root      144: 
1.1.1.3 ! root      145: /* function prototypes */
        !           146: 
        !           147: #ifndef _WCTYPE_DEFINED
1.1       root      148: 
                    149: /* character classification function prototypes */
1.1.1.3 ! root      150: /* also defined in ctype.h */
1.1       root      151: 
1.1.1.2   root      152: int _CRTAPI1 iswalpha(wint_t);
                    153: int _CRTAPI1 iswupper(wint_t);
                    154: int _CRTAPI1 iswlower(wint_t);
                    155: int _CRTAPI1 iswdigit(wint_t);
                    156: int _CRTAPI1 iswxdigit(wint_t);
                    157: int _CRTAPI1 iswspace(wint_t);
                    158: int _CRTAPI1 iswpunct(wint_t);
                    159: int _CRTAPI1 iswalnum(wint_t);
                    160: int _CRTAPI1 iswprint(wint_t);
                    161: int _CRTAPI1 iswgraph(wint_t);
                    162: int _CRTAPI1 iswcntrl(wint_t);
                    163: int _CRTAPI1 iswascii(wint_t);
1.1.1.3 ! root      164: int _CRTAPI1 isleadbyte(int);
1.1       root      165: 
1.1.1.2   root      166: wchar_t _CRTAPI1 towupper(wchar_t);
                    167: wchar_t _CRTAPI1 towlower(wchar_t);
1.1       root      168: 
1.1.1.3 ! root      169: int _CRTAPI1 iswctype(wint_t, wctype_t);
1.1       root      170: 
1.1.1.3 ! root      171: int _CRTAPI1 _isctype(int, int);
1.1       root      172: 
                    173: #define _WCTYPE_DEFINED
                    174: #endif
                    175: 
1.1.1.3 ! root      176: #define iswalpha(_c)    ( iswctype(_c,_ALPHA) )
        !           177: #define iswupper(_c)    ( iswctype(_c,_UPPER) )
        !           178: #define iswlower(_c)    ( iswctype(_c,_LOWER) )
        !           179: #define iswdigit(_c)    ( iswctype(_c,_DIGIT) )
        !           180: #define iswxdigit(_c) ( iswctype(_c,_HEX) )
        !           181: #define iswspace(_c)    ( iswctype(_c,_SPACE) )
        !           182: #define iswpunct(_c)    ( iswctype(_c,_PUNCT) )
        !           183: #define iswalnum(_c)    ( iswctype(_c,_ALPHA|_DIGIT) )
        !           184: #define iswprint(_c)    ( iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT) )
        !           185: #define iswgraph(_c)    ( iswctype(_c,_PUNCT|_ALPHA|_DIGIT) )
        !           186: #define iswcntrl(_c)    ( iswctype(_c,_CONTROL) )
1.1       root      187: #define iswascii(_c)   ( (unsigned)(_c) < 0x80 )
                    188: 
1.1.1.3 ! root      189: /* note: MS-specific routine, may evaluate its arguments more than once */
        !           190: #define isleadbyte(_c) ((_c) < 256 ? _pctype[_c] & _LEADBYTE : 0)
1.1       root      191: 
                    192: 
                    193: #ifndef _WSTDIO_DEFINED
1.1.1.3 ! root      194: 
        !           195: wint_t _CRTAPI1 fgetwc(FILE *);
        !           196: wint_t _CRTAPI1 _fgetwchar(void);
        !           197: wint_t _CRTAPI1 fputwc(wint_t, FILE *);
        !           198: wint_t _CRTAPI1 _fputwchar(wint_t);
        !           199: wint_t _CRTAPI1 getwc(FILE *);
        !           200: wint_t _CRTAPI1 getwchar(void);
        !           201: wint_t _CRTAPI1 putwc(wint_t, FILE *);
        !           202: wint_t _CRTAPI1 putwchar(wint_t);
        !           203: wint_t _CRTAPI1 ungetwc(wint_t, FILE *);
        !           204: 
1.1.1.2   root      205: int _CRTAPI2 fwprintf(FILE *, const wchar_t *, ...);
                    206: int _CRTAPI2 wprintf(const wchar_t *, ...);
                    207: int _CRTAPI2 _snwprintf(wchar_t *, size_t, const wchar_t *, ...);
                    208: int _CRTAPI2 swprintf(wchar_t *, const wchar_t *, ...);
                    209: int _CRTAPI1 vfwprintf(FILE *, const wchar_t *, va_list);
                    210: int _CRTAPI1 vwprintf(const wchar_t *, va_list);
                    211: int _CRTAPI1 _vsnwprintf(wchar_t *, size_t, const wchar_t *, va_list);
                    212: int _CRTAPI1 vswprintf(wchar_t *, const wchar_t *, va_list);
                    213: int _CRTAPI2 fwscanf(FILE *, const wchar_t *, ...);
                    214: int _CRTAPI2 swscanf(const wchar_t *, const wchar_t *, ...);
                    215: int _CRTAPI2 wscanf(const wchar_t *, ...);
1.1.1.3 ! root      216: 
        !           217: #define getwchar()             fgetwc(stdin)
        !           218: #define putwchar(_c)           fputwc((_c),stdout)
        !           219: #define getwc(_stm)            fgetwc(_stm)
        !           220: #define putwc(_c,_stm)         fputwc(_c,_stm)
        !           221: 
        !           222: 
1.1       root      223: #define _WSTDIO_DEFINED
                    224: #endif
                    225: 
                    226: 
                    227: #ifndef _WSTDLIB_DEFINED
1.1.1.2   root      228: /* also defined in stdlib.h */
                    229: double _CRTAPI1 wcstod(const wchar_t *, wchar_t **);
                    230: long   _CRTAPI1 wcstol(const wchar_t *, wchar_t **, int);
                    231: unsigned long _CRTAPI1 wcstoul(const wchar_t *, wchar_t **, int);
                    232: #define _WSTDLIB_DEFINED
1.1       root      233: #endif
                    234: 
                    235: 
                    236: #ifndef _WSTRING_DEFINED
1.1.1.2   root      237: wchar_t * _CRTAPI1 wcscat(wchar_t *, const wchar_t *);
                    238: wchar_t * _CRTAPI1 wcschr(const wchar_t *, wchar_t);
                    239: int _CRTAPI1 wcscmp(const wchar_t *, const wchar_t *);
                    240: wchar_t * _CRTAPI1 wcscpy(wchar_t *, const wchar_t *);
                    241: size_t _CRTAPI1 wcscspn(const wchar_t *, const wchar_t *);
                    242: size_t _CRTAPI1 wcslen(const wchar_t *);
                    243: wchar_t * _CRTAPI1 wcsncat(wchar_t *, const wchar_t *, size_t);
                    244: int _CRTAPI1 wcsncmp(const wchar_t *, const wchar_t *, size_t);
                    245: wchar_t * _CRTAPI1 wcsncpy(wchar_t *, const wchar_t *, size_t);
                    246: wchar_t * _CRTAPI1 wcspbrk(const wchar_t *, const wchar_t *);
                    247: wchar_t * _CRTAPI1 wcsrchr(const wchar_t *, wchar_t);
                    248: size_t _CRTAPI1 wcsspn(const wchar_t *, const wchar_t *);
                    249: wchar_t * _CRTAPI1 wcsstr(const wchar_t *, const wchar_t *);
                    250: wchar_t * _CRTAPI1 wcstok(wchar_t *, const wchar_t *);
                    251: 
                    252: wchar_t * _CRTAPI1 _wcsdup(const wchar_t *);
                    253: int _CRTAPI1 _wcsicmp(const wchar_t *, const wchar_t *);
                    254: int _CRTAPI1 _wcsnicmp(const wchar_t *, const wchar_t *, size_t);
                    255: wchar_t * _CRTAPI1 _wcsnset(wchar_t *, wchar_t, size_t);
                    256: wchar_t * _CRTAPI1 _wcsrev(wchar_t *);
                    257: wchar_t * _CRTAPI1 _wcsset(wchar_t *, wchar_t);
                    258: 
                    259: wchar_t * _CRTAPI1 _wcslwr(wchar_t *);
                    260: wchar_t * _CRTAPI1 _wcsupr(wchar_t *);
                    261: size_t _CRTAPI1 wcsxfrm(wchar_t *, const wchar_t *, size_t);
                    262: int _CRTAPI1 wcscoll(const wchar_t *, const wchar_t *);
                    263: int _CRTAPI1 _wcsicoll(const wchar_t *, const wchar_t *);
1.1       root      264: 
                    265: /* old names */
                    266: #define wcswcs wcsstr
                    267: 
                    268: #if !__STDC__
                    269: /* Non-ANSI names for compatibility */
                    270: #define wcsdup _wcsdup
                    271: #define wcsicmp        _wcsicmp
                    272: #define wcsnicmp _wcsnicmp
                    273: #define wcsnset        _wcsnset
                    274: #define wcsrev _wcsrev
                    275: #define wcsset _wcsset
                    276: #define wcslwr _wcslwr
                    277: #define wcsupr _wcsupr
                    278: #define wcsicoll _wcsicoll
                    279: #endif
                    280: 
                    281: #define _WSTRING_DEFINED
                    282: #endif
                    283: 
                    284: 
                    285: #ifndef _WTIME_DEFINED
1.1.1.3 ! root      286: size_t _CRTAPI1 wcsftime(wchar_t *, size_t, const char *, const struct tm *);
        !           287: #define _WTIME_DEFINED
1.1       root      288: #endif
                    289: 
                    290: 
                    291: #ifdef __cplusplus
                    292: }
                    293: #endif
                    294: 
                    295: #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.