/***
* Char * strcpy (DST, Src)-copy one string over another
*
* Purpose:
* Copies the string SRC into the spot specified
* DEST; assumes enough room.
*
* Entry:
* Char * DST-string over which "src" is to be copied
* Const char * Src-string to be copied over "DST"
*
* Exit:
* The address of "DST"
*
* Exceptions:
**************************************** ***************************************/
Char * strcpy (char * DST, const char * SRC)
{
Char * CP = DST;
While (* CP ++ = * SRC ++)
;/* Copy SRC over DST */
Return (DST );
}
/***
* Char * strcat (DST, Src)-concatenate (append) one string to another
*
* Purpose:
* Concatenates SRC onto the end of DeST. Assumes enough
* Space in DeST.
*
* Entry:
* Char * DST-string to which "src" is to be appended
* Const char * Src-string to be appended to the end of "DST"
*
* Exit:
* The address of "DST"
*
* Exceptions:
*
**************************************** ***************************************/
Char * strcat (char * DST, const char * SRC)
{
Char * CP = DST;
While (* CP)
CP ++;/* Find end of DST */
While (* CP ++ = * SRC ++);/* Copy SRC to end of DST */
Return (DST);/* return DST */
}
/***
* Strcmp-compare two strings, returning less than, equal to, or greater
*
* Purpose:
* Strcmp compares two strings and returns an integer
* To indicate whether the first is less than the second, the two are
* Equal, or whether the first is greater than the second.
*
* Comparison is done byte by byte on an unsigned basis, which is
* Say That null (0) is less than any other character (1-255 ).
*
* Entry:
* Const char * Src-string for left-hand side of comparison
* Const char * DST-string for right-hand side of comparison
*
* Exit:
* Returns-1 If SRC <DST
* Returns 0 if src = DST
* Returns + 1 If SRC> DST
*
* Exceptions:
*
**************************************** ***************************************/
Int strcmp (const char * SRC, const char * DST)
{
Int ret = 0;
While (! (Ret = * (unsigned char *) Src-* (unsigned char *) DST) & * DST)
++ SRC, ++ DST;
If (Ret <0)
Ret =-1;
Else if (Ret> 0)
Ret = 1;
Return (RET );
}