:i	static char str_bldstr_sccs_id[] = "%W% %G%";
#include "V_M_UC.h"
#include "str.h"
#include "sys_varargs.h"
#include "mem.h"

#if USE_varargs

/*++ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* CALL:
*   Blk * str_bldstr(va_alist)
*   	va_dcl
*
* DESCRIPTION:
*
* Make a string structure from a list of null-terminated strings.
* The list must be terminated by a null pointer.
*
* AUTHOR: John Chambers.
*
* CHANGES:
++*/
FCT Blk * str_bldstr(va_alist)
	va_dcl
{	int  i, n;
	Blk *dst=0;		/* Output string */
	char* cp;
	va_list ap;
:f	Fenter("str_bldstr");
:8	V6 "Called." D;
	va_start(ap);
	dst = va_arg(ap,Blk*);
:8	V6 "dst:%08X [%08X,%d,%d,%08X]",dst,FldsBP(dst) D;
	dst->l = 0;
	while (cp = va_arg(ap,char*)) {
:8		V6 "Append %s to %s",Dspp(cp),DspSP(dst) D;
		if (!AppBlk(dst,cp,-1)) Fail;
:8		V6 "dst=%s",DspSP(dst) D;
	}
	va_end(ap);
done:
:8	V6 "Return %08lX %s",dst,DspSP(dst) D;
:f	Fexit;
	return dst;
fail:
:f	Fexit;
	return 0;
}
#else
	int has_varargs = 0;
#endif
