SYNTAX
#include "byte.h"
unsigned int byte_chr(const char *haystack,unsigned int len,char
needle);
unsigned int byte_rchr(const char *haystack,unsigned int len,char
needle);
void byte_copy(char *out,unsigned int len,const char *in);
void byte_copyr(char *out,unsigned int len,const char *in);
int byte_diff(const char *one,unsigned int len,const char *two);
int byte_equal(const char *one,unsigned int len,const char *two);
void byte_fill(char *out,unsigned int len,const char c);
void byte_zero(char *out,unsigned int len);
DESCRIPTION
byte_chr returns the smallest integer i between 0 and len-1 inclusive
such that one[i] equals needle. If no such integer exists, byte_chr
returns len. byte_chr may read all bytes one[0], one[1], ...,
one[len-1], even if not all the bytes are relevant to the answer.
byte_rchr returns the largest integer i between 0 and len-1 inclusive
such that one[i] equals needle. If no such integer exists, byte_rchr
returns len. byte_rchr may read all bytes one[0], one[1], ...,
one[len-1], even if not all the bytes are relevant to the answer.
byte_copy copies in[0] to out[0], in[1] to out[1], etc., and finally
in[len-1] to out[len-1].
byte_copyr copies in[len-1] to out[len-1], in[len-2] to out[len-2],
etc., and in[0] to out[0].
byte_diff returns negative, 0, or positive, depending on whether the
string one[0], one[1], ..., one[len-1] is lexicographically smaller
than, equal to, or greater than the string one[0], one[1], ...,
one[len-1]. When the strings are different, byte_diff does not read
bytes past the first difference.
byte_equal returns 1 if the strings are equal, 0 otherwise. When the
strings are different, byte_equal does not read bytes past the first
difference.
byte_fill fills out[0], out[1], ..., out[len-1] with a single byte c.
byte_zero sets out[0], out[1], ..., out[len-1] to 0.
SEE ALSO
case(3), stralloc(3)
Man(1) output converted with
man2html