home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / wchar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-20  |  10.1 KB  |  248 lines

  1. #if (defined(__IBMC__) || defined(__IBMCPP__))
  2. #pragma info( none )
  3. #ifndef __CHKHDR__
  4.    #pragma info( none )
  5. #endif
  6. #pragma info( restore )
  7. #endif
  8.  
  9. #ifndef __wchar_h
  10.    #define __wchar_h
  11.  
  12.    #ifdef __cplusplus
  13.       extern "C" {
  14.    #endif
  15.  
  16.    #ifndef  _LNK_CONV
  17.      #ifdef _M_I386
  18.          #define  _LNK_CONV   _Optlink
  19.      #else
  20.        #define  _LNK_CONV
  21.      #endif
  22.    #endif
  23.  
  24.    #ifndef _IMPORT
  25.       #ifdef __IMPORTLIB__
  26.          #define _IMPORT _Import
  27.       #else
  28.          #define _IMPORT
  29.       #endif
  30.    #endif
  31.  
  32.    /********************************************************************/
  33.    /*  <wchar.h> header file                                           */
  34.    /*                                                                  */
  35.    /*  VisualAge for C++ for Windows, Version 3.5                      */
  36.    /*    Licensed Material - Property of IBM                           */
  37.    /*                                                                  */
  38.    /*  5801-ARR and Other Materials                                    */
  39.    /*                                                                  */
  40.    /*  (c) Copyright IBM Corp 1991, 1996. All rights reserved.         */
  41.    /*                                                                  */
  42.    /********************************************************************/
  43.  
  44.    #include <stdio.h>
  45.    #include <stdarg.h>
  46.  
  47.    #ifndef NULL
  48.       #ifdef __cplusplus
  49.             #define NULL 0
  50.       #else
  51.             #define NULL ((void *)0)
  52.       #endif
  53.    #endif
  54.  
  55.    #ifndef __mbstate_t
  56.       #define __mbstate_t
  57.       typedef short      mbstate_t;
  58.    #endif
  59.  
  60.    #ifndef __size_t
  61.       typedef unsigned int size_t;
  62.       #define __size_t 1
  63.    #endif
  64.  
  65.    #ifndef __wchar_t
  66.       typedef unsigned short wchar_t;
  67.       #define __wchar_t 1
  68.    #endif
  69.  
  70.    #ifndef __wint_t
  71.       #define __wint_t
  72.       typedef int        wint_t;
  73.    #endif
  74.  
  75.    #ifndef WEOF
  76.       #define WEOF -1
  77.    #endif
  78.  
  79.    struct tm;
  80.  
  81.   /* Wide character I/O functions */
  82.  
  83.   extern wint_t    _IMPORT _LNK_CONV fgetwc(FILE *);
  84.   extern wchar_t * _IMPORT _LNK_CONV fgetws(wchar_t *, int, FILE *);
  85.   extern wint_t    _IMPORT _LNK_CONV fputwc(wchar_t, FILE *);
  86.   extern int       _IMPORT _LNK_CONV fputws(const wchar_t *, FILE *);
  87.   extern wint_t    _IMPORT _LNK_CONV getwc(FILE *);
  88.   extern wint_t    _IMPORT _LNK_CONV getwchar(void);
  89.   extern wint_t    _IMPORT _LNK_CONV putwc(wchar_t, FILE *);
  90.   extern wint_t    _IMPORT _LNK_CONV putwchar(wchar_t);
  91.   extern wint_t    _IMPORT _LNK_CONV ungetwc(wint_t, FILE *);
  92.   extern int       _IMPORT _LNK_CONV swprintf(wchar_t *, size_t, const wchar_t *, ...);
  93.   extern int       _IMPORT _LNK_CONV swscanf(const wchar_t *, const wchar_t *, ...);
  94.   extern int       _IMPORT _LNK_CONV vswprintf(wchar_t *, size_t, const wchar_t *, va_list);
  95.  
  96.   extern double            _IMPORT _LNK_CONV wcstod(const wchar_t *, wchar_t **);
  97.   extern long int          _IMPORT _LNK_CONV wcstol(const wchar_t *, wchar_t **, int);
  98.   extern unsigned long int _IMPORT _LNK_CONV wcstoul(const wchar_t *, wchar_t **, int);
  99.  
  100.   /* Wide Character String handling */
  101.  
  102. #if defined _M_I386 && !defined __wcstr_h
  103.   #define __wcstr_h
  104.  
  105.   wchar_t * _Builtin __wcscat(wchar_t *, const wchar_t *);
  106.   wchar_t * _Builtin __wcschr(const wchar_t *,  wchar_t);
  107.   int       _Builtin __wcscmp(const wchar_t *, const wchar_t *);
  108.   wchar_t * _Builtin __wcscpy(wchar_t *, const wchar_t *);
  109.   size_t    _Builtin __wcslen(const wchar_t *);
  110.   wchar_t * _Builtin __wcsncat(wchar_t *, const wchar_t *, size_t);
  111.   int       _Builtin __wcsncmp(const wchar_t *, const wchar_t *, size_t);
  112.   wchar_t * _Builtin __wcsncpy(wchar_t *, const wchar_t *, size_t);
  113.   wchar_t * _Builtin __wcsrchr(const wchar_t *, wchar_t);
  114.  
  115.   #ifdef __cplusplus
  116.      inline wchar_t * _LNK_CONV wcscat(wchar_t * s1, const wchar_t * s2)
  117.                                       {return __wcscat(s1, s2); }
  118.      inline wchar_t * _LNK_CONV wcschr(const wchar_t * s1, wchar_t wc)
  119.                                       {return __wcschr(s1, wc); }
  120.      inline int       _LNK_CONV wcscmp(const wchar_t * s1, const wchar_t * s2)
  121.                                       {return __wcscmp(s1, s2); }
  122.      inline wchar_t * _LNK_CONV wcscpy(wchar_t * s1, const wchar_t * s2)
  123.                                       {return __wcscpy(s1, s2); }
  124.      inline size_t    _LNK_CONV wcslen(const wchar_t * s)
  125.                                       {return __wcslen(s); }
  126.      inline wchar_t * _LNK_CONV wcsncat(wchar_t * s1, const wchar_t * s2, size_t t)
  127.                                       {return __wcsncat(s1, s2, t); }
  128.      inline int       _LNK_CONV wcsncmp(const wchar_t * s1, const wchar_t * s2, size_t t)
  129.                                       {return __wcsncmp(s1, s2, t); }
  130.      inline wchar_t * _LNK_CONV wcsncpy(wchar_t * s1, const wchar_t * s2, size_t t)
  131.                                       {return __wcsncpy(s1, s2, t); }
  132.      inline wchar_t * _LNK_CONV wcsrchr(const wchar_t * s1, wchar_t wc)
  133.                                       {return __wcsrchr(s1, wc); }
  134.   #else
  135.      extern wchar_t * _IMPORT _LNK_CONV wcscat(wchar_t *, const wchar_t *);
  136.      extern wchar_t * _IMPORT _LNK_CONV wcschr(const wchar_t *, wchar_t);
  137.      extern int       _IMPORT _LNK_CONV wcscmp(const wchar_t *, const wchar_t *);
  138.      extern wchar_t * _IMPORT _LNK_CONV wcscpy(wchar_t *, const wchar_t *);
  139.      extern size_t    _IMPORT _LNK_CONV wcslen(const wchar_t *);
  140.      extern wchar_t * _IMPORT _LNK_CONV wcsncat(wchar_t *, const wchar_t *, size_t);
  141.      extern int       _IMPORT _LNK_CONV wcsncmp(const wchar_t *, const wchar_t *, size_t);
  142.      extern wchar_t * _IMPORT _LNK_CONV wcsncpy(wchar_t *, const wchar_t *, size_t);
  143.      extern wchar_t * _IMPORT _LNK_CONV wcsrchr(const wchar_t *, wchar_t);
  144.  
  145.      #pragma info( none )
  146.      #define wcscat( x,y )        __wcscat( (x), (y) )
  147.      #define wcschr( x,y )        __wcschr( (x), (y) )
  148.      #define wcscmp( x,y )        __wcscmp( (x), (y) )
  149.      #define wcscpy( x,y )        __wcscpy( (x), (y) )
  150.      #define wcslen( x )          __wcslen( (x) )
  151.      #define wcsncat( x,y,z )     __wcsncat( (x), (y), (z) )
  152.      #define wcsncmp( x,y,z )     __wcsncmp( (x), (y), (z) )
  153.      #define wcsncpy( x,y,z )     __wcsncpy( (x), (y), (z) )
  154.      #define wcsrchr( x,y )       __wcsrchr( (x), (y) )
  155.      #pragma info( restore )
  156.   #endif
  157. #endif
  158.  
  159. #ifdef  __THW_PPC__
  160.    extern wchar_t * _IMPORT _LNK_CONV wcscat( wchar_t *, const wchar_t * );
  161.    extern wchar_t * _IMPORT _LNK_CONV wcschr( const wchar_t *, wchar_t);
  162.    extern int     * _IMPORT _LNK_CONV wcscmp( const wchar_t *, const wchar_t * );
  163.    extern wchar_t * _IMPORT _LNK_CONV wcscpy( wchar_t *, const wchar_t * );
  164.    extern size_t  * _IMPORT _LNK_CONV wcslen( const wchar_t * );
  165.    extern wchar_t * _IMPORT _LNK_CONV wcsncat( wchar_t *, const wchar_t *, size_t);
  166.    extern int     * _IMPORT _LNK_CONV wcsncmp( const wchar_t *, const wchar_t *, size_t);
  167.    extern wchar_t * _IMPORT _LNK_CONV wcsncpy( wchar_t *, const wchar_t *, size_t);
  168.    extern wchar_t * _IMPORT _LNK_CONV wcsrchr( const wchar_t *, wchar_t);
  169. #endif
  170.  
  171.    extern int       _IMPORT _LNK_CONV wcscoll(const wchar_t *, const wchar_t *);
  172.    extern size_t    _IMPORT _LNK_CONV wcsxfrm(wchar_t *, const wchar_t *, size_t);
  173.    extern size_t    _IMPORT _LNK_CONV wcscspn (const wchar_t *, const wchar_t *);
  174.    extern wchar_t * _IMPORT _LNK_CONV wcspbrk (const wchar_t *, const wchar_t *);
  175.    extern size_t    _IMPORT _LNK_CONV wcsspn (const wchar_t *, const wchar_t *);
  176.    extern wchar_t * _IMPORT _LNK_CONV wcsstr (const wchar_t *, const wchar_t *);
  177.    extern wchar_t * _IMPORT _LNK_CONV wcswcs( const wchar_t *, const wchar_t * );
  178.    extern wchar_t * _IMPORT _LNK_CONV wcstok(wchar_t *, const wchar_t *, wchar_t **);
  179.    extern int       _IMPORT _LNK_CONV wcswidth(const wchar_t *, size_t);
  180.    extern int       _IMPORT _LNK_CONV wcwidth(const wint_t);
  181.    extern size_t    _IMPORT _LNK_CONV wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *);
  182.    extern int       _IMPORT _LNK_CONV mbsinit(mbstate_t *);
  183.    extern size_t    _IMPORT _LNK_CONV mbrlen (const char *, size_t, mbstate_t *);
  184.    extern size_t    _IMPORT _LNK_CONV mbrtowc (wchar_t *, const char *, size_t, mbstate_t *);
  185.    extern size_t    _IMPORT _LNK_CONV wcrtomb (char *, wchar_t, mbstate_t *);
  186.    extern size_t    _IMPORT _LNK_CONV mbsrtowcs (wchar_t *, const char **, size_t, mbstate_t *);
  187.    extern size_t    _IMPORT _LNK_CONV wcsrtombs (char *, const wchar_t **, size_t, mbstate_t *);
  188.    extern int       _IMPORT _LNK_CONV wctob (wint_t);
  189.  
  190. #if (defined(__EXTENDED__)  || defined( __cplusplus ))
  191.    #if (defined(__IBMC__) || defined(__IBMCPP__))
  192.       #if __OS2__
  193.          #pragma map( vswprintf,"_vswprintfieee" )
  194.       #else
  195.          #pragma map( vswprintf,"?_vswprintfieee" )
  196.       #endif
  197.  
  198.       #if defined(_M_I386) || !defined(NO_PROTOTYPE)
  199.          #if __OS2__
  200.             #pragma map( swprintf, "_swprintfieee" )
  201.             #pragma map( swscanf,  "_swscanfieee" )
  202.          #else
  203.             #pragma map( swprintf, "?_swprintfieee" )
  204.             #pragma map( swscanf,  "?_swscanfieee" )
  205.          #endif
  206.       #endif
  207.    #else
  208.       #pragma Alias( vswprintf,"_vswprintfieee" )
  209.       #ifndef NO_PROTOTYPE
  210.          #pragma Alias( swprintf, "_swprintfieee" )
  211.          #pragma Alias( swscanf,  "_swscanfieee" )
  212.       #endif
  213.    #endif
  214. #else
  215.    #if (defined(__IBMC__) || defined(__IBMCPP__))
  216.       #if defined(_M_I386) || !defined(NO_PROTOTYPE)
  217.          #if __OS2__
  218.             #pragma map( swprintf, "_swprintf_ansi"  )
  219.             #pragma map( swscanf,  "_swscanf_ansi"  )
  220.          #else
  221.             #pragma map( swprintf, "?_swprintf_ansi"  )
  222.             #pragma map( swscanf,  "?_swscanf_ansi"  )
  223.          #endif
  224.       #endif
  225.    #else
  226.       #ifndef NO_PROTOTYPE
  227.         #pragma Alias( swprintf, "_swprintf_ansi"  )
  228.         #pragma Alias( swscanf,  "_swscanf_ansi"  )
  229.       #endif
  230.    #endif
  231. #endif
  232.  
  233.  
  234.    #ifdef __cplusplus
  235.       }
  236.    #endif
  237.  
  238. #endif
  239.  
  240. #if (defined(__IBMC__) || defined(__IBMCPP__))
  241. #pragma info( none )
  242. #ifndef __CHKHDR__
  243.    #pragma info( restore )
  244. #endif
  245. #pragma info( restore )
  246. #endif
  247.  
  248.