Introduction
Introduction Statistics Contact Development Disclaimer Help
fmtfd.c - 9base - revived minimalist port of Plan 9 userland to Unix
git clone git://git.suckless.org/9base
Log
Files
Refs
README
LICENSE
---
fmtfd.c (676B)
---
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 /*
9 * public routine for final flush of a formatting buffer
10 * to a file descriptor; returns total char count.
11 */
12 int
13 fmtfdflush(Fmt *f)
14 {
15 if(__fmtFdFlush(f) <= 0)
16 return -1;
17 return f->nfmt;
18 }
19
20 /*
21 * initialize an output buffer for buffered printing
22 */
23 int
24 fmtfdinit(Fmt *f, int fd, char *buf, int size)
25 {
26 f->runes = 0;
27 f->start = buf;
28 f->to = buf;
29 f->stop = buf + size;
30 f->flush = __fmtFdFlush;
31 f->farg = (void*)(uintptr_t)fd;
32 f->flags = 0;
33 f->nfmt = 0;
34 fmtlocaleinit(f, nil, nil, nil);
35 return 0;
36 }
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.