head     56.3;
access   paws bayes jws quist brad dew jwh;
symbols  ;
locks    ; strict;
comment  @# @;


56.3
date     93.01.27.13.21.41;  author jwh;  state Exp;
branches ;
next     56.2;

56.2
date     93.01.27.12.02.05;  author jwh;  state Exp;
branches ;
next     56.1;

56.1
date     91.11.05.09.41.40;  author jwh;  state Exp;
branches ;
next     55.1;

55.1
date     91.08.25.10.19.57;  author jwh;  state Exp;
branches ;
next     54.3;

54.3
date     91.08.21.12.38.00;  author jwh;  state Exp;
branches ;
next     54.2;

54.2
date     91.08.21.09.50.10;  author jwh;  state Exp;
branches ;
next     54.1;

54.1
date     91.03.18.15.24.51;  author jwh;  state Exp;
branches ;
next     53.1;

53.1
date     91.03.11.19.26.03;  author jwh;  state Exp;
branches ;
next     52.1;

52.1
date     91.02.19.09.10.01;  author jwh;  state Exp;
branches ;
next     51.1;

51.1
date     91.01.30.16.09.26;  author jwh;  state Exp;
branches ;
next     50.1;

50.1
date     90.10.29.16.24.27;  author jwh;  state Exp;
branches ;
next     49.1;

49.1
date     90.08.14.14.08.43;  author jwh;  state Exp;
branches ;
next     48.1;

48.1
date     90.07.26.11.14.44;  author jwh;  state Exp;
branches ;
next     47.1;

47.1
date     90.05.14.10.55.58;  author dew;  state Exp;
branches ;
next     46.1;

46.1
date     90.05.07.08.43.09;  author jwh;  state Exp;
branches ;
next     45.1;

45.1
date     90.04.19.15.50.37;  author jwh;  state Exp;
branches ;
next     44.1;

44.1
date     90.04.01.22.08.08;  author jwh;  state Exp;
branches ;
next     43.1;

43.1
date     90.03.20.13.59.23;  author jwh;  state Exp;
branches ;
next     42.1;

42.1
date     90.01.23.17.43.49;  author jwh;  state Exp;
branches ;
next     41.1;

41.1
date     89.12.22.11.26.58;  author jwh;  state Exp;
branches ;
next     40.1;

40.1
date     89.09.29.11.49.02;  author jwh;  state Exp;
branches ;
next     39.1;

39.1
date     89.09.26.16.33.38;  author dew;  state Exp;
branches ;
next     38.1;

38.1
date     89.08.29.11.24.52;  author jwh;  state Exp;
branches ;
next     37.1;

37.1
date     89.05.12.11.37.41;  author dew;  state Exp;
branches ;
next     36.1;

36.1
date     89.02.06.10.16.18;  author dew;  state Exp;
branches ;
next     35.1;

35.1
date     89.02.02.13.29.55;  author dew;  state Exp;
branches ;
next     34.1;

34.1
date     89.01.23.16.05.01;  author jwh;  state Exp;
branches ;
next     33.1;

33.1
date     89.01.16.11.38.14;  author dew;  state Exp;
branches ;
next     32.1;

32.1
date     89.01.10.11.45.38;  author bayes;  state Exp;
branches ;
next     31.2;

31.2
date     88.12.15.14.42.36;  author bayes;  state Exp;
branches ;
next     31.1;

31.1
date     88.12.14.18.06.54;  author bayes;  state Exp;
branches ;
next     30.1;

30.1
date     88.12.09.13.44.24;  author dew;  state Exp;
branches ;
next     29.1;

29.1
date     88.10.31.15.28.58;  author bayes;  state Exp;
branches ;
next     28.1;

28.1
date     88.10.06.10.56.53;  author dew;  state Exp;
branches ;
next     27.1;

27.1
date     88.09.29.11.26.39;  author bayes;  state Exp;
branches ;
next     26.3;

26.3
date     88.09.28.13.07.54;  author bayes;  state Exp;
branches ;
next     26.2;

26.2
date     88.09.28.13.07.41;  author bayes;  state Exp;
branches ;
next     26.1;

26.1
date     88.09.28.13.07.28;  author bayes;  state Exp;
branches ;
next     24.1;

24.1
date     87.08.31.09.43.19;  author jws;  state Exp;
branches ;
next     23.1;

23.1
date     87.08.26.10.20.16;  author bayes;  state Exp;
branches ;
next     22.1;

22.1
date     87.08.17.11.05.03;  author bayes;  state Exp;
branches ;
next     21.1;

21.1
date     87.08.12.13.48.45;  author bayes;  state Exp;
branches ;
next     20.1;

20.1
date     87.07.30.11.01.53;  author bayes;  state Exp;
branches ;
next     19.1;

19.1
date     87.06.01.08.17.43;  author jws;  state Exp;
branches ;
next     18.1;

18.1
date     87.05.20.15.13.51;  author bayes;  state Exp;
branches ;
next     17.1;

17.1
date     87.04.30.10.28.50;  author jws;  state Exp;
branches ;
next     16.1;

16.1
date     87.04.26.15.41.32;  author jws;  state Exp;
branches ;
next     15.1;

15.1
date     87.04.13.09.15.02;  author jws;  state Exp;
branches ;
next     14.1;

14.1
date     87.04.01.15.17.47;  author jws;  state Exp;
branches ;
next     13.1;

13.1
date     87.02.28.18.27.26;  author jws;  state Exp;
branches ;
next     12.1;

12.1
date     87.02.02.13.17.30;  author jws;  state Exp;
branches ;
next     11.1;

11.1
date     87.01.19.09.43.37;  author jws;  state Exp;
branches ;
next     10.1;

10.1
date     86.12.24.10.51.02;  author jws;  state Exp;
branches ;
next     9.1;

9.1
date     86.12.12.14.29.23;  author bayes;  state Exp;
branches ;
next     8.1;

8.1
date     86.11.27.11.48.28;  author jws;  state Exp;
branches ;
next     7.1;

7.1
date     86.11.20.13.38.12;  author hal;  state Exp;
branches ;
next     6.1;

6.1
date     86.11.04.17.48.11;  author paws;  state Exp;
branches ;
next     5.1;

5.1
date     86.10.28.16.36.07;  author hal;  state Exp;
branches ;
next     4.1;

4.1
date     86.09.30.19.40.09;  author hal;  state Exp;
branches ;
next     3.1;

3.1
date     86.09.01.11.50.43;  author hal;  state Exp;
branches ;
next     2.1;

2.1
date     86.07.30.14.36.28;  author hal;  state Exp;
branches ;
next     1.1;

1.1
date     86.06.30.14.39.41;  author danm;  state tmp;
branches ;
next     ;


desc
@Base file for PWS 3.2 release.

@


56.3
log
@
pws2rcs automatic delta on Wed Jan 27 13:14:25 MST 1993
@
text
@					       (*

 (c) Copyright Hewlett-Packard Company, 1983.
All rights are reserved.  Copying or other
reproduction of this program except for archival
purposes is prohibited without the prior
written consent of Hewlett-Packard Company.


	    RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the Government
is subject to restrictions as set forth in
paragraph (b) (3) (B) of the Rights in Technical
Data and Computer Software clause in
DAR 7-104.9(a).

HEWLETT-PACKARD COMPANY
Fort Collins, Colorado                         *)


$modcal$
$debug off, range off, ovflcheck off, stackcheck off, iocheck off$
$ALLOW_PACKED ON$         { JWS 4/10/85 }

program install_ucsd_dam;

module ucsdmodule;         {UCSD directory access method}

import sysglobals, asm, misc, loader, sysdevs;

export
procedure ucsd_dam (anyvar f: fib; unum: unitnum; request: damrequesttype);

procedure init_ucsd_dam;

implement

const
  dirstart = 2*fblksize;        (*DISK ADDR OF DIRECTORY*)

type strrec = record
	      name: string255;
	      end;
     srp = ^strrec;
     ctarec = record
	      catarray: array[0..mmaxint] of catentry;
	      end;
     ctp = ^ctarec;
     dtp = ^datetimerec;
     dirfile = file of direntry;

var swapem: boolean;    {flag to function swap, means exchange bytes}
    dir: ^dirfile;

function swap8(b: shortint): shortint; external;
function swapk(k: filekind): filekind; external;

procedure init_ucsd_dam;
begin
  if dir = nil then new(dir);
end;


(* UCSD format Directory Access Method *)

procedure ucsd_dam(anyvar f: fib;  unum: unitnum; request: damrequesttype);
var d, d0:  direntry;
    mvb: boolean;

function fetchdir: boolean;
var ok: boolean;
begin
ok := false;
with fibp(dir)^, unitable^[unum] do
 begin
 fisnew := false;      fanonymous := true;
 freadable := true;    fwriteable := true;
 freadmode := false;   fbufvalid := false;
 feof := false;        fmodified := false;
 funit := unum;        fileid := dirstart;
 fpeof := maxint;      fleof := fpeof;
 fpos  := 0;           am := amtable^[datafile];
 freptcnt := 0;        flastpos := -1;
 fbufchanged := false; fbuffered := true;

 ureportchange := false;
 read(dir^, d0);
 ureportchange := true; umediavalid := true;
 with d0, unitable^[unum] do                    {VALIDITY CHECK ON DIRECTORY}
  begin
  if ioresult=ord(inoerror) then
   begin
   swapem := dlastblk >= 768;   {quick test for reversed byte order}
   if dfirstblk = 0 then
    if swapk(dfkind) = untypedfile then
     if strlen(dvid) > 0 then if strlen(dvid) <= vnlength then
      if swap8(dnumfiles) >= 0 then
       if swap8(deovblk) >= swap8(dlastblk) then
	 begin
	 fpeof := swap8(dlastblk)*fblksize - dirstart;
	 fleof := fpeof;
	 ok := (swap8(dnumfiles)+1)*sizeof(direntry) <= fpeof;
	 end;
   end;
  if ok then
    begin
    if dvid <> uvid then
      begin
      mvb := false;
      uvid := dvid;     uuppercase := true;
      end;
    end
  else
    begin
    uvid := '';
    mvb := false;
    if ioresult = ord(inoerror) then ioresult := ord(inodirectory);
    end;
  end;
 end;
fetchdir := ok;
end;

function fetchvolume: boolean;
var volname: vid;
begin
fetchvolume := false;
if fetchdir then
  begin
  volname := f.fvid;
  upc(volname);
  if unitable^[unum].uvid <> volname then ioresult := ord(ilostunit)
  else fetchvolume := true;
  end;
end;

procedure cleanup;
var i,j: dirrange;
begin with unitable^[unum] do if not mvb then
  begin
  i := 0; j := 0;
  while i < swap8(d0.dnumfiles) do
    begin
    i := i + 1;
    readdir(dir^, i+1, d);
    {RDQ 14dec88 removed year validation}
    if (strlen(d.dtid) > 0) then
      begin
      j := j + 1;
      if j < i then writedir(dir^, j+1, d);
      end;
    end;
  d0.dnumfiles := swap8(j);
  if j < i then writedir(dir^, 1, d0);
  mvb := true;
  call (fibp(dir)^.am, fibp(dir), flush, dir, 0, 0);
  end;
end;

procedure setupfib(var d: direntry);
begin with f, unitable^[funit], d do
   begin
   fileid := swap8(dfirstblk)*fblksize;
   fpeof  := swap8(dlastblk) *fblksize - fileid;
   if      not fbuffered  then am := amtable^[untypedfile]
   else if not fistextvar then am := amtable^[datafile]
			  else am := amtable^[fkind];
   end;
end;

function checkname: boolean;
begin
checkname := false;
with f do
 if ((strlen(ftitle) = 0) or (strlen(ftitle) > fnlength))
 then ioresult := ord(ibadtitle)
 else begin
      ftid := ftitle; upc(ftid);
      checkname := true;                 {further syntax may be necessary!}
      end;
end;

procedure create_new;
label 1,2;
var         i, finx,  sinx,
	 last, flast, slast,
       blocks, fsize, ssize:  integer;
       temp: array[boolean] of direntry;
       sw: boolean;

  procedure checkspace(size:  integer);
  begin
  if blocks > 0 then                                    {FIRST FIT}
    begin
    if size >= blocks then
       begin fsize := blocks; finx := i; flast := last; goto 1; end;
    end
  else if size > fsize then                             {LARGEST HOLE}
    begin ssize := fsize;       fsize := size;
	  sinx  := finx;        finx  := i;
	  slast := flast;       flast := last;
    end
  else if size > ssize then                             {SECOND LARGEST}
    begin ssize := size;
	  sinx  := i;
	  slast := last;
    end;
  end;

begin
if not f.fanonymous then if not checkname then goto 2;
if not fetchvolume then goto 2;
if (f.fstartaddress <> 0) or (efttable^[f.fkind]<>f.feft) then
	      begin ioresult := ord(ibadfiletype); goto 2; end;
cleanup;
if swap8(d0.dnumfiles)=maxpos(dir^)-1 then
  begin ioresult := ord(idirfull); goto 2; end;
blocks := f.fpos;
if blocks > 0 then blocks := (blocks+(fblksize-1)) div fblksize;
fsize := 0;
i := 0;         last := swap8(d0.dlastblk);
seek(dir^, 2);
while i < swap8(d0.dnumfiles) do
  begin
  i := i + 1;
  get(dir^);
  with dir^^ do
    begin
    checkspace(swap8(dfirstblk) - last);
    last := swap8(dlastblk);
    end;
  end;
i := i + 1;
checkspace(swap8(d0.deovblk) - last);
if fsize=0 then begin ioresult := ord(inoroom); goto 2; end;
if blocks < 0 {RT11ISH} then
  begin
  fsize := (fsize+1) div 2;
  if fsize <= ssize then
	   begin fsize := ssize; finx := sinx; flast := slast; end;
  end;

1: {FOUND THE CORRECT PLACE TO INSERT A NEW FILE}
with f, temp[true]  do
  begin
  dfirstblk := swap8(flast);
  dlastblk := swap8(flast+fsize);
  dfkind := swapk(fkind);
  dtid := '';
  fisnew := true;
  fleof := 0;
  setupfib(temp[true]);
  sw := false;
  d0.dnumfiles := swap8(swap8(d0.dnumfiles)+1);
  for i := finx+1 to swap8(d0.dnumfiles)+1 do
    begin
    readdir (dir^, i, temp[sw]);  sw := not sw;
    writedir(dir^, i, temp[sw]);
    end;
  end;
writedir(dir^, 1, d0);
2:
end;

function findold: dirrange;
var   i: dirrange;   found: boolean;
begin
findold := 0;
with f do
  if  fetchvolume then
    begin
    found := false;
    seek(dir^, 2);        i := 0;
    while (i < swap8(d0.dnumfiles)) and not found do
      begin
      i := i+1;
      get(dir^);
      found := dir^^.dtid = ftid;
      end;
    if found then findold := i else ioresult := ord(inofile);
    end;
end;

procedure open_old;
var   i: dirrange;
begin if checkname then
  begin
  i := findold;
  if i>0 then with f, dir^^ do
    begin
    fisnew := false;
    fkind := swapk(dfkind); feft := efttable^[fkind];
    fstartaddress := 0;
    setupfib(dir^^);
    if fkind = textfile then fleof := fpeof
			else fleof := fpeof - 512 + swap8(dlastbyte);
    cleanup;
    end;
  end;
end;

procedure overwrite;
var   i: dirrange;
begin if checkname then
  begin
  cleanup;
  i := findold;
  if i>0 then
    begin
    d := dir^^;
    with f, d do
      begin
      fisnew := true;
      dfkind := swapk(fkind);
      dtid := '';
      fleof := 0;
      setupfib(d);
      writedir(dir^, i+1, d);
      end;
    end;
  end;
end;

function findfile(var dupindex: dirrange; finddup: boolean): dirrange;
var found: boolean;
    linx: dirrange;
    findblock: integer;
begin
findfile := 0; dupindex := 0;
with f, unitable^[funit]  do
 if fileid > dirstart then
  if fetchvolume then
    begin
    seek(dir^, 2);
    linx := 0; found := false;
    findblock := fileid div fblksize;
    while (linx < swap8(d0.dnumfiles)) and (finddup or not found) do
      begin
      linx := linx + 1;
      get(dir^);
      with dir^^ do
	begin
	if dtid = ftid then begin dupindex := linx; finddup := false; end;
	if swap8(dfirstblk) = findblock then
	 if fisnew <> (linx = dupindex) then
			    begin findfile := linx; found := true;    end;
	end;
      end;
    if not found then ioresult := ord(ilostfile);
    end;
end;

procedure stretch;
var   dup, linx: dirrange;
      lavailblk: integer;
      peof: integer;
begin
linx := findfile(dup, false);
if linx > 0 then
  begin
  read(dir^, d);
  with d0 do if linx = swap8(dnumfiles) then lavailblk := swap8(deovblk)
	     else lavailblk := swap8(dir^^.dfirstblk);
  with f, d do
    begin
    peof := (lavailblk-swap8(dfirstblk))*fblksize;
    if peof >= fpos then
      begin
      dlastblk := swap8(((peof+fpos) div 2 + (fblksize-1)) div fblksize
							  + swap8(dfirstblk));
      dlastbyte := swap8(fblksize);
      fpeof := (swap8(dlastblk) - swap8(dfirstblk)) * fblksize;
      fmodified := true;
      writedir(dir^, linx+1, d);
      end;
    end;
  end;
end (*STRETCH*) ;

procedure delentry (finx: dirrange);
var   i: dirrange;
      temp: array[boolean] of direntry;
      sw: boolean;
begin
with d0 do
  begin
  sw := false;
  for i := swap8(dnumfiles)+1 downto finx+1 do
    begin
    readdir (dir^, i, temp[sw]);  sw := not sw;
    writedir(dir^, i, temp[sw]);
    end;
  dnumfiles := swap8(swap8(dnumfiles)-1);
  end;
writedir(dir^, 1, d0);
end (*DELENTRY*) ;

procedure purgeit;
var dup, linx: dirrange;
begin
linx := findfile(dup, false);
if linx > 0 then delentry(linx);                (*ZAP FILE OUT OF EXISTENCE*)
end;

procedure closeit;
var   linx,dupinx: dirrange;
begin with f do
  begin
  linx := findfile(dupinx, fisnew);
  if linx > 0 then with f do
    begin
    readdir(dir^, linx+1, d);
    with d do
      begin
      dtid := ftid;
      sysdate(daccess);
      dlastbyte := swap8(fleof mod fblksize);
	if dlastbyte = 0 then dlastbyte := swap8(fblksize);
      dlastblk := swap8(swap8(dfirstblk)+ ((fleof + (fblksize-1))
								div fblksize));
      end;
    writedir(dir^, linx+1, d);
    if fisnew then
      if dupinx > 0 then delentry(dupinx);
    end;
  end;
end (*CLOSE*) ;

procedure purgeold;
var i: dirrange;
begin if checkname then
 begin
 i := findold;
 if i>0 then delentry(i);                (*ZAP FILE OUT OF EXISTENCE*)
 end;
end;

procedure changeit;
var i: dirrange;
begin with f, srp(fwindow)^ do
if (strlen(name)=0) or (strlen(name)>fnlength) then
						     ioresult := ord(ibadtitle)
else begin
     ftid := name; upc(ftid);
     i := findold;
     if i > 0 then ioresult := ord(idupfile)
     else if checkname then
       begin
       i := findold;
       if i > 0 then
	 begin
	 d := dir^^;
	 d.dtid := name;  upc(d.dtid);
	 writedir(dir^, i+1, d);
	 end;
       end;
     end;
end;

procedure setname;
begin with srp(addr(f))^ do
  if (strlen(name)=0) or (strlen(name)>vnlength) then
						   ioresult := ord(ibadtitle)
  else if fetchdir then with unitable^[unum] do
    begin
    uvid := name;
    upc(uvid);
    d0.dvid := uvid;
    writedir(dir^, 1, d0);
    end;
end;

procedure makedir;
label 1;
var i: integer;
begin
if f.ftitle <> '' then ioresult := ord(ibadrequest)
else with ctp(f.fwindow)^.catarray[0], d, fibp(dir)^ do
 begin
 if not fetchvolume then if ioresult<>ord(inodirectory) then goto 1 else swapem := false;
 dfirstblk := 0;
 if cextra1 = 0 then cextra1 := 77;
 dlastblk := swap8((dirstart +
	      (cextra1 + 1) * sizeof(direntry) + (fblksize-1)) div fblksize);
 dfkind := swapk(untypedfile);
 if (strlen(cname)=0) or (strlen(cname)>vnlength) then
				begin ioresult := ord(ibadtitle); goto 1; end;
 dvid := cname; upc(dvid);
 deovblk := swap8(cpsize div fblksize);
 if (swap8(dlastblk) <= swap8(dfirstblk)) or (swap8(dlastblk) >
				   swap8(deovblk)) or (cpsize>ueovbytes(funit))
			    then begin ioresult := ord(ibadvalue); goto 1; end;
 sysdate(dlastboot);
 dloadtime := 0;
 dnumfiles := 0;
 fleof := swap8(dlastblk) * fblksize;
 fpeof := fleof;
 writedir(dir^, 1, d);
 with fibp(dir)^ do
   begin
   call (am, fibp(dir), flush,      fbuffer, 0, 0);
   for i := 0 to fblksize do fbuffer[i] := chr(0);
   fileid := 0;
   call (am, fibp(dir), writebytes, fbuffer, fblksize, 0);
   call (am, fibp(dir), writebytes, fbuffer, fblksize, fblksize);
   end;
 end;
1:
end;

procedure opendir;
begin with f, ctp(fwindow)^.catarray[0], d0 do
 if fetchvolume then
    begin
    upc(ftitle);
    cname := dvid;
    cextra1 := maxpos(dir^)-1;
    cpsize :=  swap8(deovblk)             * fblksize;
    clsize := (swap8(deovblk) - swap8(dlastblk)) * fblksize;
    cstart :=            swap8(dlastblk)  * fblksize;
    cextra2 := -1;
    cblocksize := fblksize;
    with ccreatedate do begin year := 0; day := 0; month := 0; end;
    with ccreatetime do begin hour := 0; minute := 0; centisecond := 0; end;
    clastdate := dlastboot;
    clasttime := ccreatetime;
    if swapem then cinfo := 'UCSD' else cinfo := 'WS1.0';
    end;
end;

procedure cat;
var i,j: integer;
begin with f, ctp(fwindow)^ do
  if fetchvolume then
    begin
    i := -fpos; j := 0;
    while (i < fpeof) and (j < swap8(d0.dnumfiles)) do
     begin
      read(dir^, d); j := j + 1;
      with d do
       {RDQ 14dec88 removed year validation}
       if (strlen(dtid) > 0) then
	 begin
	 if i >= 0 then with catarray[i] do
	   begin
	   cname := dtid;
	   ckind := swapk(dfkind);
	   ceft  := efttable^[swapk(dfkind)];
	   cpsize := (swap8(dlastblk) - swap8(dfirstblk)) * fblksize;
	   clsize := cpsize - 512 + swap8(dlastbyte);
	   cstart := swap8(dfirstblk) * fblksize;
	   cblocksize := fblksize;
	   with ccreatedate do begin year := 0; day := 0; month := 0; end;
	   with ccreatetime do
			  begin hour := 0; minute := 0; centisecond := 0; end;
	   clastdate := daccess;
	   clasttime := ccreatetime;
	   cextra1 := -1;
	   cextra2 := -1;
	   if swapem then cinfo := 'UCSD' else cinfo := 'WS1.0';
	   end;
	 i := i + 1;
	 end;
     end;
    fpeof := i;
    end;
end;

procedure crunchit;
label 1;
var i,j: dirrange;
    blocks, last, psize, tsize, i1, i2: integer;
    buf: windowp;
    heapmark, fp: fibp;

begin
mark(heapmark); new(fp, 0);
with unitable^[unum], f do
if strlen(ftitle) > 0 then ioresult := ord(ibadtitle)
else if fetchvolume then
 with fp^ do
  try
  i := 0; j := 0;
  blocks := (memavail div fblksize) - 5;
  if blocks < 1 then escape(-2);
  newwords(buf, blocks * (fblksize div 2));
  funit := unum; fpeof := maxint; fileid := 0;
  last := swap8(d0.dlastblk);
  while i < swap8(d0.dnumfiles) do
    begin
    i := i + 1;
    readdir(dir^, i+1, d);
    with d do
     {RDQ 14dec88 removed year validation}
     if (strlen(dtid) > 0) then
      begin
      j := j + 1;
      if swapk(dfkind) <> badfile then
       if swap8(dfirstblk) > last then
	begin
	i1 := swap8(dfirstblk);                 {source block}
	psize := swap8(dlastblk) - swap8(dfirstblk);   {number of blocks to move}
	i2 := last;                             {destination block}
	dfirstblk := swap8(i2);                 {new starting block}
	repeat
	  if psize > blocks then tsize := blocks else tsize := psize;
	  call(tm, fp, readbytes,  buf^, tsize*fblksize, i1*fblksize);
	    if ioresult <> ord(inoerror) then goto 1;
	  call(tm, fp, writebytes, buf^, tsize*fblksize, i2*fblksize);
	    if ioresult <> ord(inoerror) then goto 1;
	  psize := psize - tsize;
	  i1 := i1 + tsize;
	  i2 := i2 + tsize;
	until psize = 0;
	dlastblk := swap8(i2);                  {new ending block}
	if j = i then writedir(dir^, j+1, d);
	end;

      last := swap8(dlastblk);
      if j < i then writedir(dir^, j+1, d);
      end;
    end;
  d0.dnumfiles := swap8(j);
  if j < i then writedir(dir^, 1, d0);
  mvb := true;
  1: call (fibp(dir)^.am, fibp(dir), flush, dir, 0, 0);
  release(heapmark);
  recover begin release(heapmark); escape(escapecode); end;
end;

begin {_UCSD_dam}
 lockup;
 ioresult := ord(inoerror); fibp(dir)^.freadable := false;
 with f, unitable^[unum] do
   begin
   mvb := umediavalid;
   case request of
    createfile: create_new;
    openfile:   open_old;
    overwritefile: overwrite;
    purgefile:  purgeit;
    purgename:  purgeold;
    changename: changeit;
    closefile:  if fmodified then closeit;
    stretchit:  stretch;
    makedirectory: makedir;
    opendirectory: opendir;
    catalog:    cat;
    closedirectory: {nothing to do};
    crunch:     crunchit;
    openunit,
    openvolume: begin
		unblockeddam(f, unum, request);
		mvb := umediavalid;
		end;
    setunitprefix: if strlen(ftitle) > 0 then ioresult := ord(ibadtitle);
    getvolumedate: if fetchdir then dtp(addr(f))^.date := d0.dlastboot;
    setvolumedate: if fetchdir then
		    begin
		    d0.dlastboot := dtp(addr(f))^.date; writedir(dir^, 1, d0);
		    end;
    getvolumename: begin
		   if fetchdir then {uvid := D0.dvid} ;
		   srp(addr(f))^.name := uvid;
		   end;
    setvolumename: setname;
    stripname: begin
		 if strlen(ftitle) > 15 then
		   ioresult := ord(ibadtitle)
		 else
		   begin
		     ftid := ftitle;
		     setstrlen(ftitle,0);
		   end;
	       end;
    otherwise ioresult := ord(ibadrequest);
   end;
   if (ioresult=ord(inoerror)) and (fibp(dir)^.freadable)
		       then call (fibp(dir)^.am, fibp(dir), flush, dir, 0, 0);
   umediavalid:= mvb;
   end;
 lockdown;
end;

end; {module UCSDmodule}

import ucsdmodule, loader;

begin {program install UCSD DAM}
 init_ucsd_dam;
 markuser;
end.
@


56.2
log
@
pws2rcs automatic delta on Wed Jan 27 11:57:27 MST 1993
@
text
@d1 693
@


56.1
log
@Automatic bump of revision number for PWS version 3.25
@
text
@a0 693
					       (*

 (c) Copyright Hewlett-Packard Company, 1983.
All rights are reserved.  Copying or other
reproduction of this program except for archival
purposes is prohibited without the prior
written consent of Hewlett-Packard Company.


	    RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the Government
is subject to restrictions as set forth in
paragraph (b) (3) (B) of the Rights in Technical
Data and Computer Software clause in
DAR 7-104.9(a).

HEWLETT-PACKARD COMPANY
Fort Collins, Colorado                         *)


$modcal$
$debug off, range off, ovflcheck off, stackcheck off, iocheck off$
$ALLOW_PACKED ON$         { JWS 4/10/85 }

program install_ucsd_dam;

module ucsdmodule;         {UCSD directory access method}

import sysglobals, asm, misc, loader, sysdevs;

export
procedure ucsd_dam (anyvar f: fib; unum: unitnum; request: damrequesttype);

procedure init_ucsd_dam;

implement

const
  dirstart = 2*fblksize;        (*DISK ADDR OF DIRECTORY*)

type strrec = record
	      name: string255;
	      end;
     srp = ^strrec;
     ctarec = record
	      catarray: array[0..mmaxint] of catentry;
	      end;
     ctp = ^ctarec;
     dtp = ^datetimerec;
     dirfile = file of direntry;

var swapem: boolean;    {flag to function swap, means exchange bytes}
    dir: ^dirfile;

function swap8(b: shortint): shortint; external;
function swapk(k: filekind): filekind; external;

procedure init_ucsd_dam;
begin
  if dir = nil then new(dir);
end;


(* UCSD format Directory Access Method *)

procedure ucsd_dam(anyvar f: fib;  unum: unitnum; request: damrequesttype);
var d, d0:  direntry;
    mvb: boolean;

function fetchdir: boolean;
var ok: boolean;
begin
ok := false;
with fibp(dir)^, unitable^[unum] do
 begin
 fisnew := false;      fanonymous := true;
 freadable := true;    fwriteable := true;
 freadmode := false;   fbufvalid := false;
 feof := false;        fmodified := false;
 funit := unum;        fileid := dirstart;
 fpeof := maxint;      fleof := fpeof;
 fpos  := 0;           am := amtable^[datafile];
 freptcnt := 0;        flastpos := -1;
 fbufchanged := false; fbuffered := true;

 ureportchange := false;
 read(dir^, d0);
 ureportchange := true; umediavalid := true;
 with d0, unitable^[unum] do                    {VALIDITY CHECK ON DIRECTORY}
  begin
  if ioresult=ord(inoerror) then
   begin
   swapem := dlastblk >= 768;   {quick test for reversed byte order}
   if dfirstblk = 0 then
    if swapk(dfkind) = untypedfile then
     if strlen(dvid) > 0 then if strlen(dvid) <= vnlength then
      if swap8(dnumfiles) >= 0 then
       if swap8(deovblk) >= swap8(dlastblk) then
	 begin
	 fpeof := swap8(dlastblk)*fblksize - dirstart;
	 fleof := fpeof;
	 ok := (swap8(dnumfiles)+1)*sizeof(direntry) <= fpeof;
	 end;
   end;
  if ok then
    begin
    if dvid <> uvid then
      begin
      mvb := false;
      uvid := dvid;     uuppercase := true;
      end;
    end
  else
    begin
    uvid := '';
    mvb := false;
    if ioresult = ord(inoerror) then ioresult := ord(inodirectory);
    end;
  end;
 end;
fetchdir := ok;
end;

function fetchvolume: boolean;
var volname: vid;
begin
fetchvolume := false;
if fetchdir then
  begin
  volname := f.fvid;
  upc(volname);
  if unitable^[unum].uvid <> volname then ioresult := ord(ilostunit)
  else fetchvolume := true;
  end;
end;

procedure cleanup;
var i,j: dirrange;
begin with unitable^[unum] do if not mvb then
  begin
  i := 0; j := 0;
  while i < swap8(d0.dnumfiles) do
    begin
    i := i + 1;
    readdir(dir^, i+1, d);
    {RDQ 14dec88 removed year validation}
    if (strlen(d.dtid) > 0) then
      begin
      j := j + 1;
      if j < i then writedir(dir^, j+1, d);
      end;
    end;
  d0.dnumfiles := swap8(j);
  if j < i then writedir(dir^, 1, d0);
  mvb := true;
  call (fibp(dir)^.am, fibp(dir), flush, dir, 0, 0);
  end;
end;

procedure setupfib(var d: direntry);
begin with f, unitable^[funit], d do
   begin
   fileid := swap8(dfirstblk)*fblksize;
   fpeof  := swap8(dlastblk) *fblksize - fileid;
   if      not fbuffered  then am := amtable^[untypedfile]
   else if not fistextvar then am := amtable^[datafile]
			  else am := amtable^[fkind];
   end;
end;

function checkname: boolean;
begin
checkname := false;
with f do
 if ((strlen(ftitle) = 0) or (strlen(ftitle) > fnlength))
 then ioresult := ord(ibadtitle)
 else begin
      ftid := ftitle; upc(ftid);
      checkname := true;                 {further syntax may be necessary!}
      end;
end;

procedure create_new;
label 1,2;
var         i, finx,  sinx,
	 last, flast, slast,
       blocks, fsize, ssize:  integer;
       temp: array[boolean] of direntry;
       sw: boolean;

  procedure checkspace(size:  integer);
  begin
  if blocks > 0 then                                    {FIRST FIT}
    begin
    if size >= blocks then
       begin fsize := blocks; finx := i; flast := last; goto 1; end;
    end
  else if size > fsize then                             {LARGEST HOLE}
    begin ssize := fsize;       fsize := size;
	  sinx  := finx;        finx  := i;
	  slast := flast;       flast := last;
    end
  else if size > ssize then                             {SECOND LARGEST}
    begin ssize := size;
	  sinx  := i;
	  slast := last;
    end;
  end;

begin
if not f.fanonymous then if not checkname then goto 2;
if not fetchvolume then goto 2;
if (f.fstartaddress <> 0) or (efttable^[f.fkind]<>f.feft) then
	      begin ioresult := ord(ibadfiletype); goto 2; end;
cleanup;
if swap8(d0.dnumfiles)=maxpos(dir^)-1 then
  begin ioresult := ord(idirfull); goto 2; end;
blocks := f.fpos;
if blocks > 0 then blocks := (blocks+(fblksize-1)) div fblksize;
fsize := 0;
i := 0;         last := swap8(d0.dlastblk);
seek(dir^, 2);
while i < swap8(d0.dnumfiles) do
  begin
  i := i + 1;
  get(dir^);
  with dir^^ do
    begin
    checkspace(swap8(dfirstblk) - last);
    last := swap8(dlastblk);
    end;
  end;
i := i + 1;
checkspace(swap8(d0.deovblk) - last);
if fsize=0 then begin ioresult := ord(inoroom); goto 2; end;
if blocks < 0 {RT11ISH} then
  begin
  fsize := (fsize+1) div 2;
  if fsize <= ssize then
	   begin fsize := ssize; finx := sinx; flast := slast; end;
  end;

1: {FOUND THE CORRECT PLACE TO INSERT A NEW FILE}
with f, temp[true]  do
  begin
  dfirstblk := swap8(flast);
  dlastblk := swap8(flast+fsize);
  dfkind := swapk(fkind);
  dtid := '';
  fisnew := true;
  fleof := 0;
  setupfib(temp[true]);
  sw := false;
  d0.dnumfiles := swap8(swap8(d0.dnumfiles)+1);
  for i := finx+1 to swap8(d0.dnumfiles)+1 do
    begin
    readdir (dir^, i, temp[sw]);  sw := not sw;
    writedir(dir^, i, temp[sw]);
    end;
  end;
writedir(dir^, 1, d0);
2:
end;

function findold: dirrange;
var   i: dirrange;   found: boolean;
begin
findold := 0;
with f do
  if  fetchvolume then
    begin
    found := false;
    seek(dir^, 2);        i := 0;
    while (i < swap8(d0.dnumfiles)) and not found do
      begin
      i := i+1;
      get(dir^);
      found := dir^^.dtid = ftid;
      end;
    if found then findold := i else ioresult := ord(inofile);
    end;
end;

procedure open_old;
var   i: dirrange;
begin if checkname then
  begin
  i := findold;
  if i>0 then with f, dir^^ do
    begin
    fisnew := false;
    fkind := swapk(dfkind); feft := efttable^[fkind];
    fstartaddress := 0;
    setupfib(dir^^);
    if fkind = textfile then fleof := fpeof
			else fleof := fpeof - 512 + swap8(dlastbyte);
    cleanup;
    end;
  end;
end;

procedure overwrite;
var   i: dirrange;
begin if checkname then
  begin
  cleanup;
  i := findold;
  if i>0 then
    begin
    d := dir^^;
    with f, d do
      begin
      fisnew := true;
      dfkind := swapk(fkind);
      dtid := '';
      fleof := 0;
      setupfib(d);
      writedir(dir^, i+1, d);
      end;
    end;
  end;
end;

function findfile(var dupindex: dirrange; finddup: boolean): dirrange;
var found: boolean;
    linx: dirrange;
    findblock: integer;
begin
findfile := 0; dupindex := 0;
with f, unitable^[funit]  do
 if fileid > dirstart then
  if fetchvolume then
    begin
    seek(dir^, 2);
    linx := 0; found := false;
    findblock := fileid div fblksize;
    while (linx < swap8(d0.dnumfiles)) and (finddup or not found) do
      begin
      linx := linx + 1;
      get(dir^);
      with dir^^ do
	begin
	if dtid = ftid then begin dupindex := linx; finddup := false; end;
	if swap8(dfirstblk) = findblock then
	 if fisnew <> (linx = dupindex) then
			    begin findfile := linx; found := true;    end;
	end;
      end;
    if not found then ioresult := ord(ilostfile);
    end;
end;

procedure stretch;
var   dup, linx: dirrange;
      lavailblk: integer;
      peof: integer;
begin
linx := findfile(dup, false);
if linx > 0 then
  begin
  read(dir^, d);
  with d0 do if linx = swap8(dnumfiles) then lavailblk := swap8(deovblk)
	     else lavailblk := swap8(dir^^.dfirstblk);
  with f, d do
    begin
    peof := (lavailblk-swap8(dfirstblk))*fblksize;
    if peof >= fpos then
      begin
      dlastblk := swap8(((peof+fpos) div 2 + (fblksize-1)) div fblksize
							  + swap8(dfirstblk));
      dlastbyte := swap8(fblksize);
      fpeof := (swap8(dlastblk) - swap8(dfirstblk)) * fblksize;
      fmodified := true;
      writedir(dir^, linx+1, d);
      end;
    end;
  end;
end (*STRETCH*) ;

procedure delentry (finx: dirrange);
var   i: dirrange;
      temp: array[boolean] of direntry;
      sw: boolean;
begin
with d0 do
  begin
  sw := false;
  for i := swap8(dnumfiles)+1 downto finx+1 do
    begin
    readdir (dir^, i, temp[sw]);  sw := not sw;
    writedir(dir^, i, temp[sw]);
    end;
  dnumfiles := swap8(swap8(dnumfiles)-1);
  end;
writedir(dir^, 1, d0);
end (*DELENTRY*) ;

procedure purgeit;
var dup, linx: dirrange;
begin
linx := findfile(dup, false);
if linx > 0 then delentry(linx);                (*ZAP FILE OUT OF EXISTENCE*)
end;

procedure closeit;
var   linx,dupinx: dirrange;
begin with f do
  begin
  linx := findfile(dupinx, fisnew);
  if linx > 0 then with f do
    begin
    readdir(dir^, linx+1, d);
    with d do
      begin
      dtid := ftid;
      sysdate(daccess);
      dlastbyte := swap8(fleof mod fblksize);
	if dlastbyte = 0 then dlastbyte := swap8(fblksize);
      dlastblk := swap8(swap8(dfirstblk)+ ((fleof + (fblksize-1))
								div fblksize));
      end;
    writedir(dir^, linx+1, d);
    if fisnew then
      if dupinx > 0 then delentry(dupinx);
    end;
  end;
end (*CLOSE*) ;

procedure purgeold;
var i: dirrange;
begin if checkname then
 begin
 i := findold;
 if i>0 then delentry(i);                (*ZAP FILE OUT OF EXISTENCE*)
 end;
end;

procedure changeit;
var i: dirrange;
begin with f, srp(fwindow)^ do
if (strlen(name)=0) or (strlen(name)>fnlength) then
						     ioresult := ord(ibadtitle)
else begin
     ftid := name; upc(ftid);
     i := findold;
     if i > 0 then ioresult := ord(idupfile)
     else if checkname then
       begin
       i := findold;
       if i > 0 then
	 begin
	 d := dir^^;
	 d.dtid := name;  upc(d.dtid);
	 writedir(dir^, i+1, d);
	 end;
       end;
     end;
end;

procedure setname;
begin with srp(addr(f))^ do
  if (strlen(name)=0) or (strlen(name)>vnlength) then
						   ioresult := ord(ibadtitle)
  else if fetchdir then with unitable^[unum] do
    begin
    uvid := name;
    upc(uvid);
    d0.dvid := uvid;
    writedir(dir^, 1, d0);
    end;
end;

procedure makedir;
label 1;
var i: integer;
begin
if f.ftitle <> '' then ioresult := ord(ibadrequest)
else with ctp(f.fwindow)^.catarray[0], d, fibp(dir)^ do
 begin
 if not fetchvolume then if ioresult<>ord(inodirectory) then goto 1 else swapem := false;
 dfirstblk := 0;
 if cextra1 = 0 then cextra1 := 77;
 dlastblk := swap8((dirstart +
	      (cextra1 + 1) * sizeof(direntry) + (fblksize-1)) div fblksize);
 dfkind := swapk(untypedfile);
 if (strlen(cname)=0) or (strlen(cname)>vnlength) then
				begin ioresult := ord(ibadtitle); goto 1; end;
 dvid := cname; upc(dvid);
 deovblk := swap8(cpsize div fblksize);
 if (swap8(dlastblk) <= swap8(dfirstblk)) or (swap8(dlastblk) >
				   swap8(deovblk)) or (cpsize>ueovbytes(funit))
			    then begin ioresult := ord(ibadvalue); goto 1; end;
 sysdate(dlastboot);
 dloadtime := 0;
 dnumfiles := 0;
 fleof := swap8(dlastblk) * fblksize;
 fpeof := fleof;
 writedir(dir^, 1, d);
 with fibp(dir)^ do
   begin
   call (am, fibp(dir), flush,      fbuffer, 0, 0);
   for i := 0 to fblksize do fbuffer[i] := chr(0);
   fileid := 0;
   call (am, fibp(dir), writebytes, fbuffer, fblksize, 0);
   call (am, fibp(dir), writebytes, fbuffer, fblksize, fblksize);
   end;
 end;
1:
end;

procedure opendir;
begin with f, ctp(fwindow)^.catarray[0], d0 do
 if fetchvolume then
    begin
    upc(ftitle);
    cname := dvid;
    cextra1 := maxpos(dir^)-1;
    cpsize :=  swap8(deovblk)             * fblksize;
    clsize := (swap8(deovblk) - swap8(dlastblk)) * fblksize;
    cstart :=            swap8(dlastblk)  * fblksize;
    cextra2 := -1;
    cblocksize := fblksize;
    with ccreatedate do begin year := 0; day := 0; month := 0; end;
    with ccreatetime do begin hour := 0; minute := 0; centisecond := 0; end;
    clastdate := dlastboot;
    clasttime := ccreatetime;
    if swapem then cinfo := 'UCSD' else cinfo := 'WS1.0';
    end;
end;

procedure cat;
var i,j: integer;
begin with f, ctp(fwindow)^ do
  if fetchvolume then
    begin
    i := -fpos; j := 0;
    while (i < fpeof) and (j < swap8(d0.dnumfiles)) do
     begin
      read(dir^, d); j := j + 1;
      with d do
       {RDQ 14dec88 removed year validation}
       if (strlen(dtid) > 0) then
	 begin
	 if i >= 0 then with catarray[i] do
	   begin
	   cname := dtid;
	   ckind := swapk(dfkind);
	   ceft  := efttable^[swapk(dfkind)];
	   cpsize := (swap8(dlastblk) - swap8(dfirstblk)) * fblksize;
	   clsize := cpsize - 512 + swap8(dlastbyte);
	   cstart := swap8(dfirstblk) * fblksize;
	   cblocksize := fblksize;
	   with ccreatedate do begin year := 0; day := 0; month := 0; end;
	   with ccreatetime do
			  begin hour := 0; minute := 0; centisecond := 0; end;
	   clastdate := daccess;
	   clasttime := ccreatetime;
	   cextra1 := -1;
	   cextra2 := -1;
	   if swapem then cinfo := 'UCSD' else cinfo := 'WS1.0';
	   end;
	 i := i + 1;
	 end;
     end;
    fpeof := i;
    end;
end;

procedure crunchit;
label 1;
var i,j: dirrange;
    blocks, last, psize, tsize, i1, i2: integer;
    buf: windowp;
    heapmark, fp: fibp;

begin
mark(heapmark); new(fp, 0);
with unitable^[unum], f do
if strlen(ftitle) > 0 then ioresult := ord(ibadtitle)
else if fetchvolume then
 with fp^ do
  try
  i := 0; j := 0;
  blocks := (memavail div fblksize) - 5;
  if blocks < 1 then escape(-2);
  newwords(buf, blocks * (fblksize div 2));
  funit := unum; fpeof := maxint; fileid := 0;
  last := swap8(d0.dlastblk);
  while i < swap8(d0.dnumfiles) do
    begin
    i := i + 1;
    readdir(dir^, i+1, d);
    with d do
     {RDQ 14dec88 removed year validation}
     if (strlen(dtid) > 0) then
      begin
      j := j + 1;
      if swapk(dfkind) <> badfile then
       if swap8(dfirstblk) > last then
	begin
	i1 := swap8(dfirstblk);                 {source block}
	psize := swap8(dlastblk) - swap8(dfirstblk);   {number of blocks to move}
	i2 := last;                             {destination block}
	dfirstblk := swap8(i2);                 {new starting block}
	repeat
	  if psize > blocks then tsize := blocks else tsize := psize;
	  call(tm, fp, readbytes,  buf^, tsize*fblksize, i1*fblksize);
	    if ioresult <> ord(inoerror) then goto 1;
	  call(tm, fp, writebytes, buf^, tsize*fblksize, i2*fblksize);
	    if ioresult <> ord(inoerror) then goto 1;
	  psize := psize - tsize;
	  i1 := i1 + tsize;
	  i2 := i2 + tsize;
	until psize = 0;
	dlastblk := swap8(i2);                  {new ending block}
	if j = i then writedir(dir^, j+1, d);
	end;

      last := swap8(dlastblk);
      if j < i then writedir(dir^, j+1, d);
      end;
    end;
  d0.dnumfiles := swap8(j);
  if j < i then writedir(dir^, 1, d0);
  mvb := true;
  1: call (fibp(dir)^.am, fibp(dir), flush, dir, 0, 0);
  release(heapmark);
  recover begin release(heapmark); escape(escapecode); end;
end;

begin {_UCSD_dam}
 lockup;
 ioresult := ord(inoerror); fibp(dir)^.freadable := false;
 with f, unitable^[unum] do
   begin
   mvb := umediavalid;
   case request of
    createfile: create_new;
    openfile:   open_old;
    overwritefile: overwrite;
    purgefile:  purgeit;
    purgename:  purgeold;
    changename: changeit;
    closefile:  if fmodified then closeit;
    stretchit:  stretch;
    makedirectory: makedir;
    opendirectory: opendir;
    catalog:    cat;
    closedirectory: {nothing to do};
    crunch:     crunchit;
    openunit,
    openvolume: begin
		unblockeddam(f, unum, request);
		mvb := umediavalid;
		end;
    setunitprefix: if strlen(ftitle) > 0 then ioresult := ord(ibadtitle);
    getvolumedate: if fetchdir then dtp(addr(f))^.date := d0.dlastboot;
    setvolumedate: if fetchdir then
		    begin
		    d0.dlastboot := dtp(addr(f))^.date; writedir(dir^, 1, d0);
		    end;
    getvolumename: begin
		   if fetchdir then {uvid := D0.dvid} ;
		   srp(addr(f))^.name := uvid;
		   end;
    setvolumename: setname;
    stripname: begin
		 if strlen(ftitle) > 15 then
		   ioresult := ord(ibadtitle)
		 else
		   begin
		     ftid := ftitle;
		     setstrlen(ftitle,0);
		   end;
	       end;
    otherwise ioresult := ord(ibadrequest);
   end;
   if (ioresult=ord(inoerror)) and (fibp(dir)^.freadable)
		       then call (fibp(dir)^.am, fibp(dir), flush, dir, 0, 0);
   umediavalid:= mvb;
   end;
 lockdown;
end;

end; {module UCSDmodule}

import ucsdmodule, loader;

begin {program install UCSD DAM}
 init_ucsd_dam;
 markuser;
end.
@


55.1
log
@Automatic bump of revision number for PWS version 3.25A
@
text
@@


54.3
log
@
pws2rcs automatic delta on Wed Aug 21 12:27:56 MDT 1991
@
text
@@


54.2
log
@
pws2rcs automatic delta on Wed Aug 21 09:35:48 MDT 1991
@
text
@d1 693
@


54.1
log
@Automatic bump of revision number for PWS version 3.24
@
text
@a0 693
					       (*

 (c) Copyright Hewlett-Packard Company, 1983.
All rights are reserved.  Copying or other
reproduction of this program except for archival
purposes is prohibited without the prior
written consent of Hewlett-Packard Company.


	    RESTRICTED RIGHTS LEGEND

Use, duplication, or disclosure by the Government
is subject to restrictions as set forth in
paragraph (b) (3) (B) of the Rights in Technical
Data and Computer Software clause in
DAR 7-104.9(a).

HEWLETT-PACKARD COMPANY
Fort Collins, Colorado                         *)


$modcal$
$debug off, range off, ovflcheck off, stackcheck off, iocheck off$
$ALLOW_PACKED ON$         { JWS 4/10/85 }

program install_ucsd_dam;

module ucsdmodule;         {UCSD directory access method}

import sysglobals, asm, misc, loader, sysdevs;

export
procedure ucsd_dam (anyvar f: fib; unum: unitnum; request: damrequesttype);

procedure init_ucsd_dam;

implement

const
  dirstart = 2*fblksize;        (*DISK ADDR OF DIRECTORY*)

type strrec = record
	      name: string255;
	      end;
     srp = ^strrec;
     ctarec = record
	      catarray: array[0..mmaxint] of catentry;
	      end;
     ctp = ^ctarec;
     dtp = ^datetimerec;
     dirfile = file of direntry;

var swapem: boolean;    {flag to function swap, means exchange bytes}
    dir: ^dirfile;

function swap8(b: shortint): shortint; external;
function swapk(k: filekind): filekind; external;

procedure init_ucsd_dam;
begin
  if dir = nil then new(dir);
end;


(* UCSD format Directory Access Method *)

procedure ucsd_dam(anyvar f: fib;  unum: unitnum; request: damrequesttype);
var d, d0:  direntry;
    mvb: boolean;

function fetchdir: boolean;
var ok: boolean;
begin
ok := false;
with fibp(dir)^, unitable^[unum] do
 begin
 fisnew := false;      fanonymous := true;
 freadable := true;    fwriteable := true;
 freadmode := false;   fbufvalid := false;
 feof := false;        fmodified := false;
 funit := unum;        fileid := dirstart;
 fpeof := maxint;      fleof := fpeof;
 fpos  := 0;           am := amtable^[datafile];
 freptcnt := 0;        flastpos := -1;
 fbufchanged := false; fbuffered := true;

 ureportchange := false;
 read(dir^, d0);
 ureportchange := true; umediavalid := true;
 with d0, unitable^[unum] do                    {VALIDITY CHECK ON DIRECTORY}
  begin
  if ioresult=ord(inoerror) then
   begin
   swapem := dlastblk >= 768;   {quick test for reversed byte order}
   if dfirstblk = 0 then
    if swapk(dfkind) = untypedfile then
     if strlen(dvid) > 0 then if strlen(dvid) <= vnlength then
      if swap8(dnumfiles) >= 0 then
       if swap8(deovblk) >= swap8(dlastblk) then
	 begin
	 fpeof := swap8(dlastblk)*fblksize - dirstart;
	 fleof := fpeof;
	 ok := (swap8(dnumfiles)+1)*sizeof(direntry) <= fpeof;
	 end;
   end;
  if ok then
    begin
    if dvid <> uvid then
      begin
      mvb := false;
      uvid := dvid;     uuppercase := true;
      end;
    end
  else
    begin
    uvid := '';
    mvb := false;
    if ioresult = ord(inoerror) then ioresult := ord(inodirectory);
    end;
  end;
 end;
fetchdir := ok;
end;

function fetchvolume: boolean;
var volname: vid;
begin
fetchvolume := false;
if fetchdir then
  begin
  volname := f.fvid;
  upc(volname);
  if unitable^[unum].uvid <> volname then ioresult := ord(ilostunit)
  else fetchvolume := true;
  end;
end;

procedure cleanup;
var i,j: dirrange;
begin with unitable^[unum] do if not mvb then
  begin
  i := 0; j := 0;
  while i < swap8(d0.dnumfiles) do
    begin
    i := i + 1;
    readdir(dir^, i+1, d);
    {RDQ 14dec88 removed year validation}
    if (strlen(d.dtid) > 0) then
      begin
      j := j + 1;
      if j < i then writedir(dir^, j+1, d);
      end;
    end;
  d0.dnumfiles := swap8(j);
  if j < i then writedir(dir^, 1, d0);
  mvb := true;
  call (fibp(dir)^.am, fibp(dir), flush, dir, 0, 0);
  end;
end;

procedure setupfib(var d: direntry);
begin with f, unitable^[funit], d do
   begin
   fileid := swap8(dfirstblk)*fblksize;
   fpeof  := swap8(dlastblk) *fblksize - fileid;
   if      not fbuffered  then am := amtable^[untypedfile]
   else if not fistextvar then am := amtable^[datafile]
			  else am := amtable^[fkind];
   end;
end;

function checkname: boolean;
begin
checkname := false;
with f do
 if ((strlen(ftitle) = 0) or (strlen(ftitle) > fnlength))
 then ioresult := ord(ibadtitle)
 else begin
      ftid := ftitle; upc(ftid);
      checkname := true;                 {further syntax may be necessary!}
      end;
end;

procedure create_new;
label 1,2;
var         i, finx,  sinx,
	 last, flast, slast,
       blocks, fsize, ssize:  integer;
       temp: array[boolean] of direntry;
       sw: boolean;

  procedure checkspace(size:  integer);
  begin
  if blocks > 0 then                                    {FIRST FIT}
    begin
    if size >= blocks then
       begin fsize := blocks; finx := i; flast := last; goto 1; end;
    end
  else if size > fsize then                             {LARGEST HOLE}
    begin ssize := fsize;       fsize := size;
	  sinx  := finx;        finx  := i;
	  slast := flast;       flast := last;
    end
  else if size > ssize then                             {SECOND LARGEST}
    begin ssize := size;
	  sinx  := i;
	  slast := last;
    end;
  end;

begin
if not f.fanonymous then if not checkname then goto 2;
if not fetchvolume then goto 2;
if (f.fstartaddress <> 0) or (efttable^[f.fkind]<>f.feft) then
	      begin ioresult := ord(ibadfiletype); goto 2; end;
cleanup;
if swap8(d0.dnumfiles)=maxpos(dir^)-1 then
  begin ioresult := ord(idirfull); goto 2; end;
blocks := f.fpos;
if blocks > 0 then blocks := (blocks+(fblksize-1)) div fblksize;
fsize := 0;
i := 0;         last := swap8(d0.dlastblk);
seek(dir^, 2);
while i < swap8(d0.dnumfiles) do
  begin
  i := i + 1;
  get(dir^);
  with dir^^ do
    begin
    checkspace(swap8(dfirstblk) - last);
    last := swap8(dlastblk);
    end;
  end;
i := i + 1;
checkspace(swap8(d0.deovblk) - last);
if fsize=0 then begin ioresult := ord(inoroom); goto 2; end;
if blocks < 0 {RT11ISH} then
  begin
  fsize := (fsize+1) div 2;
  if fsize <= ssize then
	   begin fsize := ssize; finx := sinx; flast := slast; end;
  end;

1: {FOUND THE CORRECT PLACE TO INSERT A NEW FILE}
with f, temp[true]  do
  begin
  dfirstblk := swap8(flast);
  dlastblk := swap8(flast+fsize);
  dfkind := swapk(fkind);
  dtid := '';
  fisnew := true;
  fleof := 0;
  setupfib(temp[true]);
  sw := false;
  d0.dnumfiles := swap8(swap8(d0.dnumfiles)+1);
  for i := finx+1 to swap8(d0.dnumfiles)+1 do
    begin
    readdir (dir^, i, temp[sw]);  sw := not sw;
    writedir(dir^, i, temp[sw]);
    end;
  end;
writedir(dir^, 1, d0);
2:
end;

function findold: dirrange;
var   i: dirrange;   found: boolean;
begin
findold := 0;
with f do
  if  fetchvolume then
    begin
    found := false;
    seek(dir^, 2);        i := 0;
    while (i < swap8(d0.dnumfiles)) and not found do
      begin
      i := i+1;
      get(dir^);
      found := dir^^.dtid = ftid;
      end;
    if found then findold := i else ioresult := ord(inofile);
    end;
end;

procedure open_old;
var   i: dirrange;
begin if checkname then
  begin
  i := findold;
  if i>0 then with f, dir^^ do
    begin
    fisnew := false;
    fkind := swapk(dfkind); feft := efttable^[fkind];
    fstartaddress := 0;
    setupfib(dir^^);
    if fkind = textfile then fleof := fpeof
			else fleof := fpeof - 512 + swap8(dlastbyte);
    cleanup;
    end;
  end;
end;

procedure overwrite;
var   i: dirrange;
begin if checkname then
  begin
  cleanup;
  i := findold;
  if i>0 then
    begin
    d := dir^^;
    with f, d do
      begin
      fisnew := true;
      dfkind := swapk(fkind);
      dtid := '';
      fleof := 0;
      setupfib(d);
      writedir(dir^, i+1, d);
      end;
    end;
  end;
end;

function findfile(var dupindex: dirrange; finddup: boolean): dirrange;
var found: boolean;
    linx: dirrange;
    findblock: integer;
begin
findfile := 0; dupindex := 0;
with f, unitable^[funit]  do
 if fileid > dirstart then
  if fetchvolume then
    begin
    seek(dir^, 2);
    linx := 0; found := false;
    findblock := fileid div fblksize;
    while (linx < swap8(d0.dnumfiles)) and (finddup or not found) do
      begin
      linx := linx + 1;
      get(dir^);
      with dir^^ do
	begin
	if dtid = ftid then begin dupindex := linx; finddup := false; end;
	if swap8(dfirstblk) = findblock then
	 if fisnew <> (linx = dupindex) then
			    begin findfile := linx; found := true;    end;
	end;
      end;
    if not found then ioresult := ord(ilostfile);
    end;
end;

procedure stretch;
var   dup, linx: dirrange;
      lavailblk: integer;
      peof: integer;
begin
linx := findfile(dup, false);
if linx > 0 then
  begin
  read(dir^, d);
  with d0 do if linx = swap8(dnumfiles) then lavailblk := swap8(deovblk)
	     else lavailblk := swap8(dir^^.dfirstblk);
  with f, d do
    begin
    peof := (lavailblk-swap8(dfirstblk))*fblksize;
    if peof >= fpos then
      begin
      dlastblk := swap8(((peof+fpos) div 2 + (fblksize-1)) div fblksize
							  + swap8(dfirstblk));
      dlastbyte := swap8(fblksize);
      fpeof := (swap8(dlastblk) - swap8(dfirstblk)) * fblksize;
      fmodified := true;
      writedir(dir^, linx+1, d);
      end;
    end;
  end;
end (*STRETCH*) ;

procedure delentry (finx: dirrange);
var   i: dirrange;
      temp: array[boolean] of direntry;
      sw: boolean;
begin
with d0 do
  begin
  sw := false;
  for i := swap8(dnumfiles)+1 downto finx+1 do
    begin
    readdir (dir^, i, temp[sw]);  sw := not sw;
    writedir(dir^, i, temp[sw]);
    end;
  dnumfiles := swap8(swap8(dnumfiles)-1);
  end;
writedir(dir^, 1, d0);
end (*DELENTRY*) ;

procedure purgeit;
var dup, linx: dirrange;
begin
linx := findfile(dup, false);
if linx > 0 then delentry(linx);                (*ZAP FILE OUT OF EXISTENCE*)
end;

procedure closeit;
var   linx,dupinx: dirrange;
begin with f do
  begin
  linx := findfile(dupinx, fisnew);
  if linx > 0 then with f do
    begin
    readdir(dir^, linx+1, d);
    with d do
      begin
      dtid := ftid;
      sysdate(daccess);
      dlastbyte := swap8(fleof mod fblksize);
	if dlastbyte = 0 then dlastbyte := swap8(fblksize);
      dlastblk := swap8(swap8(dfirstblk)+ ((fleof + (fblksize-1))
								div fblksize));
      end;
    writedir(dir^, linx+1, d);
    if fisnew then
      if dupinx > 0 then delentry(dupinx);
    end;
  end;
end (*CLOSE*) ;

procedure purgeold;
var i: dirrange;
begin if checkname then
 begin
 i := findold;
 if i>0 then delentry(i);                (*ZAP FILE OUT OF EXISTENCE*)
 end;
end;

procedure changeit;
var i: dirrange;
begin with f, srp(fwindow)^ do
if (strlen(name)=0) or (strlen(name)>fnlength) then
						     ioresult := ord(ibadtitle)
else begin
     ftid := name; upc(ftid);
     i := findold;
     if i > 0 then ioresult := ord(idupfile)
     else if checkname then
       begin
       i := findold;
       if i > 0 then
	 begin
	 d := dir^^;
	 d.dtid := name;  upc(d.dtid);
	 writedir(dir^, i+1, d);
	 end;
       end;
     end;
end;

procedure setname;
begin with srp(addr(f))^ do
  if (strlen(name)=0) or (strlen(name)>vnlength) then
						   ioresult := ord(ibadtitle)
  else if fetchdir then with unitable^[unum] do
    begin
    uvid := name;
    upc(uvid);
    d0.dvid := uvid;
    writedir(dir^, 1, d0);
    end;
end;

procedure makedir;
label 1;
var i: integer;
begin
if f.ftitle <> '' then ioresult := ord(ibadrequest)
else with ctp(f.fwindow)^.catarray[0], d, fibp(dir)^ do
 begin
 if not fetchvolume then if ioresult<>ord(inodirectory) then goto 1 else swapem := false;
 dfirstblk := 0;
 if cextra1 = 0 then cextra1 := 77;
 dlastblk := swap8((dirstart +
	      (cextra1 + 1) * sizeof(direntry) + (fblksize-1)) div fblksize);
 dfkind := swapk(untypedfile);
 if (strlen(cname)=0) or (strlen(cname)>vnlength) then
				begin ioresult := ord(ibadtitle); goto 1; end;
 dvid := cname; upc(dvid);
 deovblk := swap8(cpsize div fblksize);
 if (swap8(dlastblk) <= swap8(dfirstblk)) or (swap8(dlastblk) >
				   swap8(deovblk)) or (cpsize>ueovbytes(funit))
			    then begin ioresult := ord(ibadvalue); goto 1; end;
 sysdate(dlastboot);
 dloadtime := 0;
 dnumfiles := 0;
 fleof := swap8(dlastblk) * fblksize;
 fpeof := fleof;
 writedir(dir^, 1, d);
 with fibp(dir)^ do
   begin
   call (am, fibp(dir), flush,      fbuffer, 0, 0);
   for i := 0 to fblksize do fbuffer[i] := chr(0);
   fileid := 0;
   call (am, fibp(dir), writebytes, fbuffer, fblksize, 0);
   call (am, fibp(dir), writebytes, fbuffer, fblksize, fblksize);
   end;
 end;
1:
end;

procedure opendir;
begin with f, ctp(fwindow)^.catarray[0], d0 do
 if fetchvolume then
    begin
    upc(ftitle);
    cname := dvid;
    cextra1 := maxpos(dir^)-1;
    cpsize :=  swap8(deovblk)             * fblksize;
    clsize := (swap8(deovblk) - swap8(dlastblk)) * fblksize;
    cstart :=            swap8(dlastblk)  * fblksize;
    cextra2 := -1;
    cblocksize := fblksize;
    with ccreatedate do begin year := 0; day := 0; month := 0; end;
    with ccreatetime do begin hour := 0; minute := 0; centisecond := 0; end;
    clastdate := dlastboot;
    clasttime := ccreatetime;
    if swapem then cinfo := 'UCSD' else cinfo := 'WS1.0';
    end;
end;

procedure cat;
var i,j: integer;
begin with f, ctp(fwindow)^ do
  if fetchvolume then
    begin
    i := -fpos; j := 0;
    while (i < fpeof) and (j < swap8(d0.dnumfiles)) do
     begin
      read(dir^, d); j := j + 1;
      with d do
       {RDQ 14dec88 removed year validation}
       if (strlen(dtid) > 0) then
	 begin
	 if i >= 0 then with catarray[i] do
	   begin
	   cname := dtid;
	   ckind := swapk(dfkind);
	   ceft  := efttable^[swapk(dfkind)];
	   cpsize := (swap8(dlastblk) - swap8(dfirstblk)) * fblksize;
	   clsize := cpsize - 512 + swap8(dlastbyte);
	   cstart := swap8(dfirstblk) * fblksize;
	   cblocksize := fblksize;
	   with ccreatedate do begin year := 0; day := 0; month := 0; end;
	   with ccreatetime do
			  begin hour := 0; minute := 0; centisecond := 0; end;
	   clastdate := daccess;
	   clasttime := ccreatetime;
	   cextra1 := -1;
	   cextra2 := -1;
	   if swapem then cinfo := 'UCSD' else cinfo := 'WS1.0';
	   end;
	 i := i + 1;
	 end;
     end;
    fpeof := i;
    end;
end;

procedure crunchit;
label 1;
var i,j: dirrange;
    blocks, last, psize, tsize, i1, i2: integer;
    buf: windowp;
    heapmark, fp: fibp;

begin
mark(heapmark); new(fp, 0);
with unitable^[unum], f do
if strlen(ftitle) > 0 then ioresult := ord(ibadtitle)
else if fetchvolume then
 with fp^ do
  try
  i := 0; j := 0;
  blocks := (memavail div fblksize) - 5;
  if blocks < 1 then escape(-2);
  newwords(buf, blocks * (fblksize div 2));
  funit := unum; fpeof := maxint; fileid := 0;
  last := swap8(d0.dlastblk);
  while i < swap8(d0.dnumfiles) do
    begin
    i := i + 1;
    readdir(dir^, i+1, d);
    with d do
     {RDQ 14dec88 removed year validation}
     if (strlen(dtid) > 0) then
      begin
      j := j + 1;
      if swapk(dfkind) <> badfile then
       if swap8(dfirstblk) > last then
	begin
	i1 := swap8(dfirstblk);                 {source block}
	psize := swap8(dlastblk) - swap8(dfirstblk);   {number of blocks to move}
	i2 := last;                             {destination block}
	dfirstblk := swap8(i2);                 {new starting block}
	repeat
	  if psize > blocks then tsize := blocks else tsize := psize;
	  call(tm, fp, readbytes,  buf^, tsize*fblksize, i1*fblksize);
	    if ioresult <> ord(inoerror) then goto 1;
	  call(tm, fp, writebytes, buf^, tsize*fblksize, i2*fblksize);
	    if ioresult <> ord(inoerror) then goto 1;
	  psize := psize - tsize;
	  i1 := i1 + tsize;
	  i2 := i2 + tsize;
	until psize = 0;
	dlastblk := swap8(i2);                  {new ending block}
	if j = i then writedir(dir^, j+1, d);
	end;

      last := swap8(dlastblk);
      if j < i then writedir(dir^, j+1, d);
      end;
    end;
  d0.dnumfiles := swap8(j);
  if j < i then writedir(dir^, 1, d0);
  mvb := true;
  1: call (fibp(dir)^.am, fibp(dir), flush, dir, 0, 0);
  release(heapmark);
  recover begin release(heapmark); escape(escapecode); end;
end;

begin {_UCSD_dam}
 lockup;
 ioresult := ord(inoerror); fibp(dir)^.freadable := false;
 with f, unitable^[unum] do
   begin
   mvb := umediavalid;
   case request of
    createfile: create_new;
    openfile:   open_old;
    overwritefile: overwrite;
    purgefile:  purgeit;
    purgename:  purgeold;
    changename: changeit;
    closefile:  if fmodified then closeit;
    stretchit:  stretch;
    makedirectory: makedir;
    opendirectory: opendir;
    catalog:    cat;
    closedirectory: {nothing to do};
    crunch:     crunchit;
    openunit,
    openvolume: begin
		unblockeddam(f, unum, request);
		mvb := umediavalid;
		end;
    setunitprefix: if strlen(ftitle) > 0 then ioresult := ord(ibadtitle);
    getvolumedate: if fetchdir then dtp(addr(f))^.date := d0.dlastboot;
    setvolumedate: if fetchdir then
		    begin
		    d0.dlastboot := dtp(addr(f))^.date; writedir(dir^, 1, d0);
		    end;
    getvolumename: begin
		   if fetchdir then {uvid := D0.dvid} ;
		   srp(addr(f))^.name := uvid;
		   end;
    setvolumename: setname;
    stripname: begin
		 if strlen(ftitle) > 15 then
		   ioresult := ord(ibadtitle)
		 else
		   begin
		     ftid := ftitle;
		     setstrlen(ftitle,0);
		   end;
	       end;
    otherwise ioresult := ord(ibadrequest);
   end;
   if (ioresult=ord(inoerror)) and (fibp(dir)^.freadable)
		       then call (fibp(dir)^.am, fibp(dir), flush, dir, 0, 0);
   umediavalid:= mvb;
   end;
 lockdown;
end;

end; {module UCSDmodule}

import ucsdmodule, loader;

begin {program install UCSD DAM}
 init_ucsd_dam;
 markuser;
end.
@


53.1
log
@Automatic bump of revision number for PWS version 3.24B
@
text
@@


52.1
log
@Automatic bump of revision number for PWS version 3.24A
@
text
@@


51.1
log
@Automatic bump of revision number for PWS version 3.24d
@
text
@@


50.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


49.1
log
@Automatic bump of revision number for PWS version 3.24b
@
text
@@


48.1
log
@Automatic bump of revision number for PWS version 3.24a
@
text
@@


47.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


46.1
log
@Automatic bump of revision number for PWS version 3.23
@
text
@@


45.1
log
@Automatic bump of revision number for PWS version 3.23C
@
text
@@


44.1
log
@Automatic bump of revision number for PWS version 3.23B
@
text
@@


43.1
log
@Automatic bump of revision number for PWS version 3.23aA
@
text
@@


42.1
log
@Automatic bump of revision number for PWS version 3.23e
@
text
@@


41.1
log
@Automatic bump of revision number for PWS version 3.23d
@
text
@@


40.1
log
@Automatic bump of revision number for PWS version 3.23c
@
text
@@


39.1
log
@Automatic bump of revision number for PWS version 3.23b
@
text
@@


38.1
log
@Automatic bump of revision number for PWS version 3.23a
@
text
@@


37.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


36.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


35.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


34.1
log
@Automatic bump of revision number for PWS version 3.22
@
text
@@


33.1
log
@Automatic bump of revision number for PWS version 3.22D
@
text
@@


32.1
log
@Automatic bump of revision number for PWS version 3.22C
@
text
@@


31.2
log
@removed range checks on year fields because the physical and logical
sizes of the year field in a daterec are now the same.
These changes will also allow the WS1.0_DAM to operate properly
thru the year 2027.
RDQ

@
text
@@


31.1
log
@Automatic bump of revision number for PWS version 3.22B
@
text
@d147 2
a148 2
    {LAF 880101 changed year comparison from 100 to 127}
    if (d.daccess.year < 127) and (strlen(d.dtid) > 0) then
d542 2
a543 2
       {LAF 880101 changed year comparison from 100 to 127}
       if (daccess.year < 127) and (strlen(dtid) > 0) then
d595 2
a596 2
     {LAF 880101 changed year comparison from 100 to 127}
     if (daccess.year < 127) and (strlen(dtid) > 0) then
@


30.1
log
@Automatic bump of revision number for PWS version 3.22A
@
text
@@


29.1
log
@Automatic bump of revision number for PWS version 3.22b
@
text
@@


28.1
log
@Automatic bump of revision number for PWS version 3.3b
@
text
@@


27.1
log
@Automatic bump of revision number for PWS version 3.3a
@
text
@@


26.3
log
@
Comment from auto synch of clock fix:
date: 88/03/02 17:23:17;  author: quist;  state: Exp;  lines added/del: 6/3
SYSDATE fixes, RDQ
@
text
@@


26.2
log
@
Comment from auto synch of clock fix:
date: 88/03/02 09:24:24;  author: bayes;  state: Exp;  lines added/del: 0/0
Automatic bump of revision number for PWS version 3.2Y
@
text
@d147 2
a148 1
    if (d.daccess.year < 100) and (strlen(d.dtid) > 0) then
d542 2
a543 1
       if (daccess.year < 100) and (strlen(dtid) > 0) then
d595 2
a596 1
     if (daccess.year < 100) and (strlen(dtid) > 0) then
@


26.1
log
@Automatic bump of revision number for PWS version 3.3 Synch
@
text
@@


24.1
log
@Automatic bump of revision number for PWS version 3.2
@
text
@@


23.1
log
@Automatic bump of revision number for PWS version 3.2P
@
text
@@


22.1
log
@Automatic bump of revision number for PWS version 3.2N
@
text
@@


21.1
log
@Automatic bump of revision number for PWS version 3.2M
@
text
@@


20.1
log
@Automatic bump of revision number for PWS version 3.2L
@
text
@@


19.1
log
@Automatic bump of revision number for PWS version 3.2K
@
text
@@


18.1
log
@Automatic bump of revision number for PWS version 3.2J
@
text
@@


17.1
log
@Automatic bump of revision number for PWS version 3.2I+
@
text
@@


16.1
log
@Automatic bump of revision number for PWS version 3.2I
@
text
@@


15.1
log
@Automatic bump of revision number for PWS version 3.2H
@
text
@@


14.1
log
@Automatic bump of revision number for PWS version 3.2G
@
text
@@


13.1
log
@Automatic bump of revision number for PWS version 3.2F
@
text
@@


12.1
log
@Automatic bump of revision number for PWS version 3.2E
@
text
@@


11.1
log
@Automatic bump of revision number for PWS version 3.2D
@
text
@@


10.1
log
@Automatic bump of revision number for PWS version 3.2C
@
text
@@


9.1
log
@Automatic bump of revision number for PWS version 3.2B
@
text
@@


8.1
log
@Automatic bump of revision number for PWS version 3.2A
@
text
@@


7.1
log
@Automatic bump of revision number for PWS version 3.2l
@
text
@@


6.1
log
@Automatic bump of revision number for PWS version 3.2k
@
text
@@


5.1
log
@Automatic bump of revision number for PWS version 3.2j
@
text
@@


4.1
log
@Automatic bump of revision number for PWS version 3.2i
@
text
@@


3.1
log
@Automatic bump of revision number for PWS version 3.2h
@
text
@@


2.1
log
@Auto bump rev number to 2.1 for sys 3.2e.
@
text
@@


1.1
log
@Initial revision
@
text
@@
