sops.c - string manipulation functions
Version Tag $Id: sops.c,v 1.15 2006/02/06 19:55:47 db60 Exp $
long cistrcmp(const char *s1, const char *s2);
Compares two strings in a case-independent manner. The strings may have the same or different length. (Strings of nonequal length are always considered different from each other.)
The strings may overlap in memory or occupy the same memory.
Pointer to the first text character of one of the strings to be compared.
Pointer to the first text character of the other string to be compared.
Returns 0 if the string are the same or nonzero if different.
char *nextnonwspc(const char *string);
Finds the next non-white-space text character in a string, if any.
Pointer to the first character in the string in question.
Pointer to the first non-white-space character in the string, or
NULL
if all characters in the string are white space.
char *salloc(long len, const char *msg);
Allocates dynamic heap memory for a string. One may later free this
memory using the standard library function free()
. The new memory is
not initialized.
Length of the string for which memory is being allocated, excluding the
terminating '\0'
. len
must be positive or zero.
Pointer to the first character of a string describing the object being
allocated for. On failure, salloc()
will crash with message 'out of
memory: cannot allocate for ' followed by this string.
Pointer to the first character of the newly-allocated memory.
char *supper(char *s);
Convert a string to upper case.
Pointer to first text character in the string to be converted.
Returns s
.