File: pas-diffs

package info (click to toggle)
sharutils 1%3A4.2-6
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,436 kB
  • ctags: 587
  • sloc: ansic: 6,313; perl: 1,742; makefile: 563; sh: 495; pascal: 293; sed: 93
file content (144 lines) | stat: -rw-r--r-- 4,786 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
diff -u 870527-ibm-pc/README 861030-darmon/README
--- 870527-ibm-pc/README	Wed May 27 00:12:39 1987
+++ 861030-darmon/README	Sat Feb 11 20:45:04 1995
@@ -1,20 +1,23 @@
-Here are versions of uuencode and uudecode that will work on an IBM
-PC.  There is a version for Turbo Pascal and one for Microsoft C.
-Porting them into other machines, languages or dialects should not
-pose a large problem.
+Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site hoptoad.uucp
+From: darmon@polaris.UUCP (Pierre Darmon)
+Newsgroups: net.sources
+Subject: Modified Turbo Pascal uudecode/encode. More user-friendly.
+Date: 30 Oct 86 01:12:40 GMT
+Date-Received: 
+Reply-To: darmon@polaris.UUCP (Pierre Darmon)
+Organization: IBM Research, Yorktown Heights, N.Y.
 
-Sorry about the lack of documentation, but the programs are easy to
-use, so you should not have a problem.  I don't know why a UNIX
-site would not have these in the first place, but at least your
-manual should tell you how to use them.  If you are not using UNIX
-at all, you have my sympathy.
+The following are the Turbo Pascal source files for uudecode and uuencode,
+modified from the net posting to display the remaining bytes to be processed,
+instead of filling up the screen with periods. It also displays the percentage
+left. See my previous posting to net.micro,net.micro.pc and net.sources for
+details.
 
-The Pascal programs' author is unknown.  The C programs were
-provided by Don Kneller.
+Enjoy!
 
-Tom Reingold
-Rockefeller University
-New York City
-UUCP:    {seismo | harvard | ihnp4}!cmcl2!rna!rocky2!reintom
-BITNET:  REINTOM@ROCKVAX
-ARPANET: reintom@rockefeller.arpa
+
+-- 
+
+Pierre Darmon, IBM Thomas J. Watson Research Center.                        
+.....seismo!philabs!polaris!darmon.
+darmon.yktvmz.ibm@csnet-relay  
Only in 861030-darmon: diffs
diff -u 870527-ibm-pc/uudecode.pas 861030-darmon/uudecode.pas
--- 870527-ibm-pc/uudecode.pas	Wed May 27 00:12:39 1987
+++ 861030-darmon/uudecode.pas	Sat Feb 11 20:44:32 1995
@@ -6,9 +6,11 @@
   TYPE string80 = string[80];
 
   VAR infile: text;
+      fi    : file of byte;
       outfile: file of byte;
       lineNum: integer;
       line: string80;
+      size,remaining :real;
 
   procedure Abort(message: string80);
 
@@ -23,8 +25,11 @@
 
     begin {NextLine}
       LineNum := succ(LineNum);
-      write('.');
-      readln(infile, s)
+      {write('.');}
+      readln(infile, s);
+      remaining:=remaining-length(s)-2;  {-2 is for CR/LF}
+      write('bytes remaining: ',remaining:7:0,' (',
+            remaining/size*100.0:3:0,'%)',chr(13));
     end; {NextLine}
 
   procedure Init;
@@ -43,7 +48,11 @@
         reset(infile);
         {$i+}
         if IOresult > 0 then abort (concat('Can''t open ', infilename));
-        writeln ('Decoding ', infilename)
+        writeln ('Decoding ', infilename);
+        assign(fi,infilename); reset(fi);
+        size:=FileSize(fi); close(fi);
+        if size < 0 then size:=size+65536.0;
+        remaining:=size;
       end; {GetInFile}
 
     procedure GetOutFile;
@@ -158,7 +167,7 @@
           then abort('Illegal character in line.');
 {        write(line[lineindex]:2);}
         if line[lineindex] = '`' then nextch := ' '
-                                  else nextch := line[lineIndex]
+                                 else nextch := line[lineIndex]
       end; {nextch}
 
     procedure DecodeByte;
diff -u 870527-ibm-pc/uuencode.pas 861030-darmon/uuencode.pas
--- 870527-ibm-pc/uuencode.pas	Wed May 27 00:12:40 1987
+++ 861030-darmon/uuencode.pas	Sat Feb 11 20:44:51 1995
@@ -18,6 +18,7 @@
       line: array [0..59] of char;
       hunk: array [0..2] of byte;
       chars: array [0..3] of byte;
+      size,remaining :real;
 
 {  procedure debug;
 
@@ -70,6 +71,9 @@
         reset (infile);
         {$i+}
         if IOResult > 0 then abort (concat ('Can''t open file ', infilename));
+        size:=FileSize(infile);
+        if size < 0 then size:=size+65536.0;
+        remaining:=size;
         write('Uuencoding file ', infilename);
 
         i := pos('.', infilename);
@@ -131,7 +135,9 @@
       end; {writeout}
 
     begin {FlushLine}
-      write ('.');
+      {write ('.');}
+      write('bytes remaining: ',remaining:7:0,' (',
+            remaining/size*100.0:3:0,'%)',chr(13));
       writeout(chr(bytesInLine + offset));
       for i := 0 to pred(lineLength) do
         writeout(line[i]);
@@ -167,6 +173,7 @@
     begin {encode1};
       if numbytes = bytesperhunk then flushhunk;
       read (infile, hunk[numbytes]);
+      remaining:=remaining-1;
       numbytes := succ(numbytes)
     end; {encode1}
 
@@ -190,5 +197,6 @@
   begin {uuencode}
     init;
     while not eof (infile) do encode1;
-    terminate
+    terminate;
+    writeln;
   end. {uuencode}