From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  7-JUN-1989 03:07
To:	MRGATE::"ARISIA::EVERHART"
Subj:	MAINT -- Full Screen File/Directory Maintenance (Part 1 of 11)

Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Tue,  6 JUN 89 14:31:09 PDT
Received: from ucbvax.Berkeley.EDU by KL.SRI.COM with TCP; Tue, 6 Jun 89 14:21:34 PDT
Received: by ucbvax.Berkeley.EDU (5.61/1.36)
	id AA28371; Tue, 6 Jun 89 14:02:12 -0700
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 6 Jun 89 20:22:45 GMT
From: peirce@gumby.wisc.edu  (Leonard J. Peirce)
Organization: Western Michigan University, Kalamazoo, MI
Subject: MAINT -- Full Screen File/Directory Maintenance (Part 1 of 11)
Message-Id: <736@gumby.cc.wmich.edu>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

$! ................... Cut between dotted lines and save. ...................
$!...........................................................................
$! VAX/VMS archive file created by VMS_SHARE V06.10 7-FEB-1989.
$!
$! VMS_SHARE was written by James Gray (Gray:OSBUSouth@Xerox.COM) from
$! VMS_SHAR by Michael Bednarek (U3369429@ucsvc.dn.mu.oz.au).
$!
$! To unpack, simply save, concatinate all parts into one file and
$! execute (@) that file.
$!
$! This archive was created by user PEIRCE
$! on  6-JUN-1989 14:43:06.87.
$!
$! ATTENTION: To keep each article below 100 blocks (51200 bytes), this
$!            program has been transmitted in 11 parts.  You should
$!            concatenate ALL parts to ONE file and execute (@) that file.
$!
$! It contains the following 18 files:
$!        000README.TXT
$!        ABSTRACT.TXT
$!        ACLDEF.H
$!        BUILD.COM
$!        BUILD.OPT
$!        CLIDEF.H
$!        COPYRIGHT.TXT
$!        FSCNDEF.H
$!        ITMLST.H
$!        MAINT.C
$!        MAINT.CLD
$!        MAINT.H
$!        MAINT.HLP
$!        MAINT.NEWS
$!        MAINT2.C
$!        MINE.CLD
$!        SUBS.C
$!        UTYPE.H
$!
$!============================================================================
$ SET SYMBOL/SCOPE=( NOLOCAL, NOGLOBAL )
$ VERSION = F$GETSYI( "VERSION" )
$ IF VERSION .GES "V4.4" THEN GOTO VERSION_OK
$ WRITE SYS$OUTPUT "You are running VMS ''VERSION'; ", -
    "VMS_SHARE V06.10 7-FEB-1989 requires VMS V4.4 or higher."
$ EXIT 44 ! SS$_ABORT
$VERSION_OK:
$ GOTO START
$!
$UNPACK_FILE:
$ WRITE SYS$OUTPUT "Creating ''FILE_IS'"
$ DEFINE/USER_MODE SYS$OUTPUT NL:
$ EDIT/TPU/COMMAND=SYS$INPUT/NODISPLAY/OUTPUT='FILE_IS'/NOSECTION -
    VMS_SHARE_DUMMY.DUMMY
b_part := CREATE_BUFFER( "{Part}", GET_INFO( COMMAND_LINE, "file_name" ) )
; s_file_spec := GET_INFO( COMMAND_LINE, "output_file" ); SET( OUTPUT_FILE
, b_part, s_file_spec ); b_errors := CREATE_BUFFER( "{Errors}" ); i_errors 
:= 0; pat_beg_1 := ANCHOR & "-+-+-+ Beginning"; pat_beg_2 := LINE_BEGIN 
& "+-+-+-+ Beginning"; pat_end := ANCHOR & "+-+-+-+-+ End"; POSITION
( BEGINNING_OF( b_part ) ); LOOP EXITIF SEARCH( SPAN( ' ' )@r_trail 
& LINE_END, FORWARD) = 0; POSITION( r_trail ); ERASE( r_trail ); ENDLOOP
; POSITION( BEGINNING_OF( b_part ) ); i_append_line := 0; LOOP EXITIF MARK
( NONE ) = END_OF( b_part ); s_x := ERASE_CHARACTER( 1 )
; IF s_x = '+' THEN r_skip := SEARCH( pat_beg_1, FORWARD, EXACT ); IF r_skip 
<> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ERASE_LINE; ENDIF
; ENDIF; IF s_x = '-' THEN r_skip := SEARCH( pat_end, FORWARD, EXACT )
; IF r_skip <> 0 THEN s_x := ''; MOVE_HORIZONTAL( -CURRENT_OFFSET ); m_skip 
:= MARK( NONE ); r_skip := SEARCH( pat_beg_2, FORWARD, EXACT ); IF r_skip 
<> 0 THEN POSITION( END_OF( r_skip ) ); MOVE_HORIZONTAL( -CURRENT_OFFSET )
; MOVE_VERTICAL( 1 ); MOVE_HORIZONTAL( -1 ); ELSE POSITION( END_OF( b_part ) 
); ENDIF; ERASE( CREATE_RANGE( m_skip, MARK( NONE ), NONE ) ); ENDIF; ENDIF
; IF s_x = 'V' THEN s_x := ''; IF i_append_line <> 0 THEN APPEND_LINE
; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF; i_append_line := 1
; MOVE_VERTICAL( 1 ); ENDIF; IF s_x = 'X' THEN s_x := ''; IF i_append_line 
<> 0 THEN APPEND_LINE; MOVE_HORIZONTAL( -CURRENT_OFFSET ); ENDIF
; i_append_line := 0; MOVE_VERTICAL( 1 ); ENDIF; IF s_x <> '' THEN i_errors 
:= i_errors + 1; s_text := CURRENT_LINE; POSITION( b_errors ); COPY_TEXT
( "The following line could not be unpacked properly:" ); SPLIT_LINE
; COPY_TEXT( s_x ); COPY_TEXT( s_text ); POSITION( b_part ); MOVE_VERTICAL
( 1 ); ENDIF; ENDLOOP; POSITION( BEGINNING_OF( b_part ) ); LOOP r_x := SEARCH
( "`", FORWARD, EXACT ); EXITIF r_x = 0; POSITION( r_x ); ERASE_CHARACTER( 1 
); COPY_TEXT( ASCII( INT( ERASE_CHARACTER( 3 ) ) ) ); ENDLOOP
; IF i_errors = 0 THEN SET( NO_WRITE, b_errors, ON ); ELSE POSITION
( BEGINNING_OF( b_errors ) ); COPY_TEXT( FAO
( "The following !UL errors were detected while unpacking !AS", i_errors
, s_file_spec ) ); SPLIT_LINE; SET( OUTPUT_FILE, b_errors, "SYS$COMMAND" )
; ENDIF; EXIT; 
$ DELETE VMS_SHARE_DUMMY.DUMMY;*
$ CHECKSUM 'FILE_IS
$ WRITE SYS$OUTPUT " CHECKSUM ", -
  F$ELEMENT( CHECKSUM_IS .EQ. CHECKSUM$CHECKSUM, ",", "failed!!,passed." )
$ RETURN
$!
$START: 
$ FILE_IS = "000README.TXT"
$ CHECKSUM_IS = 1783381641
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
XMAINT Installation Guide
XLast update:  06-Jun-1989
X
X   Welcome to MAINT!  First a little bit about what MAINT does.
X
V   MAINT is a screen-oriented file and directory maintenance program.  It wil
Xl
Xallow you to do all sorts of things to files and directories with just a few
Xkeystrokes.  It also makes it easier to scan a bunch of directories and sub-
Xdirectories very quickly.  It has a number of different startup options for
Xformatting the information on the screen and the a whole slew of commands
Xthat may be specified.
X
V   I know the above paragraph seems a little sketchy but after you start usin
Xg
XMAINT, I think that you will find that it can be a very useful tool.  We
Xhave been using it for quite a while here and I have gotten a lot of positive
Xfeedback on it, including many suggestions for improving it.
X
V   The idea for MAINT is not necessarily my own.  I was influenced by a numbe
Xr
Xof different packages that I have seen on many different machines.  Nothing
Xlike it existed for VMS, however (at least not here!).  I started writing it
Xone day, borrowing all kinds of ideas from a very similar program that was
Xwritten by a co-worker some time ago for our DECsystem-10.
X
XWhat's included with MAINT:
X---------------------------
X
X   The source code is included in case you want to see how some things are
Xdone or if you want to hack on it.  I don't mind as long as the copyright
Xnotice (COPYRIGHT.TXT) stays with it if you give it to someone else and you
Xdon't claim you wrote it or try to make money from it.  If you come up with
Xa bug fix or a new feature, I'd be very interested in hearing about it.
X
X   If you look at the source code, you might be surprised by the number of
Xcomments in the code.  Call me over-zealous but I like comments in my code.
XJust the other day I was fixing some code that I had written about three
Xmonths previous and I had a hard time figuring out what was happening.
X
X   You will also see little comments in the code that look like "/*eject*/".
XThese are just little preprocessor directives to a program that I use here
Xto print it on the line printer; you can just ignore them if you want or
Xmaybe you could change them to form-feeds.  Personally, I like to have all
Xmy listings such that all functions start on a new page :-).
X
X   Source code
X   -----------
X   MAINT.C`009`009main source file
X   MAINT2.C`009`009secondary source file
X   SUBS.C`009`009general-purpose subroutines
X   MAINT.H`009`009MAINT's very own header file
X
X   CLD file
X   --------
X   MAINT.CLD
X
X   COM file
X   --------
X   BUILD.COM
X
X   HELP file
X   ---------
X   MAINT.HLP
X
X   Miscellaneous header files
X   --------------------------
X   ACLDEF.H
X   UTYPE.H
X   ITMLST.H
X   FSCNDEF.H
X
X   Miscellaneous files
X   -------------------
X   MAINT.NEWS`009`009`009`009newsletter article
X   ABSTRACT.TXT`009`009`009`009short abstract describing MAINT
X   000README.TXT`009`009`009this file!
X   BUILD.OPT`009`009`009`009options file for LINK step
X
XBefore building MAINT
X---------------------
X
X   Look at the file MAINT.H.  There is a #define for EXTERNAL_HLB.  Defining
Xthis will make MAINT use an external help library SYS$HELP:MAINT.HLB.  Not
Xdefining it will make MAINT look in the standard VMS help library
XSYS$HELP:HELPLIB.HLB.  My boss here doesn't like making our VMS help
Xlibrary too big, thus the external option.
X
X
XInstalling MAINT
X----------------
X
X1. Installing MAINT system-wide
X-------------------------------
X
XYou will need the following privileges to install MAINT:
X
X     - SYSPRV - for copying stuff to SYS$SYSTEM: and modifying the system
X                help library
X     - CMKRNL - for running INSTALL
X
XThese aren't the only two privileges that will work.  BYPASS seems to work
Vreal well :-).  You will also have to have SYS$LIBRARY:ACLEDTSHR.EXE installe
Xd
Xfor MAINT to work.
X
XRealize of course the MAINT doesn't need these privileges to run.  You only
Xneed to have these priveleges to build and install the program system-wide.
XMAINT needs no privileges to run.
X
X  1. Building the executable (MAINT.EXE)
X
X        To build MAINT, simply use the BUILD.COM file:
X
X        $ @BUILD
X
X  2. Copy MAINT.EXE to SYS$SYSTEM.
X
X        $ COPY/PROT=(S:RWED,O:RWED,G:E,W:E) MAINT.EXE SYS$SYSTEM:
X
X  3. Run INSTALL to install MAINT.EXE (optional)
X
X        $ INSTALL :== $INSTALL/COMMAND
X        $ INSTALL
X        INSTALL> ADD SYS$SYSTEM:MAINT.EXE/OPEN/HEADER/SHARE
X`009INSTALL> EXIT
X
X  4. Install the .CLD file.
X
X     The following command should suffice:
X
V        $ SET COMMAND/TABLE=SYS$LIBRARY:DCLTABLES/OUTPUT=SYS$LIBRARY:DCLTABLE
XS -
X        _$ MAINT
X
X     Then run INSTALL and do a REPLACE on DCLTABLES.
X
X        $ INSTALL :== $INSTALL/COMMAND
X        $ INSTALL
X        INSTALL> REPLACE SYS$LIBRARY:DCLTABLES.EXE
X`009INSTALL> EXIT
X
X  5. Install the help library.
X
X     a) if you (1) built MAINT.EXE from the .OBJ files or (2) build from the
X        the sources AND you did NOT #define EXTERNAL_HLB, install MAINT.HLP
X        in the system help library SYS$HELP:HELPLIB.HLB:
X
X        $ LIBRARY/HELP/INSERT SYS$HELP:HELPLIB.HLB MAINT.HLP    `032
X
X        Of course, you need exclusive access to HELPLIB.HLB before you can
X        do this.  I usually accomplish this by reprotecting it and then
X        making sure no one is using it :-).
X
X     b) if you didn't choose a), you must've built from the sources AND
X        added #define EXTERNAL_HLB.  In this case, you must first build a
X        help library by entering
X
X           $ LIBRARY/HELP/CREATE MAINT.HLB MAINT.HLP
X
X        Now copy it out to SYS$HELP:
X
X           $ COPY/PROT=(S:RWED,O:RWED,G:R,W:R) MAINT.HLB SYS$HELP:
X
X  6. Log out and log back in to get the new version of DCLTABLES or do the
X     following command:
X
X        $ SET COMMAND/TABLE=SYS$LIBRARY:DCLTABLES.EXE
X
X   That's it!  Enter "MAINT" and see what happens.  Once you get in, you can
Xpress the Help key or just "h" for help.  To quit, you can enter "q".
X
X   You should also be able to enter "HELP MAINT" (if you installed the help
Xfile in SYS$HELP:HELPLIB.HLB or "MAINT/HELP" in either case.
X
X2. Installing MAINT in your own area
X------------------------------------
X
XYou're probably reading this section since you don't have permission to
Vinstall MAINT system-wide.  Take heart in the fact that MAINT can be installe
Xd
Xin a local area (this is actually the way I debug it).  To do it, however,
Vyou must rebuild from the sources (in other words, you must have a C compiler
X).
X
XAnyway, here's what you have to do:
X
X   1. In MAINT.H, enter the following line:
X
X      #define EXTERNAL_HLB
X
X      This will make MAINT look in it's own HELP library when you ask for it.
X      Place this line as the first #define in the file.
X
X   2. In MAINT.C, find the definition of the helplib_d descriptor.  It's
X      actually inside of an #ifdef statement.  It should look something like
X`032
X      #ifdef EXTERNAL_HLB
X      static $DESCRIPTOR(helplib_d,"SYS$HELP:MAINT.HLB");
X      #else
X      static $DESCRIPTOR(helplib_d,"SYS$HELP:HELPLIB.HLB");
X      #endif
X
X      Change the first definition from "SYS$HELP:MAINT.HLB" to where you
X      want the help library to be in your area.
X
X   3. Create the help library:
X
X      $ library/help/create your-help-library-name MAINT.HLP
X
V      where "your-help-library-name" is the name of the MAINT.HLB file in you
Xr
X      area.
X
X   4. Modify the .CLD file to point to the executable in your area.  There
X      is a line in the MAINT.CLD file that looks like
X
X      image sys$system:maint.exe
X
X      Change "sys$system:maint.exe" to be the name of the MAINT.EXE file
X      in your area.
X
X   5. Do a SET COMMAND on the MAINT.CLD file in your LOGIN.COM so that it
X      will be done every time you login.  The form is just
X
X      $ set command your-cld-file-name
X
X      where "your-cld-file-name" is the name of the MAINT.CLD file in your
X      area.
X
X   6. Rebuild MAINT from the sources by entering the command
X
X      @build
X
X   7. Rename the MAINT.EXE file to match the change you made to the .CLD
X      file.
X
X   8. Now either do a SET COMMAND MAINT or logout and log in to set up
X      the .CLD file for MAINT.
X
XThat's it!  Enter the command
X
X$ MAINT
X
Xand it "should" work.  MAINT/HELP might be a good first command to try.
X
XKnown glitches
X--------------
X
V   By doing HELP MAINT Caveats, you will get a list of the known "gotchas" th
Xat
Xstill exist in MAINT.  Some of them I just haven't had time to work out; a
Xfew either have me stumped on how to accomplish them or I know to do it
Xbut I haven't figured out WHERE to put it in MAINT.  Hopefully, by the time
XI finally decide to quit playing with this thing, the list will be gone.
X
X   There is probably an infinite number of little bugs (especially in the
XExpand command, although I think I have most of the information there) but I
Xthink that I weeded out quite a few of them.
X
XA word of advice about using MAINT
X----------------------------------
X
X   Even though MAINT requires no privileges to run, watch out if you have
Xprivileges turned on.  Once when I was testing MAINT I needed a directory
Xthat had a lot of files in it.  Like a dummy I chose to use SYS$SYSTEM.
XWell, I had SYSPRV turned on and I had a bunch of files marked for deletion;
XI had no intention of deleting them, though.  Anyway, the line to my terminal
Vsometimes has a mind of its own and on this occasion, it spit out an "X" whic
Xh
Xmeans "execute the marks".  After I opened my eyes, I realized that I had
Xwiped out quite a bit of SYS$SYSTEM.
X
X   It was after this fiasco that I added the /CONFIRM switch that asks if you
XREALLY want to execute commands.  I defined MAINT to have the /CONFIRM switch
Xin my LOGIN.COM after that and it has actually saved me from screwing up on
Xmore than one occasion.
X
XIf you want to hack on the code
X-------------------------------
X
X   Look at MAINT.C for a little information about some of the data structures
Xused and some built-in debugging mechanisms.  The debugging mechanisms are
Xreally just some #ifdef'd code that makes it easier to run DEBUG on MAINT.
X
XIf you have problems installing MAINT
X-------------------------------------
X
XFeel free to call me or send me some e-mail and let me know how I blew it.
XI'll do what I can to make sure that MAINT can be installed at your site.
X
XConclusion
X----------
X
VI put a lot of work into MAINT and I would appreciate any comments/suggestion
Xs/
Xflames that you might have.  I'd like to keep track of where MAINT is being
Xused for a couple of reasons:  1) this is my first submission to the net and
XI'm just curious about how many sites find this thing useful and 2) to
Xsend out any bug fixes that come up.  I would appreciate it if you would
Veither send me some e-mail to one of the addresses below or phoning me, letti
Xng
Xme know that you installed MAINT and what your thoughts are about it.
X
XWhile I'm sure that there other products available that do about the same
Xstuff that MAINT does, I still feel that you will find it useful.  At any
Xrate, I use it quite a bit, even if no one else does :-).
X
X-----
XLeonard J. Peirce`009`009Internet:  peirce@gumby.cc.wmich.edu
XWestern Michigan University`009`009   peirce@gw.wmich.edu
XAcademic Computer Center`009UUCP:      ...uunet!sharkey!wmichgw!peirce
XKalamazoo, MI  49008`009`009Voice:     (616) 387-5430
$ GOSUB UNPACK_FILE

$ FILE_IS = "ABSTRACT.TXT"
$ CHECKSUM_IS = 51209422
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
XABSTRACT.TXT
X------------
X
XMAINT is a full-screen Directory/File Maintenance utility.  Directories
Xare presented to the user in a series of one or more screens, allowing the
Xuser to work with an entire directory at one time instead of working with a
Xfew files and having to do a DIRECT to see the current state of the
Xdirectory.  Run-time switches provide the user the opportunity to tailor
Xwhat information is included on the screen and the option of including
Xuser-defined extended textual descriptors for individual files/directories.
X
XThe following functions are available in MAINT:
X
X   1) delete files/directories
X   2) copy files
X   3) rename files/directories
X   4) protect files/directories
X   5) edit an Access Control List (ACL) for a file/directory
X   6) list a file's contents to the screen
X   7) change to a subdirectory
X   8) get full directory information on a file
X   9) search for a specific file in a directory
X  10) suspend MAINT and return to DCL level, either indefinitely or just
X      to execute one command
X  11) create/access extended textual descriptors for files and directories
X  12) access on-line help
X
XBy combining the above capabilities with a full-screen interface and some
Xadded functionality, the user can work with entire directory structures
Xquickly, easily, and efficiently just by pressing a few keys.
X
XOne very important feature of MAINT is that execution of the operations on
Xfiles is NOT done until you tell it to go ahead and perform them.  In other
Xwords, you can work with all of the files, specifying the operations, and
Xthen tell MAINT to execute them all at once.  This means that you have time
Xto change your mind and perhaps undo the operations on one or more of the
Xfiles.
$ GOSUB UNPACK_FILE

$ FILE_IS = "ACLDEF.H"
$ CHECKSUM_IS = 1545086961
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X#ifndef ACLDEF_H
V/****************************************************************************
X**
V*****************************************************************************
X**
X
X   Installation:  Western Michigan University Academic Computer Center
X
X   System:`009ACL definitions
X `032
X   Header name:  acldef.h
X
X   Version=01   Level=01           12/10/87  Leonard J. Peirce
X
X   Purpose:  Symbolic definitions for ACL's.  Extracted from
X`009     SYS$LIBRARY:STARLET.MLB and converted to C.
X
X   Other information:  Originally written by DEC (author unknown).
X
V*****************************************************************************
X***
V*****************************************************************************
X**/
X
X#define ACLDEF_H 1`009`009`009/* to prevent multiple inclusion      */
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*                        # I N C L U D E   F I L E S                    `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*                             # D E F I N E S                           `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X#define ACL$K_LENGTH`00912
X#define ACL$C_LENGTH`00912
X#define ACL$C_FILE`0091
X#define ACL$C_DEVICE`0092
X#define ACL$C_JOBCTL_QUEUE`0093
X#define ACL$C_COMMON_EF_CLUSTER`0094
X#define ACL$C_LOGICAL_NAME_TABLE`0095
X#define ACL$C_PROCESS`0096
X#define ACL$C_GROUP_GLOBAL_SECTION`0097
X#define ACL$C_SYSTEM_GLOBAL_SECTION`0098
X#define ACL$C_ADDACLENT`0091
X#define ACL$C_DELACLENT`0092
X#define ACL$C_MODACLENT`0093
X#define ACL$C_FNDACLENT`0094
X#define ACL$C_FNDACETYP`0095
X#define ACL$C_DELETEACL`0096
X#define ACL$C_READACL`0097
X#define ACL$C_ACLLENGTH`0098
X#define ACL$C_READACE`0099
X#define ACL$C_RLOCK_ACL`00910
X#define ACL$C_WLOCK_ACL`00911
X#define ACL$C_UNLOCK_ACL`00912
X#define ACL$S_ADDACLENT`009255
X#define ACL$S_DELACLENT`009255
X#define ACL$S_MODACLENT`009255
X#define ACL$S_FNDACLENT`009255
X#define ACL$S_FNDACETYP`009255
X#define ACL$S_DELETEACL`009255
X#define ACL$S_READACL`009512
X#define ACL$S_ACLLENGTH`0094
X#define ACL$S_READACE`009255
X#define ACL$S_RLOCK_ACL`0094
X#define ACL$S_WLOCK_ACL`0094
X#define ACL$S_UNLOCK_ACL`0094
X#define ACL$S_ACLDEF`00916
X#define ACL$L_FLINK`0090
X#define ACL$L_BLINK`0094
X#define ACL$W_SIZE`0098
X#define ACL$B_TYPE`00910
X#define ACL$L_LIST`00912
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*          S T R U C T U R E S ,   U N I O N S ,   T Y P E D E F S      `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*   E X T E R N A L   D E F I N I T I O N S   &   D E C L A R A T I O N S
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*     S T A T I C   D E F I N I T I O N S   &   D E C L A R A T I O N S `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X#endif
$ GOSUB UNPACK_FILE

$ FILE_IS = "BUILD.COM"
$ CHECKSUM_IS = 302218396
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X$! BUILD.COM -- build MAINT
X$!
X$ IF P1 .EQS. "OBJ" THEN GOTO BUILD_OBJ
X$!
X$! build MAINT from the sources
X$!
X$  write sys$output "Building MAINT from the sources"
X$  write sys$output ""
X$  write sys$output "CC:`009MAINT.C"
X$  cc maint.c
X$  write sys$output "CC:`009MAINT2.C"
X$  cc maint2.c
X$  write sys$output "CC:`009SUBS.C"
X$  cc subs.c
X$BUILD_OBJ:
X$  write sys$output ""
X$  write sys$output "Linking MAINT"
X$  link/notrace maint,maint2,subs,build.opt/opt
X$  write sys$output ""
X$  write sys$output "*** MAINT built ***"
X$  exit
$ GOSUB UNPACK_FILE

$ FILE_IS = "BUILD.OPT"
$ CHECKSUM_IS = 1929406956
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
XSYS$SHARE:VAXCRTL.EXE/SHARE
$ GOSUB UNPACK_FILE

$ FILE_IS = "CLIDEF.H"
$ CHECKSUM_IS = 1612661551
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X#ifndef CLIDEF_H
V/****************************************************************************
X**
V*****************************************************************************
X**
X
X   Installation:  Western Michigan University Academic Computer Center
X
X   System:  Command Language Interface
X `032
X   Header name:  clidef.h
X
X   Version=01   Level=01           04/23/87  Leonard J. Peirce
X
X   Purpose:  Extracted from SYS$LIBRARY:STARLET.MLB and converted to C.
X
X   Other information:  Originally written by DEC (author unknown).
X
V*****************************************************************************
X***
V*****************************************************************************
X**/
X
X#define CLIDEF_H 1`009`009`009/* to prevent multiple inclusion      */
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*                        # I N C L U D E   F I L E S                    `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*                             # D E F I N E S                           `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X#define CLI$M_DEBUG`0091
X#define CLI$M_DBGTRU`0092
X#define CLI$M_VERIFY`0094
X#define CLI$M_BATCH`0098
X#define CLI$M_INDIRECT`00916
X#define CLI$M_VFYINP`00932
X#define CLI$M_TRMVRBLV`009768
X#define CLI$M_DBGEXCP`00965536
X#define CLI$S_CLIDEF`00932
X#define CLI$L_INIARGCNT`0090
X#define CLI$A_PROGXFER`0094
X#define CLI$A_UTILSERV`0098
X#define CLI$A_IMGHDADR`00912
X#define CLI$A_IMGFILED`00916
X#define CLI$L_LINKFLAG`00920
X#define CLI$L_CLIFLAG`00924
X#define CLI$V_DEBUG`0090
X#define CLI$V_DBGTRU`0091
X#define CLI$V_VERIFY`0092
X#define CLI$V_BATCH`0093
X#define CLI$V_INDIRECT`0094
X#define CLI$V_VFYINP`0095
X#define CLI$S_TRMVRBLV`0092
X#define CLI$V_TRMVRBLV`0098
X#define CLI$V_DBGEXCP`00916
X#define CLI$L_ARGLIST`00928
X#define CLI$M_PARMREQ`0091
X#define CLI$M_ABSADR`0092
X#define CLI$M_EXPNAM`0094
X#define CLI$M_LASTVAL`0091
X#define CLI$M_DUMMY`0092
X#define CLI$M_PARMPRS`0091
X#define CLI$M_CONCATINP`0092
X#define CLI$M_MOREINP`0094
X#define CLI$M_PARMDEF`0098
X#define CLI$M_MOREVALS`0091
X#define CLI$M_KEYVALU`0092
X#define CLI$K_REQDESC`00928
X#define CLI$C_REQDESC`00928
X#define CLI$S_CLIDEF1`00928
X#define CLI$B_RQTYPE`0090
X#define CLI$S_SUBTYP`0094
X#define CLI$V_SUBTYP`0090
X#define CLI$S_PRITYP`0094
X#define CLI$V_PRITYP`0094
X#define CLI$W_SERVCOD`0091
X#define CLI$B_RQINDX`0091
X#define CLI$B_BITNUM`0091
X#define CLI$B_RQFLGS`0092
X#define CLI$V_PARMREQ`0090
X#define CLI$V_ABSADR`0091
X#define CLI$V_EXPNAM`0092
X#define CLI$V_LASTVAL`0090
X#define CLI$V_DUMMY`0091
X#define CLI$B_RQSTAT`0093
X#define CLI$V_PARMPRS`0090
X#define CLI$V_CONCATINP`0091
X#define CLI$V_MOREINP`0092
X#define CLI$V_PARMDEF`0093
X#define CLI$V_MOREVALS`0090
X#define CLI$V_KEYVALU`0091
X#define CLI$A_ERRACT`0094
X#define CLI$S_RQDESC`0098
X#define CLI$Q_RQDESC`0098
X#define CLI$W_RQSIZE`0098
X#define CLI$L_RQVALU`00912
X#define CLI$A_RQADDR`00912
X#define CLI$A_PRSACT`00916
X#define CLI$A_ABSACT`00920
X#define CLI$A_QUALST`00924
X#define CLI$S_CLIDEF2`00936
X#define CLI$S_NAMDESC`0098
X#define CLI$Q_NAMDESC`0094
X#define CLI$S_VALDESC`0098
X#define CLI$Q_VALDESC`00912
X#define CLI$S_TABDESC`0098
X#define CLI$Q_TABDESC`00920
X#define CLI$L_ITMLST`00928
X#define CLI$L_ATTR`00932
X#define CLI$S_CLIDEF3`00912
X#define CLI$L_NEW_MASK`0094
X#define CLI$L_OLD_MASK`0098
X#define CLI$S_CLIDEF4`0098
X#define CLI$L_PID`0094
X#define CLI$M_NOWAIT`0091
X#define CLI$M_NOCLISYM`0092
X#define CLI$M_NOLOGNAM`0094
X#define CLI$M_NOKEYPAD`0098
X#define CLI$M_NOTIFY`00916
X#define CLI$M_NOCONTROL`00932
X#define CLI$K_SPAWN_VERSION`0091
X#define CLI$C_SPAWN_VERSION`0091
X#define CLI$K_SRVDESC`00984
X#define CLI$C_SRVDESC`00984
X#define CLI$S_CLIDEF5`00984
X#define CLI$B_FLAGS`0094
X#define CLI$V_NOWAIT`0090
X#define CLI$V_NOCLISYM`0091
X#define CLI$V_NOLOGNAM`0092
X#define CLI$V_NOKEYPAD`0093
X#define CLI$V_NOTIFY`0094
X#define CLI$V_NOCONTROL`0095
X#define CLI$L_OUTPID`0098
X#define CLI$L_LSTSTATUS`00912
X#define CLI$S_CMDSTR`0098
X#define CLI$Q_CMDSTR`00916
X#define CLI$S_INPUT`0098
X#define CLI$Q_INPUT`00924
X#define CLI$S_OUTPUT`0098
X#define CLI$Q_OUTPUT`00932
X#define CLI$S_PRCNAM`0098
X#define CLI$Q_PRCNAM`00940
X#define CLI$L_ASTADR`00948
X#define CLI$L_ASTPRM`00952
X#define CLI$B_EFN`00956
X#define CLI$B_VERSION`00957
X#define CLI$S_PROMPT`0098
X#define CLI$Q_PROMPT`00960
X#define CLI$S_CLI`0098
X#define CLI$Q_CLI`00968
X#define CLI$S_TABLE`0098
X#define CLI$Q_TABLE`00976
X#define CLI$M_ALLOCCUR`0091
X#define CLI$M_QDUSRV`0092
X#define CLI$M_QDEXPA`0094
X#define CLI$M_QUALTRU`0091
X#define CLI$M_QUALEXP`0092
X#define CLI$K_QUALDEF`00920
X#define CLI$C_QUALDEF`00920
X#define CLI$K_QDBITS`00920
X#define CLI$C_QDBITS`00920
X#define CLI$S_CLIDEF6`00924
X#define CLI$B_QDBLKSIZ`0090
X#define CLI$B_QDCODE`0091
X#define CLI$B_QDFLGS`0092
X#define CLI$V_ALLOCCUR`0090
X#define CLI$V_QDUSRV`0091
X#define CLI$V_QDEXPA`0092
X#define CLI$B_QDSTAT`0093
X#define CLI$V_QUALTRU`0090
X#define CLI$V_QUALEXP`0091
X#define CLI$S_QDVALDESC`0098
X#define CLI$Q_QDVALDESC`0094
X#define CLI$W_QDVALSIZ`0094
X#define CLI$A_QDVALADR`0098
X#define CLI$A_TRUACT`00912
X#define CLI$A_FLSACT`00916
X#define CLI$L_USRVAL`00920
X#define CLI$K_WORKAREA`009128
X#define CLI$C_WORKAREA`009128
X#define CLI$K_UTILOPR`0090
X#define CLI$K_INPSPEC`0091
X#define CLI$K_OUTSPEC`0092
X#define CLI$K_PARDONE`0093
X#define CLI$K_VALCONV`0094
X#define CLI$K_CLINT`0095
X#define CLI$K_INITPRS`0090
X#define CLI$K_GETCMD`0091
X#define CLI$K_GETQUAL`0092
X#define CLI$K_GETOPT`0093
X#define CLI$K_GETLINE`0094
X#define CLI$K_CLISERV`0095
X#define CLI$K_INPUT1`00916
X#define CLI$K_INPUT2`00917
X#define CLI$K_INPUT3`00918
X#define CLI$K_INPUT4`00919
X#define CLI$K_OUTPUT1`00932
X#define CLI$K_OUTPUT2`00933
X#define CLI$K_OUTPUT3`00934
X#define CLI$K_OUTPUT4`00935
X#define CLI$K_ENDPRM1`00948
X#define CLI$K_ENDPRM2`00949
X#define CLI$K_ENDPRM3`00950
X#define CLI$K_ENDPRM4`00951
X#define CLI$K_NUMERVAL`00964
X#define CLI$K_ASCIIVAL`00965
X#define CLI$K_KEYWORD`00966
X#define CLI$K_KEYVAL`00967
X#define CLI$K_FILSPEC`00968
X#define CLI$K_PRESENT`00980
X#define CLI$K_GETVALUE`00981
X#define CLI$K_ENDPARSE`00982
X#define CLI$K_DCLPARSE`00983
X#define CLI$K_DISPATCH`00984
X#define CLI$K_NEXTQUAL`00985
X#define CLI$S_CLIDEF7`009128
X#define CLI$S_WORKAREA`009128
X#define CLI$L_WORKAREA`0090
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*          S T R U C T U R E S ,   U N I O N S ,   T Y P E D E F S      `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*   E X T E R N A L   D E F I N I T I O N S   &   D E C L A R A T I O N S
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*     S T A T I C   D E F I N I T I O N S   &   D E C L A R A T I O N S `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X#endif
$ GOSUB UNPACK_FILE

$ FILE_IS = "COPYRIGHT.TXT"
$ CHECKSUM_IS = 1029724750
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X`009       MAINT Directory/File Maintenance General Public License
X
X`009`009    (C) Copyright 1988 by Leonard J. Peirce
X
X
X`009`009`009  `009COPYING POLICIES
X
X     Permission is hereby granted for copying and distribution of copies of
X  the MAINT source files, and that of any part thereof, subject to the fol-
X  lowing license conditions:
X
V        1. You may, without additional permission from the author, distribute
X`032
V           MAINT or components of MAINT, with or without additions developed
X by`032
V           you or by others at no charge.  You may also distribute MAINT alon
Xg`032
X           with any other product for sale, provided that the cost of the`032
V           bundled package is the same regardless of whether MAINT is include
Xd,
V           and provided that those interested only in MAINT must be notified`
X032
X           that it is a product freely available from the author.
X
X        2. Furthermore, if you distribute MAINT software or parts of MAINT,
V           with or without additions developed by you or others, then you mus
Xt`032
V           either make available the source to all portions of the MAINT syst
Xem`032
V           (exclusive of any additions made by you or by others) upon request
X,`032
X           or instead you may notify anyone requesting source that it is`032
X           freely available from the author.
X
X        3. In addition, you may not omit any of the copyright notices
X           on either the source files, the executable file, or the`032
X           documentation.
X
V        4. Also, you may not omit transmission of this License agreement with
X`032
X           whatever portions of MAINT that are distributed.
X
X        5. Lastly, any users of this software must be notified that it is
V           without warrantee or guarantee of any nature, express or implied,`
X032
X           nor is there any fitness for use represented.
X
XSoftware is a malleable thing and the author can in no way guarantee that
Xusing this program will not cause grevious damage to your system.  Of course
Xthis isn't anticipated, but if it does happen, the author cannot be held
Xliable for any damages either directly or indirectly caused by this event.
X
XModification of the system is encouraged, providing that the portions of`032
Xthe system that are from the original still carry the appropriate copyright
Xnotices and that the changed sections are clearly delimited as such.  The
Vauthor requests copies of any changes made to ensure that the various version
Xs
Xstay reasonably in sync with each other.
X
XNote that it is not permitted to copy, sublicense, distribute or transfer any
Xof the MAINT software except as expressly indicated herein.  Any attempts to
Xdo otherwise will be considered a violation of this license and your rights
Xto the MAINT software will be voided.
X
X
XComments on the system and/or this licensing agreement are encouraged.  Send
Xelectronic mail to "peirce@gw.wmich.edu".  The text of this copyright license
Xwas borrowed from the ELM(tm) Mail System with permission from Dave Taylor.
$ GOSUB UNPACK_FILE

$ FILE_IS = "FSCNDEF.H"
$ CHECKSUM_IS = 1345343343
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X/*** MODULE $fscndef ***/
V/*++                                                                        *
X/
V/*                                                                          *
X/
V/*        Descriptor codes for SYS$FILESCAN                                 *
X/
V/*                                                                          *
X/
V/*                                                                          *
X/
X#define FSCN$M_NODE 1
X#define FSCN$M_DEVICE 2
X#define FSCN$M_ROOT 4
X#define FSCN$M_DIRECTORY 8
X#define FSCN$M_NAME 16
X#define FSCN$M_TYPE 32
X#define FSCN$M_VERSION 64
Xstruct fldflags `123
V    unsigned fscn$v_node : 1;           /* Node name present                *
X/
V    unsigned fscn$v_device : 1;         /* Device name present              *
X/
V    unsigned fscn$v_root : 1;           /* Root directory present           *
X/
V    unsigned fscn$v_directory : 1;      /* Directory present                *
X/
V    unsigned fscn$v_name : 1;           /* File name present                *
X/
V    unsigned fscn$v_type : 1;           /* File type present                *
X/
V    unsigned fscn$v_version : 1;        /* File version present             *
X/
X    unsigned fscn$v_fill_12 : 1;
X    `125 ;
V#define FSCN$_FILESPEC 1                /* complete filespec                *
X/
V#define FSCN$_NODE 2                    /* node:: field                     *
X/
V#define FSCN$_DEVICE 3                  /* device: field                    *
X/
V#define FSCN$_ROOT 4                    /* [root.] field                    *
X/
V#define FSCN$_DIRECTORY 5               /* [directory] field                *
X/
V#define FSCN$_NAME 6                    /* name field                       *
X/
V#define FSCN$_TYPE 7                    /* .typ field                       *
X/
V#define FSCN$_VERSION 8                 /* ;version field                   *
X/
X#define FSCN$S_ITEM_LEN 8
Xstruct fscndef `123
V    unsigned short int fscn$w_length;   /* return length word               *
X/
V    unsigned short int fscn$w_item_code; /* item code value                 *
X/
V    unsigned long int fscn$l_addr;      /* return length pointer            *
X/
X    `125 ;
X`032
$ GOSUB UNPACK_FILE

$ FILE_IS = "ITMLST.H"
$ CHECKSUM_IS = 677278752
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X#ifndef ITMLST_H
V/****************************************************************************
X**
V*****************************************************************************
X**
X
X   Installation:  Western Michigan University Academic Computer Center
X
X   System:  General Purpose Headers
X `032
X   Header name:  itmlst
X
X   Version=01   Level=01           12/04/86  JoAnne M. Hernandez
X
X   Purpose:  Contains a typedef of a structure tag for item lists.
X
X   Other information:  none
X
V*****************************************************************************
X***
V*****************************************************************************
X**/
X
X#define ITMLST_H 1`009`009`009/* to prevent multiple inclusion      */
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*                        # I N C L U D E   F I L E S                    `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X#ifdef WMUACC
X#include utype`009`009`009`009/* typedefs for unsigned types`009      */
X#else
X#include "utype.h"
X#endif
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*                             # D E F I N E S                           `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*          S T R U C T U R E S ,   U N I O N S ,   T Y P E D E F S      `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
Xtypedef`009 struct`009  ITM_TYPE `123
X`009 USHORT`009  buf_len,
X`009`009  itm_code;
X`009 char `009  *buf_addr;
X`009 USHORT`009  *ret_len;
X`125 ITM_LST;
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*   E X T E R N A L   D E F I N I T I O N S   &   D E C L A R A T I O N S
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*     S T A T I C   D E F I N I T I O N S   &   D E C L A R A T I O N S `032
X    */
V/*                                                                       `032
X    */
V/****************************************************************************
X**/
X
X#endif
$ GOSUB UNPACK_FILE

$ FILE_IS = "MAINT.C"
$ CHECKSUM_IS = 1243676033
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
V/****************************************************************************
X**
V*****************************************************************************
X**
X
X   Site:`009Western Michigan University Academic Computer Center
X
X   System:`009Directory/File System Maintenance
X `032
X   Program:`009maint
X
X   Version=01`009Level=01`00908/12/87`009Leonard J. Peirce
X
X   Purpose:`009This program provides the user with a full-screen method for
X`009`009maintaining directories and file systems.  The directory
X`009`009will be presented to the user in a series of screens, each
X`009`009of which will contain information about individual files.
X`009`009The user may move through a directory structure, marking files
X`009`009for deletion, changing protection modes, renaming files,
X`009`009creating text descriptors, copying files, editing files, and
X`009`009viewing files.  Other options are available to allow the user
X`009`009to spawn a subprocess to return to DCL and search for a
X`009`009file.
X
X`009`009See the help file MAINT.HLP for more details.
X
X   Version=01`009Level=02`00909/04/87`009Leonard J. Peirce
X
X   Purpose:`009Make it so that protection strings can be specified exactly
X`009`009the same way they are specified at DCL.  Also display them
X`009`009the same way when an Expand command is issued.
X`009`009Fix a few miscellaneous bugs when making file slots.
X
X   Version=01`009Level=03`00908/04/88`009Leonard J. Peirce
X
X   Purpose:`009Add the capability to edit a file's Access Control List.
X`009`009Also add ACL's to the Expand command for a file.  Fix a number
X`009`009of nagging little bugs that only I would find.
X
X`009`009The information presented in the Expand command has been
X`009`009upgraded to include most (hopefully all) of the different
X`009`009information that will appear on a DIRECTORY/FULL.
X
X`009`009Cursoring now wraps around like it should; this should've
X`009`009been fixed a long time ago but I just now got motivated to
X`009`009do it.
X
X`009`009The /SORT=SIZE option has been added.
X
X`009`009The !/$ command has been added to allow a single DCL command
X`009`009to be executed and MAINT to regain control immediately.  What
X`009`009use this is is open to question.
X
X   Version=01`009Level=04`00908/17/88`009Leonard J. Peirce
X
X   Purpose:`009Fix a little nagging bug with formatting text descriptors
X`009`009that only I would find.
X
X   Version=01`009Level=05`00910/06/88`009Leonard J. Peirce
X
X   Purpose:`009Make the user confirm that they really want to Finish/Quit
X`009`009if there are some files marked.  Also fix a few little nagging
X`009`009bugs that only I find when I'm debugging.
X
X   Version=01`009Level=06`00906/06/89`009Leonard J. Peirce
X
X   Purpose:`009Include all versions for files instead of just the highest
X`009`009version in some situations.
X
X   Arguments:`009See associated CLD file MAINT.CLD and HELP file MAINT.HLP.
X
X   External variables:  none
X
X   WMU external functions:
X
X          Defined: none
X
X          Called:  strindex,cat,strmcpy,strdel
X
X`009  Other external functions called from MAINT2.C.
X
X   Files accessed:  only those in the directory, along with the HELP library.
X
X   Return codes:  return code status from a number of different RTL routines.
X
X   Compiling instructions:
X
X      To compile for production:
X
X         $ CC MAINT.C/OPTIMIZE
X
X      To compile with debugging mechanisms turned on:
X
X         $ CC MAINT.C/DEBU/NOOP/DEFINE=DEBUG
X
X   Linking instructions:
X
X      To link for production:
X
X         $ LINK/NOTRACE MAINT,MAINT2,SYS$SHARE:VAXCRTL.OPT/OPT
X
X      To link in preparation for debugging:
X
X         $ LINK/DEBU/NOOP MAINT,MAINT2,SYS$SHARE:VAXCRTL.OPT/OPT
X
X   Other information:
X
X   Built-in debugging mechanisms
X   -----------------------------
X
X   Debugging programs that use SMG routines can be difficult.  To make things
X   easier, define DEBUG on the command as shown above.  This will make this
X   program easier to debug because it will send its SMG output and get its
X   SMG input from another terminal, the name of which must be set in the
X   DCL symbol MAINT_DEV.  For example,
X
X      $ MAINT_DEV :== LTA306:
X  `032
V   In order to make this work, you must enable SHARE.  Getting used to sharin
Xg
X   keystrokes with the other session (if it is not a permanently connected
X   terminal and you have to log in on it) gets a little tedious but it is
X   workable.  If you can find a permanent, allocatable terminal then things
X   are fine and dandy.
X
X   Data structures
X   ---------------
X
X   Several different data structures are used internally to MAINT to store
V   all kinds of information, ranging from the filenames and related informati
Xon
X   to text descriptors and new filenames.
X
V   Directory information for the files in a directory is allocated dynamicall
Xy
X   upon entry to the proc_dir() function.  An automatic pointer, dirptr, is
X   used to point to the memory that holds the information about the files.
X   This pointer MUST remain automatic because each directory needs it own
X   copy.  After the number of files in the directory is determined, the
X   amount of memory needed to hold the information about each file in the
X   directory can be calculated.  It is calculated by taking the number of
X   files in the directory, adding one, and multiplying it by the length of
X   the structure definition ENT_DEF.  This is the number of bytes needed.
X   The memory is allocated by calling LIB$GET_VM() and the pointer to the
X   memory is stored in dirptr.
X
V   When a Finish command is issued or the commands in a directory are execute
Xd,
X   the memory is deallocated, the number of files is computed, the size of
V   the memory necessary is calculated, and the memory is allocated once again
X.
X
X   A) Memory Pools
X
X   MAINT uses its own memory pool allocation scheme.  These memory pools are
X   used to store only CHARACTER data and thus there is no need to worry about
X   byte alignment for integer values and such.  Items that are stored in the
X   memory pools include:  1) the full filename of a file, 2) the protection
X   string in case the /PROTECTION or /FULL switch is specified, 3) the date
X   string in case the /DATE or the /FULL switch is specified, and 4) the
X   text descriptor of the file in case the user selects text mode.
X
X   The pools are allocated on a demand basis and are linked together into a
X   linked list.  The size of each memory pool in the list can vary, depending
X   on the state of the information that will be included for each directory.
X   The global variable ent_factor is initially set to FUDGE_FACTOR, which is
X   a guess at the number of bytes that each file entry is going to need to
V   store its information.  Then the run-time arguments are taken into account
X,
X   with ent_factor being updated for each that argument that will require
X   something stored in the memory pools.  See the routine set_args() for
X   the values that ent_factor is increased by.
X
X   When it is time to redo the information for a directory, the memory in the
V   memory pools is reclaimed rather than released and reallocated.  The point
Xer`032
V   to the next available byte in the structure is set to point to the beginni
Xng
V   of the memory pool and the remaining length is reset to the original lengt
Xh
X   of the pool.  This may waste a little memory but it saves a few calls that
X   would be needed to free and reallocate the memory.
X
X   B) Command structures
X
X   Command structures are used to hold the information necessary to carry out
X   commands for a specific file.  When the first command for a file is speci-
X   fied by the user, a new command structure is allocated and linked to the
X   file entry for the file, the pointer to the command structure being stored
X   in the command field of the ENT_DEF structure.
X
V   All of the information in the command structure that requires string value
Xs
X   (such as ren_name, copy_name, and text) are stored in memory allocated by
X   LIB$GET_VM() and NOT in a memory pool.  This is to cut down on wasting of
X   memory for file commands that are cancelled.
X
V   When commands for a file are cancelled, all the memory for any of the char
X-
V   acter strings are freed (via LIB$FREE_VM()) and the command structure itse
Xlf
X   is freed.
X
V*****************************************************************************
X***
V*****************************************************************************
X**/
X
X
V/****************************************************************************
X**/
V/*                                                                       `032
X    */
V/*                        # I N C L U D E   F I L E S                    `032
-+-+-+-+-+ End of part 1 +-+-+-+-+-

