00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 }