merge the formfield patch from ooo-build
[ooovba.git] / dmake / unix / sysvr1 / vfprintf.c
blob55e4d36640855e21636a29efcf764e44159da653
1 /* From:
2 * John Limpert johnl@gronk.UUCP uunet!n3dmc!gronk!johnl
3 */
5 #include <stdio.h>
6 #include <varargs.h>
8 #ifndef BUFSIZ
9 #include <stdio.h>
10 #endif
12 #ifndef va_dcl
13 #include <varargs.h>
14 #endif
16 int
17 vsprintf(str, fmt, ap)
18 char *str, *fmt;
19 va_list ap;
21 FILE f;
22 int len;
24 f._flag = _IOWRT+_IOMYBUF;
25 f._ptr = (char *)str; /* My copy of BSD stdio.h has this as (char *)
26 * with a comment that it should be
27 * (unsigned char *). Since this code is
28 * intended for use on a vanilla BSD system,
29 * we'll stick with (char *) for now.
31 f._cnt = 32767;
32 len = _doprnt(fmt, ap, &f);
33 *f._ptr = 0;
34 return (len);
37 int
38 vfprintf(iop, fmt, ap)
39 FILE *iop;
40 char *fmt;
41 va_list ap;
43 int len;
45 len = _doprnt(fmt, ap, iop);
46 return (ferror(iop) ? EOF : len);
49 int
50 vprintf(fmt, ap)
51 char *fmt;
52 va_list ap;
54 int len;
56 len = _doprnt(fmt, ap, stdout);
57 return (ferror(stdout) ? EOF : len);