
/*     
 *      FILE
 *     	rules/linf/rstrings.l
 *     
 *      DESCRIPTION
 *     	Routines to create the desired plan for processing a query
 *     
 */
defvar (_RCS_rstrings_,"$Header: rstrings.l,v 1.2 89/02/21 01:24:06 hirohama Exp $");

/*     
 *      EXPORTS
 *     	string-c-to-l
 *     	Make-String
 */

/*    
 *     XXX ???
 *    
 */
LispValue
string_c_to_l (c_strc_str)
LispValue c_str ;
{
	/* XXX - prog form, maybe incorrect */
	LispValue length = LispNil;
	LispValue res = LispNil;
	length = c_length (c_str);
	;
	res = Make_String (1,length,"x");
	;
	c_copystring (res,c_str);
	return (res);
	;
}

/*    (defun Make-String (current-length wanted-length string)
 *      (cond
 *       ((lessp wanted-length current-length) string)
 *       (t (Make-String (* 2 current-length) wanted-length
 *    		   (strcat string string)))))
 */
LispValue
Make_String (current_lengthcurrent_length,wanted_lengthwanted_length,stringxstringx)
LispValue current_length,wanted_length,stringx ;
{
	if ( lessp (wanted_length,current_length) ) {
		stringx;
	} else {
		Make_String (2 * current_length,wanted_length,strcat (stringx,stringx));
	};

}
