<!DOCTYPE File PUBLIC "-//Liam Quin//DTD C API Documentation v1.1//EN" "doc.dtd"><File>
<Entry dir="liblqutil">
<Function File="../../src/liblqutil/revstr.c">
<Name>LQU_ReverseString</Name>
<Class>Utilities/Strings
<Purpose>
<P>Reverses the bytes in the given string; if `type' is even,
the individual whitespace-delimited words are reversed in place;
if type is even, he entire string is reveresed.  The process is
repeated with (type - 1) until type is zero.  Hence, a reverse type
of zero does nothing, and a reverse type of one reverses the string in
place; a reverse type of 2 will reverse the order of the words in
the string; a reverse type of 3 is the same as a reverse type of one,
and a reverse type of 4 leaves the string in place.  Values greater
than two are thus pointless, but are allowed for convenience.
<Returns>
the given start pointer; the string is reversed in place.
<Notes>
<P>The string must be in read-write memory; to reverse a string
that was a manifest constant at compile time, you must first copy
it into a dynamically allocated buffer.
<P>This function is used by lqkwic, which contains some examples.
</Notes>
<Errors>
An internal error (always fatal) is produced if either start or
end is a null pointer, or if end < start (implying a string of
negative length), or if the type argument is outside the range
from zero to eight inclusive.
</Errors>
</Function>
<Decl>
API char *
LQU_ReverseString(start, end, type)
    char *start;
    char *end;
    int type;
</Decl>
</Entry>
