xref: /plan9-contrib/sys/src/ape/lib/fmt/fmtprint.c (revision 781103c4074deb8af160e8a0da2742ba6b29dc2b)
140ef9009SDavid du Colombier /*
240ef9009SDavid du Colombier  * The authors of this software are Rob Pike and Ken Thompson.
340ef9009SDavid du Colombier  *              Copyright (c) 2002 by Lucent Technologies.
440ef9009SDavid du Colombier  * Permission to use, copy, modify, and distribute this software for any
540ef9009SDavid du Colombier  * purpose without fee is hereby granted, provided that this entire notice
640ef9009SDavid du Colombier  * is included in all copies of any software which is or includes a copy
740ef9009SDavid du Colombier  * or modification of this software and in all copies of the supporting
840ef9009SDavid du Colombier  * documentation for such software.
940ef9009SDavid du Colombier  * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
1040ef9009SDavid du Colombier  * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY
1140ef9009SDavid du Colombier  * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
1240ef9009SDavid du Colombier  * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
1340ef9009SDavid du Colombier  */
1440ef9009SDavid du Colombier #include <stdarg.h>
1540ef9009SDavid du Colombier #include <string.h>
1640ef9009SDavid du Colombier #include "utf.h"
1740ef9009SDavid du Colombier #include "fmt.h"
1840ef9009SDavid du Colombier #include "fmtdef.h"
1940ef9009SDavid du Colombier 
2040ef9009SDavid du Colombier 
2140ef9009SDavid du Colombier /*
2240ef9009SDavid du Colombier  * format a string into the output buffer
2353ff6c4dSDavid du Colombier  * designed for formats which themselves call fmt
2440ef9009SDavid du Colombier  */
2540ef9009SDavid du Colombier int
fmtprint(Fmt * f,char * fmt,...)2640ef9009SDavid du Colombier fmtprint(Fmt *f, char *fmt, ...)
2740ef9009SDavid du Colombier {
2840ef9009SDavid du Colombier 	va_list va;
2940ef9009SDavid du Colombier 	int n;
3040ef9009SDavid du Colombier 
31*781103c4SDavid du Colombier 	va_start(va, fmt);
3253ff6c4dSDavid du Colombier 	n = fmtvprint(f, fmt, va);
33*781103c4SDavid du Colombier 	va_end(va);
3440ef9009SDavid du Colombier 	return n;
3540ef9009SDavid du Colombier }
3640ef9009SDavid du Colombier 
37