1994-06-24 14:02:31 +00:00
|
|
|
/* $Id$ */
|
1984-07-20 10:44:57 +00:00
|
|
|
/*
|
|
|
|
* (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
|
|
|
|
*
|
|
|
|
* This product is part of the Amsterdam Compiler Kit.
|
|
|
|
*
|
|
|
|
* Permission to use, sell, duplicate or disclose this software must be
|
|
|
|
* obtained in writing. Requests for such permissions may be sent to
|
|
|
|
*
|
|
|
|
* Dr. Andrew S. Tanenbaum
|
|
|
|
* Wiskundig Seminarium
|
|
|
|
* Vrije Universiteit
|
|
|
|
* Postbox 7161
|
|
|
|
* 1007 MC Amsterdam
|
|
|
|
* The Netherlands
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Author: J.W. Stevenson */
|
|
|
|
|
2018-06-17 13:54:18 +00:00
|
|
|
#include "pc.h"
|
1984-07-20 10:44:57 +00:00
|
|
|
|
2018-06-17 13:54:18 +00:00
|
|
|
void _wstrin(int width, int len, char* buf, struct file* f)
|
|
|
|
{
|
1984-07-20 10:44:57 +00:00
|
|
|
_wf(f);
|
2018-06-17 13:54:18 +00:00
|
|
|
for (width -= len; width > 0; width--)
|
|
|
|
{
|
1984-07-20 10:44:57 +00:00
|
|
|
*f->ptr = ' ';
|
|
|
|
_outcpt(f);
|
|
|
|
}
|
2018-06-17 13:54:18 +00:00
|
|
|
while (--len >= 0)
|
|
|
|
{
|
1984-07-20 10:44:57 +00:00
|
|
|
*f->ptr = *buf++;
|
|
|
|
_outcpt(f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-17 13:54:18 +00:00
|
|
|
void _wsc(int w, char c, struct file* f)
|
|
|
|
{
|
|
|
|
if (w < 0)
|
|
|
|
_trp(EWIDTH);
|
|
|
|
_wss(w, 1, &c, f);
|
1984-07-20 10:44:57 +00:00
|
|
|
}
|
|
|
|
|
2018-06-17 13:54:18 +00:00
|
|
|
void _wss(int w, int len, char* s, struct file* f)
|
|
|
|
{
|
|
|
|
if (w < 0 || len < 0)
|
|
|
|
_trp(EWIDTH);
|
1984-07-20 10:44:57 +00:00
|
|
|
if (w < len)
|
|
|
|
len = w;
|
2018-06-17 13:54:18 +00:00
|
|
|
_wstrin(w, len, s, f);
|
1984-07-20 10:44:57 +00:00
|
|
|
}
|
|
|
|
|
2018-06-17 13:54:18 +00:00
|
|
|
void _wrs(int len, char* s, struct file* f)
|
|
|
|
{
|
|
|
|
if (len < 0)
|
|
|
|
_trp(EWIDTH);
|
|
|
|
_wss(len, len, s, f);
|
1984-07-20 10:44:57 +00:00
|
|
|
}
|
|
|
|
|
2018-06-17 13:54:18 +00:00
|
|
|
void _wsb(int w, int b, struct file* f)
|
|
|
|
{
|
1984-07-20 10:44:57 +00:00
|
|
|
if (b)
|
2018-06-17 13:54:18 +00:00
|
|
|
_wss(w, 4, "true", f);
|
1984-07-20 10:44:57 +00:00
|
|
|
else
|
2018-06-17 13:54:18 +00:00
|
|
|
_wss(w, 5, "false", f);
|
1984-07-20 10:44:57 +00:00
|
|
|
}
|
|
|
|
|
2018-06-17 13:54:18 +00:00
|
|
|
void _wrb(int b, struct file* f)
|
|
|
|
{
|
|
|
|
_wsb(5, b, f);
|
1984-07-20 10:44:57 +00:00
|
|
|
}
|