X-NEWS: cerritos.edu vmsnet.sources: 347 Relay-Version: VMS News - V6.0-1 14/11/90 VAX/VMS V5.3; site cerritos.edu Path: cerritos.edu!usc!rutgers!maverick.ksu.ksu.edu!deimos.cis.ksu.edu!mccall!miclon!ibmpcug!ctssuk!VERKADE Newsgroups: vmsnet.sources Subject: DWUTILS V1.0 part 1 of 6 Message-ID: <901223133540.00000F02@MARVIN.CTSS.CO.UK> From: VERKADE@CTSS.CO.UK (Herman Verkade) Date: 23 Dec 90 13:35:40 GMT Followup-To: vmsnet.sources.d Organization: CompuThoughts Software Solutions (UK) Ltd. Keywords: DECwindows utilities Lines: 401 $! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.2-007 22-FEB-1990 $! On 23-DEC-1990 13:05:39.34 By user VERKADE (Herman Verkade) $! $! 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 6 PARTS, TO KEEP EACH PART $! BELOW 30 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.TXT;2 $! 2. ACCDEF.H;3 $! 3. COPYRIGHT.H;2 $! 4. DATATYPES.H;2 $! 5. DWSTART.CLD;3 $! 6. DWSTART.H;9 $! 7. DWSTART.TXT;3 $! 8. DWSTART_APPLICATION.C;36 $! 9. DWSTART_COMMANDS.CLD;14 $! 10. DWSTART_DECTERM.C;30 $! 11. DWSTART_DISPLAY.C;6 $! 12. DWSTART_MAIN.C;52 $! 13. DWSTART_MESSAGE.MSG;9 $! 14. DWSTART_MISC.C;36 $! 15. DWSTART_REMOTE.C;24 $! 16. DWSTART_SERVER.C;23 $! 17. DWSTART_SHARE.H;30 $! 18. DWSTART_SHARE.MAR;12 $! 19. DWSTART_SHARE.OPT;4 $! 20. DWUTILS.OPT;1 $! 21. FABDEF.H;4 $! 22. FIDDEF.H;2 $! 23. MAKEFILE.;8 $! 24. MAKEFILE.COM;18 $! 25. NAMDEF.H;8 $! 26. RESIGNAL.MAR;9 $! 27. SHOWDISPLAY.C;3 $! $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' X`09`09DWUTILS - DECwindows utilities and examples X`09`09------------------------------------------- X XThis is the first release of DWutils. This version contains only one utility V, XDWSTART, but others will hopefully follow soon. I want to keep them together Xas one package, because the utilities will use each other. The utilities can Xbe useful for technical support people and system managers that are working V in Xa distributed DECwindows environment. X XUse DWUTILS as is, or as an example, or as a starting point for your own Xutilities. But note the following: X X---------------------------------------------------------------------------- V---- XCopyright 1990 Herman Verkade X`09 CompuThoughts Software Solutions (UK) Ltd. X`09 29 Huntly Gardens X`09 Dowanhill X`09 Glasgow G12 9AX X`09 Scotland, UK X XPermission to use, copy, modify and distribute this software and its Xdocumentation for any non-commercial purpose is hereby granted without Xfee, provided that the above copyright notice appear in all copies and Xthat both that copyright notice and this permission notice appear in Xsupporting documentation. The author makes no representations about Xthe suitability of this software for any purpose. It is provided "as is" Xwithout express or implied warranty. X XTHE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, XINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN XNO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR XCONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS XOF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE XOR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE XUSE OR PERFORMANCE OF THIS SOFTWARE. X---------------------------------------------------------------------------- V---- X XNow that we got that out of the way, let's get going :-) X XDWstart is a utility to start DECwindows applications. That application can Xrun on the local node, but just as easily on a remote node. It consists of o Vne Xsingle subroutine DWS_Start_Application. One front end is provided: a DCL Xinterface. Future versions of DWutils will probably contain some more Xfrontends (Ever dreamt of shutting down or AUTOGENing 25 workstations with o Vne Xclick of a mouse button?). X XDWstart currently only supports LOCAL and DECNET as its transports, because V it Xis very VMS specific. If you want TCP/IP support, you'll have to do it Xyourself, but I would appreciate any sources to be included in future releas Ves. X XAny questions, suggestions, improvements, errors, comments or whatever can b Ve Xdirected to me by electronic mail on one of the following addresses: X X`09VERKADE@CTSS.CO.UK`09(Preferred) X`09verkade@ctssuk.uucp X`09verkade%ctss.co.uk@ukc.ac.uk X`09...!mcsun!ukc!ctssuk!verkade X XEnjoy! X XHerman Verkade $ CALL UNPACK AAAREADME.TXT;2 1866495014 $ create 'f' X/* X *`09Module:`09`09ACCDEF.H X *`09Description:`09System include file X * X *`09Revision history: X * X *`09000`09 9-may-1990`09- Generated by MAR_TO_H T1.0-007 on VMS V5.3 `20 X */ X X#include "datatypes.h" X X#define ACC$K_TERMLEN 84 X#define ACC$C_TERMLEN 84 X#define ACC$K_JOB_LEN 108 X#define ACC$C_JOB_LEN 108 X#define ACC$K_PRT_LEN 88 X#define ACC$C_PRT_LEN 88 X#define ACC$S_ACCDEF1 88 X#define ACC$K_INS_LEN 176 X#define ACC$C_INS_LEN 176 X#define ACC$S_ACCDEF2 176 X#define ACC$K_PRCTRM 1 X#define ACC$K_BATTRM 2 X#define ACC$K_INTTRM 3 X#define ACC$K_LOGTRM 4 X#define ACC$K_IMGTRM 5 X#define ACC$K_SUBTRM 6 X#define ACC$K_DETTRM 7 X#define ACC$K_NETTRM 8 X#define ACC$K_PRTJOB 16 X#define ACC$K_INSMSG 17 X#define ACC$K_INSMESG 1 X#define ACC$K_NEWFILE 2 X#define ACC$K_ENABACC 3 X#define ACC$K_DISAACC 4 X#define ACC$K_ENABSEL 5 X#define ACC$K_DISASEL 6 Xstruct ACC `7B X WORD acc$w_msgtyp;`09`09`09`09`09/* 0 */ X WORD acc$w_msgsiz;`09`09`09`09`09/* 2 */ X LONGWORD acc$l_finalsts;`09`09`09`09/* 4 */ X LONGWORD acc$l_pid;`09`09`09`09`09/* 8 */ X LONGWORD acc$l_jobid;`09`09`09`09/* 12 */ X QUADWORD acc$q_termtime;`09`09`09`09/* 16 */ X#define ACC$S_ACCOUNT 8 X char acc$t_account`5BACC$S_ACCOUNT`5D;`09`09`09/* 24 */ X#define ACC$S_USERNAME 12 X char acc$t_username`5BACC$S_USERNAME`5D;`09`09/* 32 */ X variant_union `7B X`09variant_struct `7B X`09 LONGWORD acc$l_cputim;`09`09`09`09/* 44 */ X`09 LONGWORD acc$l_pageflts;`09`09`09`09/* 48 */ X`09 LONGWORD acc$l_pgflpeak;`09`09`09`09/* 52 */ X`09 LONGWORD acc$l_wspeak;`09`09`09`09/* 56 */ X`09 LONGWORD acc$l_biocnt;`09`09`09`09/* 60 */ X`09 LONGWORD acc$l_diocnt;`09`09`09`09/* 64 */ X`09 LONGWORD acc$l_volumes;`09`09`09`09/* 68 */ X`09 QUADWORD acc$q_login;`09`09`09`09/* 72 */ X`09 LONGWORD acc$l_owner;`09`09`09`09/* 80 */ X#define ACC$S_JOB_NAME 8 X`09 char acc$t_job_name`5BACC$S_JOB_NAME`5D;`09`09/* 84 */ X#define ACC$S_JOB_QUE 16 X`09 char acc$t_job_que`5BACC$S_JOB_QUE`5D;`09`09`09/* 92 */ X`09`7D acc$r_overlay_1; X`09variant_struct `7B X`09 LONGWORD acc$l_pagcnt;`09`09`09`09/* 48 */ X`09 LONGWORD acc$l_qiocnt;`09`09`09`09/* 52 */ X`09 LONGWORD acc$l_getcnt;`09`09`09`09/* 56 */ X`09 QUADWORD acc$q_quetime;`09`09`09`09/* 60 */ X#define ACC$S_PRT_NAME 8 X`09 char acc$t_prt_name`5BACC$S_PRT_NAME`5D;`09`09/* 68 */ X#define ACC$S_PRT_QUE 12 X`09 char acc$t_prt_que`5BACC$S_PRT_QUE`5D;`09`09`09/* 76 */ X`09`7D acc$r_overlay_2; X`09variant_struct `7B X#define ACC$S_USER_DATA 132 X`09 char acc$t_user_data`5BACC$S_USER_DATA`5D;`09`09/* 44 */ X`09`7D acc$r_overlay_3; X `7D acc$r_overlay; X`7D ; $ CALL UNPACK ACCDEF.H;3 1531457886 $ create 'f' X/* X * Copyright 1990 Herman Verkade X *`09`09 CompuThoughts Software Solutions (UK) Ltd. X *`09`09 29 Huntly Gardens X *`09`09 Dowanhill X *`09`09 Glasgow G12 9AX X *`09`09 Scotland, UK X * X * Permission to use, copy, modify and distribute this software and its X * documentation for any non-commercial purpose is hereby granted without X * fee, provided that the above copyright notice appear in all copies and X * that both that copyright notice and this permission notice appear in X * supporting documentation. The author makes no representations about X * the suitability of this software for any purpose. It is provided X * "as is" without express or implied warranty. X * X * THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, X * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN X * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR X * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS X * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE X * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE X * USE OR PERFORMANCE OF THIS SOFTWARE. X */ $ CALL UNPACK COPYRIGHT.H;2 671547967 $ create 'f' X/* X *`09Module:`09`09DATATYPES.H X *`09Description:`09Data Type Definitions for System Include Files X *`09Author:`09`09Herman Verkade X * X *`09Revision History: X * X *`09002`0919-sep-1988`09- Added TEXT and F_FLOAT datatypes X *`09001`09 3-jun-1988`09- Added QUADWORD dataype X *`09000`0917-feb-1988`09- Newly created X */ X X X#ifndef DATATYPES_SET X#define DATATYPES_SET`091 Xtypedef unsigned char BYTE; Xtypedef unsigned short WORD; Xtypedef unsigned int LONGWORD; Xtypedef unsigned int QUADWORD`5B2`5D; Xtypedef void *POINTER; Xtypedef char TEXT; Xtypedef float F_FLOAT; X#endif $ CALL UNPACK DATATYPES.H;2 991115386 $ create 'f' Xdefine verb dwstart X`09image dwstart_main X`09parameter p1, label=COMMAND, prompt="Application", X`09`09value(required, type=$rest_of_line) X`09qualifier NODE, value(required, type=$file) $ CALL UNPACK DWSTART.CLD;3 36903828 $ create 'f' X/* X * Module:`09DWstart.h X * Author:`09Herman Verkade X * Description:`09Definitions for DWstart X * X * Revision History: X * X * 6-dec-1990 000 HHV`09- Split image into separate images X */ X X#include "copyright.h" X X#define NODENAME_LEN`096 X#define NODESPEC_LEN`0964 X#define APPLICATION_LEN`0916 X#define COMMAND_LEN`09255 X#define DISPLAYNAME_LEN`0916 X#define MAILBOXNAME_LEN`0916 X#define FILENAME_LEN`09132 X#define`09TRANSPORTNAME_LEN`0916 X#define`09SERVERNAME_LEN`098 X#define`09SCREENNAME_LEN`098 X Xvoid DWS_Get_DeviceName(unsigned short, char*, int); $ CALL UNPACK DWSTART.H;9 106237080 $ create 'f' X`09`09DWSTART: Start a remote DECwindows process`20 X`09`09------------------------------------------ X XDWSTART is a utility to create a DECwindows application on a local or remote Xnode. It has been designed to consume as few system resources as possible. I Vt Xcreates detached processes so that a new set of quota will be given to the n Vew Xprocess. When using the programming interface, an AST can be specified that Xwill be delivered when the remote task completes. X XThe utility was designed as a subroutine to be called from a menu or Xmodified session manager. For more general use, there is also a DCL command, Xwhich runs a simple program that calls the subroutine. X XThe subroutine has the following calling sequence: X X`09unsigned int DWS_Start_Application(Node, Command, ASTroutine, ASTparam) X`09char *Node, *Command; X`09void (*ASTroutine)(int); X`09int ASTparam; X XThe DCL command has the following format: X X`09$ DWSTART `5B/NODE=nodename`5D command X XIf the Node argument is NULL, the process will be started on the local node. XThe node parameter may optionally contain access control (i.e. NODE"user pwd V"), Xbut must not contain the double colons. Access control is performed through Xstandard VMS mechanisms (Proxies, default DECnet account, etc). X XThe ASTroutine and ASTparam work identical to the equivalent arguments of XLIB$SPAWN. However, DWSTART does not spawn, but creates detached processes. X XCurrently the following commands are valid for DWSTART: X X DECTERM - Creates a remote DECterm. X X`09Optional qualifiers: X X`09 /COMMAND=command-list`09Command(s) to send to the remote X`09`09`09`09`09process. DCL commands need to be X`09`09`09`09`09preceeded by the dollarsign, enclosed X`09`09`09`09`09in double quotes and mutliple commands X`09`09`09`09`09need to seperated by commas. X`09 /RESOURCE_FILE=filename`09Resource file to be used for the X`09`09`09`09`09DECterm. X X`09Example: X X`09 Status = DWS_Start_Application("LNPCLS", X`09 "DECTERM/COMMAND=(\"$show sys\",\"wait 00:00:10\")", X`09 ASTroutine, 0); X X MAIL - Creates a DECwindows Mail process on the remote system X X`09Does not support any qualifiers. X X LOGIN - Starts the login screen on the current display. Can be used by X`09 for example, VAXstation 2000s that are used as X terminals to X`09 start a login screen from a remote machine during boot. X X SESSION_MANAGER - Starts a remote session manager. It can be quite X`09 confusing to have several session managers on the screen and a quit +-+-+-+-+-+-+-+- END OF PART 1 +-+-+-+-+-+-+-+-