70 lines
2.5 KiB
HTML
70 lines
2.5 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>bstring(3)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>bstring(3)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
bstring, bcopy, bcmp, bzero, ffs - bit and byte string operations
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>#include</STRONG> <STRONG><sys/types.h></STRONG>
|
|
<STRONG>#include</STRONG> <STRONG><string.h></STRONG>
|
|
<STRONG>#include</STRONG> <STRONG><unistd.h></STRONG>
|
|
|
|
<STRONG>void</STRONG> <STRONG>bcopy(const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>src</EM><STRONG>,</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>dst</EM><STRONG>,</STRONG> <STRONG>size_t</STRONG> <EM>length</EM><STRONG>)</STRONG>
|
|
<STRONG>int</STRONG> <STRONG>bcmp(const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>b1</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>void</STRONG> <STRONG>*</STRONG><EM>b2</EM><STRONG>,</STRONG> <STRONG>size_t</STRONG> <EM>length</EM><STRONG>)</STRONG>
|
|
<STRONG>void</STRONG> <STRONG>bzero(void</STRONG> <STRONG>*</STRONG><EM>dst</EM><STRONG>,</STRONG> <STRONG>size_t</STRONG> <EM>length</EM><STRONG>)</STRONG>
|
|
<STRONG>int</STRONG> <STRONG>ffs(int</STRONG> <EM>i</EM><STRONG>)</STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
The functions <STRONG>bcopy</STRONG>, <STRONG>bcmp</STRONG>, and <STRONG>bzero</STRONG> operate on variable length strings
|
|
of bytes. They do not check for null bytes as the routines in <STRONG><A HREF="../man3/string.3.html">string(3)</A></STRONG>
|
|
do.
|
|
|
|
<STRONG>Bcopy</STRONG> copies <EM>length</EM> bytes from string <EM>src</EM> to the string <EM>dst</EM>.
|
|
|
|
<STRONG>Bcmp</STRONG> compares byte string <EM>b1</EM> against byte string <EM>b2</EM>, returning zero if
|
|
they are identical, non-zero otherwise. Both strings are assumed to be
|
|
<EM>length</EM> bytes long.
|
|
|
|
<STRONG>Bzero</STRONG> places <EM>length</EM> 0 bytes in the string <EM>b1</EM>.
|
|
|
|
<STRONG>Ffs</STRONG> find the first bit set in the argument passed it and returns the
|
|
index of that bit. Bits are numbered starting at 1. A return value of 0
|
|
indicates the value passed is zero.
|
|
|
|
|
|
</PRE>
|
|
<H2>BUGS</H2><PRE>
|
|
The <STRONG>bcopy</STRONG>, <STRONG>bcmp</STRONG>, and <STRONG>bzero</STRONG> functions are obsolete; new code should use
|
|
<STRONG>memmove</STRONG>, <STRONG>memcmp</STRONG>, and <STRONG>memset</STRONG> respectively.
|
|
|
|
The <STRONG>bcopy</STRONG> routine takes parameters backwards from <STRONG>memcpy</STRONG>, <STRONG>memmove</STRONG>, and
|
|
<STRONG>strcpy</STRONG>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|