亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? library_6.html

?? Glibc的中文手冊
?? HTML
?? 第 1 頁 / 共 3 頁
字號:
beginning at <VAR>string</VAR> to its corresponding wide character code.  It
stores the result in <CODE>*<VAR>result</VAR></CODE>.
<P>
<CODE>mbtowc</CODE> never examines more than <VAR>size</VAR> bytes.  (The idea is
to supply for <VAR>size</VAR> the number of bytes of data you have in hand.)
<P>
<CODE>mbtowc</CODE> with non-null <VAR>string</VAR> distinguishes three
possibilities: the first <VAR>size</VAR> bytes at <VAR>string</VAR> start with
valid multibyte character, they start with an invalid byte sequence or
just part of a character, or <VAR>string</VAR> points to an empty string (a
null character).
<P>
For a valid multibyte character, <CODE>mbtowc</CODE> converts it to a wide
character and stores that in <CODE>*<VAR>result</VAR></CODE>, and returns the
number of bytes in that character (always at least <CODE>1</CODE>, and never
more than <VAR>size</VAR>).
<P>
For an invalid byte sequence, <CODE>mbtowc</CODE> returns <CODE>-1</CODE>.  For an
empty string, it returns <CODE>0</CODE>, also storing <CODE>0</CODE> in
<CODE>*<VAR>result</VAR></CODE>.
<P>
If the multibyte character code uses shift characters, then
<CODE>mbtowc</CODE> maintains and updates a shift state as it scans.  If you
call <CODE>mbtowc</CODE> with a null pointer for <VAR>string</VAR>, that
initializes the shift state to its standard initial value.  It also
returns nonzero if the multibyte character code in use actually has a
shift state.  See section <A HREF="library_6.html#SEC75" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_6.html#SEC75">Multibyte Codes Using Shift Sequences</A>.
<P>
<A NAME="IDX355"></A>
<U>Function:</U> int <B>wctomb</B> <I>(char *<VAR>string</VAR>, wchar_t <VAR>wchar</VAR>)</I><P>
The <CODE>wctomb</CODE> ("wide character to multibyte") function converts
the wide character code <VAR>wchar</VAR> to its corresponding multibyte
character sequence, and stores the result in bytes starting at
<VAR>string</VAR>.  At most <CODE>MB_CUR_MAX</CODE> characters are stored.
<P>
<CODE>wctomb</CODE> with non-null <VAR>string</VAR> distinguishes three
possibilities for <VAR>wchar</VAR>: a valid wide character code (one that can
be translated to a multibyte character), an invalid code, and <CODE>0</CODE>.
<P>
Given a valid code, <CODE>wctomb</CODE> converts it to a multibyte character,
storing the bytes starting at <VAR>string</VAR>.  Then it returns the number
of bytes in that character (always at least <CODE>1</CODE>, and never more
than <CODE>MB_CUR_MAX</CODE>).
<P>
If <VAR>wchar</VAR> is an invalid wide character code, <CODE>wctomb</CODE> returns
<CODE>-1</CODE>.  If <VAR>wchar</VAR> is <CODE>0</CODE>, it returns <CODE>0</CODE>, also
storing <CODE>0</CODE> in <CODE>*<VAR>string</VAR></CODE>.
<P>
If the multibyte character code uses shift characters, then
<CODE>wctomb</CODE> maintains and updates a shift state as it scans.  If you
call <CODE>wctomb</CODE> with a null pointer for <VAR>string</VAR>, that
initializes the shift state to its standard initial value.  It also
returns nonzero if the multibyte character code in use actually has a
shift state.  See section <A HREF="library_6.html#SEC75" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_6.html#SEC75">Multibyte Codes Using Shift Sequences</A>.
<P>
Calling this function with a <VAR>wchar</VAR> argument of zero when
<VAR>string</VAR> is not null has the side-effect of reinitializing the
stored shift state <EM>as well as</EM> storing the multibyte character
<CODE>0</CODE> and returning <CODE>0</CODE>.
<P>
<H2><A NAME="SEC74" HREF="library_toc.html#SEC74" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC74">Example of Character-by-Character Conversion</A></H2>
<P>
Here is an example that reads multibyte character text from descriptor
<CODE>input</CODE> and writes the corresponding wide characters to descriptor
<CODE>output</CODE>.  We need to convert characters one by one for this
example because <CODE>mbstowcs</CODE> is unable to continue past a null
character, and cannot cope with an apparently invalid partial character
by reading more input.
<P>
<PRE>
int
file_mbstowcs (int input, int output)
{
  char buffer[BUFSIZ + MB_LEN_MAX];
  int filled = 0;
  int eof = 0;

  while (!eof)
    {
      int nread;
      int nwrite;
      char *inp = buffer;
      wchar_t outbuf[BUFSIZ];
      wchar_t *outp = outbuf;

      /* Fill up the buffer from the input file.  */
      nread = read (input, buffer + filled, BUFSIZ);
      if (nread &#60; 0) {
        perror ("read");
        return 0;
      }
      /* If we reach end of file, make a note to read no more. */
      if (nread == 0)
        eof = 1;

      /* <CODE>filled</CODE> is now the number of bytes in <CODE>buffer</CODE>. */
      filled += nread;

      /* Convert those bytes to wide characters--as many as we can. */
      while (1)
        {
          int thislen = mbtowc (outp, inp, filled);
          /* Stop converting at invalid character;
             this can mean we have read just the first part
             of a valid character.  */
          if (thislen == -1)
            break;
          /* Treat null character like any other,
             but also reset shift state. */
          if (thislen == 0) {
            thislen = 1;
            mbtowc (NULL, NULL, 0);
          }
          /* Advance past this character. */
          inp += thislen;
          filled -= thislen;
          outp++;
        }

      /* Write the wide characters we just made.  */
      nwrite = write (output, outbuf,
                      (outp - outbuf) * sizeof (wchar_t));
      if (nwrite &#60; 0)
        {
          perror ("write");
          return 0;
        }

      /* See if we have a <EM>real</EM> invalid character. */
      if ((eof &#38;&#38; filled &#62; 0) || filled &#62;= MB_CUR_MAX)
        {
          error ("invalid multibyte character");
          return 0;
        }

      /* If any characters must be carried forward,
         put them at the beginning of <CODE>buffer</CODE>. */
      if (filled &#62; 0)
        memcpy (inp, buffer, filled);
      }
    }

  return 1;
}
</PRE>
<P>
<H2><A NAME="SEC75" HREF="library_toc.html#SEC75" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_toc.html#SEC75">Multibyte Codes Using Shift Sequences</A></H2>
<P>
In some multibyte character codes, the <EM>meaning</EM> of any particular
byte sequence is not fixed; it depends on what other sequences have come
earlier in the same string.  Typically there are just a few sequences
that can change the meaning of other sequences; these few are called
<DFN>shift sequences</DFN> and we say that they set the <DFN>shift state</DFN> for
other sequences that follow.
<P>
To illustrate shift state and shift sequences, suppose we decide that
the sequence <CODE>0200</CODE> (just one byte) enters Japanese mode, in which
pairs of bytes in the range from <CODE>0240</CODE> to <CODE>0377</CODE> are single
characters, while <CODE>0201</CODE> enters Latin-1 mode, in which single bytes
in the range from <CODE>0240</CODE> to <CODE>0377</CODE> are characters, and
interpreted according to the ISO Latin-1 character set.  This is a
multibyte code which has two alternative shift states ("Japanese mode"
and "Latin-1 mode"), and two shift sequences that specify particular
shift states.
<P>
When the multibyte character code in use has shift states, then
<CODE>mblen</CODE>, <CODE>mbtowc</CODE> and <CODE>wctomb</CODE> must maintain and update
the current shift state as they scan the string.  To make this work
properly, you must follow these rules:
<P>
<UL>
<LI>
Before starting to scan a string, call the function with a null pointer
for the multibyte character address--for example, <CODE>mblen (NULL,
0)</CODE>.  This initializes the shift state to its standard initial value.
<P>
<LI>
Scan the string one character at a time, in order.  Do not "back up"
and rescan characters already scanned, and do not intersperse the
processing of different strings.
</UL>
<P>
Here is an example of using <CODE>mblen</CODE> following these rules:
<P>
<PRE>
void
scan_string (char *s)
{
  int length = strlen (s);

  /* Initialize shift state. */
  mblen (NULL, 0);

  while (1)
    {
      int thischar = mblen (s, length);
      /* Deal with end of string and invalid characters. */
      if (thischar == 0)
        break;
      if (thischar == -1)
        {
          error ("invalid multibyte character");
          break;
        }
      /* Advance past this character. */
      s += thischar;
      length -= thischar;
    }
}
</PRE>
<P>
The functions <CODE>mblen</CODE>, <CODE>mbtowc</CODE> and <CODE>wctomb</CODE> are not
reentrant when using a multibyte code that uses a shift state.  However,
no other library functions call these functions, so you don't have to
worry that the shift state will be changed mysteriously.
<P>Go to the <A HREF="library_5.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_5.html">previous</A>, <A HREF="library_7.html" tppabs="http://www.cs.utah.edu/dept/old/texinfo/glibc-manual-0.02/library_7.html">next</A> section.<P>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美性色黄大片| 不卡的av电影| 日韩你懂的在线观看| 秋霞电影网一区二区| 欧美大肚乱孕交hd孕妇| 激情综合一区二区三区| 久久久久久久国产精品影院| 国产成人av影院| 亚洲人成人一区二区在线观看| 久久这里都是精品| 国产美女主播视频一区| 国产精品久久久久久福利一牛影视| 亚洲伦理在线精品| 欧美性三三影院| 美日韩一区二区| 久久精品视频免费观看| 91麻豆国产自产在线观看| 夜夜嗨av一区二区三区四季av | 一区二区三区四区乱视频| 91在线观看视频| 亚洲影院理伦片| 日韩精品一区二区三区中文不卡| 1024亚洲合集| 欧美久久久久久久久久| 色综合中文字幕| 色成人在线视频| 一区二区三区四区精品在线视频| 不卡免费追剧大全电视剧网站| 国产视频视频一区| 亚洲在线观看免费视频| 免费三级欧美电影| 亚洲欧洲日产国产综合网| 玉米视频成人免费看| 91免费在线播放| 99re视频这里只有精品| 久久久久久久久久久99999| 国产寡妇亲子伦一区二区| 亚洲综合视频在线观看| 欧美精品一区二区蜜臀亚洲| 97久久精品人人澡人人爽| 视频一区二区三区中文字幕| 中文字幕av资源一区| 欧美一区二区高清| 99在线精品观看| 国产一区二区调教| 午夜欧美2019年伦理| 中文字幕亚洲视频| 精品国产乱码久久久久久1区2区 | 国产亚洲精品精华液| 色悠久久久久综合欧美99| 黄色日韩网站视频| 亚洲夂夂婷婷色拍ww47| 国产午夜亚洲精品午夜鲁丝片| 国产伦精品一区二区三区免费迷 | 亚洲亚洲精品在线观看| 国产精品天干天干在线综合| 欧美一区二区不卡视频| 一本在线高清不卡dvd| 国产不卡一区视频| 久久精品久久精品| 亚洲大片精品永久免费| 亚洲人成在线播放网站岛国| 亚洲国产精品av| 久久精品人人做| 免费人成黄页网站在线一区二区| 国产资源在线一区| 亚洲成国产人片在线观看| 成人精品视频网站| 自拍偷拍亚洲欧美日韩| 色国产综合视频| 精品写真视频在线观看| 国产日韩欧美不卡| 91国产福利在线| 六月丁香综合在线视频| 亚洲妇熟xx妇色黄| 日韩黄色在线观看| 亚洲国产一区二区视频| 亚洲乱码国产乱码精品精可以看| 风流少妇一区二区| 国产精品一区二区久激情瑜伽| 国产精品天干天干在线综合| 久久久www免费人成精品| 日韩欧美一级二级三级久久久| 国产一区二区三区四| 国产一区二区三区免费观看 | 日韩三级在线观看| 欧美精品 国产精品| 欧美美女黄视频| 5566中文字幕一区二区电影| 欧美一区二区人人喊爽| 日韩视频免费观看高清完整版| 国产精品一区二区三区乱码 | 亚洲综合一二三区| 亚洲综合免费观看高清完整版在线| 日韩欧美一区在线| 精品久久久久久久久久久久包黑料 | 喷白浆一区二区| 精品一区二区三区av| 国产精品一品二品| av日韩在线网站| 欧美视频在线一区| 日韩视频一区二区| 国产亚洲短视频| 在线免费观看日本欧美| 欧美日韩在线观看一区二区 | 91久久一区二区| 欧美日韩国产另类一区| 日韩精品中文字幕一区二区三区| 91啪在线观看| 欧美三级欧美一级| 欧美一区二区三区的| 精品国产成人在线影院| 亚洲欧洲日本在线| 日本最新不卡在线| 国产成人精品亚洲午夜麻豆| 欧美亚洲综合在线| 亚洲精品一区二区三区99| 欧美国产一区视频在线观看| 亚洲sss视频在线视频| 免费观看在线色综合| 成人av免费网站| 欧美精品在线视频| 日本一区免费视频| 午夜精品久久久久久久久| 丰满白嫩尤物一区二区| 欧美性猛交一区二区三区精品| 不卡的av网站| 日韩欧美一区二区久久婷婷| 综合在线观看色| 久久精品国产**网站演员| 色婷婷av一区二区| 国产午夜精品久久久久久免费视| 精品av综合导航| 亚洲图片欧美视频| 懂色一区二区三区免费观看 | 国产一区二区三区香蕉| 欧美性大战久久久| 久久精品免费在线观看| 日韩在线一区二区| 99久久精品99国产精品| 26uuu精品一区二区在线观看| 欧美一区二区黄| 亚洲国产视频直播| 成人av在线网| 久久久99久久| 日韩国产精品久久| 91传媒视频在线播放| 国产精品久久久久久久久免费相片 | 成人avav影音| 精品国产免费视频| 日韩精品电影一区亚洲| 99国产精品国产精品久久| 国产亚洲欧美激情| 国模大尺度一区二区三区| 日韩美女主播在线视频一区二区三区| 亚洲精品一区二区三区影院| 日韩精品乱码av一区二区| 一本久久a久久免费精品不卡| 在线观看一区二区精品视频| 1区2区3区精品视频| 粉嫩嫩av羞羞动漫久久久| 欧美大白屁股肥臀xxxxxx| 午夜久久久久久| 欧美一a一片一级一片| 亚洲综合色自拍一区| 91污片在线观看| 亚洲欧美怡红院| 成人av在线资源网站| 国产精品毛片大码女人| 国产成人免费视频网站| 国产亚洲欧美日韩日本| 国产成人一区在线| 中文字幕乱码亚洲精品一区| 国产91丝袜在线18| 日本一区二区三区久久久久久久久不| 亚洲伦理在线免费看| 色婷婷狠狠综合| 亚洲高清免费视频| 欧美日韩一区精品| 舔着乳尖日韩一区| 欧美一级欧美三级在线观看 | 国产精品不卡一区二区三区| 成人动漫一区二区在线| 国产精品福利一区二区| 色94色欧美sute亚洲13| 五月婷婷色综合| 欧美videos中文字幕| 国产精品白丝jk白祙喷水网站 | 日韩国产精品久久久| 在线成人高清不卡| 麻豆精品久久精品色综合| 久久夜色精品国产噜噜av| 国产黄人亚洲片| 亚洲人成精品久久久久| 欧美日韩mp4| 蜜臀久久99精品久久久画质超高清| 波多野结衣在线一区| 日韩理论片在线| 911精品国产一区二区在线| 精品一区二区三区视频|