Print this page
remove support for non-ANSI compilation


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*


  23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 /*      Copyright (c) 1986 AT&T     */
  28 /*        All Rights Reserved   */
  29 
  30 
  31 /*      This module is created for NLS on Jun.04.86             */
  32 
  33 #ifndef _WIDEC_H
  34 #define _WIDEC_H
  35 
  36 #pragma ident   "%Z%%M% %I%     %E% SMI"
  37 
  38 #include <sys/feature_tests.h>
  39 
  40 #if defined(__STDC__)
  41 #include <stdio.h>        /* For definition of FILE */
  42 #endif
  43 #include <euc.h>
  44 #include <wchar.h>
  45 
  46 #ifdef  __cplusplus
  47 extern "C" {
  48 #endif
  49 
  50 #if defined(__STDC__)
  51 /* Character based input and output functions */
  52 extern wchar_t  *getws(wchar_t *);
  53 extern int      putws(const wchar_t *);
  54 
  55 #if !defined(__lint)
  56 #define getwc(p)        fgetwc(p)
  57 #define putwc(x, p)     fputwc((x), (p))
  58 #define getwchar()      getwc(stdin)
  59 #define putwchar(x)     putwc((x), stdout)
  60 #endif
  61 
  62 /* wchar_t string operation functions */
  63 extern wchar_t  *strtows(wchar_t *, char *);
  64 extern wchar_t  *wscpy(wchar_t *, const wchar_t *);
  65 extern wchar_t  *wsncpy(wchar_t *, const wchar_t *, size_t);
  66 extern wchar_t  *wscat(wchar_t *, const wchar_t *);
  67 extern wchar_t  *wsncat(wchar_t *, const wchar_t *, size_t);
  68 extern wchar_t  *wschr(const wchar_t *, wchar_t);
  69 extern wchar_t  *wsrchr(const wchar_t *, wchar_t);
  70 extern wchar_t  *wspbrk(const wchar_t *, const wchar_t *);


  77 extern size_t   wsspn(const wchar_t *, const wchar_t *);
  78 extern size_t   wscspn(const wchar_t *, const wchar_t *);
  79 extern int      wscoll(const wchar_t *, const wchar_t *);
  80 extern size_t   wsxfrm(wchar_t *, const wchar_t *, size_t);
  81 
  82 #if !defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)
  83 
  84 extern wchar_t  *wsdup(const wchar_t *);
  85 extern int      wscol(const wchar_t *);
  86 extern double   wstod(const wchar_t *, wchar_t **);
  87 extern long     wstol(const wchar_t *, wchar_t **, int);
  88 extern int      wscasecmp(const wchar_t *, const wchar_t *);
  89 extern int      wsncasecmp(const wchar_t *, const wchar_t *, size_t);
  90 extern int      wsprintf(wchar_t *, const char *, ...);
  91 #if defined(_LONGLONG_TYPE)
  92 extern long long        wstoll(const wchar_t *, wchar_t **, int);
  93 #endif  /* defined(_LONGLONG_TYPE) */
  94 
  95 #endif /* !defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX) */
  96 
  97 #else   /* !defined(__STDC__) */
  98 /* Character based input and output functions */
  99 extern wchar_t          *getws();
 100 extern int              putws();
 101 
 102 #ifndef getwc
 103 #define getwc(p)        fgetwc(p)
 104 #endif
 105 #ifndef putwc
 106 #define putwc(x, p)     fputwc((x), (p))
 107 #endif
 108 #ifndef getwchar
 109 #define getwchar()      getwc(stdin)
 110 #endif
 111 #ifndef putwchar
 112 #define putwchar(x)     putwc((x), stdout)
 113 #endif
 114 
 115 /* wchar_t string operation functions */
 116 extern wchar_t  *strtows();
 117 extern wchar_t  *wscpy();
 118 extern wchar_t  *wsncpy();
 119 extern wchar_t  *wscat();
 120 extern wchar_t  *wsncat();
 121 extern wchar_t  *wschr();
 122 extern wchar_t  *wsrchr();
 123 extern wchar_t  *wspbrk();
 124 extern wchar_t  *wstok();
 125 
 126 extern int      wscmp();
 127 extern int      wsncmp();
 128 extern int      wslen();
 129 extern int      wsspn();
 130 extern int      wscspn();
 131 extern int      wscoll();
 132 extern int      wsxfrm();
 133 
 134 extern char     *wstostr();
 135 extern wchar_t  *wsdup();
 136 extern int      wscol();
 137 extern double   wstod();
 138 extern long     wstol();
 139 extern int      wscasecmp();
 140 extern int      wsncasecmp();
 141 extern int      wsprintf();
 142 #if defined(_LONGLONG_TYPE)
 143 extern long long        wstoll();
 144 #endif  /* defined(_LONGLONG_TYPE) */
 145 
 146 #endif  /* !defined(__STDC__) */
 147 
 148 /* Returns the code set number for the process code c. */
 149 #define WCHAR_SHIFT     7
 150 #define WCHAR_S_MASK    0x7f
 151 #define wcsetno(c) \
 152         (((c)&0x20000000)?(((c)&0x10000000)?1:3):(((c)&0x10000000)?2:0))
 153 
 154 /* Aliases... */
 155 #define windex          wschr
 156 #define wrindex         wsrchr
 157 
 158 #define watol(s)        wstol((s), (wchar_t **)0, 10)
 159 #if defined(_LONGLONG_TYPE) && !defined(__lint)
 160 #define watoll(s)       wstoll((s), (wchar_t **)0, 10)
 161 #endif  /* defined(_LONGLONG_TYPE) && !defined(__lint) */
 162 #define watoi(s)        ((int)wstol((s), (wchar_t **)0, 10))
 163 #define watof(s)        wstod((s), (wchar_t **)0)
 164 
 165 /*
 166  * other macros.
 167  */


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  24  *
  25  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29 /*      Copyright (c) 1986 AT&T     */
  30 /*        All Rights Reserved   */
  31 
  32 
  33 /*      This module is created for NLS on Jun.04.86             */
  34 
  35 #ifndef _WIDEC_H
  36 #define _WIDEC_H
  37 


  38 #include <sys/feature_tests.h>
  39 

  40 #include <stdio.h>        /* For definition of FILE */

  41 #include <euc.h>
  42 #include <wchar.h>
  43 
  44 #ifdef  __cplusplus
  45 extern "C" {
  46 #endif
  47 

  48 /* Character based input and output functions */
  49 extern wchar_t  *getws(wchar_t *);
  50 extern int      putws(const wchar_t *);
  51 
  52 #if !defined(__lint)
  53 #define getwc(p)        fgetwc(p)
  54 #define putwc(x, p)     fputwc((x), (p))
  55 #define getwchar()      getwc(stdin)
  56 #define putwchar(x)     putwc((x), stdout)
  57 #endif
  58 
  59 /* wchar_t string operation functions */
  60 extern wchar_t  *strtows(wchar_t *, char *);
  61 extern wchar_t  *wscpy(wchar_t *, const wchar_t *);
  62 extern wchar_t  *wsncpy(wchar_t *, const wchar_t *, size_t);
  63 extern wchar_t  *wscat(wchar_t *, const wchar_t *);
  64 extern wchar_t  *wsncat(wchar_t *, const wchar_t *, size_t);
  65 extern wchar_t  *wschr(const wchar_t *, wchar_t);
  66 extern wchar_t  *wsrchr(const wchar_t *, wchar_t);
  67 extern wchar_t  *wspbrk(const wchar_t *, const wchar_t *);


  74 extern size_t   wsspn(const wchar_t *, const wchar_t *);
  75 extern size_t   wscspn(const wchar_t *, const wchar_t *);
  76 extern int      wscoll(const wchar_t *, const wchar_t *);
  77 extern size_t   wsxfrm(wchar_t *, const wchar_t *, size_t);
  78 
  79 #if !defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)
  80 
  81 extern wchar_t  *wsdup(const wchar_t *);
  82 extern int      wscol(const wchar_t *);
  83 extern double   wstod(const wchar_t *, wchar_t **);
  84 extern long     wstol(const wchar_t *, wchar_t **, int);
  85 extern int      wscasecmp(const wchar_t *, const wchar_t *);
  86 extern int      wsncasecmp(const wchar_t *, const wchar_t *, size_t);
  87 extern int      wsprintf(wchar_t *, const char *, ...);
  88 #if defined(_LONGLONG_TYPE)
  89 extern long long        wstoll(const wchar_t *, wchar_t **, int);
  90 #endif  /* defined(_LONGLONG_TYPE) */
  91 
  92 #endif /* !defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX) */
  93 



















































  94 /* Returns the code set number for the process code c. */
  95 #define WCHAR_SHIFT     7
  96 #define WCHAR_S_MASK    0x7f
  97 #define wcsetno(c) \
  98         (((c)&0x20000000)?(((c)&0x10000000)?1:3):(((c)&0x10000000)?2:0))
  99 
 100 /* Aliases... */
 101 #define windex          wschr
 102 #define wrindex         wsrchr
 103 
 104 #define watol(s)        wstol((s), (wchar_t **)0, 10)
 105 #if defined(_LONGLONG_TYPE) && !defined(__lint)
 106 #define watoll(s)       wstoll((s), (wchar_t **)0, 10)
 107 #endif  /* defined(_LONGLONG_TYPE) && !defined(__lint) */
 108 #define watoi(s)        ((int)wstol((s), (wchar_t **)0, 10))
 109 #define watof(s)        wstod((s), (wchar_t **)0)
 110 
 111 /*
 112  * other macros.
 113  */