libowfat Documentation - str.a

str_copy - copy an ASCIIZ string
str_chr - find character in ASCIIZ string
str_rchr - find character in ASCIIZ string
str_diff - compare two ASCIIZ strings
str_diffn - compare two ASCIIZ strings
str_equal - compare two ASCIIZ strings
str_len - find length of ASCIIZ string
str_start - compare prefixes of strings

Table of Contents

Synopsis

#include <str.h>
extern int str_copy(char *out, const char *in);
extern int str_chr(const char *haystack, char needle);
extern int str_rchr(const char *haystack, char needle);
extern int str_diff(const char *a, const char *b);
extern int str_diffn(const char *a, const char *b,unsigned int limit);
extern int str_equal(const char *a, const char *b);
extern int str_len(const char *string);
extern int str_start(const char *a, const char *b);

Description

str_chr returns the index of the first occurrance of needle or \0 in string.

str_copy copies the leading bytes of in to out up to and including the first occurrance of \0. str_copy returns the number of bytes copied.

str_rchr returns the index of the last occurrance of needle or the first occurrance of \0 in string.

str_diff returns negative, 0, or positive, depending on whether the string a[0], a[1], ..., a[n]=='\0' is lexicographically smaller than, equal to, or greater than the string b[0], b[1], ..., b[m-1]=='\0'. If the strings are different, str_diff does not read bytes past the first difference.

str_diffn returns negative, 0, or positive, depending on whether the string a[0], a[1], ..., a[n]=='\0' is lexicographically smaller than, equal to, or greater than the string b[0], b[1], ..., b[m-1]=='\0'. If the strings are different, str_diff does not read bytes past the first difference. The strings will be considered equal if the first limit characters match.

str_equal returns nonzero if a and b match up to and including the first occurrance of \0. If the strings are different, str_equal does not read bytes past the first difference.

str_len returns the index of the first occurrance of \0 in string.

str_start returns 1 if b is a prefix of a, 0 otherwise.

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