home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / dump.lzh / dump
Encoding:
Text File  |  1990-08-12  |  16.4 KB  |  711 lines

  1.  
  2. #!/bin/sh
  3. # shar:    Shell Archiver  (v1.27)
  4. #
  5. #    Run the following text with /bin/sh to create:
  6. #      bufio.pas
  7. #      ngdump.pas
  8. #      readme
  9. #
  10. sed 's/^X//' << 'SHAR_EOF' > bufio.pas &&
  11. X{$R+,I+}
  12. X{$M 45000,0,655360}
  13. Xunit BufIO;
  14. X
  15. Xinterface
  16. X
  17. Xprocedure bread(var f:file; var buf; count:word; var result:word);
  18. Xprocedure bskip(var f:file; n:longint);
  19. Xprocedure bseek(var f:file; p:longint);
  20. Xfunction  bpos(var f:file):longint;
  21. X
  22. Ximplementation
  23. X
  24. X{$define Buffered}
  25. X
  26. X{$ifdef Buffered}
  27. X
  28. Xconst MaxFbuf = 1024;
  29. X
  30. Xvar   fbuf   : array [1..MaxFbuf] of byte;
  31. X      inbuf  : 0..MaxFbuf;
  32. X      curbuf : 1..MaxFbuf+1;
  33. X
  34. Xprocedure bread( var f:file; var buf; count:word; var result:word);
  35. Xtype ByteArray = array [1..maxint] of byte;
  36. Xvar done,n:word;
  37. X    abuf : ByteArray absolute buf;
  38. Xbegin
  39. X  result := 0;
  40. X  if (count > inbuf) or (inbuf = 0) then begin
  41. X     if (inbuf > 0)
  42. X      then move(fbuf[curbuf], buf, inbuf);
  43. X     done := inbuf;
  44. X     while (done < count) do begin
  45. X        blockread(f, fbuf, MaxFbuf, result);
  46. X        inbuf := result;
  47. X        if (inbuf < 1) then begin
  48. X{           writeln('BufIO.bread: unexpected eof.'); }
  49. X           FillChar(buf, count, 0);
  50. X           result := 0;
  51. X           exit;
  52. X        end;
  53. X        curbuf := 1;
  54. X        n := count - done;
  55. X        if (n > inbuf) then n := inbuf;
  56. X        move(fbuf[curbuf], abuf[done+1], n);
  57. X        inc(done, n);
  58. X        dec(inbuf, n);
  59. X        inc(curbuf, n);
  60. X     end;
  61. X  end
  62. X  else begin
  63. X     move(fbuf[curbuf], buf, count);
  64. X     dec(inbuf, count);
  65. X     inc(curbuf);
  66. X  end;
  67. X  result := count;
  68. Xend;
  69. X
  70. Xprocedure bseek(var f:file; p:longint);
  71. Xbegin
  72. X  seek(f, p);
  73. X  inbuf := 0; curbuf := 1;       { flush buffer }
  74. Xend;
  75. X
  76. Xfunction bpos(var f:file):longint;
  77. Xbegin
  78. X  bpos := filepos(f) - inbuf;
  79. Xend;
  80. X
  81. Xprocedure bskip(var f:file; n:longint);
  82. Xbegin
  83. X  if (n < inbuf) then begin
  84. X     dec(inbuf, n);
  85. X     inc(curbuf, n);
  86. X  end
  87. X  else begin
  88. X     bseek(f, bpos(f)+n);
  89. X  end;
  90. Xend;
  91. X
  92. X{$else}
  93. X
  94. Xprocedure bread( var f:file; var buf; count:word; var result:word);
  95. Xbegin
  96. X  blockread(f, buf, count, result);
  97. X  if (result < 1) then begin
  98. X     writeln('BufIO.bread: unexpected eof.');
  99. X  end;
  100. Xend;
  101. X
  102. Xprocedure bseek(var f:file; p:longint);
  103. Xbegin
  104. X  seek(f, p);
  105. Xend;
  106. X
  107. Xfunction bpos(var f:file):longint;
  108. Xbegin
  109. X  bpos := filepos(f);
  110. Xend;
  111. X
  112. Xprocedure bskip(var f:file; n:longint);
  113. Xbegin
  114. X  bseek(f, filepos(f)+n);
  115. Xend;
  116. X
  117. X{$endif}
  118. X
  119. X(*
  120. Xvar SaveExitProc : Pointer;
  121. X
  122. X{$F+} procedure MyExitProc; {$F-}
  123. Xbegin
  124. X  ExitProc := SaveExitProc;
  125. Xend;
  126. X*)
  127. X
  128. Xbegin
  129. X{$ifdef Buffered}
  130. X  inbuf := 0;
  131. X  curbuf := 1;
  132. X{$endif}
  133. Xend.
  134. SHAR_EOF
  135. chmod 0644 bufio.pas || echo "restore of bufio.pas fails"
  136. sed 's/^X//' << 'SHAR_EOF' > ngdump.pas &&
  137. X{$R+,I+,V-}
  138. X
  139. Xprogram ngdump;
  140. X
  141. Xuses crt, dos,
  142. X     BufIO;
  143. X
  144. Xconst progname = 'NGDUMP';
  145. X      version  = 'V1.0';
  146. X      copyright = 'Copyright 1989 J.P.Pedersen, 1990 E.v.Asperen';
  147. X
  148. X      MaxNameLen = 40;
  149. X      MaxLineLen = 160;
  150. X
  151. Xtype gentry = record                    {General entry type}
  152. X                filptr:longint;
  153. X                name:string[MaxNameLen];
  154. X              end;
  155. X     line   = string[MaxLineLen];
  156. X
  157. Xvar
  158. X     mennu:array[0..3,0..8] of gentry;  {Buffer to hold variable part of guide menu structure}
  159. X     itemlist:array[0..3] of byte;               {Menu structure info}
  160. X     errorinfo:array[3..6] of string[14];        {Buffer for error messages}
  161. X     f:file;                                                                                    {The guide file}
  162. X     propath,homedir,streng:string;              {String variables, mostly for path and file use}
  163. X     erro,
  164. X        seealsonum,
  165. X        menuantal,
  166. X        menunr : byte;                           {Byte variables}
  167. X     entrytype : (et_misc, et_short, et_long);
  168. X     guidename : line;
  169. X
  170. Xconst MaxLevel = 10;
  171. X      OutBufSize   = 4096;
  172. X
  173. Xtype FileBuffer = array [1..OutBufSize] of byte;
  174. X
  175. Xvar  outf    : array [1..MaxLevel] of text;
  176. X     flevel  : 1..MaxLevel;
  177. X     OutBuf  : array [1..MaxLevel] of ^FileBuffer;
  178. X     Nfiles  : word;
  179. X     numentries : longint;
  180. X
  181. X
  182. X
  183. Xprocedure threenitvars;                 {Initialize variables}
  184. Xbegin
  185. X    menunr := 0;
  186. Xend;
  187. X
  188. Xprocedure twonitvars;                   {Initialize variables}
  189. Xbegin
  190. X    threenitvars;
  191. Xend;
  192. X
  193. Xprocedure initvars;                     {Initialize variables}
  194. Xvar str5:string;
  195. Xbegin
  196. X    twonitvars;
  197. X    errorinfo[3] := 'File not found';
  198. X    errorinfo[4] := 'Not an NG file';
  199. X    errorinfo[5] := 'Unexpected EOF';
  200. X    errorinfo[6] := 'Corrupted file';
  201. X    str5 := '';propath := paramstr(0);
  202. X    while (pos('\',propath) > 0) do begin
  203. X        str5 := str5+copy(propath,1,pos('\',propath));
  204. X        propath := copy(propath,pos('\',propath)+1,length(propath)-(pos('\',propath)+1));
  205. X    end;
  206. X    propath := str5;
  207. Xend;
  208. X
  209. Xvar attr, startattr : byte;
  210. X
  211. Xprocedure WriteNgString(var outf:text; s:string);
  212. Xvar i,j:byte;
  213. X    c:char;
  214. Xbegin
  215. X    i := 1;
  216. X    attr := startattr;
  217. X    while (i <= length(s)) do begin
  218. X        c := s[i];
  219. X        if c = #255 then begin
  220. X            {Expand spaces}
  221. X            inc(i);
  222. X            c := s[i];
  223. X            for j := 1 to ord(c) do begin
  224. X                write(outf, ' ');
  225. X            end;
  226. X        end
  227. X        else begin
  228. X            if (c = '!') and (i = 1) then write(outf, c);
  229. X            write(outf, c);
  230. X        end;
  231. X        inc(i);
  232. X    end;
  233. X
  234. X    writeln(outf);
  235. Xend;
  236. X
  237. Xprocedure WriteString(s:string);
  238. Xbegin
  239. X  WriteNgString(outf[flevel], s);
  240. Xend;
  241. X
  242. Xconst Fx = 10; Fy = 2;
  243. X      Gx = 10; Gy = 3;
  244. X      Mx = 10; My = 5;
  245. X      Cx = 10; Cy = 7;
  246. X      Lx = 10; Ly = 8;
  247. X      Sx = 10; Sy = 10;
  248. X
  249. X
  250. Xprocedure ShowShort(s:string);
  251. Xbegin
  252. X  gotoxy(Sx, Sy);  ClrEol;
  253. X  gotoxy(1, Sy+1); ClrEol;
  254. X  gotoxy(Sx, Sy);  WriteNgString(Output, s);
  255. Xend;
  256. X
  257. Xprocedure ShowLong(n:longint);
  258. Xbegin
  259. X  gotoxy(Lx, Ly); write(n:7);
  260. Xend;
  261. X
  262. Xprocedure ShowEndLong;
  263. Xbegin
  264. X  gotoxy(Lx, Ly); ClrEol;
  265. Xend;
  266. X
  267. Xprocedure ShowFile(s:string);
  268. Xbegin
  269. X  gotoxy(Fx, Fy); ClrEol; write(s);
  270. Xend;
  271. X
  272. Xprocedure ShowGuide(s:string);
  273. Xbegin
  274. X  gotoxy(Gx, Gy); ClrEol; write(s);
  275. Xend;
  276. X
  277. Xprocedure ShowCount(n:longint);
  278. Xbegin
  279. X  gotoxy(Cx, Cy); write(n:7);
  280. Xend;
  281. X
  282. Xprocedure ShowMenu(s:string);
  283. Xbegin
  284. X  gotoxy(Mx, My); ClrEol; WriteNgString(output, s);
  285. Xend;
  286. X
  287. Xprocedure ScreenInit;
  288. Xbegin
  289. X  ClrScr;
  290. X  gotoxy(Fx-8, Fy); write(' file:');
  291. X  gotoxy(Gx-8, Gy); write('guide:');
  292. X  gotoxy(Mx-8, My); write(' menu:');
  293. X  gotoxy(Cx-8, Cy); write('count:');
  294. X  gotoxy(Lx-8, Ly); write('lines:');
  295. X  gotoxy(Sx-8, Sy); write('entry:');
  296. Xend;
  297. X
  298. Xprocedure ScreenExit;
  299. Xbegin
  300. X  gotoxy(1, Sy+3); ClrScr;
  301. Xend;
  302. X
  303. Xprocedure Usage;                        {Write usage info}
  304. Xbegin
  305. X  writeln;
  306. X  writeln('usage:        ngdump filename');
  307. X  writeln;
  308. X  Halt(1);
  309. Xend;
  310. X
  311. Xprocedure slutlort(b:byte);  {Exit on error and display relevant error message}
  312. Xbegin
  313. X  if b > 3 then close(f);
  314. X  if b > 2 then begin
  315. X     writeln('NGDUMP ERROR #', b, ': '+errorinfo[b]+', cannot proceed');
  316. X  end;
  317. X  if b < 3 then usage;
  318. X  halt(0);
  319. Xend;
  320. X
  321. Xprocedure sllut(b:byte); {Error handler without exit, just indicating the error type}
  322. Xvar sl:byte;
  323. Xbegin
  324. X  sl := 0;
  325. X  if b > 3 then close(f);
  326. X  writeln(' ',errorinfo[b],' - Press any key');
  327. X  erro := 1;
  328. Xend;
  329. X
  330. Xfunction decrypt(b:byte):byte;          {Decrypt byte from NG format}
  331. Xbegin
  332. X(*
  333. X  if ((b mod 32)>=16) then b := b-16 else b := b+16;
  334. X  if ((b mod 16)>=8) then b := b-8 else b := b+8;
  335. X  if ((b mod 4)>=2) then b := b-2 else b := b+2;
  336. X  decrypt := b;
  337. X*)
  338. X  decrypt := b xor (16+8+2);   { this is somewhat more efficient... EVAS}
  339. Xend;
  340. X
  341. Xfunction read_byte:byte;                {Read and decrypt byte}
  342. Xvar tb:byte;
  343. X    numread:word;
  344. Xbegin
  345. X  bread(f, tb, 1, numread);
  346. X  read_byte := tb xor 26;
  347. Xend;
  348. X
  349. Xfunction read_word:word;                {Read and decrypt word}
  350. Xvar tb:byte;
  351. Xbegin
  352. X  tb := read_byte;
  353. X  read_word := word(tb) or (word(read_byte) shl 8);
  354. Xend;
  355. X
  356. Xfunction read_long:longint;             {Read and decrypt longint}
  357. Xvar tw:word;
  358. Xbegin
  359. X  tw := read_word;
  360. X  read_long := longint(tw) or (longint(read_word) shl 16);
  361. Xend;
  362. X
  363. Xtype BigStr = string[255];
  364. X
  365. Xprocedure read_string(maxlen:byte; var s:BigStr);
  366. Xvar c,j:byte;
  367. Xbegin
  368. X  j := 0;
  369. X  repeat
  370. X    c := read_byte;
  371. X    inc(j);
  372. X    s[j] := chr(c);
  373. X  until (c = 0) or (j = maxlen);
  374. X  s[0] := chr(j-1);
  375. Xend;
  376. X
  377. Xprocedure read_menu;             {Read a menu structure into the menu buffer}
  378. Xvar items,i,j:word;
  379. Xbegin
  380. X  mennu[menunr,0].filptr := bpos(f)-2;
  381. X  bskip(f, 2);
  382. X  items := read_word;
  383. X  itemlist[menunr] := items;
  384. X  bskip(f, 20);
  385. X  for i := 1 to items-1 do begin
  386. X    mennu[menunr,i].filptr := read_long;
  387. X  end;
  388. X  bskip(f, items * 8);
  389. X  for i := 0 to items-1 do begin
  390. X     with mennu[menunr, i] do begin
  391. X        read_string( 40, name );
  392. X     end;
  393. X  end;
  394. X  bskip(f, 1);
  395. Xend;
  396. X
  397. Xprocedure skip_short_long;       {Skip procedure for the initial menu bseek}
  398. Xvar length:word;
  399. Xbegin
  400. X  length := read_word;
  401. X  bskip(f, length + 22);
  402. Xend;
  403. X
  404. Xprocedure read_header(modf:byte); {Read NG file header and enter the guide name in the screen template}
  405. Xvar buf       : array[0..377] of byte;
  406. X    i,numread : word;
  407. Xbegin
  408. X  bread(f, buf, sizeof(buf), numread);
  409. X  if ((buf[0]<>ord('N')) or (buf[1]<>ord('G'))) then begin
  410. X     {If the two first characters in the file are not 'NG', the file is no guide}
  411. X     if modf = 0
  412. X      then slutlort(4)
  413. X      else sllut(4);
  414. X  end;
  415. X
  416. X  menuantal := buf[6];
  417. X  i := 0;
  418. X  repeat
  419. X    guidename[i+1] := chr(buf[i+8]);
  420. X    inc(i);
  421. X  until (buf[i+8] = 0);
  422. X  guidename[0] := chr(i);
  423. X
  424. X  ShowGuide( guidename );
  425. X  bseek(f, 378);
  426. Xend;
  427. X
  428. Xprocedure read_menus(modf:boolean);  {Initial menu bseek, indexing the whole file}
  429. Xvar id : word;
  430. Xbegin
  431. X  repeat
  432. X    id := read_word;
  433. X    if (id < 2) then begin
  434. X       skip_short_long
  435. X    end
  436. X    else if (id = 2) then begin
  437. X       read_menu;
  438. X       inc(menunr);
  439. X    end
  440. X    else if (id <> 5) then begin
  441. X       if (filesize(f) <> bpos(f)) then begin
  442. X          if (not modf)
  443. X           then slutlort(5)
  444. X           else sllut(5);        {NG file error}
  445. X       end
  446. X       else id := 5;
  447. X    end;
  448. X  until (id = 5);
  449. X
  450. X  if (menunr <> menuantal) then begin
  451. X     if (not modf)
  452. X      then slutlort(6)
  453. X      else sllut(6);                {Incomplete file}
  454. X  end;
  455. Xend;
  456. X
  457. Xfunction MakeName:Dos.PathStr;
  458. Xvar fname:Dos.PathStr;
  459. Xbegin
  460. X  inc(Nfiles);
  461. X  str(Nfiles, fname);
  462. X  MakeName := fname;
  463. Xend;
  464. X
  465. Xprocedure OpenOutFile(n:word; s:Dos.PathStr);
  466. Xbegin
  467. X  assign(outf[n], s); rewrite(outf[n]);
  468. X  SetTextBuf(outf[n], OutBuf[n]^, OutBufSize);
  469. Xend;
  470. X
  471. Xprocedure read_entry(level:byte; fp:longint); forward;
  472. X
  473. Xprocedure read_short_entry(level:byte);
  474. X{Read short entry from file and wring some information out of it}
  475. Xvar i, items: word;
  476. X    subject : line;
  477. X    entrypos, subj_pos, p0, p   : longint;
  478. Xbegin
  479. X  bskip(f, 2);
  480. X  items := read_word;
  481. X  bskip(f, 20);
  482. X  p0 := bpos(f);
  483. X  subj_pos := p0 + longint(items) * 6;
  484. X  for i := 1 to items do begin
  485. X    bskip(f, 2);
  486. X    entrypos := read_long;
  487. X    p := bpos(f);
  488. X    bseek(f, subj_pos);
  489. X    read_string( MaxLineLen, subject );
  490. X    subj_pos := bpos(f);
  491. X    write(outf[flevel], '!short:'); WriteString(subject);
  492. X{}  ShowShort(subject);
  493. X    read_entry(level+1, entrypos);
  494. X    bseek(f, p);
  495. X  end;
  496. Xend;
  497. X
  498. Xprocedure read_long_entry;
  499. X{Read long entry information}
  500. Xconst MaxSeeAlso = 20;
  501. Xvar i, linens, dlength, seealso_num : word;
  502. X    s : line;
  503. Xbegin
  504. X  bskip(f, 2);
  505. X  linens := read_word;
  506. X  dlength := read_word;
  507. X{} ShowLong(linens);
  508. X  bskip(f, 18);       { 10 + links to prev/next entry (long's) }
  509. X  for i := 1 to linens do begin
  510. X    read_string( MaxLineLen, s );
  511. X    WriteString(s);
  512. X  end;
  513. X
  514. X  if dlength <> 0 then begin            {If there are seealso entries, read them}
  515. X     seealso_num := read_word;
  516. X     { skip the offsets for the SeeAlso-items; }
  517. X     bskip(f, seealso_num * 4);
  518. X     { read the items; }
  519. X     for i := 1 to seealso_num do begin
  520. X        if i <= MaxSeeAlso then begin
  521. X           read_string( MaxLineLen, s );
  522. X           writeln(outf[flevel], '!seealso: "', s, '"');
  523. X        end;
  524. X     end;
  525. X  end;
  526. X{} ShowEndLong;
  527. Xend;
  528. X
  529. Xprocedure read_entry(level:byte; fp:longint); {Read some kind of file entry}
  530. Xvar id:word; fname:dos.pathstr;
  531. Xbegin
  532. X  inc(numentries); ShowCount(numentries);
  533. X  bseek(f, fp);
  534. X  id := read_word;
  535. X  case id of
  536. X   0: begin
  537. X        if (level > 0) then begin
  538. X           fname := MakeName;
  539. X           writeln(outf[flevel], '!file: ',fname+'.NGO');
  540. X           inc(flevel);
  541. X{$ifdef Debug}
  542. X           assign(outf[flevel], 'CON'); rewrite(outf[flevel]);
  543. X{$else}
  544. X           OpenOutFile(flevel, fname+'.DAT');
  545. X{$endif}
  546. X           read_short_entry(level);
  547. X           close(outf[flevel]);
  548. X           dec(flevel);
  549. X        end
  550. X        else begin
  551. X           read_short_entry(level);
  552. X        end;
  553. X      end;
  554. X   1: begin
  555. X(*
  556. X        if (level > 0) and (not odd(level)) then begin
  557. X           fname := MakeName;
  558. X           writeln(outf[flevel], '!long: ',fname+'.NGO');
  559. X           inc(flevel);
  560. X{$ifdef Debug}
  561. X           assign(outf[flevel], 'CON'); rewrite(outf[flevel]);
  562. X{$else}
  563. X           OpenOutFile(flevel, fname+'.DAT');
  564. X{$endif}
  565. X           read_long_entry;
  566. X           close(outf[flevel]);
  567. X           dec(flevel);
  568. X        end
  569. X        else begin
  570. X           read_long_entry;
  571. X        end;
  572. X*)
  573. X        read_long_entry;
  574. X      end;
  575. X  end;
  576. Xend;
  577. X
  578. X
  579. Xprocedure Main;
  580. Xlabel Next;
  581. Xvar i,j,k:word;
  582. X    linkf : text;
  583. X    fname : Dos.PathStr;
  584. Xbegin
  585. X  numentries := 0;
  586. X
  587. X  { create Menu Link Control File; }
  588. X  assign(linkf, 'GUIDE.LCF'); rewrite(linkf);
  589. X  writeln(linkf, '!name:'^i, guidename);
  590. X  writeln(linkf);
  591. X
  592. X  for i := 0 to menuantal-1 do begin
  593. X     writeln(linkf, '!menu:'^i, mennu[i,0].name);
  594. X     ShowMenu(mennu[i,0].name);
  595. X     for j := 1 to itemlist[i]-1 do begin
  596. X        close(outf[flevel]);
  597. X        fname := MakeName;
  598. X        OpenOutFile(flevel, fname+'.dat');
  599. X        ShowMenu(mennu[i,j].name);
  600. X        writeln(linkf, ^i, mennu[i,j].name, ^i, fname+'.ngo');
  601. X        read_entry( 0, mennu[i,j].filptr );
  602. XNext:
  603. X     end;
  604. X  end;
  605. X
  606. X  close(linkf);
  607. X
  608. X  { write a makefile; }
  609. X  assign(linkf, 'MAKEGUID'); rewrite(linkf);
  610. X  writeln(linkf, '.dat.ngo:');
  611. X  writeln(linkf, ^i'ngc $<');
  612. X  writeln(linkf);
  613. X  write(linkf, 'OBJECTS=');
  614. X  j := 0;
  615. X  for i := 1 to Nfiles do begin
  616. X     str(i, fname);
  617. X     fname := fname + '.ngo ';
  618. X     write(linkf, fname);
  619. X     inc(j, length(fname));
  620. X     if (j > 65) then begin
  621. X        write(linkf, '\'^m^j^i);
  622. X        j := 0;
  623. X     end;
  624. X  end;
  625. X  writeln(linkf);
  626. X  writeln(linkf);
  627. X  writeln(linkf, 'guide.ng:    $(OBJECTS)');
  628. X  writeln(linkf, ^i'ngml guide.lcf');
  629. X  close(linkf);
  630. Xend;
  631. X
  632. Xvar i:byte;
  633. Xbegin                        {Main loop and command-line parser}
  634. X  flevel := 1;
  635. X  Nfiles := 0;
  636. X  for i := 1 to MaxLevel do begin
  637. X    new(OutBuf[i]);
  638. X  end;
  639. X
  640. X{$ifndef Debug}
  641. X  assign(outf[flevel], 'CON');
  642. X{$else}
  643. X  assign(outf[flevel], 'GUIDE.DAT');
  644. X{$endif}
  645. X  rewrite(outf[flevel]);
  646. X  SetTextBuf(outf[flevel], OutBuf[flevel]^, OutBufSize);
  647. X
  648. X  writeln(progname,' ',version,'. ',copyright,'.');
  649. X  initvars; {Initialize global variables}
  650. X
  651. X  if ((paramstr(1)='/?') or (paramstr(1)='/h') or (paramstr(1)='/H')) then begin
  652. X     Usage;
  653. X  end;
  654. X
  655. X  if (ParamCount <> 1) then begin
  656. X     Usage;
  657. X  end;
  658. X
  659. X  streng := paramstr(1);
  660. X
  661. X  if pos('.',streng)=0
  662. X   then streng := streng+'.NG';        {Expand file name}
  663. X
  664. X  assign(f, streng);
  665. X{$I-}
  666. X  reset(f, 1);
  667. X  if ioresult<>0 then slutlort(3);   {If file does not exist, terminate and write cause of death}
  668. X{$I+}
  669. X
  670. X  ScreenInit;
  671. X  ShowFile(streng);
  672. X  ShowMenu('reading menu-info...');
  673. X  read_header(0);
  674. X  read_menus(False);
  675. X  Main;
  676. X
  677. X  close(f);
  678. X  close(outf[flevel]);
  679. X  ScreenExit;
  680. Xend.
  681. SHAR_EOF
  682. chmod 0644 ngdump.pas || echo "restore of ngdump.pas fails"
  683. sed 's/^X//' << 'SHAR_EOF' > readme &&
  684. X21/06/1990
  685. X
  686. X
  687. XThis is the README for NGDUMP, a decompiler for Norton Guides Database
  688. Xfiles. NGDUMP is based on NG_CLONE, a clone of the NG program I found
  689. Xon SIMTEL (<msdos.txtutl>ng_clone.zip). I modified the program to emit
  690. Xsource code for the NG compiler.
  691. X
  692. Xusage:        ngdump databasefile[.ng]
  693. X
  694. XNGDUMP creates numbered data-files (1.dat, 2.dat, etc.) with the text,
  695. Xa NG linker control file (GUIDE.LCF), and a makefile (MAKEGUID).
  696. X
  697. XEnjoy
  698. X
  699. XEelco van Asperen
  700. Xevas@cs.eur.nl (asperen@hroeur5.bitnet)
  701. XErasmus University Rotterdam, The Netherlands
  702. SHAR_EOF
  703. chmod 0644 readme || echo "restore of readme fails"
  704. exit 0
  705.  
  706. -- 
  707. bill davidsen    (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
  708.             "Stupidity, like virtue, is its own reward" -me
  709.  
  710.  
  711.