libowfat Documentation - byte.a

byte_copy - copy a string
byte_copyr - copy a string
byte_chr - search for a byte in a string
byte_rchr - search for a byte in a string
byte_diff - compare two strings
byte_equal - compare two strings
byte_zero - initialize a string

Table of Contents

Synopsis

#include <byte.h>
void byte_copy(char *out, unsigned int len, const char *needle);
void byte_copyr(char *out, unsigned int len, const char *in);
int byte_chr(const char *haystack, unsigned int len, char needle);
int byte_rchr(const char *haystack, unsigned int len, char *needle);
void 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_zero(const char *out, unsigned int len);

Description

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_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_chr 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_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_zero sets out[0], out[1], ..., out[len-1] to 0.

Tino Reichardt <der@mcmilk.de>, Felix von Leitner <der@fefe.de>
Version: 5.2, Date: 2001/05/26