-+-+-+-+-+-+-+-+ START OF PART 5 -+-+-+-+-+-+-+-+ X if(verified) X cat(out_buf,"There is a VERIFIED JOBLOG log file from ",username, X`09`09 " waiting to be retrieved."); X else X cat(out_buf,"There is a UNVERIFIED JOBLOG log file from ",username, X`09`09 " waiting to be retrieved."); X X out_rab.rab$w_rsz = (USHORT) strlen(out_buf); X status = SYS$PUT(&out_rab); X X strcpy(out_buf,"To retrieve it, enter the command"); X out_rab.rab$w_rsz = (USHORT) strlen(out_buf); X status = SYS$PUT(&out_rab); X X out_buf`5B0`5D = '\0'; X out_rab.rab$w_rsz = 0; X status = SYS$PUT(&out_rab); X status = SYS$PUT(&out_rab); X X cat(out_buf,"`09JOBLOG/RETRIEVE/USER=",username); X out_rab.rab$w_rsz = (USHORT) strlen(out_buf); X status = SYS$PUT(&out_rab); X X out_buf`5B0`5D = '\0'; X out_rab.rab$w_rsz = 0; X status = SYS$PUT(&out_rab); X status = SYS$PUT(&out_rab); X X status = SYS$FAO(&format_d,&length,&out_buf_d,days); X X if(status != SS$_NORMAL) X return; X X status = SYS$CLOSE(&out_fab); X X if(status != RMS$_NORMAL) X return; X X if(verified) X cat(command,"$MAIL/SUBJECT=\"VERIFIED JOBLOG from ",username, X`09 " is still pending\" ",tempfile," ",recipient); X else X cat(command,"$MAIL/SUBJECT=\"VERIFIED JOBLOG from ",username, X`09 " is still pending\" ",tempfile," ",recipient); X X command_d.dsc$a_pointer = command; X command_d.dsc$w_length = (USHORT) strlen(command); X X /* now try to spawn the command to mail the notice */ X X status = LIB$SPAWN(&command_d,&null_d,&null_d,NULL,NULL,0L,&status2,0L,0L V, X`09`09 0L,0L,NULL,NULL); X X delete(tempfile);`09`09`09/* kill it before we forget`09 */ X X if(status != SS$_NORMAL) X `7B X LIB$SIGNAL(JLG_NO_SPAWN); X return; X `7D X X /* now warn the sender */ X X out_fab.fab$w_ifi = 0; `09`09/* reset this!`09`09`09 */ X X status = SYS$OPEN(&out_fab); X X if(status != RMS$_NORMAL) X return; X X /* warn the recipient */ X X cat(out_buf,"The JOBLOG log file for ",recipient, X " has yet to be retrieved. If"); X out_rab.rab$w_rsz = (USHORT) strlen(out_buf); X status = SYS$PUT(&out_rab); X X status = SYS$FAO(&format2_d,&length,&out_buf_d,days); X X if(status != SS$_NORMAL) X `7B X SYS$CLOSE(&out_fab); X return; X `7D X X status = SYS$CLOSE(&out_fab); X X if(status != RMS$_NORMAL) X return; X X cat(command,"$MAIL/SUBJECT=\"JOBLOG logfile for ",recipient, X " not retrieved\" ",tempfile," ",username); X X command_d.dsc$w_length = (USHORT) strlen(command); X X /* now try to spawn the command to mail the notice */ X X status = LIB$SPAWN(&command_d,&null_d,&null_d,NULL,NULL,0L,&status2,0L,0L V, X`09`09 0L,0L,NULL,NULL); X X delete(tempfile);`09`09`09/* kill it before we forget`09 */ X X if(status != SS$_NORMAL) X LIB$SIGNAL(JLG_NO_SPAWN); X X return; X X`7D`09/*** warn ***/ X`0C X/*************************************************************************** V**** X**************************************************************************** V**** X X Function:`09parse_filename X X Purpose:`09Parse a filename and extract the username, recipient, and X`09`09the verified status. The form of the filename is X X`09`09from_to_account.flag_joblog_dd_mm_yy_hh_mm X X`09`09where flag is V for VERIFIED log files and U for UNVERIFIED X`09`09log files. X X Formal Parameters: X X`09Name`09`09`09Description X`09----`09`09`09----------- X`09filename`09`09filename to be parsed X`09username`09`09username to be returned X`09recipient`09`09recipient to be returned X`09verified`09`09set if log file is verified X X Global variables: X X`09Name`09`09`09Examine/Modify/Use/Read/Write X`09----`09`09`09----------------------------- X`09none X X Return Codes: X X`09Code`09`09`09Reason X`09----`09`09`09------ X`09none X X**************************************************************************** V**** X**************************************************************************** V***/ X Xstatic void parse_filename(char *filename,char *username,char *recipient, X`09`09`09 USHORT *verified) X X`7B`09/*** parse_filename ***/ X`09`09`09`09`09/******** LOCAL VARIABLES ********/ X`09 char`09 *ptr,`09`09`09/* to parse parts of the filename */ X`09`09 *ptr2;`09`09/* ditto....`09`09`09 */ X X X /* get the sender name */ X X ptr = strchr(filename,'_'); X X if(username != NULL) X strncpy(username,filename,ptr - filename); X X ptr++;`09`09`09`09/* start at recipient`09`09 */ X X /* get the recipient name */ X X ptr2 = strchr(ptr,'_'); X X if(recipient != NULL) X strncpy(recipient,ptr,ptr2 - ptr); X X ptr = strchr(ptr2,'.'); X X if(verified != NULL) X `7B X if(*(ptr + 1) == 'V') X`09 *verified = TRUE; X else X`09 *verified = FALSE; X `7D X X return; X X`7D`09/*** parse_filename ***/ X`0C X/*************************************************************************** V**** X**************************************************************************** V**** X X Function:`09squeeze_str X X Purpose:`09Squeeze the whitespace characters out of a string X X Formal Parameters: X X`09Name`09`09`09Description X`09----`09`09`09----------- X`09str`09`09`09string to be squeezed X X Global variables: X X`09Name`09`09`09Examine/Modify/Use/Read/Write X`09----`09`09`09----------------------------- X`09none X X Return Codes: X X`09Code`09`09`09Reason X`09----`09`09`09------ X`09none X X**************************************************************************** V**** X**************************************************************************** V***/ X Xstatic void squeeze_str(register char *str) X X`7B`09/*** squeeze_str ***/ X`09`09`09`09`09/******** LOCAL VARIABLES ********/ Xregister char`09 *ptr;`09`09`09/* temporary pointer`09`09 */ X X X ptr = str; X X while(*ptr) X `7B X if(!isspace(*ptr)) X`09 *str++ = *ptr++; X else X`09 ptr++; X `7D X X *str = '\0';`09`09`09`09/* make sure it's a string`09 */ X return; X X`7D`09/*** squeeze_str ***/ X`0C X/*************************************************************************** V**** X**************************************************************************** V**** X X Function:`09my_puts X X Purpose:`09Output a string to the screen without using C I/O. X X Formal Parameters: X X`09Name`09`09`09Description X`09----`09`09`09----------- X`09string`09`09`09string to be displayed X X Global variables: X X`09Name`09`09`09Examine/Modify/Use/Read/Write X`09----`09`09`09----------------------------- X`09none X X Return Codes: X X`09Code`09`09`09Reason X`09----`09`09`09------ X`09none X X**************************************************************************** V**** X**************************************************************************** V***/ X Xstatic void my_puts(char *string) X X`7B`09/*** my_puts ***/ X`09`09`09`09`09/******** LOCAL VARIABLES ********/ Xstatic $DESCRIPTOR(string_d,"");`09/* for writing to the TTY`09 */ X X X string_d.dsc$w_length = (USHORT) strlen(string); X string_d.dsc$a_pointer = string; X X LIB$PUT_OUTPUT(&string_d); X X return; X X`7D`09/*** my_puts ***/ X`0C X/*************************************************************************** V**** X**************************************************************************** V**** X X Function:`09my_gets X X Purpose:`09Get a string from the screen without using C I/O. X X Formal Parameters: X X`09Name`09`09`09Description X`09----`09`09`09----------- X`09buffer`09`09`09where input string is stored X`09prompt`09`09`09prompt string X`09length`09`09`09length of input string X`09buflen`09`09`09size of buffer X X Global variables: X X`09Name`09`09`09Examine/Modify/Use/Read/Write X`09----`09`09`09----------------------------- X`09none X X Return Codes: X X`09Code`09`09`09Reason X`09----`09`09`09------ X`09SUCCESS X`09FAILURE X X**************************************************************************** V**** X**************************************************************************** V***/ X Xstatic ULONG my_gets(char *buffer,char *prompt,USHORT *length,USHORT buflen) X X`7B`09/*** my_gets ***/ X`09`09`09`09`09/******** LOCAL VARIABLES ********/ X`09 ULONG`09 status;`09`09/* return code status holder`09 */ Xstatic $DESCRIPTOR(prompt_d,"");`09/* used for prompt string`09 */ Xstatic $DESCRIPTOR(buffer_d,"");`09/* for input buffer`09`09 */ X X X buffer_d.dsc$a_pointer = buffer; X buffer_d.dsc$w_length = (USHORT) buflen; X prompt_d.dsc$a_pointer = prompt; X prompt_d.dsc$w_length = (USHORT) strlen(prompt); X X status = LIB$GET_INPUT(&buffer_d,&prompt_d,length); X X if(status != SS$_NORMAL && status != LIB$_INPSTRTRU) X return(FAILURE); X else if(*length == 0) X buffer`5B0`5D = CARRIAGE_RETURN; X else X buffer`5B*length`5D = '\0';`09`09/* make it a string`09`09 */ X X return(SUCCESS); X X`7D`09/*** my_gets ***/ X`0C X/*************************************************************************** V**** X**************************************************************************** V**** X X Function:`09kill_log X X Purpose:`09Kill the log file during an ungraceful exit. X X Formal Parameters: X X`09Name`09`09`09Description X`09----`09`09`09----------- X`09none X X Global variables: X X`09Name`09`09`09Examine/Modify/Use/Read/Write X`09----`09`09`09----------------------------- X`09log_fab`09`09`09`09`09X X`09logfile`09`09`09`09`09X X X Return Codes: X X`09Code`09`09`09Reason X`09----`09`09`09------ X`09none X X**************************************************************************** V**** X**************************************************************************** V***/ X Xstatic void kill_log(void) X X`7B`09/*** kill_log ***/ X`09`09`09`09`09/******** LOCAL VARIABLES ********/ X`09 ULONG`09 status;`09`09/* return code status holder`09 */ Xunion`09 prvdef _align(longword) privs; /* for turning on SYSPRV`09 V */ X X X memset(privs,0,sizeof(privs)); X privs.prv$v_sysprv = ON;`09`09/* need SYSPRV to close the log file */ X X status = SYS$SETPRV(ON,&privs,FALSE,NULL); X X SYS$CLOSE(&log_fab); X delete(logfile); X X return; X X`7D`09/*** kill_log ***/ X`0C X/*************************************************************************** V**** X**************************************************************************** V**** X X Function:`09quit2 X X Purpose:`09Secondary exit handler called from the primary handler to X`09`09help ensure that no old log files are left around. X X Formal Parameters: X X`09Name`09`09`09Description X`09----`09`09`09----------- X`09none X X Global variables: X X`09Name`09`09`09Examine/Modify/Use/Read/Write X`09----`09`09`09----------------------------- X`09logfile`09`09`09`09`09X X X Return Codes: X X`09Code`09`09`09Reason X`09---- `09`09`09------ X`09none X X**************************************************************************** V**** X**************************************************************************** V***/ X Xstatic void quit2(void) X X`7B`09/*** quit2 ***/ X X delete(logfile); X exit(); X X`7D`09/*** quit2 ***/ $ CALL UNPACK JOBLOG.C;452 844349321 $ create 'f' X1 JOBLOG X! JOBLOG.HLP X! Copyright (c) 1990, Leonard J. Peirce X XJOBLOG will capture the output for a terminal session, place it in a file, Xand, upon exit, give you the option of printing it, saving it, storing the Xlog file in a secure area and sending notification of it to another user, Xor deleting it. X XThere are essentially two types of JOBLOG log files: VERIFIED and UNVERI- XFIED. VERIFIED log files are guaranteed to be untouched by the person who Xcreated them. Since the log files themselves are never accessible to the Xuser while running JOBLOG, the only opportunity for modification is if Xlogging is disabled while in JOBLOG. While this is often a nice feature, Xit immediately makes the log file UNVERIFIED. X XThe difference between VERIFIED and UNVERIFIED log files becomes important Xfor printed and mailed log files, especially for class assignments and such. X XNOTE: Logging full-screen applications is risky at best and are not guar- Xanteed to be logged correctly. X XTo invoke JOBLOG, the syntax is: X X $ JOBLOG/qualifier(s) X2 Qualifiers X/CLASS X X /CLASS=class X X Used in conjunction with the /RETRIEVE qualifier, log files from the X specified class are retrieved from the secure area and placed in the X current directory. X X/DELETE X X /DELETE=user X X Delete a JOBLOG that you've sent to USER from the staging area. You must X specify /USER. A mail message stating that the log file has been deleted X will be sent to USER. X X/EXPERT X X /EXPERT X X Suppress the JOBLOG startup message. X X/MAIL X X /MAIL=user X X Mail notification of log file to the specified user upon exit from JOBLOG. X The log file will be placed in a secure staging area and can then be X retrieved by the user by using the /RETRIEVE qualifier. The specified X user must possess one of the following identifiers: STAFF, FACULTY, X JOBLOG_RECIPIENT. X X/PRINT X X /PRINT`5B=queue`5D X X Print the log file upon exit from JOBLOG to the specified queue. If X no queue is specified, you will be prompted for it upon exiting JOBLOG. X X/RETRIEVE X X /RETRIEVE X X Retrieve a log file from the secure area. You must know the username of X user who sent you the notification of the pending log file. You must also X specify either /CLASS or /USER. X X/SAVE X X /SAVE`5B=file-spec`5D X X Save the log file to the specified file upon exit from JOBLOG. If the X file-spec is not specified, you will be prompted for it upon exiting X JOBLOG. X X/SKIM X X /SKIM X X Skim the secure area, deleting old log files and warning both senders and X recipients (via mail) of files that are soon to be deleted. Both /WAIT X and /WARN are required qualifiers. SYSPRV is required to use this X qualifier. X X/TIME_STAMP X X /TIME_STAMP X X Display the current time in the log file for each DCL command entered. X Time stamping can be toggle on/off by entering control-`5E. X X/USER X X /USER`5B=username`5D X X Specify the username for the /RETRIEVE or /MAIL qualifiers. If /USER is X not specified, you will be prompted for it. X X/WAIT X X /WAIT=n X X Specified in conjunction with the /WARN qualifier, /WAIT specifies how X how long to wait before a pending log file is deleted from the secure X area. Any log files older than n days are deleted. SYSPRV is required X to use this qualifier. X X/WARN X X /WARN=n X X Mail messages are sent to senders and recipients of files in the secure X area that are older than n days but not older than the number of days X specified with the /WAIT qualifier. Both /SKIM and /WAIT must be speci- X fied with this qualifier. SYSPRV is also required to use this qualifier. X X2 time_stamp X To enable time stamping of all DCL commands in JOBLOG, enter control-`5E X (hold the Control key down and press `5E). Each time this is entered the X time stamp feature is toggled. It is initially off when JOBLOG is X started. Specify the /TIME_STAMP qualifier on the command line to start X JOBLOG with time-stamping enabled. X X2 toggle_logging X To toggle logging on/off, enter control-\ (hold the Control key down and X press \). Logging is initially enabled with JOBLOG starts. If logging X is ever turned off, the log file immediately becomes UNVERIFIED. `20 $ CALL UNPACK JOBLOG.HLP;1 1412963602 $ create 'f' Xmodule joblog_cld X Xdefine verb joblog X X`09qualifier class,`09placement=global,value(required) X`09qualifier delete,`09placement=global,value X`09qualifier expert,`09placement=global X`09qualifier mail,`09`09placement=global,value X`09qualifier output,`09placement=global,value(required,type=$file) X`09qualifier print,`09placement=global,value X`09qualifier retrieve,`09placement=global X`09qualifier save,`09`09placement=global,value(type=$file) X`09qualifier skim,`09`09placement=global,value(type=$number) X`09qualifier time_stamp,`09placement=global X`09qualifier user,`09`09placement=global,value(required) X`09qualifier warn,`09`09placement=global,value(required,type=$number) X`09qualifier wait,`09`09placement=global,value(required,type=$number) X X`09disallow class and delete X`09disallow class and expert X`09disallow class and mail X`09disallow class and output X`09disallow class and print X`09disallow class and save X`09disallow class and skim X`09disallow class and time_stamp X`09disallow class and user X`09disallow class and wait X`09disallow class and warn X X`09disallow delete and expert X`09disallow delete and mail X`09disallow delete and output X`09disallow delete and print X`09disallow delete and save X`09disallow delete and skim X`09disallow delete and retrieve X`09disallow delete and time_stamp X`09disallow delete and user X`09disallow delete and wait X`09disallow delete and warn X X`09disallow expert and class X`09disallow expert and delete X`09disallow expert and retrieve X`09disallow expert and skim X`09disallow expert and wait X`09disallow expert and warn X X`09disallow mail and output X`09disallow mail and print X`09disallow mail and retrieve X`09disallow mail and save X`09disallow mail and skim X`09disallow mail and user X`09disallow mail and wait X`09disallow mail and warn X X`09disallow output and print X`09disallow output and retrieve X`09disallow output and skim X`09disallow output and save X`09disallow output and user X`09disallow output and wait X`09disallow output and warn X X`09disallow print and retrieve X`09disallow print and save X`09disallow print and skim X`09disallow print and user X`09disallow print and wait X`09disallow print and warn X X`09disallow retrieve and save X`09disallow retrieve and skim X`09disallow retrieve and time_stamp X`09disallow retrieve and wait X`09disallow retrieve and warn X X`09disallow save and skim X`09disallow save and user X`09disallow save and wait X`09disallow save and warn X X`09disallow skim and time_stamp X`09disallow skim and user X X`09disallow time_stamp and wait X`09disallow time_stamp and warn X X`09disallow user and wait X`09disallow user and warn X X`09disallow retrieve and not (user or class) X`09disallow skim and not wait X`09disallow skim and not warn X`09disallow wait and not skim X`09disallow warn and not skim $ CALL UNPACK JOBLOGCLD.CLD;77 889721107 $ create 'f' X.TITLE`09`09`09JOBLOG Program Error Messages X.IDENT`09`09`09'JOBLOG 1.1' X.FACILITY`09`09JOBLOG,2/PREFIX=JLG_ X X.SEVERITY `09`09SEVERE XNO_LOGICAL`09`09/FAO_COUNT=1 XNO_LOGFILE `09`09 XNO_EXH `09`09 XCANT_QUEUE`09`09/FAO_COUNT=1 XCANT_REQUEUE`09`09/FAO_COUNT=1 XCANT_WRITE`09`09/FAO_COUNT=1 XINUSE`09`09`09 X.SEVERITY `09`09WARNING XNO_SPAWN `09`09 XCANT_CANCEL_IO`09`09/FAO_COUNT=1 XCANT_DELETE`09`09/FAO_COUNT=1 XCANT_DASSGN`09`09/FAO_COUNT=1 XCANT_RESET`09`09 X.SEVERITY `09`09INFORMATIONAL XCANT_DELETE_LOG`09`09/FAO_COUNT=1 X.END $ CALL UNPACK JOBLOGMSG.MSG;9 1175387555 $ create 'f' XFile`09`09`09`09Contents X----`09`09`09`09-------- XBUILD.COM`09`09`09For people who don't have MMS XCOPYRIGHT.TXT`09`09`09Full JOBLOG copyright text XDESCRIP.MMS`09`09`09MMS control file XDOC.TXT`09`09`09`09Description of JOBLOG that we give our users XJOBLOG.C`09`09`09JOBLOG C source file XJOBLOG.HLP`09`09`09JOBLOG VMS-style help file XJOBLOGCLD.CLD`09`09`09JOBLOG CLD file XJOBLOGMSG.MSG`09`09`09JOBLOG message definitions XMANIFEST.TXT`09`09`09This file XREADME.TXT`09`09`09JOBLOG description and installation X`09`09`09`09instructions XSUBS.C`09`09`09`09Some general-purpose subroutines $ CALL UNPACK MANIFEST.TXT;2 2137132953 $ create 'f' XLast update: 12/03/90 X XINTRODUCTION X Welcome to JOBLOG, a terminal session logging facility. JOBLOG is based Xon the popular program PHOTO, written by Asbed Bedrossian at USC. Basically V, XJOBLOG does what PHOTO does, provides some additional options for "secure" Xlog files (untouched by the user), and fixes a bug that caused VT220 termina Vls Xto hang. X X PHOTO is Copyright 1986 by Asbed Bedrossian at University of Southern XCalifornia. X XDISTRIBUTION X Feel free to redistribute JOBLOG. I don't mind as long as the copyright Xnotice (COPYRIGHT) stays with it and you don't claim you wrote it or try to Xmake money from it. X XREQUIREMENTS X The TW/PY PTY drivers must be installed for JOBLOG to work. If you have XDECwindows installed, you don't have to worry. If you don't, you should Xcheck to see that they are installed. If they aren't, they are available Xfrom your friendly anonymous FTP site, DECUS tape, or neighboring site. X X Other requirements: X X`09- two system directories to hold 1) temporary log files and 2) X`09 log files waiting to be retrieved X`09- two system-wide logical names pointing to the above directories X`09- adding the JOBLOG help file to the system-wide help library X`09- INSTALLation of JOBLOG.EXE with SYSPRV, PHY_IO, and CMKRNL X`09 privileges X`09- an entry in a daily batch job to run JOBLOG so that recipient X`09 and senders of log files are notified of pending log files X`09 and old log files are deleted X XDESCRIPTION X In order to understand the above requirements, let's look at the life of Xa log file created by JOBLOG. X X`091. User runs JOBLOG. The log file is created in the system dir- X`09 ectory pointed to by the JOBLOG$LOG logical. This directory is X`09 protected RWED,,, so the user is never able to modify it. X X`092. During the session, the user has the option of toggling logging X`09 on/off. If logging is turned OFF, the log file immediately be- X`09 comes UNVERIFIED, signifying that it is not a true record of the X`09 login session. X X`093. After the user terminates the session, the user can: X X`09 a) print the log file X X`09 The log file is printed directly from the JOBLOG$LOG dir- X`09 ectory with a job name that reflects whether it is VERIFIED X`09 or UNVERIFIED. The log file is deleted after printing. X X`09 b) delete the log file X X`09 The log file is deleted directly from the JOBLOG$LOG dir- X`09 ectory. X X`09 c) save the log file X X`09 The log file is copied to the file specified by the user X`09 and deleted from the JOBLOG$LOG directory. X X`09 d) mail notification of the log file to someone X X`09 The log file is move from the JOBLOG$LOG directory to the X`09 staging directory pointed to by the JOBLOG$STAGE directory. X`09 The log file will stay here until 1) it is picked up by the X`09 recipient using the /RETRIEVE qualifier to JOBLOG, 2) de- X`09 leted by the sender using the /DELETE qualifier, or 3) de- X`09 leted automatically from a batch job using the /SKIM qualifer. X X`09 The batch job should run JOBLOG/SKIM/WAIT=n/WARN=m once per X`09 day to keep the staging directory cleaned out. The sender X`09 and the recipient will be warned via e-mail that there is a X`09 log file that hasn't been picked up after m days. The log X`09 file will be deleted from the staging area after n days and X`09 both the sender and the recipient are notified. X X All four of the choices in #3, as well as a number of other options, can Xbe specified on the command line at startup. If disposition of the log file Xisn't specified on the command line, the user will be prompted for it. See Xthe help file for more information. X XA FEW WORDS ABOUT MAILING LOG FILES X The first question is why aren't log files simply mailed to the recipient V? XThe main reason is to give users an opportunity to delete log files if they Xwant. This would be impossible to do if the log files were actually in Xthe recipient's mail file. X X JOBLOG is setup so that only accounts that have a certain identifier can Xreceive mailed logfiles. The identifiers here that allow an account to Xreceive mailed log files are FACULTY, STAFF, and JOBLOG_RECIPIENT (the last Xwe grant on a need basis). Also, users cannot mail log files to themselves X(to prevent people from bypassing their disk quotas). And since student Xaccounts here don't have any of the above identifiers, they can't mail log Xfiles to each other. In a student environment, these might be reasonable Xrestrictions. If you want to change/delete/add identifiers, see the Xvalid_ids array in the valid_recip() routine. X XINSTALLATION X 1. Build the executable. This can be done one of two ways: X X`09a) If you have MMS installed on your system, enter X X`09`09$ MMS X X`09b) If you don't have MMS installed, enter X X`09`09$ @BUILD X X`09There are some free versions of MAKE available for VMS that might X`09work with the DESCRIP.MMS file, although I've never tried any. X X 2. Copy JOBLOG.EXE to it's final destination. SYS$SYSTEM is a reasonabl Ve X location for most systems and will be used in the following example X steps. If your final destination is different, be sure to substitute X wherever SYS$SYSTEM is used below. X X 3. Install JOBLOG using the INSTALL program. Enter X X`09$ INSTALL X X and at the INSTALL> prompt enter X X INSTALL> ADD SYS$SYSTEM:JOBLOG.EXE/OPEN/HEADER/SHARE/PRIV=(SYSPRV,PHY V_IO,CMKRNL) X X Arrange for JOBLOG to be INSTALLed at system boot time by adding the V line X from step #3 to the appropriate startup file. X X 4. Add a symbol definition to SYS$SYSTEM:SYLOGIN.COM for JOBLOG. For X example, X X`09$ JOBLOG :== $JOBLOG X X would work if JOBLOG is installed in SYS$SYSTEM. If it isn't, you'll X have to use the full file specification. X X 5. Add the help file to the system help library. To do this, you must X have exclusive access to SYS$HELP:HELPLIB.HLB. An ideal time would b Ve X when you have the machine to yourself and logins are disabled. If X you're installing JOBLOG for the first time, the command for adding X the help library is X X`09$ LIBRARY/HELP/INSERT SYS$HELP:HELPLIB.HLB JOBLOG.HLP X X If JOBLOG's help file already exists in your help library, the comman Vd X would be X X`09$ LIBRARY/HELP/REPLACE SYS$HELP:HELPLIB.HLB JOBLOG.HLP X X If you don't have the system to yourself, you could do what I do: X protect SYS$HELP:HELPLIB.HLB so that no one can access it, wait until X everyone is done using it, insert the help file, and reset the pro- X tection back to what it was when you started. A few people might get X protection failures when running HELP but it beats shutting down your X machine. X`20 X 6. Create the two directories required for JOBLOG: X X`09- a directory where log files live while the user is running JOBLOG; X`09 after a user exits JOBLOG, their log file will be 1) moved to X`09 another location (the user's area or the staging area) or 2) de- X`09 leted, either by the user or after printing. X X`09 Example: SYS$SYSTEM:`5BJOBLOG_LOG`5D X X`09- a "staging" directory where log files live waiting to be picked up X`09 by the recipient specified by the user. X X`09 Example: SYS$SYSTEM:`5BJOBLOG_STAGE`5D X X IMPORTANT: Both directories should be protected RWED,,, X X 7. Create two system-wide logical names pointing to the directories X created in step #6. The logical names are X X`09JOBLOG$LOG X`09JOBLOG$STAGE X X Define them as follows: X X`09$ DEFINE/SYSTEM/EXEC/TRANS=CONCEALED JOBLOG$LOG SYS$SYSTEM:`5BJOBLOG_LOG` V5D X`09$ DEFINE/SYSTEM/EXEC/TRANS=CONCEALED JOBLOG$STAGE SYS$SYSTEM:`5BJOBLOG_ST VAGE`5D X X Arrange for these logicals to be defined at system boot time by addin Vg X the above definitions to the appropriate startup file. X X 8. Add an entry into a batch job that runs once per day that will check X the staging directory for old log files and notify the sender and X recipient that they haven't been picked up. X X`09Example: $ JOBLOG/SKIM/WAIT=10/WARN=7 X X That should do it. Try running it and see if it works. If you have pro- Xblems building/installing JOBLOG, feel free to call me or send me e-mail and Xlet me know how I blew it. I'll do what I can to make sure that it can be Xinstalled at your site. X XHACKING ON THE CODE X Since the source is distributed, feel free to hack on the code. There is Xnothing very complicated in JOBLOG; the code itself is pretty straightforwar Vd X(at least I think so! :`5E). If you find a bug, you can either 1) fix it yo Vur- Xself, contact me, and send me the fix, or 2) let me know about it and I'll s Vee Xwhat I can do. I'll be sending out patches when appropriate. X XA NOTE ABOUT VMS 5.4 X VMS 5.4 includes a new PTY driver, FTDRIVER, that will replace the TW/PY Xdrivers. Once we get 5.4 installed here (which should be soon), I'll be Xporting JOBLOG to work with the new device driver. Thus, there will be two Xversions but each will contain the same features. The only differences will Xbe the interaction with the respective PTY driver. Once the port is com- Xplete, I'll post the new version. X XCONCLUSION X I put a lot of work into JOBLOG and I would appreciate any comments/ Xsuggestions/flames that you might have. If you get it up and running, I Xwould appreciate it if you would either send me e-mail or phone me, letting Xme know that you installed it and what your thoughts are about it. X-- XLeonard Peirce Internet: peirce@gumby.cc.wmich.edu XWestern Michigan University peirce@gw.wmich.edu XAcademic Computing Services UUCP: ...!uunet!sharkey!wmichgw!peirce XKalamazoo, MI 49008 Voice: (616) 387-5469 $ CALL UNPACK README.TXT;19 1095383425 $ create 'f' X/*************************************************************************** V**** X**************************************************************************** V**** X X Installation: Western Michigan University Academic Computing Services X X System:`09General Purpose Subroutines X `20 X Program:`09JOBLOG X X Version=01`09Level=00`0909/12/90`09Leonard J. Peirce X X Purpose:`09Three general purpose subroutines used by JOBLOG. If you X`09`09want to use them for something else, feel free. I just X`09`09didn't want to include them in JOBLOG.C since they already X`09`09exist in a object library here. X X Arguments:`09See individual routines X X External variables:`09none X X WMU external functions: X X Defined:`09cat,strins,strlu X X Called:`09none X X Files accessed:`09none X X Return codes:`09See individual routines X X Compiling instructions:`09See DESCRIP.MMS X X Linking instructions:`09See DESCRIP.MMS X X Other information:`09`09Copyright (c) 1990, Leonard J. Peirce X X**************************************************************************** V**** X**************************************************************************** V***/ X X/*************************************************************************** V***/ X/* V `20 V */ X/* # I N C L U D E F I L E S V */ X/* V `20 V */ X/*************************************************************************** V***/ X X#include varargs X#include ctype X X/*************************************************************************** V***/ X/* V `20 V */ X/* # D E F I N E S V */ X/* V `20 V */ X/*************************************************************************** V***/ X X/*************************************************************************** V***/ X/* V `20 V */ X/* S T R U C T U R E S , U N I O N S , T Y P E D E F S V */ X/* V `20 V */ X/*************************************************************************** V***/ X X/*************************************************************************** V***/ X/* V `20 V */ X/* 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 V */ X/* V `20 V */ X/*************************************************************************** V***/ X X`09 char`09 *cat(); X X`09 int`09 strins(); X X`09 void`09 strlu(); X X/*************************************************************************** V***/ X/* V `20 V */ X/* 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 V */ X/* V `20 V */ X/*************************************************************************** V***/ X`0C X/*************************************************************************** V**** X**************************************************************************** V**** X X Function:`09cat X X Purpose:`09This general-purpose subroutine will concatenate null- X`09`09terminated strings into one destination string. X X Formal Parameters: X X`09Name`09`09`09Description X`09----`09`09`09----------- X`09dest`09`09`09where new string is created X`09source1,...sourcen`09input strings X X Global variables: X X`09Name`09`09`09Examine/Modify/Use/Read/Write X`09----`09`09`09----------------------------- X`09none X X Return Codes: X X`09Code`09`09`09Reason X`09----`09`09`09------ X`09retval`09`09`09pointer to destination string X`09nullptr`09`09`09null string pointer; returned when X`09`09`09`09no arguments are passed X X**************************************************************************** V**** X**************************************************************************** V***/ X Xchar *cat(va_alist) X`09`09`09`09`09/******* FORMAL PARAMETERS *******/ X`09 va_dcl`09`09`09`09/* variable-length parameter list */ X X`7B`09/*** cat ***/ X`09`09`09`09`09/******** LOCAL VARIABLES ********/ Xregister char`09 *dest,`09`09/* pointer to destination string */ X`09`09 *source;`09`09/* pointer to current source string */ X`09 char`09 *retval;`09`09/* to save pointer to destination */ Xregister int`09 count;`09`09/* number of arguments passed`09 */ X`09 va_list incrmtr;`09`09/* argument list incrementor`09 */ Xstatic`09 char`09 *nullptr = "";`09/* null string pointer`09`09 */ X X X va_start(incrmtr);`09`09`09/* begin everything....`09`09 */ X X va_count(count);`09`09`09/* get number of arguments`09 */ X X if(count == 0)`09`09`09/* were any arguments specified? */ X return(nullptr);`09`09`09/* nope, get out of here...`09 */ X X dest = va_arg(incrmtr,char*);`09/* get the destination pointer`09 */ X retval = dest;`09`09`09/* save pointer to destination`09 */ X X source = va_arg(incrmtr,char*);`09/* get the first source pointer`09 V */ X X while(--count > 0)`09`09`09/* process all of the source strings */ X `7B +-+-+-+-+-+-+-+- END OF PART 5 +-+-+-+-+-+-+-+-