Print this page
Garrett's man page edits.

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man3c/wctrans.3c
          +++ new/usr/src/man/man3c/wctrans.3c
↓ open down ↓ 3 lines elided ↑ open up ↑
   4    4  .\" Common Development and Distribution License ("CDDL"), version 1.0.
   5    5  .\" You may only use this file in accordance with the terms of version
   6    6  .\" 1.0 of the CDDL.
   7    7  .\"
   8    8  .\" A full copy of the text of the CDDL should have accompanied this
   9    9  .\" source.  A copy of the CDDL is also available via the Internet at
  10   10  .\" http://www.illumos.org/license/CDDL.
  11   11  .\"
  12   12  .\"
  13   13  .\" Copyright (c) 2014 Joyent, Inc.  All rights reserved.
       14 +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
  14   15  .\"
  15      -.TH WCTRANS 3C "Jun 11, 2014"
       16 +.TH WCTRANS 3C "Jun 25, 2014"
  16   17  
  17   18  .SH NAME
  18      -
  19   19  towctrans, towctrans_l, wctrans, wctrans_l \- define and perform transliteration mappings
  20      -
  21   20  .SH SYNOPSIS
  22      -
  23   21  .LP
  24   22  .nf
  25   23  #include <wctype.h>
  26   24  
  27      -.BI "wint_t towctrans(wint_t " wc ", wctrans_t " desc );
  28      -.BI "wint_t towctrans_l(wint_t " wc ", wctrans_t " desc ", locale_t " loc );
  29      -
  30      -.BI "wctrans_t wctrans(const char *" class );
  31      -.BI "wctrans_t wctrans_l(const char *" class, " locale_t " loc );
  32      -
       25 +\fBwint_t\fR \fBtowctrans\fR(\fBwint_t\fR \fIwc\fR, \fBwctrans_t\fR \fIdesc\fR);
       26 +.fi
       27 +.LP
       28 +.nf
       29 +\fBwint_t\fR \fBtowctrans_l\fR(\fBwint_t\fR \fIwc\fR, \fBwctrans_t\fR \fIdesc\fR, \fBlocale_t\fR \fIloc\fR);
       30 +.fi
       31 +.LP
       32 +.nf
       33 +\fBwctrans_t\fR \fBwctrans\fR(\fBconst char *\fR \fItranclass\fR);
       34 +.fi
       35 +.LP
       36 +.nf
       37 +\fBwctrans_t\fR \fBwctrans_l\fR(\fBconst char *\fR \fItranclass\fR, \fBlocale_t\fR \fIloc\fR);
       38 +.fi
  33   39  .SH DESCRIPTION
  34      -
  35      -The function
  36      -.B wctrans
  37      -is used to obtain a handle to a mapping table that maps one set of wide
  38      -characters to another. It returns an object of type
       40 +.LP
       41 +The functions
       42 +.B wctrans()
       43 +and
       44 +.B wctrans_l()
       45 +are used to obtain a handle to a table that maps one set of wide
       46 +characters to another. They return an object of type
  39   47  .I wctrans_t
  40   48  which can be used with the functions
  41   49  .B towctrans()
  42   50  and
  43   51  .BR towctrans_l() .
  44   52  The valid set of classes that are available depends on the locale.
  45      -Regardless of what locale is being used, the following names are always
  46      -valid:
  47      -
  48      -.na
  49      -.in +2
  50      -.I tolower
  51      -.in -2
  52      -.fi
  53      -
  54      -.na
  55      -.in +2
  56      -.I toupper
  57      -.in -2
  58      -.fi
  59      -.sp
       53 +The following names are valid in all locales:
       54 +.TP
       55 +"tolower"
       56 +Conversion from upper case to lower case characters.
       57 +.TP
       58 +"toupper"
       59 +Conversion from lower case to upper case characters.
  60   60  .LP
  61   61  The
  62   62  .B towctrans()
  63      -function converts the wide character
       63 +and
       64 +.B towctrans_l()
       65 +functions convert the wide character
  64   66  .IR wc
  65      - based on the conversion table
  66      -specified by
       67 +based on the conversion table specified by
  67   68  .IR desc .
  68      -
  69      -
  70   69  .LP
  71   70  The functions
  72      -.B towctrans_l
       71 +.B towctrans_l()
  73   72  and
  74      -.B wctrans_l
       73 +.B wctrans_l()
  75   74  are equivalent to the functions
  76      -.B towctrans
       75 +.B towctrans()
  77   76  and
  78      -.BR wctrans ,
  79      -but instead of operating in the current environemnt, they operate on the
  80      -environment specified by
       77 +.BR wctrans() ,
       78 +but instead of operating in the current locale, they operate on the
       79 +locale specified by
  81   80  .IR loc .
  82      -
  83   81  .SH RETURN VALUES
  84      -
  85   82  On successful completion,
  86   83  .B towctrans()
  87   84  and
  88   85  .B towctrans_l()
  89   86  functions return the character that corresponds to the argument passed
  90   87  through the mapping table described by
  91   88  .IR desc .
  92      -Otherwise, it returns the character unchanged and sets
       89 +Otherwise, they return the character unchanged and set
  93   90  .BR errno .
  94      -
  95   91  On successful completion,
  96   92  .B wctrans()
  97   93  and
  98   94  .B wctrans_l()
  99   95  functions return a non-zero identifier for
 100      -.IR class .
       96 +.IR tranclass .
 101   97  On failure, they return zero and set
 102   98  .BR errno .
 103      -
 104      -
 105   99  .SH ERRORS
 106  100  .LP
 107  101  The
 108  102  .B wctrans()
 109  103  and
 110  104  .B wctrans_l()
 111  105  functions will fail if:
 112      -.sp
 113      -.ne 2
 114      -.na
 115      -.B EINAVL
 116      -.ad
 117      -.RS 10n
      106 +.TP
      107 +.B EINVAL
 118  108  The mapping class specified by
 119      -.I class
      109 +.I tranclass
 120  110  does not exist or is invalid.
 121      -.RE
 122      -
 123  111  .LP
 124  112  The
 125  113  .B towctrans()
 126  114  and
 127  115  .B towctrans_l()
 128  116  functions will fail if:
 129      -.sp
 130      -.ne 2
 131      -.na
 132      -.B EINAVL
 133      -.ad
 134      -.RS 10n
      117 +.TP
      118 +.B EINVAL
 135  119  The mapping class specified by
 136  120  .I desc
 137  121  is invalid.
 138      -.RE
 139      -
 140  122  .SH ATTRIBUTES
 141      -.sp
 142  123  .TS
 143  124  box;
 144  125  c | c
 145  126  l | l .
 146  127  ATTRIBUTE TYPE  ATTRIBUTE VALUE
 147  128  _
 148  129  Interface Stability     Standard
 149  130  _
 150      -MT-Level        Safe, with exceptions
      131 +MT-Level        MT-Safe
 151  132  .TE
 152  133  
 153  134  .SH SEE ALSO
 154      -.BR duplocale (3C),
 155  135  .BR newlocale (3C),
 156  136  .BR setlocale (3C),
 157  137  .BR towlower (3C),
 158  138  .BR towupper (3C),
 159  139  .BR environ (5),
 160  140  .BR locale (5)
 161      -
 162      -.SH NOTES
 163      -
 164      -The functions
 165      -.B towctrans()
 166      -and
 167      -.B wctrans()
 168      -are thread-safe as long as
 169      -the thread is emplying a per-thread locale as set per
 170      -.B uselocale(3C)
 171      -or
 172      -.B setlocale(3C)
 173      -is not called by another thread while these functions are running.
 174      -Both
 175      -.B towctrans_l()
 176      -and
 177      -.B wctrans_l()
 178      -are MT-safe.
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX