From: SMTP%"rlboyd@rock.concert.net" 9-FEB-1994 15:53:20.03 To: EVERHART CC: Subj: SLMOD part 1 of 5 From: Bob Boyd X-Disclaimer-1: rock.concert.net is a CONCERT-CONNECT public access host. X-Disclaimer-2: Opinions expressed are not necessarily X-Disclaimer-3: those of MCNC or the CONCERT Network. Message-Id: <9402092049.AA24036@rock.concert.net> Subject: SLMOD part 1 of 5 To: ADAMSE@LETT.KUN.NL (Hans Adamse), 8004slb@vmsf.csd.mu.edu (Sandy Berger), Everhart@arisia.gce.com (Glenn Everhart), bolson@u.washington.edu (Ed Bolson), jkraft@mccoy.fhcrc.org (John Kraft) Date: Wed, 9 Feb 94 15:49:58 EST X-Mailer: ELM [version 2.3 PL11] $! ------------------ CUT HERE ----------------------- $ v='f$VERIFY(f$TRNLNM("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.2-007 22-FEB-1990 $! On 4-FEB-1994 19:29:21.36 By user RLB14162 (Bob Boyd) $! $! This VMS_SHARE Written by: $! Andy Harper, Kings College London UK $! $! Acknowledgements to: $! James Gray - Original VMS_SHARE $! Michael Bednarek - Original Concept and implementation $! $!+ THIS PACKAGE DISTRIBUTED IN 5 PARTS, TO KEEP EACH PART $! BELOW 60 BLOCKS $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. AAAREADME.1ST;6 $! 2. SLMOD.HLP;12 $! 3. SLMOD.SPEC;7 $! 4. SLMOD.FOR;88 $! 5. SLMOD_UTILS.FOR;35 $! 6. SLMOD_STRUCTURES.INC;9 $! 7. SLMOD_BUILD.COM;16 $! 8. SLMOD_KIT.COM;18 $! 9. SLMOD_SETUP.COM;2 $! 10. SLMOD_TEST.COM;41 $! 11. CLI_FRONT_END.FOR;4 $! 12. CLIMSGDEF.INC;1 $! 13. SLMOD.CLD;32 $! 14. SLMOD_LINKABLE.CLD;20 $! 15. MAKEFILE.;2 $! $set="set" $set symbol/scope=(nolocal,noglobal) $f=f$PARSE("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$GETJPI("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if f$TRNLNM("SHARE_LOG") then $ w = "!" $ ve=f$GETSYI("version") $ if ve-f$EXTRACT(0,1,ve) .ges. "4.4" then $ goto START $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$VERIFY(v) $ exit 44 $UNPACK: SUBROUTINE ! P1=filename, P2=checksum $ if f$SEARCH(P1) .eqs. "" then $ goto FILE_ABSENT $ e "-W-EXISTS, File ''P1' exists. Skipped." $ delete 'f'* $ exit $file_absent: $ if f$PARSE(P1) .nes. "" then $ goto DIROK $ dn=f$PARSE(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'." $ create/dir 'dn' $ if $status then $ goto DIROK $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped." $ delete 'f'* $ exit $dirok: $ w "-I-PROCESS, Processing file ''P1'." $ if .not. f$VERIFY() then $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1' PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:= CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b)); LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION( BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1); IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE; MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1; ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")= 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF"; POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r); ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1; COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE, "output_file"));ENDPROCEDURE;Unpacker;QUIT; $ delete/nolog 'f'* $ CHECKSUM 'P1' $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT $ e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ ENDSUBROUTINE $START: $ create 'f' XSLMOD = Search List Modification Utility X XWritten by Bob Boyd. X XSLMOD is a utility for manipulating search list logical names in a way that Xmimics the behavior of the DEFINE command in most ways. `20 X XThe program will create a search list logical name, insert additional Xelements at any specified position in the list, remove specific elements Xfrom the list, and if the resulting list is empty, it will delete the Xlogical name. If the logical name to be updated is in a shared logical Xname table the program will use the lock manager to coordinate access to Xthe table and logical name. Note: there apparently is no other interlock Xmechanism on logical names, so this will not prevent a DEFINE command from Xoverwriting a logical name at the same time that SLMOD is working on it. X XWhile it is possible to have the image installed with privileges,`20 XI suggest that you not give it any privileges except for SYSLCK. XThere is currently no code in the program to minimize its privileges Xto the bare necessity of SYSLCK. Perhaps you would like to put in`20 Xthe time to deal with this? If so, please let me know what you do`20 Xwith it. The only time the privilege is actually needed is in`20 Xroutine LOCK_IT, and (maybe) UNLOCK_IT. The rest of the time, only Xthe process privileges should be on. X XIn order to enable SLMOD to provide system wide interlocks on logical Xsearch list updates, it's recommended that you install the image with XSYSLCK privilege, or only use it from usernames with SYSLCK privilege Xenabled. If the image or the user is enabled for SYSLCK, the image will Xuse the system wide lock flag when taking out the locks before doing any`20 Xtranslating and updating. The locks are released after the work is Xcompleted. X XThe program concept was developed by Bob Boyd while working at the Harris XMicroelectronics Center. The program was completed while working for XUnisys at the US EPA National Data Processing Division. X XIncluded are: executable compiled & linked on OpenVMS V5.5-2, source files, Xbuild procedure, specification text, help text, a verification/test`20 Xprocedure, and object code. X XYou can contact Bob via Internet at rlboyd@rock.concert.net, voice Xat (919)554-0043. $ CALL UNPACK AAAREADME.1ST;6 373633556 $ create 'f' X!Last Modified: 4-FEB-1994 14:57:14.73, By: RLB14162 X! X! HELP Library module SLMOD X! X! Author:`09Robert L. Boyd X! Date:`09`0915-Nov-1990 X! X! Change History: X!---------------------------------------------------------------------- X! 04-Feb-1994`09R.L.Boyd`09Modified ITEM and DELETE qualifiers X!`09`09`09`09entries to cover new features X!`09`09`09`09Added examples X! X! 15-Nov-1990`09R.L.Boyd`09Initial Version X!---------------------------------------------------------------------- X! X1 SLMOD X Creates a search list, inserts, or removes one or more X elements from a search list. If removing leaves the list X empty and the /EMPTY_DELETE qualifier is present, then the X logical name will be deleted. X`20 X This command is similar to the DEFINE command. See HELP X DEFINE for more about defining logical names. X X Format: X X SLMOD`09logical_name equivalence_string(s) X2 Parameters X See HELP DEFINE PARAMETERS for a full description. X3 Logical_Name X See HELP DEFINE PARAMETERS for a complete description. X3 Equivalence_String(s) X See HELP DEFINE PARAMETERS for a complete description. X2 Qualifiers X/INSERT (Def) X X This qualifier causes SLMOD to insert, prepend, or append X additional values to a search list or to create a search X list from scratch. X X Mutually exclusive with /DELETE or /REMOVE X/DELETE`5B=ALL`5D X/REMOVE`5B=ALL`5D X X These qualifiers are equivalent. They specify that the X elements in the search list that match the listed X equivalence string(s) or specified item numbers are to be X removed from the search list. In the case of specifying item X numbers the equivalence string(s) will not be required. When X using the /BEFORE or /AFTER qualifiers, the search list is X scanned for the equivalence strings starting with the X position in the list specified by the position qualifier X used. X X Mutually exclusive with /INSERT. X/BEFORE X/AFTER (Def) X/ITEM X X /BEFORE`5B=number`5D X /AFTER`5B=number`5D (Default, End for INSERT, 0 for DELETE) X /ITEM=position X range X list X * X X Used to control the insertion or deletion of equivalence X strings. When inserting /BEFORE without a numeric value X tells the utility to insert the equivalence string(s) before X the existing list (pre-pend). When /AFTER is used without a X numeric value, the new strings are appended to the list. X /AFTER=0 is the same as /BEFORE. If /BEFORE=n specifies a X number that is greater than the number of items in the X translation it is the same as AFTER. X X Only 1 of these 3 qualifiers may be specified. They are X mutually exclusive. X X /ITEM may only be used with the /DELETE or /REMOVE X qualifier. It picks a specific item or list of items to be X deleted by their position in the list without regard for the X equivalence strings at those positions. X X /ITEM can be used in any of the following ways: X X /ITEM=position`09`09! Delete affects only this position X /ITEM=position1-position2`09! Deletes the range specified X /ITEM=(list,of,positions,or,ranges) ! deletes all of the listed positions X /ITEM=*`09`09`09! Deletes the logical name X/INPUT_TABLE X/OUTPUT_TABLE X X /INPUT_TABLE=(NAME=lnmtable`5B,MODE=`5D) X /OUTPUT_TABLE=(NAME=lnmtable`5B,MODE=`5D) X XThe input and output logical name tables may be selected by Xthe use of these qualifiers. Use of the MODE entry for the XOUTPUT_TABLE overrides the global qualifiers that specify Xaccess mode. There is no default access mode on the XINPUT_TABLE, you must specify it if you want to force the Xtranslation to that mode. The default for OUTPUT_TABLE is XSUPERVISOR mode. If you specify /USER/OUTPUT=(NAME=LNM$JOB) Xthe mode used for the output table definition will be XSUPERVISOR since it is defaulted in by specifying the table Xname. If you specify /USER/JOB the mode used will be USER Xmode. X X NAME X Specifies the logical name table to be used. X X MODE X Specifies the access mode to be used when translating or X creating/updating the logical name. Valid modes are X X USER, SUPERVISOR, EXECUTIVE, and KERNEL X X If the user specifies EXECUTIVE or KERNEL for the X OUTPUT_TABLE and doesn't have the necessary privileges, X the logical name will be created using SUPERVISOR mode. X X/PROCESS (Def) X/JOB X/GROUP X/SYSTEM X XUsing any of these qualifiers will set both the input and Xoutput tables to the same value unless you specifically Xoverride it with the INPUT_TABLE or OUTPUT_TABLE qualifiers. X X/USER_MODE X/SUPERVISOR_MODE (Def) X/EXECUTIVE_MODE X/KERNEL_MODE XUsed to select which access mode you wish to use to Xdefine/update the logical name. If specified, the selected Xmode will be used in translating the existing logical Xname(if any) as well as creating the new definition. If one Xof these qualifiers is specified it will only apply to the Xoutput table, unless explicitly overridden by a MODE entry Xin the /OUTPUT_TABLE value list. X/NAME_ATTRIBUTES X /NAME_ATTRIBUTES`5B=(keyword`5B,...`5D)`5D X XControls the name attributes for the logical name. Currently Xsupported keywords are: NO_ALIAS and CONFINE. These are Xidentical to the ones supported by the DEFINE command. `20 X XSee HELP DEFINE /NAME_ATTRIBUTES for more on these keywords. X/TRANSLATION_ATTRIBUTES X X /TRANSLATION_ATTRIBUTES`5B=(keyword`5B,...`5D)`5D XSpecifies translation attributes to apply to the equivalence Xnames. These attributes apply to the elements individually. XThis qualifier may be used in a global or positional mode. XIf used as a global qualifier any attribute(s) specified Xwill be applied to all elements of the search list except Xwhere explicitly overridden. X XValid keywords are: `5BNO`5DCONCEAL, NO`5DTERMINAL X XSee HELP DEFINE /TRANSLATION_ATTRIBUTES for more on these Xkeywords. X/LOG X X /LOG X /NOLOG (Default) X X Tells the utility that it is to send a log message to X SYS$OUTPUT to indicate the action performed. X X/EMPTY_DELETE X X /EMTPY_DELETE (Default) X /NOEMPTY_DELETE X X In the event that a /DELETE or /REMOVE causes the resulting X list to be empty, the utility will by default delete the X specified logical name. If /NOEMPTY_DELETE is specified, no X change will be made to the search list logical name -- it X will be left unchanged. X/SYMBOL X X /SYMBOL=dcl_symbol_name X XStores in a DCL local symbol a string containing the Xequivalence logical name(s), any translation attributes that Xapply to them, the access mode, and the name attributes in a format`20 Xthat could be used to do an SLMOD or DEFINE command. X2 Examples X X To create a search list in the LNM$JOB logical name table: X X SLMOD MY_LIST/JOB A/TRANSLATION_ATTRIBUTES=(CONCEALED),B,C X X To insert a single value in a list, return the list to a X symbol, and log the event: X X SLMOD/INSERT MY_LIST/JOB D/BEFORE=2/SYMBOL=MY_LIST_SYMBOL/LOG X SLMOD/INSERT MY_LIST/JOB D/AFTER=1/SYMBOL=MY_LIST_SYMBOL/LOG X X SHOW SYMBOL MY_LIST_SYMBOL X MY_LIST_SYMBOL =`20 X "A/TRANSLATION_ATTRIBUTES=(CONCEALED),D,B,C/SUPERVISOR_MODE" X X To copy a list from one table to another and delete a X value from the list: X X SLMOD/DELETE MY_LIST/INPUT_TABLE=(NAME=LNM$JOB)/PROCESS/USER/ITEM=2-3 X X To copy a list from one table to another and insert/append a value: X X SLMOD SYS$SYSTEM/INPUT_TABLE=NAME=LNM$SYSTEM - X`09SITE_UTILITIES/OUTPUT_TABLE=(NAME=LNM$GROUP,MODE=EXECUTIVE) X X To delete all the elements of a search list except the 1st one: X X SLMOD/DELETE MY_LIST/JOB/ITEM=2-* X X To delete an element matching a particular string after a specific X position in the list: X X SLMOD/DELETE SYS$SYSTEM/GROUP/EXECUTIVE_MODE/AFTER=2 SITE_UTILITIES X X To delete an entire list: X X SLMOD/DELETE=ALL DECW$USER_TRASH - X`09/OUTPUT_TABLE=DECW$LOGICAL_NAMES/MODE=KERNEL X`20 X With USER,SUPERVISOR and EXECUTIVE mode logical names you can just X as easily use the DEASSIGN command. SLMOD provides you the added X capability to manipulate KERNEL mode logical names. $ CALL UNPACK SLMOD.HLP;12 553794643 $ create 'f' XAnnouncing a prototype search list logical name manipulation utility: X XSLMOD (aka SLDEFINE or LNMMOD) X XThis command has the capability of creating, inserting, or removing one or Xmore elements from a search list. If removing leaves the list empty and the X/EMPTY_DELETE qualifier is present, then the logical name will be deleted. X XI have coded a prototype that implements all of the functionality`20 Xdescribed below. I am soliciting BETA testers based on the following Xspecification. The code that I've generated includes: X X SLMOD.FOR`09! Main source file (about 1K lines) X SLMOD_STRUCTURES.INC ! Include file (common definitions) X CLIMSGDEF.INC`09!(not needed if you have $CLIMSGDEF module in FORSYSDEF.TLB V) X SLMOD.CLD`09! Command Definition file (about 100 lines) X SLMOD_LINKABLE.CLD`09! Command Definition for linkable module X SLMOD_BUILD.COM`09! Procedure to build SLMOD X SLMOD_KIT.COM`09! Procedure to build the distribution kits X SLMOD_TEST.COM`09! Verification procedure (about 230 lines) X SLMOD.SPEC`09! This text file X SLMOD.HLP`09! Help text to create a help library or include in`20 X`09`09! your system-wide utility help library X SLMOD_UTILS.FOR! Utility procedures /subroutine functions for SLMOD X CLI_FRONT_END.FOR`09! Front end routines for CLI$ routines so that`20 X`09`09`09! SLMOD can be invoked without doing SET COMMAND X MAKEFILE.`09! Makefile that should work with Todd Aven's MAKE`20 X XPlease send any comments/suggestions/questions to rlboyd@rock.concert.net X XSLMOD`09logical_name equivalence_string(s) X`20 X Qualifiers: X XIn order to insert, prepend, or append additional values to a search list Xor to create a search list from scratch, the following qualifier must Xbe specified. X X `09/INSERT (Default) X XThe next 2 qualifiers are equivalent. They specify that the elements in Xthe search list that match the listed equivalence string(s) or specified Xitem numbers are to be removed from the search list. In the case of`20 Xspecifying item numbers the equivalence string(s) will not be required. XWhen using the /BEFORE or /AFTER qualifiers, the search list is scanned Xfor the equivalence strings starting with the position in the list specified Xby the position qualifier used. If the ALL keyword value is supplied, Xthen the entire logical name is deleted from the output table. X X`09/DELETE`5B=ALL`5D X `09/REMOVE`5B=ALL`5D X XIn order to control the insertion or deletion of equivalence strings the Xfollowing qualifiers provide 3 different forms of control. When inserting X/BEFORE without a numeric value tells the utility to insert the equivalence Xstring(s) before the existing list (pre-pend). When /AFTER is used without Xa numeric value, the new strings are appended to the list. /AFTER=0 is the Xsame as /BEFORE. If /BEFORE=n specifies a number that is greater than the Xnumber of items in the translation it is the same as /AFTER. X X/ITEM may only be used with the /DELETE or /REMOVE qualifier. It picks a Xspecific item or list of items to be deleted by their position in the Xlist without regard for the equivalence strings at those positions. X`20 X `09/BEFORE`5B=position`5D X `09/AFTER`5B=position`5D`09! Default X`09/ITEM=position`09! only valid with DELETE or REMOVE X`09`09m-n`09! range of positions X`09`09(list of positions and/or ranges) X`09`09*`09! Equivalent to /DELETE=ALL X`20 X/LOG tells the utility that it is to send a log message to SYS$OUTPUT to Xindicate the action performed. X X `09/`5BNO`5DLOG X XIn the event that a /DELETE or /REMOVE causes the resulting list to Xbe empty, the utility will by default delete the specified logical name. XIf /NOEMPTY_DELETE is specified, no change will be made to the search Xlist logical name -- it will be left unchanged. X X `09/`5BNO`5DEMPTY_DELETE X`20 XThe input and output logical name tables may be selected by the use of Xthese qualifiers. Use of the MODE entry for the OUTPUT_TABLE overrides the Xglobal qualifiers that specify access mode. There is no default access`20 Xmode on the INPUT_TABLE, you must specify it if you want to force the Xtranslation to that mode. The default for OUTPUT_TABLE is SUPERVISOR mode. XIf you specify /USER/OUTPUT=(NAME=LNM$JOB) the mode used for the output Xtable definition will be SUPERVISOR since it is defaulted in by specifying Xthe table name. If you specify /USER/JOB the mode used will be USER mode. X X `09/INPUT_TABLE=(NAME=lnmtable`5B,MODE=`5D) X `09/OUTPUT_TABLE=(NAME=lnmtable`5B,MODE=`5D) X XUsing any of the following qualifiers will set both the input and Xoutput tables to the same value unless specifically overriden with Xone of the qualifiers above. X X`09/PROCESS`09! Default X`09/JOB X`09/GROUP X`09/SYSTEM X XYou may select which access mode you wish to use for accessing the logical Xname you are affecting. If specified, the selected mode will be used in Xtranslating the existing logical name(if any) as well as creating the new Xdefinition. If one of these qualifiers is specified it will only apply to Xthe output table, unless explicitly overridden by a MODE entry in the X/OUTPUT_TABLE value list. X X`09/USER X`09/SUPERVISOR`09! Default, applies to output only/ X`09/EXECUTIVE X`09/KERNEL X`20 XThe name attributes for the logical name may be controlled by the use Xof the the following qualifier. Currently supported keywords are XNO_ALIAS and CONFINE. These are identical to the ones supported by Xthe DEFINE command. X X `09/NAME_ATTRIBUTES=(attributes allowed by DEFINE) X XSometimes it is nice to get the values of a search list logical back in Xa DCL symbol for other purposes -- not the least of which is debugging! XSo the following qualifier will help those who need this capability. X X`09/SYMBOL=dclsymbol Symbol name to receive a string copy of the old X`09`09`09 value of the search list X`20 X Positional qualifier(s) X`20 X `09/TRANSLATION_ATTRIBUTES=(translation_keyword(s)) X`20 X Name attributes apply to the whole search list. The Translation attributes X apply to the elements individually. This qualifier may be used at a global X level. If used globally, any attribute(s) specified globally will be X applied to all elements of the search list except where explicitly overridd Ven. X`20 X In order to maintain compatibility with the DEFINE command, if the`20 X equivalence string is a list of values, the list is inserted or removed X as appropriate. X`20 X A DELETE/REMOVE can do it either by position or equivalence name or deletin Vg X the entire logical name. Also, if there would be no elements left in the`2 V0 X list and the EMPTY_DELETE is specified it will DEASSIGN the logical name. $ CALL UNPACK SLMOD.SPEC;7 6458440 $ create 'f' XC Last Modified: 4-FEB-1994 10:39:08.91, By: RLB14162 Xc X`09Program SLMOD X`09implicit none Xc Xc`09Title:`09SLMOD.FOR Xc Xc`09Author:`09Robert L. Boyd, Harris Semiconductor Xc Xc`09Date:`09Nov, 1990 Xc Xc`09Abstract:`09This program is intended to simplify the manipulation Xc`09`09`09of logical name search lists. It provides a simple Xc`09VAX/VMS DCL command line interface to define or update search list Xc`09logical names. The most significant features are the easy insertion Xc`09and deletion of elements in the search list. Xc Xc`09Contributors:`09Robert L. Boyd, Fred Stluka, & Jerry Leichter Xc Xc`09Modification History: Xc Xc`09Intls`09Date`09Notes Xc`09___________________________________________________________________ Xc`09RLB`092/1/94`09Modified DELETE behavior to cover /ITEM=*,m-n Xc`09`09`09and /DELETE=ALL scenarios Xc`09RLB`094/5/91`09Corrected /DELETE behavior and inherited attribute Xc`09`09`09handling. Xc`09RLB`094/15/91`09Converted to universal command interpreter Xc`09`09`09interface. Corrected access mode default processing. Xc Xc`09RLB`094/23/91`09Changed interlock table lookup to actually Xc`09`09`09determine the input and output table name & Xc`09`09`09parents. Avoid incorrect locks. Xc X`09integer`09sys$trnlnm, sys$crelnm, sys$dellnm, ots$cvt_ti_l X`09integer`09cli_get_value,cli_present, lib$put_output, sys$getjpi X`09integer`09str$copy_r, lib$set_symbol, lib$set_logical, dereference, X`091`09lib$delete_symbol, lib$delete_logical, slmod_cli_init, X`092`09lnm_table_find Xc X`09include '($lnmdef)' X`09include 'climsgdef.inc' X`09include '($psldef)' X`09include '($ssdef)' X`09include '($jpidef)' X`09include '($prvdef)' Xc X`09include 'slmod_structures.inc' X X`09integer*4`09index_table(maximum_items) X X`09record`09/item_list/ lnm_list(maximum_list) X`09record /item_list/ jpi_list(6) Xc X`09record /equivalence_strings/ translation(maximum_items) Xc X`09record /equivalence_strings/ input_list(maximum_items) Xc Xc Xc X`09integer`09initial_index, final_index, max_index, move_index, end_index X`09integer`09first_item, lnm_index, tran_attrib Xc X`09integer`09`09sym_len, sym_ptr, sym_ctr, name_pointer, tran_len X`09integer*2`09cmd_len, translation_count, input_count, item_id, X`091`09`09input_item, lnm_len, output_item, hyphen_loc X`09integer*4`09name_attributes /0/, tran_attributes /0/, X`091`09`09create_mode, input_table_len, input_table_parent_len, X`092`09`09output_table_len, output_table_parent_len, X`093`09`09delete_start, delete_end Xc X`09integer p2_status, status, input_tlen*2, output_tlen*2, exit_status X`09integer indx, list_end, input_attributes /0/, before_index, X`091`09after_index, item_index X`09logical`09after_flag, before_flag, log_flag, insert_flag, X`091`09ok_to_delete, item_flag, delete_all /.FALSE./, defaulted Xc X`09byte`09`09input_access_mode/4/, output_access_mode/4/ Xc X`09character*31`09input_table, output_table, logical_name, X`091`09`09input_table_name, input_table_parent, X`092`09`09output_table_name, output_table_parent X`09character*255`09cmd_item X`09character`09symbol_name*32, symbol_buffer*32385 X`09character`09tran_string*64 Xc Xc Process the command line Xc Xc Xc See if the command was executed as an external verb or a foreign command Xc If $VERB is not equal to SLMOD then it is a foreign command for sure. Xc If $LINE starts with : it is probably a foreign command. Xc If the symbol SLMOD is defined to be SLMOD =`5B=`5D "$SLMOD" and Xc the logical SLMOD is defined by DEFINE SLMOD SLMOD_EXE:SLMOD then it Xc will be pretty near impossible to distinguish which way it was invoked. Xc X`09call SLMOD_Cli_Init() Xc Xc Process Parameters and Qualifiers Xc X`09status = cli_get_value('Logical_Name',cmd_item,cmd_len) X`09logical_name = cmd_item(:cmd_len) X`09lnm_len = cmd_len X Xc Xc If the INPUT_TABLE is not explicitly specified there is no access Xc mode associated with the input table. The global qualifier(s) that Xc specify access mode apply only to the output table. Xc X`09output_access_mode = 4 X`09if( cli_present('USER_MODE').ne.cli$_absent ) then X`09`09output_access_mode = psl$c_user X`09else if( (cli_present('SUPERVISOR_MODE').ne.cli$_absent) ) then X`09`09status = cli_present('SUPERVISOR_MODE') X`09`09if( (status.ne.cli$_defaulted)) X`091`09`09output_access_mode = psl$c_super X`09else if( cli_present('EXECUTIVE_MODE').ne.cli$_absent ) then X`09`09output_access_mode = psl$c_exec X`09else if( cli_present('KERNEL_MODE').ne.cli$_absent ) then X`09`09output_access_mode = psl$c_kernel X`09endif X Xd`09type *,'INPUT_ACCESS_MODE:',input_access_mode, Xd`091`09', OUTPUT_ACCESS_MODE:',output_access_mode X Xc Xc Process any specified logical table names Xc X`09input_tlen = 0 X`09status = cli_present('OUTPUT_TABLE') X`09if( status.eq.cli$_defaulted ) then Xc Xc workaround for bug in CLI interface routines with lists with Xc defaulted values. Bug present through VMS V5.3-1 Xc X`09`09Output_Tlen = 11 X`09`09Output_Table(1:output_tlen) = 'LNM$PROCESS' X`09`09if( output_access_mode.gt.psl$c_user ) X`091`09 output_access_mode = psl$c_super Xd Xd`09`09type *,'OUTPUT_TABLE defaulted: '//output_table(:output_tlen) Xd`091`09`09//', Output_Access_Mode:',output_access_mode X`09endif Xc Xc If the output table was defaulted but there is a / Xc qualifier present, honor that qualifier over the defaulted table. Xc X`09if( cli_present('JOB').ne.cli$_absent ) then X`09`09input_table = 'LNM$JOB' X`09`09input_tlen = 7 X`09`09output_table = 'LNM$JOB' X`09`09output_tlen = 7 X`09else`09if( cli_present('GROUP').ne.cli$_absent ) then X`09`09input_table = 'LNM$GROUP' X`09`09input_tlen = 9 X`09`09output_table = 'LNM$GROUP' X`09`09output_tlen = 9 X`09else`09if( cli_present('SYSTEM').ne.cli$_absent ) then X`09`09input_table = 'LNM$SYSTEM' X`09`09input_tlen = 10 X`09`09output_table = 'LNM$SYSTEM' X`09`09output_tlen = 10 X`09else`09if( cli_present('PROCESS').ne.cli$_absent )then X`09`09input_table = 'LNM$PROCESS' X`09`09input_tlen = 11 X`09`09output_table = 'LNM$PROCESS' X`09`09output_tlen = 11 X`09endif Xc Xc Process any INPUT_TABLE qualifier value(s) Xc X`09status = cli_present('INPUT_TABLE') X`09if( status.ne.cli$_absent) then X`09`09status = cli_get_value('input_table',cmd_item,cmd_len) X`09`09if( cli_present('input_table.name').ne.cli$_absent) then X`09`09 status = cli_get_value( X`091`09`09'input_table.name',input_table,input_tlen) X`09`09endif X`09`09if( cli_present('input_table.mode').ne.cli$_absent) then X`09`09 status = cli_get_value('input_table.mode',cmd_item,cmd_len) Xd`09 type *,'INPUT_TABLE_NAME: '//intput_table(:input_tlen) Xd`09 type *,'INPUT_ACCESS_MODE:'//cmd_item(:cmd_len) X`09`09 if( cmd_item(:1).eq.'U') input_access_mode = psl$c_user X`09`09 if( cmd_item(:1).eq.'S') input_access_mode = psl$c_super X`09`09 if( cmd_item(:1).eq.'E') input_access_mode = psl$c_exec X`09`09 if( cmd_item(:1).eq.'K') input_access_mode = psl$c_kernel X`09`09endif X`09endif Xc Xc Process OUTPUT_TABLE qualifier value(s) Xc X`09status = cli_present('OUTPUT_TABLE') X`09if( status.eq.cli$_present ) then Xc Xd`09type *,'Output_Table status:',status X`09`09status = cli_get_value('output_table',cmd_item,cmd_len) Xd`09type *,'Output_Table:'//cmd_item(:cmd_len) X`09`09status = cli_present('output_table.name') X`09`09if( status.ne.cli$_absent ) then X`09`09 status = cli_get_value( X`091`09 'output_table.name',output_table,output_tlen) X`09`09endif X`09`09status = cli_present('output_table.mode') X`09`09if( status.ne.cli$_absent ) then X`09`09 if( status.eq.cli$_defaulted ) then X`09`09 output_access_mode = psl$c_super X`09`09 else X`09`09 status = cli_get_value( X`091`09`09'output_table.mode',cmd_item,cmd_len) Xd`09 type *,'OUTPUT_ACCESS_MODE:'//cmd_item(:cmd_len) X`09`09 if( output_access_mode.gt.psl$c_user .or. X`091`09`09status.ne.cli$_defaulted ) then X`09`09 if( cmd_item(:1).eq.'U') output_access_mode = psl$c_user X`09`09 if( cmd_item(:1).eq.'S') output_access_mode = psl$c_super X`09`09 if( cmd_item(:1).eq.'E') output_access_mode = psl$c_exec X`09`09 if( cmd_item(:1).eq.'K') output_access_mode = psl$c_kernel X`09`09 endif ! access_mode specified X`09`09 endif ! defaulted X`09`09else ! mode not present (or defaulted?) X`09`09 if( output_access_mode.gt.psl$c_user ) X`091`09`09output_access_mode = psl$c_super X`09`09endif X`09endif Xd`09type *,'INPUT_ACCESS_MODE:',input_access_mode, Xd`091`09', OUTPUT_ACCESS_MODE:',output_access_mode Xc Xc see if we are to LOG the transaction Xc X`09status = cli_present('LOG') X`09if( status .eq. cli$_present) then X`09`09log_flag = 1 X`09else X`09`09log_flag = 0 X`09endif Xc Xc Find out whether we are Inserting or Deleting Xc Xc X`09if( cli_present('INSERT').ne.cli$_absent) then X`09`09insert_flag = .true. X`09endif +-+-+-+-+-+-+-+- END OF PART 1 +-+-+-+-+-+-+-+-