shithub: riscv

ref: c0a7fbea1f61b1d77a09d612b85c74fd6c673b7c
dir: /sys/src/libgeometry/fmt.c/

View raw version
#include <u.h>
#include <libc.h>
#include <geometry.h>

int
vfmt(Fmt *f)
{
	Point2 p;

	p = va_arg(f->args, Point2);
	return fmtprint(f, "[%g %g %g]", p.x, p.y, p.w);
}

int
Vfmt(Fmt *f)
{
	Point3 p;

	p = va_arg(f->args, Point3);
	return fmtprint(f, "[%g %g %g %g]", p.x, p.y, p.z, p.w);
}

void
GEOMfmtinstall(void)
{
	fmtinstall('v', vfmt);
	fmtinstall('V', Vfmt);
}