Content-type: text/html Manpage of string utilities

string utilities

Section: C Library Functions (3)
Updated: libutils.h
Index Return to Main Contents
 

NAME

string utilities - a collection of extensions to the standard C library string manipulation tools, adding case insensitive string comparrisons, conversion to upper or lower case, extraction of string prefixes and suffixes, and matching to a list of strings.  

VERSION

This manpage refers to version 1.0 of libutils.  

SYNOPSIS

int strmatch(char *s, char **m)

int strcasematch(char *s, char **m)

char *strlower(char *s)

char *strupper(char *s)

char *strnprefix(char *s, char *pf, int len, char *sep)

char *strnsuffix(char *s, char *sf, int len, char *sep)

char **str2ary(char *str, char *delims)

char **xstr2ary(char *str, char *delims, char *quotes, char *escapes)

char *ary2str(char **ary, char *delim)

char *ary2xstr(char **ary, char *delims, char *quotes, char *escapes)  

DESCRIPTION

The strmatch and strcasematch functions try to match a string against an array of match strings. If a match is found the index of the match string is returned, otherwise a negative value is returned. The strmatch function performs the matches using the standard strcmp function and is case-sensitive. The strcasematch uses the strcasecmp function found and is not case-sensitive.

NOTE: The array of match strings must be terminated by a NULL pointer or the functions will overrun the end of the array.

The strlower and strupper routines convert strings to upper or lower case in place. Both routines return a pointer to the converted string.

The strnprefix and strnsuffix routes will extract a leading or trailing portion of a string set off from the rest of the string by one of a set of separation characters.

The str2ary, xstr2ary, ary2str, and ary2xstr routines will convert between a delimited string and an array of strings. The xstr allow the component strings to be enclosed in user defined quote characters and with user defined escape characters.

The quotes parameter in xstr2ary and ary2xstr must be formatted as pairs of quote characters. The first element of the pair opens a quoted string, the second closes the string. This means that if you want to use quotes that don't have different opening and closing forms then you must have a pair of the same character in the quotes string.  

FILES

The declarations for these routines can be found in the utils.h header file. The routines themselves are contained in the libutils library.  

AUTHOR

Jeffrey S. Dutky <dutky@bellatlantic.net>


 

Index

NAME
VERSION
SYNOPSIS
DESCRIPTION
FILES
AUTHOR

This document was created by man2html, using the manual pages.
Time: 03:49:37 GMT, July 12, 2001