home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / stdlib / multibyte.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-01  |  4.8 KB  |  195 lines

  1. /* 
  2.  * multibyte.c --
  3.  *
  4.  *    Multibyte library functions.
  5.  *      These are just dummy stubs.
  6.  *
  7.  * Copyright 1991 Regents of the University of California
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that this copyright
  11.  * notice appears in all copies.  The University of California
  12.  * makes no representations about the suitability of this
  13.  * software for any purpose.  It is provided "as is" without
  14.  * express or implied warranty.
  15.  */
  16.  
  17. #ifndef lint
  18. static char rcsid[] = "$Header: /sprite/lib/forms/RCS/proto.c,v 1.5 91/02/09 13:24:44 ouster Exp $ SPRITE (Berkeley)";
  19. #endif /* not lint */
  20.  
  21. #include <stdio.h>
  22. #include <stdlib.h>
  23. #include <sys/types.h>
  24. #include <sys/stdtypes.h>
  25.  
  26. /*
  27.  *----------------------------------------------------------------------
  28.  *
  29.  * mblen --
  30.  *
  31.  *      Determines the number of bytes comprising the multibyte
  32.  *      character pointed to by s.
  33.  *
  34.  * Results:
  35.  *    Returns the number of bytes comprising the multibyte
  36.  *      character pointed to by s.
  37.  *
  38.  * Side effects:
  39.  *    None.
  40.  *
  41.  *----------------------------------------------------------------------
  42.  */
  43.  
  44. int
  45. mblen(s, n)
  46.     char *s;
  47.     size_t n;
  48. {
  49.  
  50.     if (s == NULL) {
  51.     return 0;
  52.     }
  53.     return -1;
  54. }
  55.  
  56. /*
  57.  *----------------------------------------------------------------------
  58.  *
  59.  * mbstowcs --
  60.  *
  61.  *      Converts a sequence of multibyte characters that begins
  62.  *      in the initial shift state from the array pointed to by
  63.  *      s into a sequence of corresponding codes and stores  no
  64.  *      more  than  n  codes into the array pointed to by pwcs.
  65.  *      No multibyte characters that follow  a  null  character
  66.  *      (which  is  converted into a code with value zero) will
  67.  *      be examined or converted.  Each multibyte character  is
  68.  *      converted  as if by a call to mbtowc(), except that the
  69.  *      shift state of mbtowc() is not affected.
  70.  *
  71.  *      No more than n elements will be modified in  the  array
  72.  *      pointed  to  by  pwcs.   If copying takes place between
  73.  *      objects that overlap, the behavior is undefined.
  74.  *
  75.  * Results:
  76.  *    None.
  77.  *
  78.  * Side effects:
  79.  *    None.
  80.  *
  81.  *----------------------------------------------------------------------
  82.  */
  83.  
  84. size_t
  85. mbstowcs(s, pwcs, n)
  86.     char *s;
  87.     wchar_t *pwcs;
  88.     size_t n;
  89. {
  90.  
  91.     return 0;
  92. }
  93.  
  94. /*
  95.  *----------------------------------------------------------------------
  96.  *
  97.  * mbtowc --
  98.  *
  99.  *      Determines the number of bytes that comprise the multi-
  100.  *      byte  character  pointed to by s.  mbtowc() then deter-
  101.  *      mines  the  code  for  value  of  type   wchar_t   that
  102.  *      corresponds  to that multibyte character.  The value of
  103.  *      the code corresponding to the null caharacter is  zero.
  104.  *      If  the  multibyte  character is valid and pwc is not a
  105.  *      null pointer, mbtowc() stores the code  in  the  object
  106.  *      pointed  to  by  pwc.   At  most  n  bytes of the array
  107.  *      pointed to by s will be examined.
  108.  *
  109.  * Results:
  110.  *    None.
  111.  *
  112.  * Side effects:
  113.  *    None.
  114.  *
  115.  *----------------------------------------------------------------------
  116.  */
  117. int
  118. mbtowc(pwc, s, n)
  119.     wchar_t *pwc;
  120.     char *s;
  121.     size_t n;
  122. {
  123.  
  124.     return 0;
  125. }
  126.  
  127. /*
  128.  *----------------------------------------------------------------------
  129.  *
  130.  * wcstombs --
  131.  *
  132.  *        Converts a sequence of codes that correspond to  multi-
  133.  *        byte  characters from the array pointed to by pwcs into
  134.  *        a sequence of multibyte characters that begins  in  the
  135.  *        initial  shift state and stores these multibyte charac-
  136.  *        ters into the array pointed to by s, stopping if a mul-
  137.  *        tibyte  character  would  exceed  the  limit of n total
  138.  *        bytes or if a null character is stored.  Each  code  is
  139.  *        converted  as if by a call to wctomb(), except that the
  140.  *        shift state of wctomb() is not affected.
  141.  *
  142.  * Results:
  143.  *    None.
  144.  *
  145.  * Side effects:
  146.  *    None.
  147.  *
  148.  *----------------------------------------------------------------------
  149.  */
  150.  
  151. int
  152. wcstombs(s, pwcs, n)
  153.     char *s;
  154.     wchar_t *pwcs;
  155.     size_t n;
  156. {
  157.  
  158.     return 0;
  159. }
  160.  
  161. /*
  162.  *----------------------------------------------------------------------
  163.  *
  164.  * wctomb --
  165.  *
  166.  *      Determines the number of bytes needed to represent  the
  167.  *      multibyte  character  corresponding  to  the code whose
  168.  *      value is wchar (including any change in  shift  state).
  169.  *      wctomb()  stores the multibyte character representation
  170.  *      in the array object pointed to by s (if s is not a null
  171.  *      pointer).   At  most, MB_CUR_MAX characters are stored.
  172.  *      If the value of wchar is zero, wctomb() is left in  the
  173.  *      initial shift state.
  174.  *
  175.  * Results:
  176.  *    None.
  177.  *
  178.  * Side effects:
  179.  *    None.
  180.  *
  181.  *----------------------------------------------------------------------
  182.  */
  183. int
  184. wctomb(s, wchar)
  185.     char *s;
  186.     wchar_t wchar;
  187. {
  188.  
  189.     if (s == NULL) {
  190.     return 0;
  191.     }
  192.     return -1;
  193. }
  194.  
  195.