home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d183
/
pcq.lha
/
PCQ
/
Include
/
StringLib.i
< prev
Wrap
Text File
|
1989-02-26
|
2KB
|
56 lines
{ A select few string routines- the ones I needed for the compiler }
Function streq(s1, s2 : String): Boolean;
forward;
{ returns true if the strings are equal, false otherwise.
Because I needed it for the compiler, this routine is
case insensitive. }
Function strcmp(s1, s2 : String): Integer;
forward;
{ returns 0 if the strings are equal, -1 if s1 is < s2, and 1 if
s1 > s2. Again this is case insensitive. }
Function strlen(s : String): Integer;
forward;
{ returns the length of the string. Remember that the string will
require that number plus one (for the zero termination byte) to
for storage }
Procedure strcpy(s1, s2 : string);
forward;
{ copies s1 into s2. Both of these must be allocated already, and the
routine does not do any length checking, so you'll have to use
AllocString() and strlen(), probably in reverse order }
Procedure strcat(s1, s2 : string);
forward;
{ concatenates s2 on the end of s1. s1 is assumed to be big enough }
Function AllocString(s : Integer): String;
forward;
{ Allocates memory for a string of the given size. This uses the
run time library's new() routine, so if you forget to free the
string you'll be OK }
Procedure FreeString(s : String);
forward;
{ Frees the memory for the string }
Function raise(c : Char) : Char;
forward;
{ if c is in [a..z] it returns the uppercase letter, otherwise it
just returns the same character. OK, it's not really a string
function, but who's counting. It's here because it's used internally
by streq and strcmp to make those functions case insensitive. }