hbase

heirloom base
git clone git://git.2f30.org/hbase
Log | Files | Refs | README

runevseprint.c (505B)


      1 /* Copyright (c) 2002-2006 Lucent Technologies; see LICENSE */
      2 #include <stdarg.h>
      3 #include <string.h>
      4 #include "plan9.h"
      5 #include "fmt.h"
      6 #include "fmtdef.h"
      7 
      8 Rune*
      9 runevseprint(Rune *buf, Rune *e, char *fmt, va_list args)
     10 {
     11 	Fmt f;
     12 
     13 	if(e <= buf)
     14 		return nil;
     15 	f.runes = 1;
     16 	f.start = buf;
     17 	f.to = buf;
     18 	f.stop = e - 1;
     19 	f.flush = nil;
     20 	f.farg = nil;
     21 	f.nfmt = 0;
     22 	VA_COPY(f.args,args);
     23 	fmtlocaleinit(&f, nil, nil, nil);
     24 	dofmt(&f, fmt);
     25 	VA_END(f.args);
     26 	*(Rune*)f.to = '\0';
     27 	return (Rune*)f.to;
     28 }
     29