software/MFrame/commonFunctions/commonFunctions.cpp
/*-----------------------------------------------------
 * function: 	C2Pas
 * input:		A C string and a pointer to the Pascal one
 * return:		A pointer to the Pascal string
 * description:	Converts a C (\0 terminated) string into
 *				a Pascal one (\length<string>).
 * note:		The output pointer can be the same with 
 *				input one.
 * by:			Emy Parparita
 *-----------------------------------------------------*/
C2Pas
input:               A C string and a pointer to the Pascal one
return:              A pointer to the Pascal string
description: Converts a C (\0 terminated) string into
a Pascal one (\length).
note:                The output pointer can be the same with
input one.
by:                  Emy Parparita
C2Pas input : A C string and a pointer to the Pascal one return : A pointer to the Pascal string description : Converts a C ( \ 0 terminated ) string into a Pascal one ( \ length ) . note : The output pointer can be the same with input one . by : Emy Parparita
char* C2Pas(char* cStr, Str255 pStr)
{
	register int	k,
					l;
	for (k = 0; cStr[k]  && k < 255; k++){;} 
	for (l = k; k > 0; k--) pStr[k] = cStr[k - 1];
	pStr[0] = l;
	return((char*)pStr);
}
char * C2Pas ( char * cStr , Str255 pStr ) { register int k , l ; for ( k = 0 ; cStr [ k ] && k < 255 ; k ++ ) { ; } for ( l = k ; k > 0 ; k -- ) pStr [ k ] = cStr [ k - 1 ] ; pStr [ 0 ] = l ; return ( ( char * ) pStr ) ; }
function:    C2Pas
 input:               A C string and a pointer to the Pascal one
 return:              A pointer to the Pascal string
 description: Converts a C (\0 terminated) string into
                              a Pascal one (\length<string>).
function : C2Pas input : A C string and a pointer to the Pascal one return : A pointer to the Pascal string description : Converts a C ( \ 0 terminated ) string into a Pascal one ( \ length<string > ) .
/* Pascal string lenght <= 255 */