#-h- msplit.r 1701 asc 27-apr-81 12:49:54 [002,100] #-h- defns 68 asc 27-apr-81 12:49:19 [002,100] define(MAXHEADERS,50) # this value must jive with msg.w/msg.r/defns #-h- main 816 asc 27-apr-81 12:49:20 [002,100] DRIVER(msplit) character ch, cl, root(FILENAMESIZE), file(FILENAMESIZE) integer i, verbos, status integer getarg, equal, cpymsg string dfroot "tmsg" string minusv "-v" data ch/LETA/ data cl/LETA/ call query("usage: msplit LETZ) { cl = LETA ch = ch + 1 } } until (status == EOF) DRETURN end #-h- cpymsg 631 asc 27-apr-81 12:49:21 [002,100] integer function cpymsg(n, file) integer n, out, i, status integer create, getlin, equal linepointer temp character file(FILENAMESIZE), hdrpat(4), buf(MAXLINE) data hdrpat/1, 1, NEWLINE, EOS/ out = create(file, WRITE) if (out == ERR) call cant(file) i = 0 repeat { call markl(STDIN, temp) status = getlin(buf, STDIN) if (status == EOF) break if (equal(buf, hdrpat) == YES) { i = i + 1 if (i > n) { call seek(temp, STDIN) # backup one line status = n # n messages copied break } } call putlin(buf, out) } call close(out) cpymsg = status return end #-h- msplit.rof 974 asc 08-may-81 16:53:10 [002,100] .in 5 .rm 75 .pl 60 .he 'MSPLIT'1/11/79'MSPLIT' .fo //-#-/ .bp 1 NAME .in +3 msplit - utility for salvaging message files .ti -3 SYNOPSIS msplit