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

$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
$!
$! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
$!   On 11-JUN-1992 08:37:45.78   By user GOATHUNTER (@WKUVX1.BITNET)
$!
$! 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 7 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. [.JOBLOG]BUILD.COM;1
$!       2. [.JOBLOG]COPYRIGHT.TXT;1
$!       3. [.JOBLOG]DESCRIP.MMS;1
$!       4. [.JOBLOG]DOC.TXT;1
$!       5. [.JOBLOG]JOBLOG.C;1
$!       6. [.JOBLOG]JOBLOG.HLP;1
$!       7. [.JOBLOG]JOBLOG.OPT;1
$!       8. [.JOBLOG]JOBLOGCLD.CLD;1
$!       9. [.JOBLOG]JOBLOGMSG.MSG;1
$!      10. [.JOBLOG]MANIFEST.TXT;1
$!      11. [.JOBLOG]README.TXT;1
$!      12. [.JOBLOG]SUBS.C;1
$!
$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$! BUILD.COM -- build JOBLOG
X$!
X$! Copyright (c) 1990, Leonard J. Peirce
X$!
X$ IF P1 .EQS. "OBJ" THEN GOTO BUILD_OBJ
X$!
X$! build JOBLOG from the sources
X$!
X$  write sys$output "Building JOBLOG from the sources....."
X$  write sys$output ""
X$  write sys$output "CC:`09JOBLOG.C"
X$! /OPTIMIZE=NOINLINE specified to overcome a bug in VAX C 3.0
X$  cc/optimize=noinline joblog.c
X$  write sys$output "CC:`09SUBS.C"
X$  cc/optimize=noinline subs.c
X$  write sys$output "MESSAGE:`09JOBLOGMSG.MSG"
X$  message/nolist/object=joblogmsg.obj joblogmsg.msg
X$  write sys$output "SET COMMAND:`09JOBLOGCLD.CLD"
X$  set command/object joblogcld.cld
X$BUILD_OBJ:
X$  write sys$output ""
X$  write sys$output "Linking JOBLOG....."
X$  link/notrace joblog,subs,joblogcld,joblogmsg,joblog.opt/opt
X$  write sys$output ""
X$  write sys$output "*** JOBLOG built ***"
X$  exit
$ CALL UNPACK [.JOBLOG]BUILD.COM;1 828127742
$ create 'f'
X                        JOBLOG General Public License
X
X                   (C) Copyright 1990 by Leonard J. Peirce
X
X
X`09`09`09  `09COPYING POLICIES
X
X   Permission is hereby  granted for copying and distribution of copies of t
Vhe
XJOBLOG source  files, and that of  any part thereof, subject to  the followi
Vng
Xlicense conditions:
X
X    1. You may, without  additional permission from the author, distribute`2
V0
X       JOBLOG or components of JOBLOG, with or without additions developed
X       by you or by  others at no charge.   You may also distribute JOBLOG
X       along with any other product  for sale, provided  that the  cost of
X       the bundled package is the same regardless of whether JOBLOG is in-
X       cluded, and provided that those interested  only in JOBLOG  must be
X       notified that it is a product freely available from the author.
X
X    2. Furthermore, if you distribute JOBLOG software or  parts of JOBLOG,
X       with or without additions developed by you or others, then you must`2
V0
X       either  make  available the  source to  all portions  of the JOBLOG
X       system (exclusive  of any additions made by  you or by others) upon
X       request, or instead you may notify anyone requesting source that it
X       is freely available from the author.
X
X    3. In  addition, you  may  not  omit any of the  copyright  notices on
X       either the source files, the executable file, or the documentation.
X
X    4. Also, you  may not omit transmission of this License agreement with`2
V0
X       whatever portions of JOBLOG that are distributed.
X
X    5. Lastly, any  users of  this  software must be  notified that  it is
X       without  warrantee or guarantee  of any nature, express or implied,`2
V0
X       nor is there any fitness for use represented.
X
XSoftware is  a malleable  thing and the  author can in  no way  guarantee th
Vat
Xusing this  program will not cause grevious  damage to your system.  Of cour
Vse
Xthis  isn't anticipated, but  if it  does  happen, the author  cannot  be he
Vld
Xliable for any damages either directly or indirectly caused by this event.
X
XModification of the  system is encouraged, providing  that the portions of t
Vhe
Xsystem that  are from the original still  carry the  appropriate copyright n
Vo-
Xtices  and  that the  changed  sections  are clearly  delimited  as such.  T
Vhe
Xauthor requests copies of any changes made to ensure that the various versio
Vns
Xstay reasonably in sync with each other.
X
XNote that it is not  permitted to copy, sublicense, distribute or transfer a
Vny
Xof the JOBLOG software except as expressly indicated herein.   Any attempts
V to
Xdo otherwise will be considered a violation of this license and your rights
V to
Xthe JOBLOG software will be voided.
X
X
XComments on  the system  and/or this licensing agreement are encouraged.  Se
Vnd
Xelectronic  mail to peirce@gw.wmich.edu.  The text  of this  copyright licen
Vse
Xwas borrowed from the ELM(tm) Mail System with permission from Dave Taylor.
$ CALL UNPACK [.JOBLOG]COPYRIGHT.TXT;1 911876202
$ create 'f'
X############################################################################
V##
X############################################################################
V##
X#
X#  Installation:  Western Michigan University Academic Computing Services
X#
X#  System:`09JOBLOG
X#
X#  Version=01`09Level=00`0901/05/90`09Leonard J. Peirce
X#
X#  Purpose:     Description file for building JOBLOG
X#
X#  Version=01`09Level=01`0912/03/90`09Leonard J. Peirce
X#
X#  Purpose:     Updates for 1.1.
X#
X#  Version=01`09Level=02`0902/11/91`09Leonard J. Peirce
X#
X#  Purpose:     Updates for 1.2.
X#
X#  Syntax:`09mms`09`09`09to build JOBLOG
X#`09`09mms install`09`09to build/install JOBLOG
X#`09`09mms clean`09`09to clean up after ourselves
X#
X#  Other information:`09Copyright (c) 1990, Leonard J. Peirce
X#
X############################################################################
V##
X############################################################################
V##
X
XPROG = joblog
X
XSOURCES = joblog.c,subs.c,joblogcld.cld,joblogmsg.msg
X
XOBJECTS = joblog.obj,subs.obj,joblogcld.obj,joblogmsg.obj
X
XERRORS = error.dat`09`09`09! where error messages are sent
X
XBINDIR = sys$common:`5Bsysexe`5D`09`09! where the executable lives
XPROT = prot=(s:rwed,o:rwed,g:e,w:e)
X
X# VAX C 3.0 has a problem with inline code generation; make sure that
X# /optimize has =noinline if you are using it
X
XCFLAGS=/optimize=noinline
XLINKFLAGS=/notrace
X#CFLAGS=/debug/nooptimize
X#LINKFLAGS=/debug
XLIBS=
XLINKOPTIONS=,joblog.opt/opt $(LIBS)
X
X$(PROG).exe :`09$(OBJECTS)
X`09`09$(LINK) $(LINKFLAGS)/exec=$(PROG) $(OBJECTS) $(LINKOPTIONS)
X
Xclean :
X`09`09- delete/nolog/noconfirm *.obj;*,*.exe;*
X
Xinstall :`09$(PROG).exe
X`09`09copy $(PROG).exe $(BINDIR)/$(PROT)
X`09`09library/help/replace sys$help:helplib.hlb joblog.hlp
X
X# default rule -- .C to .OBJ
X
X.c.obj :
X`09`09$(CC) $(CFLAGS) $*.C
X
X.FIRST
X`09`09@- define/nolog sys$error $(ERRORS)
X
X.LAST
X`09`09@- define/nolog sys$error sys$output
X
X# individual dependencies -- make sure to update these if you change somethi
Vng!
X
Xjoblog.obj :
Xjoblogcld.obj :
Xjoblogmsg.obj :
$ CALL UNPACK [.JOBLOG]DESCRIP.MMS;1 256339037
$ create 'f'
XJOBLOG:  an bonafide terminal logging facility
X----------------------------------------------
X
XJOBLOG, a facility for logging terminal sessions, is now available.
X
XThere are two types of JOBLOG log files:  VERIFIED and UNVERIFIED.  VERIFIED
Xlog files are guaranteed to be unedited by anyone, including the person who
Xcreated it.  Since the log files themselves are never accessible to the user
V while running JOBLOG, the only opportunity for modification
Xis if logging is disabled while in JOBLOG, which immediately makes the log
Xfile UNVERIFIED.
X
XThe difference between VERIFIED and UNVERIFIED log files becomes important
Xfor printed and mailed log files, especially for class assignments.
X
XThis also corrects a major shortcoming of the SET HOST/LOG implementation
Xsince the file is never where a user can modify it.
X
XTo start JOBLOG, enter:
X
X     $ JOBLOG
X
XAs a reminder, while in JOBLOG, your prompt will be JOBLOG.  To exit JOBLOG,
Xsimply enter:
X
X     $ LOGOUT
X
XRemember that after exiting JOBLOG, you are still logged in to the VAX and
Xneed to enter LOGOUT to end your session.
X
XThere are two commands that can be specified while running JOBLOG: 1) turnin
Vg
Xtime stamping of DCL commands on/off, and 2) turning logging on/off.
X
XTo toggle time stamping of DCL commands on/off, enter Control-`5D.  Time-
Xstamping is initially turned off when you enter JOBLOG unless you specified
Xthe /TIME_STAMP identifier when JOBLOG is started.  The time stamps for the
XDCL commands will only appear in the log file and will not appear on the
Xscreen.
X
XTo toggle between logging on/off, enter Control-\.  Logging is initially
Xturned on when JOBLOG is started.  If logging is ever turned off, the log
Xfile immediately becomes UNVERIFIED.
X
XThe disposition of the log file upon exiting JOBLOG can be handled in two
Xways.  You can either specify it when invoking JOBLOG or you can wait for
XJOBLOG to ask what should be done.  The different dispositions for the log
Xfile are:
X
X   1) Print the log file. You will be prompted for the print queue to be
X      used.  The /PRINT qualifier can be specified upon startup to have
X      the log file automatically printed upon exit from JOBLOG.  The queue
X      can be specified upon startup by using /PRINT=queue where queue
X      is the print queue to be used.  If the queue is not specified, you
X      will be prompted for it after exiting JOBLOG.`20
X
X   2) Save the log file.  You will be prompted for the name of the log
X      file.  The /SAVE qualifier can be specified upon startup to have
X      log file automatically saved upon exit from JOBLOG.  The filename
X      can be specified upon startup by using /SAVE=filename where
X      filename is the name of the file to which the log file is to be
X      saved.  If the filename is not specified, you will be prompted
X      for it after exiting JOBLOG.
X
X   3) Mail notification of a pending log file.  You will be prompted for
X      the user that is to receive the log file.  The /MAIL qualifier can
X      be specified upon startup to have the notification automatically
X      mailed upon exit from JOBLOG.  The person to receive the notifi-
X      cation can be specified upon startup by using /MAIL=username
X      where username is the name of the user to receive the notification.
X      If the username is not specified, you will be prompted for it
X      after exiting JOBLOG.
X
X      The log file notification will contain instructions on how to re-
X      trieve the log file as well as whether or not the log file was
X      VERIFIED or UNVERIFIED.
X
X      There are certain restrictions on who can receive mailed log files.
X      To be able to mail a log file to a user, the intended recipient
X      must be faculty, staff, or hold the JOBLOG_RECIPIENT identifier.
X      It is also not possible to send a log file to yourself.
X     `20
X   4) Delete the log file.  This is the default and can be used when you
X      want to start over.
X
XRetrieving log files
X--------------------
XOnce you have received a log file notification, the log file can be retrieve
Vd
Xby using the /RETRIEVE qualifier.  Either /USER or /CLASS must be specified
Xalong with /RETRIEVE.  For example, to retrieve a log file from user 620SMIT
VH,
Xthe syntax would be:
X
X     $ JOBLOG/RETRIEVE/USER=620SMITH
X
XThe resulting filename would be 620SMITH.JOBLOG if the log file was VERIFIED
Xand 620SMITH.UNVERIFIED_JOBLOG if the log file was UNVERIFIED.
X
XThe /CLASS qualifier would normally only be used by instructors.  For exampl
Ve,
Xif an instructor wanted to retrieve all of the log files for one's CS 105
Xclass, the syntax would be
X
X`09$ JOBLOG/RETRIEVE/CLASS=CS105
X
XThere are no spaces in the class specification.
X
XSince a user can only retrieve log files that were "mailed" specifically
Xto him/her, the problem of retrieving log files for another instructor's
XCS 105 class is avoided.
X
XMailed log files will be deleted after a certain length of time, currently
Xten days.  After seven days, both the sender and the recipient will be warne
Vd
Xthat the log file hasn't been picked up and that it will be deleted.
X
XWhile running JOBLOG it is best to avoid doing full-screen applications such
Xas editing.  Sometimes they are not logged correctly, and such files also
Xcause problems if they are printed.
X
XIt is also not possible to run JOBLOG while in JOBLOG.
X
XFor more information about JOBLOG, enter:
X
X     $ HELP JOBLOG
$ CALL UNPACK [.JOBLOG]DOC.TXT;1 189931992
$ create 'f'
X/***************************************************************************
V****
X****************************************************************************
V****
X
X   Installation:  Western Michigan University Academic Computing Services
X
X   System:`09JOBLOG
X `20
X   Program:`09JOBLOG
X
X   Version=01`09Level=00`0907/02/90`09Leonard J. Peirce
X
X   Purpose:`09JOBLOG will capture the output for a terminal session, place
X`09`09it in a file, and, upon exit, give the option of printing it,
X`09`09saving it, storing the log file in a secure area and sending
X`09`09notification of it to another user, or deleting it.
X
X`09`09There are essentially two types of JOBLOG log files:  VERIFIED
X`09`09and UNVERIFIED.  VERIFIED log files are guaranteed to be un-
X`09`09touched by the person who created them.  Since the log files
X`09`09themselves are never accessible to the user while running
X`09`09JOBLOG, the only opportunity for modification is if logging
X`09`09is disabled while in JOBLOG.  While this is often a nice
X`09`09feature, it immediately makes the log file UNVERIFIED.
X
X`09`09The difference between VERIFIED and UNVERIFIED log files be-
X`09`09comes important for printed and mailed log files, especially
X`09`09for class assignments and such.`20
X
X   Version=01`09Level=01`0912/03/90`09Leonard J. Peirce
X
X   Purpose:`09Fix /SKIM so that it actually works.
X
X`09`09Add a second exit handler that is called in quit() so that
X`09`09if a user hangs up or disconnects their log file is deleted.
X
X`09`09Make sure to override the user's default protection for the
X`09`09log file so that it can be deleted.
X
X`09`09Make sure that the log file is deleted on any ungraceful exit.
X
X`09`09Clean up some comments that were misleading or just plain
X`09`09wrong.
X
X   Version=01`09Level=02`0901/18/91`09Leonard J. Peirce
X
X   Purpose:`09Quit using mailboxes to detect input on the TTY and PTY.
X`09`09No more dropped reads on the TTY and a big win in performance.
X
X`09`09Fix warn() so that it will actually warn both the sender
X`09`09and the recipient.  Add the delete date to the mail message
X`09`09sent to the sender and recipient.
X
X`09`09Add PHOTO_MODE so that users don't have to go through all of
X`09`09the hassle of INSTALLing JOBLOG, creating logicals/directories,
X`09`09etc., if all they want to do is log files.  The log file is
X`09`09called JOBLOG.LOG and is created in the user's current dir-
X`09`09ectory.
X
X`09`09Put in a fix for SMP.  This was borrowed from the SMP version
X`09`09of PHOTO.
X
X`09`09Remove the code for exact logging, leaving comments in place
X`09`09in case some brave soul decides to implement it.
X
X   Version=01`09Level=03`0909/20/91`09Leonard J. Peirce
X
X   Purpose:`09Tighten down on use of privs to close a security hole.
X
X   Version=01`09Level=04`0906/04/92`09Leonard J. Peirce
X
X   Purpose:`09Port to use FT driver.
X
X   Arguments:`09See JOBLOG.HLP
X
X   External variables:
X
X`09`09joblog_cld`09`09.CLD file for parsing
X`09`09JLG_*`09`09`09for JOBLOGMSG.MSG
X`09`09LIB$M_CLI_CTRLY`09`09for trapping control-Y
X
X   External functions:
X
X          Defined:`09none
X
X          Called:`09cat,strins,strlu,strmcpy,str_post_trim,str_pref_trim
X
X   Files accessed:`09files in staging area and secure area
X
X   Logical names accessed:`09JOBLOG$LOG
X`09`09`09`09JOBLOG$STAGE
X
X   Return codes:`09none
X
X   Compiling instructions:`09See DESCRIP.MMS
X
X   Linking instructions:`09See DESCRIP.MMS
X
X   Other information:`09Privileges needed when INSTALLed:  SYSPRV and
X`09`09`09CMKRNL.
X
X`09`09`09This version uses the new FT pseudo-terminal
X`09`09`09driver from DEC.  If you are using a version of
X`09`09`09VMS that doesn't support the FT drivers and you
X`09`09`09would like to use JOBLOG get version 1.3.
X
X`09`09`09This program borrows some code and ideas from PHOTO,
X`09`09`09written by Asbed Bedrossian at the University of
X`09`09`09Southern California.
X
X`09`09`09Thanks to FK for his immeasurable patience and
X`09`09`09knowledge.  Sorry it took so long to port to the
X`09`09`09FT driver......
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 file
X#include stat
X#include descrip
X#include rms
X#include rmsdef
X#include ssdef
X#include climsgdef
X#include jpidef
X#include ttdef
X#include tt2def
X#include prvdef
X#include prcdef
X#include dvidef
X#include iodef
X#include uaidef
X#include lnmdef
X#include libdef
X#include syidef
X#include ctype
X#include time
X#include sjcdef
X
X/***************************************************************************
V***/
X/*
V                                                                         `20
V  */
X/*                             # D E F I N E S
V                                */
X/*
V                                                                         `20
V  */
X/***************************************************************************
V***/
X
X#define NULL (void *) 0
X#define DEFAULT_PRINT_QUEUE "SYS$PRINT"
X
X#define STATUS_STR_MAX 255`09`09/* max. length of SNDJBC status mess. */
X#define COMMAND_MAX 512`09`09`09/* max. length of command line`09      */
X#define ACCOUNT_MAX 12`09`09`09/* max. length of account string      */
X#define FT_NAME_MAX 64`09`09`09/* max. length of FT device name      */
X#define PNAME_MAX 15`09`09`09/* max. length of a process name      */
X#define USERNAME_MAX 15`09`09`09/* max. length of a username`09      */
X#define QUEUE_MAX 39
X#define CARRIAGE_RETURN 13
X#define LINE_FEED 10
X#define CONTROL_Z 26
X#define TOGGLE_LOG 28`09`09`09/* toggle logging`09`09      */
X#define TOGGLE_STAMP 30`09`09`09/* toggle time stamping`09`09      */
X#define TIME_MAX 23`09`09`09/* for full time string`09`09      */
X#define MAX_REC 1024`09`09`09/* max. length of log file record     */
X#define TT_BUF_MAX 512`09`09`09/* max. length of read from TTY`09      */
X#define IN_BUF_MAX 4096`09`09`09/* max. length of read/write to file  */
X#define TEMPBUF_MAX 512`09`09`09/* for formatting messages`09      */
X#define FT_DATA_MAX 508`09`09`09/* one page - status longword`09      */
X#define TT_DATA_MAX FT_DATA_MAX
X#define BUFSIZ 512
X#define XOFF 0x13
X#define XON 0x11
X#define BELL 0x7
X#define ON 1
X#define OFF 0
X#define TRUE 1
X#define FALSE 0
X#define CANCEL 3
X#define NO_INPUT 2
X#define SUCCESS 1
X#define FAILURE 0
X#define SECONDS_IN_DAY 86400
X#define INT_STR_MAX 15
X#define NUM_IO_BUFFERS 3
X#define PAGE_SIZE 0x200
X
X#define PTD$C_SEND_XON`09`090`09/* Pseudo Terminal Driver event       */
X#define PTD$C_SEND_BELL`09`091`09/* types. When these are in           */
X#define PTD$C_SEND_XOFF `092`09/* SYS$LIBRARY:VAXCDEF.TLB they       */
X#define PTD$C_STOP_OUTPUT`093`09/* should be removed from here.`09      */
X#define PTD$C_RESUME_OUTPUT `094
X#define PTD$C_CHAR_CHANGED `095
X#define PTD$C_ABORT_OUTPUT `096
X#define PTD$C_START_READ `097
X#define PTD$C_MIDDLE_READ `098
X#define PTD$C_END_READ `09`099
X#define PTD$C_ENABLE_READ `0910
X#define PTD$C_DISABLE_READ `0911
X#define PTD$C_MAX_EVENTS `0912
X
X#define SYSPRV(val) privs.prv$v_sysprv = val; \
X   status = SYS$SETPRV(ON,&privs,FALSE,NULL); \
X   if(!(status & SS$_NORMAL)) \
X      LIB$STOP(status);
X
X#define CMKRNL(val) privs.prv$v_cmkrnl = val; \
X   status = SYS$SETPRV(ON,&privs,FALSE,NULL); \
X   if(!(status & SS$_NORMAL)) \
X      LIB$STOP(status);
X
X#define SYS_CMK_PRV(val) privs.prv$v_sysprv = val; \
X   privs.prv$v_cmkrnl = val; \
X   status = SYS$SETPRV(ON,&privs,FALSE,NULL); \
X   if(!(status & SS$_NORMAL)) \
X      LIB$STOP(status);
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
Xtypedef`09 unsigned  int   UINT;`09`09/* for unsigned integers`09      */
Xtypedef`09 unsigned  long  ULONG;`09`09/* for unsigned long integers`09
V      */
Xtypedef`09 unsigned  short USHORT;`09/* for unsigned short integers`09
V      */
Xtypedef`09 unsigned  char  UCHAR;`09`09/* for unsigned characters`09      */
Xtypedef`09 unsigned  char  TINY;`09`09/* more descriptive for using un-
V     */
X`09`09`09`09`09/* characters as integers`09      */
X
Xtypedef`09 struct`09  ITM_TYPE `7B
X`09 USHORT`09  buf_len,
X`09`09  itm_code;
X`09 char `09  *buf_addr;
X`09 USHORT`09  *ret_len;
X`7D ITM_LST;
X
Xtypedef`09 struct`09  `7B`09`09`09/* run-time and computed flags`09      */
X`09 UCHAR`09  expert,`09`09/* no welcome message`09`09      */
X`09`09  exact,`09`09/* do exact logging?`09`09      */
X`09`09  delete,`09`09/* deleting a log file?`09`09      */
X`09`09  time_stamp,`09`09/* start with time-stamping enabled?  */
X`09`09  retrieve,`09`09/* someone retrieving a log file?     */
X`09`09  skim,`09`09`09/* set if /SKIMming old logs`09      */
X`09`09  mail,`09`09`09/* set if /MAILing a log file`09      */
X`09`09  save,`09`09`09/* set if /SAVEing a log file`09      */
X`09`09  print;`09`09/* set if /PRINT specified`09      */
X`7D ARG_DEF;
X
Xtypedef`09 struct`09  `7B`09`09`09/* program flags`09`09      */
X`09 UCHAR`09  hangups,`09`09/* hangups enabled?`09`09      */
X`09`09  logging,`09`09/* are we logging?`09`09      */
X`09`09  time_stamp,`09`09/* are we time-stamping?`09      */
X`09`09  verify,`09`09/* are we still verified?`09      */
X`09`09  command;`09`09/* set if input from TTY is a command */
X`09 char`09  filename`5BNAM$C_MAXRSS+1`5D; /* logfile name without dev/dir.
V  */
X`7D FLAG_DEF;
X
Xtypedef`09 struct`09  SENSE_TYPE `7B`09`09/* SENSEMODE structure for termina
Vls  */
X`09 UCHAR`09  class,`09`09/* device class`09`09`09      */
X`09`09  type;`09`09`09/* device type`09`09`09      */
X`09 USHORT`09  buf_size;`09`09/* buffer size`09`09`09      */
X`09 UINT`09  characts : 24;`09/* terminal characteristics`09      */
X`09 UCHAR`09  page_len;`09`09/* page length`09`09`09      */
X`09 ULONG`09  ext_char;`09`09/* extended characteristics`09      */
X`7D SENS_DEF;
X
Xtypedef`09 struct`09  SET_TYPE `7B`09`09/* SETMODE structure for terminals
V    */
X`09 UCHAR`09  class,`09`09/* device class`09`09`09      */
X`09`09  type;`09`09`09/* device type`09`09`09      */
X`09 USHORT`09  page_wid;`09`09/* page width for terminals`09      */
Xunion`09 ttdef`09  characts;`09`09/* terminal characteristics`09      */
Xunion`09 tt2def`09  ext_char;`09`09/* extended characteristics`09      */
X`7D SET_DEF;
X
Xtypedef`09 struct`09  IO2_TYPE `7B`09`09/* SENSEMODE I/O status block`09
V      */
X`09 USHORT`09  status;`09`09/* status value`09`09`09      */
X`09 UCHAR`09  t_speed,`09`09/* transmit baud rate`09`09      */
X`09`09  r_speed,`09`09/* receive baud rate`09`09      */
X`09`09  cr_fill,`09`09/* CR fill count`09`09      */
X`09`09  lf_fill,`09`09/* LF fill count`09`09      */
X`09`09  parity,`09`09/* parity flags`09`09`09      */
X`09`09  dummy;`09`09/* dummy padding variable`09      */
X`7D IO2_DEF;
X
Xtypedef`09 struct`09  ITEM_TYPE `7B`09`09/* message item type`09`09      */
X`09 short`09  size,`09`09`09/* item size`09`09`09      */
X`09`09  code;`09`09`09/* item code`09`09`09      */
X`09 char`09  *ptr;`09`09`09/* variable-length message`09      */
X`7D ITEM_DEF;
X
Xtypedef`09 struct`09  IOSB_TYPE `7B`09      `09/* I/O status block type`09
V      */
X`09 USHORT`09  status,`09`09/* completion status`09`09      */
X`09 `09  count,`09`09/* byte count`09`09`09      */
X`09`09  terminator,`09`09/* terminator character`09`09      */
X`09`09  term_count;`09`09/* number of characters in terminator */
X`7D IOSB_DEF;
X
Xtypedef`09 struct`09  `7B`09`09`09/* exit handler block`09`09      */
X`09 ULONG`09  forward_link;`09`09/* used by VMS`09`09`09      */
X`09 ULONG`09  (*routine)();`09`09/* address of exit handler routine    */
X`09 UCHAR`09  arg_count,`09`09/* argument count`09`09      */
X`09`09  dummy`5B3`5D;`09`09/* must be zeros!`09`09      */
X`09 ULONG`09  *condition;`09`09/* address of condition value`09      */
X`7D EXH_DEF;
X
Xtypedef`09 struct`09  `7B`09`09`09/* holds ASCII/longword id pairs      */
X`09 char`09  *id_string;`09`09/* ASCII identifer`09`09      */
X`09 ULONG`09  id;`09`09`09/* integer identifier value`09      */
X`7D ID_DEF;
X
Xtypedef`09 struct`09  `7B`09`09`09/* terminator character mask`09      */
X`09 USHORT`09  size,
X`09`09  unused;
X`09 USHORT`09  *ptr;
X`7D TERM_DEF;
X
Xtypedef`09 struct`09  `7B`09`09`09/* address_range`09`09      */
X`09 char`09  *start,`09`09/* start of a page`09`09      */
X`09`09  *end;`09`09`09/* end of a page`09`09      */
X`7D ADDR_RAN;
X
Xtypedef`09 struct   `7B`09`09`09/* FT device I/O buffer`09`09      */
X`09 USHORT`09  status,`09`09/* I/O completion status`09      */
X`09`09  count;`09`09/* number of bytes read/written`09      */
X`09 UCHAR`09  data`5BFT_DATA_MAX`5D;`09/* actual data`09`09`09      */
X`7D FT_BUF;
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
Xglobalref`09  joblog_cld;
X
Xglobalvalue`09  CLI$M_NOWAIT,
X`09`09  JLG_NO_LOGICAL,
X`09`09  JLG_NO_LOGFILE,
+-+-+-+-+-+-+-+-  END  OF PART 1 +-+-+-+-+-+-+-+-
