From:	MERC::"uunet!WKUVX1.BITNET!FILESERV-Mgr" 12-JUN-1992 15:41:05.75
To:	galaxy::gleeve
CC:	
Subj:	JOBLOG.06_OF_07

-+-+-+-+-+-+-+-+ START OF PART 6 -+-+-+-+-+-+-+-+
X`09`09  tempfile`5BNAM$C_MAXRSS+1`5D,
X`09`09  out_buf`5BBUFSIZ`5D,`09/* formatting and I/O buffer`09      */
X`09`09  deadline_buf`5BBUFSIZ`5D,
X`09`09  command`5BCOMMAND_MAX+1`5D;
Xstruct`09 FAB`09  out_fab;`09`09/* for creating mail message file     */
Xstruct`09 RAB`09  out_rab;
X$DESCRIPTOR(null_d,"NL:");
X$DESCRIPTOR(command_d,"");
X$DESCRIPTOR(out_buf_d,out_buf);
X$DESCRIPTOR(deadline_d,deadline_buf);
X$DESCRIPTOR(format_d,
X`09    "If it is not retrieved, it will be deleted on !AS !ZL, !ZL.");
X$DESCRIPTOR(month_d,"");
Xstatic`09 char`09  *months`5B`5D = `7B"January","February","March","April","
VMay",
X`09`09`09       "June","July","August","September","October",
X`09`09`09       "November", "December"`7D;
X
X
X   parse_filename(filename,username,recipient,&verified);
X
X   /* make a mail message for the recipient */
X
X   strcpy(tempfile,"JOBXXXXXX");
X   mktemp(tempfile);
X   strcat(tempfile,".TMP");
X
X   out_rab = cc$rms_rab;
X   out_rab.rab$l_fab = &out_fab;`09/* pointer to input FAB`09`09      */
X   out_rab.rab$b_rac = RAB$C_SEQ;`09/* sequential access for copy`09      */
X   out_rab.rab$w_usz = sizeof(out_buf);`09/* length of output buffer`09
V      */
X   out_rab.rab$l_rbf = out_buf;`09`09/* pointer to buffer`09`09      */
X
X   out_fab = cc$rms_fab;
X   out_fab.fab$w_ifi = 0; `09`09/* reset this!`09`09`09      */
X   out_fab.fab$b_fac = FAB$M_PUT;
X
X   out_fab.fab$l_fna = tempfile;
X   out_fab.fab$b_fns = (UCHAR) strlen(tempfile);
X
X   /* open the output file */
X
X   status = SYS$CREATE(&out_fab);
X
X   if(status != RMS$_NORMAL)
X   `7B
X      SYS$CLOSE(&out_fab);
X      LIB$SIGNAL(status);
X      return;
X   `7D
X
X   /* connect the output file's RMS blocks */
X
X   status = SYS$CONNECT(&out_rab);
X
X   if(status != RMS$_NORMAL)
X   `7B
X      SYS$CLOSE(&out_fab);
X      LIB$SIGNAL(status);
X      return;
X   `7D
X
X   /* warn the recipient */
X
X   if(verified)
X      cat(out_buf,"There is a VERIFIED JOBLOG log file from ",username,
X`09`09  " waiting to");
X   else
X      cat(out_buf,"There is an UNVERIFIED JOBLOG log file from ",username,
X`09`09  " waiting to");
X
X   out_rab.rab$w_rsz = (USHORT) strlen(out_buf);
X   status = SYS$PUT(&out_rab);
X
X   strcpy(out_buf,"be retrieved.  To retrieve it, enter");
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
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
X   month_d.dsc$a_pointer = months`5Bmonth`5D;
X   month_d.dsc$w_length = (USHORT) strlen(months`5Bmonth`5D);
X
X   status = SYS$FAO(&format_d,&length,&deadline_d,&month_d,day,year + 1900);
X
X   if(!(status & SS$_NORMAL))
X      return;
X
X   strmcpy(out_buf,deadline_buf,length);
X   out_rab.rab$w_rsz = (USHORT) strlen(out_buf);
X
X   status = SYS$PUT(&out_rab);
X
X   status = SYS$CLOSE(&out_fab);
X
X   if(status != RMS$_NORMAL)
X   `7B
X      LIB$SIGNAL(status);
X      return;
X   `7D
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$CREATE(&out_fab);
X
X   if(status != RMS$_NORMAL)
X   `7B
X      LIB$SIGNAL(status);
X      return;
X   `7D
X
X   /* reconnect the output file's RMS blocks */
X
X   status = SYS$CONNECT(&out_rab);
X
X   if(status != RMS$_NORMAL)
X   `7B
X      SYS$CLOSE(&out_fab);
X      LIB$SIGNAL(status);
X      return;
X   `7D
X
X   /* warn the recipient */
X
X   cat(out_buf,"The JOBLOG log file you sent to ",recipient,
X       " has not been retrieved.");
X   out_rab.rab$w_rsz = (USHORT) strlen(out_buf);
X
X   status = SYS$PUT(&out_rab);
X
X   strcpy(out_buf,deadline_buf);
X   out_rab.rab$w_rsz = (USHORT) strlen(out_buf);
X
X   status = SYS$PUT(&out_rab);
X
X   status = SYS$CLOSE(&out_fab);
X
X   if(status != RMS$_NORMAL)
X   `7B
X      LIB$SIGNAL(status);
X      return;
X   `7D
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`09 int`09  length;`09`09/* length to be copied`09`09      */
X
X
X   /* get the sender name */
X
X   ptr = strchr(filename,'_');
X   length = ptr - filename;
X
X   if(username != NULL)
X      strmcpy(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   length = ptr2 - ptr;
X
X   if(recipient != NULL)
X      strmcpy(recipient,ptr,length);
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
X
X  Formal Parameters:
X
X`09Name`09`09`09Description
X`09----`09`09`09-----------
X`09buffer`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`09tt_chan`09`09`09`09`09X
X
X  Return Codes:
X
X`09Code`09`09`09Reason
X`09----`09`09`09------
X`09none
X
X  Termination Codes:
X
X`09Code`09 `09`09Reason
X`09----`09`09`09------
X`09status`09`09`09write to TTY failed
X`09iosb.status
X
X****************************************************************************
V****
X****************************************************************************
V***/
X
Xstatic void my_puts(char *buffer)
X
X`7B`09/*** my_puts ***/
X`09`09`09`09`09/********   LOCAL  VARIABLES   ********/
Xregister ULONG`09  status,`09`09/* return code status holder`09      */
X`09`09  length;`09`09/* length of string to be written     */
Xstatic`09 IOSB_DEF iosb;`09`09`09/* I/O status block for write`09      */
X
X
X   length = (ULONG) strlen(buffer);
X   status = SYS$QIOW(0,tt_chan,IO$_WRITEVBLK,&iosb,0,0,buffer,length,0,32,0,
V0);
X
X   if(!(status & SS$_NORMAL))
X      LIB$STOP(status);
X
X   if(iosb.status != SS$_NORMAL)
X      LIB$STOP(iosb.status);
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`09channel`09`09`09TTY channel
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`09CANCEL
X
X****************************************************************************
V****
X****************************************************************************
V***/
X
Xstatic ULONG my_gets(USHORT channel,char *buffer,char *prompt,USHORT *length
V,
X`09`09     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      */
X`09`09  retval;`09`09/* return value`09`09`09      */
X`09 IOSB_DEF iosb;`09`09`09/* I/O status block`09`09      */
Xstatic $DESCRIPTOR(prompt_d,"");`09/* used for prompt string`09      */
Xstatic $DESCRIPTOR(buffer_d,"");`09/* for input buffer`09`09      */
X
X
X   status = SYS$QIOW(0,channel,IO$_READVBLK`7CIO$_READPROMPT,&iosb,0,0,buffe
Vr,
X`09`09`09(ULONG) buflen,0,0,prompt,strlen(prompt));
X
X   if(!(status & SS$_NORMAL))
X      return(FAILURE);
X
X   if(iosb.terminator == 0)
X   `7B
X      /* user pressed `5EC or `5EY */
X
X      buffer`5B0`5D = '\0';
X      return(CANCEL);
X   `7D
X   else if(iosb.terminator == CONTROL_Z && iosb.count == 0)
X   `7B
X      buffer`5B0`5D = CARRIAGE_RETURN;
X      buffer`5B1`5D = '\0';
X      return(SUCCESS);
X   `7D
X
X   buffer`5Biosb.count`5D = '\0';`09`09/* make it a string`09`09      */
X   *length = iosb.count;
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`09privs`09`09`09`09  X`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      */
X
X
X   memset(privs,0,sizeof(privs));
X   privs.prv$v_sysprv = ON;`09`09/* so we can get to the log directory */
X
X   status = SYS$SETPRV(ON,&privs,FALSE,NULL);
X
X   if(!(status & SS$_NORMAL))
X      LIB$STOP(status);
X
X   SYS$CLOSE(&log_fab);
X   delete(logfile);
X
X   status = SYS$SETPRV(OFF,&privs,FALSE,NULL);
X
X   if(!(status & SS$_NORMAL))
X      LIB$STOP(status);
X
X   privs.prv$v_sysprv = OFF;
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_log(logfile);
X   exit();
X
X`7D`09/*** quit2 ***/
X`0C
X/***************************************************************************
V****
X****************************************************************************
V****
X
X  Function:`09subprocess_exit
X
X  Purpose:`09Called when the subprocess is terminated.  Just set the
X`09`09hangup flag and exit and let the exit handler do the rest.
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`09flags.hangup`09`09   X
X`09clean_exit`09`09`09  X
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 void subprocess_exit(void)
X
X`7B`09/*** subprocess_exit ***/
X
X   if(flags.hangups)
X   `7B
X      clean_exit = TRUE;`09`09/* "normal" exit if we get here`09      */
X      exit(1);
X   `7D
X
X   return;
X
X`7D`09/*** subprocess_exit ***/
X`0C
X/***************************************************************************
V****
X****************************************************************************
V****
X
X  Function:`09delete_log
X
X  Purpose:`09Delete a log file from the log area.  SYSPRV is needed to
X`09`09do this so we turn it on, delete the file, and turn it off.
X
X  Formal Parameters:
X
X`09Name`09`09`09Description
X`09----`09`09`09-----------
X`09logfile`09`09`09name of log file to be deleted
X
X  Global variables:
X
X`09Name`09`09`09Examine/Modify/Use/Read/Write
X`09----`09`09`09-----------------------------
X`09privs`09`09`09`09  X`09X
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 USHORT delete_log(char *logfile)
X
X`7B`09/*** delete_log ***/
X`09`09`09`09`09/********   LOCAL  VARIABLES   ********/
X`09 ULONG`09  status;`09`09/* return code status holder`09      */
X
X
X   privs.prv$v_sysprv = ON;`09`09/* need SYSPRV to delete the log file */
X
X   status = SYS$SETPRV(ON,&privs,FALSE,NULL);
X
X   if(!(status & SS$_NORMAL))
X      return(FAILURE);
X
X   delete(logfile);
X
X   status = SYS$SETPRV(OFF,&privs,FALSE,NULL);
X
X   if(!(status & SS$_NORMAL))
X      return(FAILURE);
X
X   privs.prv$v_sysprv = OFF;
X   return(SUCCESS);
X
X`7D`09/*** delete_log ***/
$ CALL UNPACK [.JOBLOG]JOBLOG.C;1 437395319
$ 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]JOBLOG.HLP;1 1412963602
$ create 'f'
XSYS$SHARE:VAXCRTL.EXE/SHARE
$ CALL UNPACK [.JOBLOG]JOBLOG.OPT;1 1929406956
$ 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 [.JOBLOG]JOBLOGCLD.CLD;1 889721107
$ create 'f'
X.TITLE`09`09`09JOBLOG Program Error Messages
X.IDENT`09`09`09'JOBLOG 1.4'
X.FACILITY`09`09JOBLOG,2/PREFIX=JLG_
X
X.SEVERITY      `09`09SEVERE
XNO_LOGICAL`09`09<!AS logical not set.  Contact System Manager>/FAO_COUNT=1
XNO_LOGFILE  `09`09<Cannot open log file.  Exiting JOBLOG>
XNO_EXH   `09`09<Cannot declare exit handler.  Exiting JOBLOG>
XCANT_QUEUE`09`09<Cannot queue !AS>/FAO_COUNT=1
XCANT_WRITE`09`09<Cannot write !AS>/FAO_COUNT=1
XINUSE`09`09`09<You are already running JOBLOG>
X.SEVERITY      `09`09WARNING
XNO_SPAWN     `09`09<Cannot SPAWN to send mail>
XCANT_CANCEL_IO`09`09<Cannot cancel I/O on !AS>/FAO_COUNT=1
XCANT_DELETE`09`09<Cannot delete !AS>/FAO_COUNT=1
XCANT_DASSGN`09`09<Cannot deassign !AS>/FAO_COUNT=1
XCANT_RESET`09`09<Cannot reset TT characteristics>
X.SEVERITY      `09`09INFORMATIONAL
XCANT_DELETE_LOG`09`09<Cannot delete JOBLOG log file !AS>/FAO_COUNT=1
X.END
$ CALL UNPACK [.JOBLOG]JOBLOGMSG.MSG;1 789209333
$ 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
XJOBLOG.OPT`09`09`09Linker option 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 [.JOBLOG]MANIFEST.TXT;1 877159874
$ create 'f'
XLast update:  06/08/92
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   This version of JOBLOG (1.4) works with the FT pseudo-terminal driver tha
Vt
Xshipped with VMS 5.4.  If you're running a version of VMS that doesn't have
Xthe FT driver and you would like to use JOBLOG, get version 1.3.  You will
Xalso need the TW/PY pseudo-terminal driver.  Both are available from a numbe
Vr
Xof anonymous FTP sites around the net, DECUS tapes, or neighbors.  If you
Xcan't find them, e-mail me and I'll send them to you.
X
X   PHOTO mode is available so that JOBLOG can be built so that it functions
Xexactly like PHOTO.  This is for users who don't want to go through all of
Xthe steps necessary to have secure log files.  Log files are written to a
Xfile called JOBLOG.LOG in the current directory.
X
X   NOTE:  the default is for JOBLOG to be built for secure log files.
X
X   Requirements for secure log files:
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 and CMKRNL 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
X   If you wish to use PHOTO mode, go to the INSTALLATION section.
X
XDESCRIPTION
X   In order to understand the above requirements, let's look at the life of
Xa secure log file created by JOBLOG.
X
X`091. User runs JOBLOG.  The log file is created in the system dir-
+-+-+-+-+-+-+-+-  END  OF PART 6 +-+-+-+-+-+-+-+-
