wrl.c

Go to the documentation of this file.
00001 /* $Header: /opt/proj/minix/cvsroot/src/lib/ack/libp/wrl.c,v 1.1 2005/10/10 15:27:47 beng Exp $ */
00002 /*
00003  * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
00004  *
00005  *          This product is part of the Amsterdam Compiler Kit.
00006  *
00007  * Permission to use, sell, duplicate or disclose this software must be
00008  * obtained in writing. Requests for such permissions may be sent to
00009  *
00010  *      Dr. Andrew S. Tanenbaum
00011  *      Wiskundig Seminarium
00012  *      Vrije Universiteit
00013  *      Postbox 7161
00014  *      1007 MC Amsterdam
00015  *      The Netherlands
00016  *
00017  */
00018 
00019 /* Author: J.W. Stevenson */
00020 
00021 #include        <pc_err.h>
00022 #include        <pc_file.h>
00023 
00024 extern          _wstrin();
00025 
00026 #define MAXNEGLONG      -2147483648
00027 
00028 _wsl(w,l,f) int w; long l; struct file *f; {
00029         char *p,c; long j; char buf[11];
00030 
00031         if (w < 0) _trp(EWIDTH);
00032         p = &buf[11];
00033         if ((j=l) < 0) {
00034                 if (l == MAXNEGLONG) {
00035                         _wstrin(w,11,"-2147483648",f);
00036                         return;
00037                 }
00038                 j = -j;
00039         }
00040         do {
00041                 c = j%10;
00042                 *--p = c + '0';
00043         } while (j /= 10);
00044         if (l<0)
00045                 *--p = '-';
00046         _wstrin(w,(int)(&buf[11]-p),p,f);
00047 }
00048 
00049 _wrl(l,f) long l; struct file *f; {
00050         _wsl(11,l,f);
00051 }

Generated on Fri Apr 14 22:57:25 2006 for minix by  doxygen 1.4.6