DEFINITION MODULE misc;

FROM K32baseTypes IMPORT

	integer32;

FROM K32types IMPORT

	openDescriptor, seid, setOfOpenModes;

FROM K32except IMPORT

	exceptionType;

FROM NKSR IMPORT

	acpFileBlock;

EXPORT QUALIFIED

	ACPDIR, acpDirSeid, acpOpAbort, DEBUG, error, NONKCALL, openTerm,
	printAcp, putAcpMsg, rmAcpFile, substr;

CONST

    DEBUG       = FALSE;                (* turns on DEBUG output if true *)
    NONKCALL   = '  ';                   (* used in acpOpAbort *)
    ACPDIR     = '/sys/sysAudit';      (* directory containing the ACP files*)

VAR
    READONLY   		: setOfOpenModes;
    WRITEONLY  		: setOfOpenModes;
    acpDirSeid        : seid;         (* seid of ACPDIR *)
    error               : exceptionType;    (* error code returned from kernel *)
    termInOd          : openDescriptor;
					(* open descriptor to terminal-input*)
    termOutOd         : openDescriptor;
					(* open descriptor to terminal-output*)


PROCEDURE acpOpAbort(
	   errMsg         : ARRAY OF CHAR;
	   callName       : ARRAY OF CHAR;
	   exception       : exceptionType
	);

PROCEDURE substr(
	   string	: ARRAY OF CHAR;
	   start	: integer32;
	   length	: integer32;
	VAR	subString	: ARRAY OF CHAR
	);

PROCEDURE putAcpMsg(
	   acpMess        : acpFileBlock
	);

PROCEDURE printAcp (
	   fileName       : ARRAY OF CHAR
	);

PROCEDURE rmAcpFile(
	   fileName       : ARRAY OF CHAR
	);

PROCEDURE openTerm;

END misc.
