📄 blib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/bLib.html - generated by refgen from bLib.c --> <title> bLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>bLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>bLib</strong> - buffer manipulation library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./bLib.html#bcmp">bcmp</a>( )</b> - compare one buffer to another<br><b><a href="./bLib.html#binvert">binvert</a>( )</b> - invert the order of bytes in a buffer<br><b><a href="./bLib.html#bswap">bswap</a>( )</b> - swap buffers<br><b><a href="./bLib.html#swab">swab</a>( )</b> - swap bytes<br><b><a href="./bLib.html#uswab">uswab</a>( )</b> - swap bytes with buffers that are not necessarily aligned<br><b><a href="./bLib.html#bzero">bzero</a>( )</b> - zero out a buffer<br><b><a href="./bLib.html#bcopy">bcopy</a>( )</b> - copy one buffer to another<br><b><a href="./bLib.html#bcopyBytes">bcopyBytes</a>( )</b> - copy one buffer to another one byte at a time<br><b><a href="./bLib.html#bcopyWords">bcopyWords</a>( )</b> - copy one buffer to another one word at a time<br><b><a href="./bLib.html#bcopyLongs">bcopyLongs</a>( )</b> - copy one buffer to another one long word at a time<br><b><a href="./bLib.html#bfill">bfill</a>( )</b> - fill a buffer with a specified character<br><b><a href="./bLib.html#bfillBytes">bfillBytes</a>( )</b> - fill buffer with a specified character one byte at a time<br><b><a href="./bLib.html#index">index</a>( )</b> - find the first occurrence of a character in a string<br><b><a href="./bLib.html#rindex">rindex</a>( )</b> - find the last occurrence of a character in a string<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains routines to manipulate buffers of variable-lengthbyte arrays. Operations are performed on long words when possible, eventhough the buffer lengths are specified in bytes. This occurs only whensource and destination buffers start on addresses that are both odd or botheven. If one buffer is even and the other is odd, operations must be doneone byte at a time (because of alignment problems inherent in the MC68000),thereby slowing down the process.<p>Certain applications, such as byte-wide memory-mapped peripherals, mayrequire that only byte operations be performed. For this purpose, theroutines <b><a href="./bLib.html#bcopyBytes">bcopyBytes</a>( )</b> and <b><a href="./bLib.html#bfillBytes">bfillBytes</a>( )</b> provide the same functions as <b><a href="./bLib.html#bcopy">bcopy</a>( )</b>and <b><a href="./bLib.html#bfill">bfill</a>( )</b>, but use only byte-at-a-time operations. These routines donot check for null termination.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>string.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p>ansiString<hr><a name="bcmp"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>bcmp( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>bcmp( )</strong> - compare one buffer to another</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int bcmp ( char * buf1, /* pointer to first buffer */ char * buf2, /* pointer to second buffer */ int nbytes /* number of bytes to compare */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine compares the first <i>nbytes</i> characters of <i>buf1</i> to <i>buf2</i>.<p></blockquote><h4>RETURNS</h4><blockquote><p><p> 0 if the first <i>nbytes</i> of <i>buf1</i> and <i>buf2</i> are identical,<br> less than 0 if <i>buf1</i> is less than <i>buf2</i>, or<br> greater than 0 if <i>buf1</i> is greater than <i>buf2</i>.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bLib.html#top">bLib</a></b><hr><a name="binvert"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>binvert( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>binvert( )</strong> - invert the order of bytes in a buffer</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void binvert ( char * buf, /* pointer to buffer to invert */ int nbytes /* number of bytes in buffer */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine inverts an entire buffer, byte by byte. For example,the buffer {1, 2, 3, 4, 5} would become {5, 4, 3, 2, 1}.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bLib.html#top">bLib</a></b><hr><a name="bswap"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>bswap( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>bswap( )</strong> - swap buffers</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void bswap ( char * buf1, /* pointer to first buffer */ char * buf2, /* pointer to second buffer */ int nbytes /* number of bytes to swap */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine exchanges the first <i>nbytes</i> of the two specified buffers.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bLib.html#top">bLib</a></b><hr><a name="swab"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>swab( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>swab( )</strong> - swap bytes</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void swab ( char * source, /* pointer to source buffer */ char * destination, /* pointer to destination buffer */ int nbytes /* number of bytes to exchange */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the specified number of bytes from <i>source</i>,exchanges the adjacent even and odd bytes, and puts them in <i>destination</i>.The buffers <i>source</i> and <i>destination</i> should not overlap.<p></blockquote><h4>NOTE</h4><blockquote><p>On some CPUs, <b><a href="./bLib.html#swab">swab</a>( )</b> will cause an exception if the buffers areunaligned. In such cases, use <b><a href="./bLib.html#uswab">uswab</a>( )</b> for unaligned swaps. On ARMfamily CPUs, <b><a href="./bLib.html#swab">swab</a>( )</b> may reorder the bytes incorrectly without causingan exception if the buffers are unaligned. Again, use <b><a href="./bLib.html#uswab">uswab</a>( )</b> forunaligned swaps.<p>It is an error for <i>nbytes</i> to be odd.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bLib.html#top">bLib</a></b>, <b><a href="./bLib.html#uswab">uswab</a>( )</b><hr><a name="uswab"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>uswab( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>uswab( )</strong> - swap bytes with buffers that are not necessarily aligned</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void uswab ( char * source, /* pointer to source buffer */ char * destination, /* pointer to destination buffer */ int nbytes /* number of bytes to exchange */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine gets the specified number of bytes from <i>source</i>,exchanges the adjacent even and odd bytes, and puts them in <i>destination</i>.<p></blockquote><h4>NOTE</h4><blockquote><p>Due to speed considerations, this routine should only be used whenabsolutely necessary. Use <b><a href="./bLib.html#swab">swab</a>( )</b> for aligned swaps.<p>It is an error for <i>nbytes</i> to be odd.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bLib.html#top">bLib</a></b>, <b><a href="./bLib.html#swab">swab</a>( )</b><hr><a name="bzero"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>bzero( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>bzero( )</strong> - zero out a buffer</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void bzero ( char * buffer, /* buffer to be zeroed */ int nbytes /* number of bytes in buffer */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine fills the first <i>nbytes</i> characters of thespecified buffer with 0.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./bLib.html#top">bLib</a></b><hr><a name="bcopy"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>bcopy( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>bcopy( )</strong> - copy one buffer to another</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -