source: trunk/minix/lib/ack/libp/wrs.c@ 15

Last change on this file since 15 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.3 KB
Line 
1/* $Header: /cvsup/minix/src/lib/ack/libp/wrs.c,v 1.1 2005/10/10 15:27:47 beng Exp $ */
2/*
3 * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 *
5 * This product is part of the Amsterdam Compiler Kit.
6 *
7 * Permission to use, sell, duplicate or disclose this software must be
8 * obtained in writing. Requests for such permissions may be sent to
9 *
10 * Dr. Andrew S. Tanenbaum
11 * Wiskundig Seminarium
12 * Vrije Universiteit
13 * Postbox 7161
14 * 1007 MC Amsterdam
15 * The Netherlands
16 *
17 */
18
19/* Author: J.W. Stevenson */
20
21#include <pc_err.h>
22#include <pc_file.h>
23
24extern _wf();
25extern _outcpt();
26
27_wstrin(width,len,buf,f) int width,len; char *buf; struct file *f; {
28
29 _wf(f);
30 for (width -= len; width>0; width--) {
31 *f->ptr = ' ';
32 _outcpt(f);
33 }
34 while (--len >= 0) {
35 *f->ptr = *buf++;
36 _outcpt(f);
37 }
38}
39
40_wsc(w,c,f) int w; char c; struct file *f; {
41
42 if (w < 0) _trp(EWIDTH);
43 _wss(w,1,&c,f);
44}
45
46_wss(w,len,s,f) int w,len; char *s; struct file *f; {
47
48 if (w < 0 || len < 0) _trp(EWIDTH);
49 if (w < len)
50 len = w;
51 _wstrin(w,len,s,f);
52}
53
54_wrs(len,s,f) int len; char *s; struct file *f; {
55 if (len < 0) _trp(EWIDTH);
56 _wss(len,len,s,f);
57}
58
59_wsb(w,b,f) int w,b; struct file *f; {
60 if (b)
61 _wss(w,4,"true",f);
62 else
63 _wss(w,5,"false",f);
64}
65
66_wrb(b,f) int b; struct file *f; {
67 _wsb(5,b,f);
68}
Note: See TracBrowser for help on using the repository browser.