;"***************************************************************************** This file defines library update routines for use with either network libraries or resident libraries. LUP-USER.MUD: EDIT HISTORY Machine Independent COMPILATION: Spliced in at compile time. JUN84 [Shane] - Created. 31OCT84 [Shane] - Commented, cleaned up. 10NOV84 [Shane] - LUP-ADD-FILE, LUP-DEL-FILE ****************************************************************************" ;"ACTLIB -- The active library represented as a channel. If the library is resident, we never write to this channel, since LUPI-KEY in LUP-BASE contains the actual shadow library (ACTLIB is the channel that the write lock is placed on.)" '>> ;"LUP-CREATE -- Effect: Create library named NAME with associated log file. Second name defaults to LIBMIM (LOG for log file). NBKTS is the number of buckets to use. Returns: The full name of the library file." > ;"LUP-ABORT -- Effect: If there is an update in progress, abort all changes after the last install or lock." ,ACTLIB) (OUTCHAN:CHANNEL .OUTCHAN)) > )>) (T )>) ("TOPS20" )> )> )>> ;"LUP-ACT -- Effect: Lock the library named LIBS if there is no pre-existing lock. Returns: T if successful, otherwise FALSE." %<>)) ) ) (>> )> >)) > ) ( ,ACK> )> >)>)> > > > ) (T .LOCK)>> > )>>>> ;"LUP-DCT -- Effect: Unlock the active library and install all changes since the last lock or install. Returns: T if successful, otherwise FALSE." ,ACTLIB)) )> >)) <==? <1 .MSG> ,ACK>> > ) (T )>>)>)> > > ) (T )>> >> ;"LUP-INSTALL -- Effect: Install changes made since last lock or install without releasing lock. Returns: T if successful, FALSE otherwise." ,ACTLIB)) ) )> >)) <==? <1 .MSG> ,ACK>> ) (T )>>)>)> > > )> ) (T )>> >> ;"LUP-ADD-PACK -- Effect: Add module named PKG to library. The files for PKG are found in L-SEARCH-PATH. An optional documentation file may be specified: %<> means none. STRING means documentation is string rather than file. [] = [NM1 NM2] specifies file in search path. [NAME] means full file name. And finally [NM1 NM2 DEV SNM]. ABSTRACT? means generate and ABSTR file if non-false. COPY?, if FALSE, causes the library to point at the files where they are found rather than copying them to library directory (meaningful only for local libraries). Returns: T if successful, otherwise FALSE." FALSE> %<>) (ABSTRACT?: T) (COPY?: T) "AUX" (LIBC: ,ACTLIB)) ABSTR: (OUTCHAN:CHANNEL .OUTCHAN) (RECORD:UVECTOR >)) ) (>> ) ( .LIBC> ERRET-T-TO-UPDATE-FALSE-TO-EXIT!-ERRORS LUP-ADD-PACK> >> )>) (T >)>)> "DOC"]>)> 2> VECTOR ,L-SEARCH-PATH > >>) ( 1> <==? 4>> NM2: DEV: SNM: NAME:STRING FN:) 4> > > > > > > ) (T >> > > > > > )> ) (T >)>>) (T >)> >)>)>) ( ,MAXSTRS>> ERRET-T-TO-EXIT-FALSE-TO-IGNORE!-ERRORS LUP-ADD-PACK> >) (T >)>)> )>)> ;"Write abstract to file." <2 >) (ABSTRACT:LIST <1 >) (NM1: ) (NM2: "ABSTR") (FN: ) (NAME:STRING ) (CH:CHANNEL )) > .ABSTRACT> ]> >) (T >)> > <==? PACKAGE> .COPY? .ABSTR .DOC .RECORD> .ABSTR .DOC>> ) (T )>)>)> .ABSTR .DOC>> ) (T )>> >> ;"LUP-DEL-PACK -- Effect: Remove module named PKG from active library. Returns: T if successful, otherwise FALSE." ,ACTLIB)) ) (> )> 8>>>>)) <==? <1 .MSG> ,ACK>> ) (T )>>)>)> ) (T )>> >> ;"LUP-GC -- Effect: Garbage collect the active library. NBKTS is the number of buckets to use. Returns: T if successful, otherwise FALSE." ,ACTLIB)) )> >)) > <==? <1 .MSG> ,ACK>> ) (T >)>>)>)> ) (T >)>> >> ;"LUP-ADD-FILE -- Effect: Copies the file named NAME to the directory of the active library. Returns: T if successful, FALSE otherwise." ,ACTLIB) (FIL: %<>) (CPY: %<>)) ) (>> )> !\. >> > )>) (T >)>)> > )) <1 .R 8>>> > >> > .CPY LUP-ADD-FILE>) ( <==? <1 .R> ,ACK>> )> >)>)> "CREATE" "ASCII">> > ) (SNM: ) (NM2: ) (FN: )) > > > > )> > )>>>> ;"LUP-DEL-FILE Effect: Remove file named NAME from active library directory. Returns: T if successful, FALSE otherwise." ,ACTLIB)) ) (> )> 8>>>>)) <==? <1 .R> ,ACK>> ) (T )>>)>)> >>> ;"LIBRARY-RECORD-EXISTS? -- Effect: Determine if active library contains module named PKG. Returns: T if it exists, otherwise FALSE." 8>>>>)) <==? <1 .MSG> ,ACK>>>>)>)> >>> ;"LIBRARY-FILE-EXISTS? -- Effect: Determine if active library directory contains file named NAME. Returns: T if it exists, otherwise FALSE." 8>>>>)) <==? <1 .MSG> ,ACK>>>>)>)> >>> ;"DSK-FILE-COPY -- Effect: Copy FROM to TO. Modifies: FROM, TO." TO:) >) AMOUNT:FIX) 0>> )>>> ;"LOCAL-UPDATE -- Effect: Add a module to a local library. The module is represented by RECORD. COPY? specifies whether or not files are to be copied. FILES is (in order, some missing possibly) the file spec vectors for MSUBR, MUD, ABSTR, DOC. A file spec vector is [NAME NM1 NM2 DEV SNM]. Returns: T if successful, FALSE otherwise. Requires: RECORD is properly formatted library record as defined in LIBRARY.FORMAT." LIBC: "TUPLE" FILES:) ) (SNM: ) NM2: FROM: TO: NAME:STRING FN:) ;"Copy files." FALSE>) > <=? .SNM <5 .FV>>>> ;"We have to copy files in library directory regardless of COPY? since user may have moved files there without updating library. Thus, if he deleted a record, we would delete new files." > )> "READ">> > > > >> !.ADD)> )>)>> .FILES> >> ;"BUILD-RECORD -- Effect: Create a library record. Returns: The actual length of the record. Modifies: Record. Note: CFN, SFN, AFN, DOC are file specs (except DOC can be string). USES, EXPORTS, INCLUDES are lists of modules referenced by the module. ENTRYS, RENTRYS are the obvious." COPY?: CFN: SFN: AFN: DOC: ENTRYS:VECTOR RENTRYS:VECTOR USES:VECTOR EXPORTS:VECTOR INCLUDES:VECTOR RECORD:UVECTOR "AUX" (RECLEN:FIX ) (SFNLEN:FIX 0) (PDNLEN:FIX ) (CFNLEN:FIX 0) (AFNLEN:FIX 0) (DOCLEN:FIX 0) DELTAE:FIX DELTAU:FIX) <1 .RECORD ;"File bits for record info word." ,RINFO-DOC?) (.DOC ,RINFO-DFN?) (T 0)> .PDNLEN>> ;"And length of name in words." >> ;"Module name." >> NM1.NM2." ;"Implies default SNM, DEV." !\. <3 .CFN>>>>> >)> !\. <3 .SFN>>>>> >)> !\. <3 .AFN>>>>> >)> !\. <3 .DOC>>>)> > >)>) (T ;"Otherwise full name." >:STRING>> >)> >:STRING>> >)> >:STRING>> >)> >)> > >)>)> >> ;"Start of r/entry list." > > > ) ( > >) ( > >> 0>> > >) (T > >)> ;"Construct r/entry descriptor. Name length, type info, name." <1 .RECORD >> .TYPES>>> 8> ,ERTYP-APPLICABLE) (T 0)>>) (T 0)> %> ,ERTYP-ENTRY?) (T 0)> ,ERTYP-MANIFEST?) (T 0)> ,ERTYP-TYPE?) (T 0)> > 16>>> >> >> >> ;"Start of U/X/I list." UXITYPE:FIX UXILEN:FIX) ;"Again, the vectors are sorted and we merge sort them into record." >) (T > )> > > 0>>> > )> > > 0>>> > )> > > > ) (<==? .UXITYPE ,UXI-USED?> >) (<==? .UXITYPE ,UXI-INCLUDED?> >) (T >)> ;"Construct descriptor. Bit indicating reference type, name length, name." <1 .RECORD >>> >> >> ;"Compute length of record and shove into record info word. Fix up r/entry count - displacement word. Fixup U/X/I count - displacement word." >> <1 > >> <1 >> .CFNLEN>> <1 > <+ >>> <1 <+ >>> .RECLEN>