      *>***************************************************************
      *> 
      *> Copyright (C) 1984-2007 Micro Focus (IP) Limited.
      *> All rights reserved.
      *>
      *> The software and information contained herein are
      *> proprietary to, and comprise valuable trade secrets of,
      *> Micro Focus (IP) Limited, which intends to preserve
      *> as trade secrets such software and information. This software
      *> is an unpublished copyright of Micro Focus and may not be
      *> used, copied, transmitted, or stored in any manner.  This
      *> software and information or any other copies thereof may not
      *> be provided or otherwise made available to any other person.
      *> 
      *> Genesis Run Time System (Studio/Server 5.0 Freeze)
      *> 
      *> @(#)mfaudit.cpy	11.3
      *> 
      *> Last Modified on 07/01/15 at 16:51:49
      *> 
      *>***************************************************************

      *>***************************************************************
      *>
      *> Audit Facility
      *>
      *>***************************************************************
       copy "cbltypes.cpy".
       copy "mfctf.cpy".

      *>---------------------------------------------------------------
      *> CBL_AUDIT_ API return codes
      *>---------------------------------------------------------------
       78  78-AUD-RET-SUCCESS                     
                               value 78-CTF-RET-SUCCESS.
       78  78-AUD-RET-FAILURE                     
                               value 78-CTF-RET-FAILURE.
       78  78-AUD-RET-INVALID-HANDLE              
                               value 78-CTF-RET-INVALID-TRACE-HANDLE.
       78  78-AUD-RET-INVALID-CATEGORY
                               value 4.
       78  78-AUD-RET-NOT-ENOUGH-MEMORY           
                               value 78-CTF-RET-NOT-ENOUGH-MEMORY.
       78  78-AUD-RET-OUTPUT-ERROR                
                               value 78-CTF-RET-OUTPUT-ERROR.
       78  78-AUD-RET-PROPERTY-NOT-FOUND          
                               value 78-CTF-RET-PROPERTY-NOT-FOUND.
       78  78-AUD-RET-BUFFER-TOO-SMALL            
                               value 78-CTF-RET-BUFFER-TOO-SMALL.
       78  78-AUD-RET-VALUE-NOT-INTEGER           
                               value 78-CTF-RET-VALUE-NOT-INTEGER.
       78  78-AUD-RET-EMITTER-NOT-FOUND           
                               value 78-CTF-RET-EMITTER-NOT-FOUND.
       78  78-AUD-RET-ZERO-LENGTH-DATA            
                               value 78-CTF-RET-ZERO-LENGTH-DATA.
       78  78-AUD-RET-INVALID-PROP-NAME           
                               value 78-CTF-RET-INVALID-PROP-NAME.
       78  78-AUD-RET-INVALID-COMP-NAME           
                               value 78-CTF-RET-INVALID-COMP-NAME.
       78  78-AUD-RET-INVALID-EMITTER-NAME
                               value 78-CTF-RET-INVALID-EMITTER-NAME.
       78  78-AUD-RET-NO-SERVER-PROCESS
                               value 78-CTF-RET-NO-SERVER-PROCESS.
       78  78-AUD-RET-ACCESS-DENIED
                               value 78-CTF-RET-ACCESS-DENIED.
       78  78-AUD-RET-FILE-NOT-EXIST              
                               value 1000.
       78  78-AUD-RET-FILE-NOT-AVAILABLE          
                               value 1001.
       78  78-AUD-RET-FILE-INVALID-FORMAT         
                               value 1002.
       78  78-AUD-RET-FILE-EOF                    
                               value 1003.
       78  78-AUD-RET-FILE-NO-MORE-RECORDS        
                               value 1004.
       78  78-AUD-RET-FILE-INVALID-NAME
                               value 1005.
       78  78-AUD-RET-FILE-NOT-DUMPED
                               value 1006.

      *>---------------------------------------------------------------
      *> CBL_AUDIT_ API control flags
      *>---------------------------------------------------------------

      *>
      *>  Used by:
      *>
      *>        CBL_AUDIT_CONFIG_PROPERTY_GET
      *>        CBL_AUDIT_CONFIG_PROPERTY_SET
      *>        CBL_AUDIT_EMITTER_PROPERTY_GET
      *>        CBL_AUDIT_EMITTER_PROPERTY_SET
      *>
       78  78-AUD-FLAG-PROP-STRING-VALUE        value h'00000000'.
       78  78-AUD-FLAG-PROP-INT-VALUE           value h'00000001'.
       78  78-AUD-FLAG-PROP-NULL-TERM           value h'00000002'.

      *>
      *>  Used by:
      *>
      *>        CBL_AUDIT_FILE_CLOSE
      *>
       78  78-AUD-FLAG-CLOSE-ALL                value h'00000000'.
       78  78-AUD-FLAG-CLOSE-CURRENT            value h'00000001'.
       78  78-AUD-FLAG-CLOSE-DUMPED             value h'00000002'.

      *>
      *>  Used by:
      *>
      *>        CBL_AUDIT_FILE_OPEN
      *>
       78  78-AUD-FLAG-OPEN-FILE                value h'00000000'.
       78  78-AUD-FLAG-OPEN-COLLECTION          value h'00000001'.
       78  78-AUD-FLAG-OPEN-NAME-NULL-TERM      value h'00000002'.

      *>
      *>  Used by:
      *>
      *>        CBL_AUDIT_EVENT
      *>
       78  78-AUD-FLAG-EVENT-ARRAY-DATA         value h'00002000'.

      *>
      *>  Used by:
      *>
      *>        CBL_AUDIT_EMITTER_PROPERTY_GET
      *>        CBL_AUDIT_EMITTER_PROPERTY_SET
      *>
       78  78-AUD-FLAG-EMIT-NAME-NULL-TERM      value h'10000000'.

      *>
      *>  Used by:
      *>
      *>        CBL_AUDIT_CONFIG_PROPERTY_GET
      *>        CBL_AUDIT_CONFIG_PROPERTY_SET
      *>
       78  78-AUD-FLAG-PROP-NAME-NULL-TERM      value h'20000000'.

      *>
      *>  Used by:
      *>
      *>        CBL_AUDIT_EVENT
      *>        CBL_AUDIT_HANDLE_GET
      *>
       78  78-AUD-FLAG-COMP-NAME-NULL-TERM      value h'40000000'.

      *>
      *>  Used by:
      *>
      *>        CBL_AUDIT_EVENT
      *>
       78  78-AUD-FLAG-COMPID-STRING            value h'80000000'.

      *>---------------------------------------------------------------
      *> Audit categories
      *>---------------------------------------------------------------
       78  78-AUDEVT-CAT-UNKNOWN                value 0.
       78  78-AUDEVT-CAT-AUDIT-FACILITY         value 1.
       78  78-AUDEVT-CAT-SYSTEM                 value 2.
       78  78-AUDEVT-CAT-SECAPI-REQ-CHECK       value 3.
       78  78-AUDEVT-CAT-SECAPI-REQ-DEFINE      value 4.
       78  78-AUDEVT-CAT-SECAPI-REQ-OTHER       value 5.
       78  78-AUDEVT-CAT-SECAPI-RES-ALLOW       value 6.
       78  78-AUDEVT-CAT-SECAPI-RES-DENY        value 7.
       78  78-AUDEVT-CAT-SECAPI-RES-ERROR       value 8.
       78  78-AUDEVT-CAT-SECAPI-RES-OK          value 9.

      *>---------------------------------------------------------------
      *> Audit event
      *>---------------------------------------------------------------
       01       cblt-aud-event                  typedef.
         03     cblte-audevt-version            cblt-x4-comp5.
         03     cblte-audevt-flags              cblt-x4-comp5.
         03     cblte-audevt-id                 cblt-x4-comp5.
         03     cblte-audevt-category           cblt-x4-comp5.
         03     cblte-audevt-data-count         cblt-x4-comp5.
         03     cblte-audevt-reserved1          cblt-x4-comp5 occurs 7.
         03     cblte-audevt-event-len          cblt-pointer.
         03     cblte-audevt-event-type         cblt-pointer.
         03     cblte-audevt-event-data         cblt-pointer.
         03     cblte-audevt-reserved2          cblt-pointer occurs 7.

      *>
      *> Version types (cblte-audevt-version)
      *>
       78  78-AUDIT-EVENT-VERSION               value 0.

      *>
      *> Control flags (cblte-audevt-flags)
      *>
       78  78-AUDIT-EVENT-FLAGS-NONE            value h'00000000'.

      *>
      *> Audit data item types (cblte-audevt-event-type)
      *>
       78  78-AUDIT-EVENT-TYPE-BINARY           
                            value 78-TRACE-EVENT-TYPE-BINARY.
       78  78-AUDIT-EVENT-TYPE-TEXT             
                            value 78-TRACE-EVENT-TYPE-TEXT.
       78  78-AUDIT-EVENT-TYPE-ADDRESS          
                            value 78-TRACE-EVENT-TYPE-ADDRESS.
       78  78-AUDIT-EVENT-TYPE-COMP5            
                            value 78-TRACE-EVENT-TYPE-COMP5.
       78  78-AUDIT-EVENT-TYPE-COMPX            
                            value 78-TRACE-EVENT-TYPE-COMPX.
       78  78-AUDIT-EVENT-TYPE-UTF8             
                            value 78-TRACE-EVENT-TYPE-UTF8.
       78  78-AUDIT-EVENT-TYPE-COMP5S           
                            value 78-TRACE-EVENT-TYPE-COMP5S.
       78  78-AUDIT-EVENT-TYPE-COMPXS           
                            value 78-TRACE-EVENT-TYPE-COMPXS.

      *>---------------------------------------------------------------
      *> Audit record
      *>---------------------------------------------------------------
       01       cblt-aud-record                 typedef.
         03     cblte-audrec-version            cblt-x4-comp5.
         03     cblte-audrec-flags              cblt-x4-comp5.

         03     cblte-audrec-pid-len            cblt-x4-comp5.
         03     cblte-audrec-tid-len            cblt-x4-comp5.

         03     cblte-audrec-pid-32             cblt-x4-comp5.
         03     cblte-audrec-pid-64             cblt-x8-comp5
                                      redefines cblte-audrec-pid-32.

         03     cblte-audrec-tid-32             cblt-x4-comp5.
         03     cblte-audrec-tid-64             cblt-x8-comp5
                                      redefines cblte-audrec-tid-32.

         03     cblte-audrec-event-id           cblt-x4-comp5.
         03     cblte-audrec-event-category     cblt-x4-comp5.
         03     cblte-audrec-data-count         cblt-x4-comp5.
         03     cblte-audrec-appname-len        cblt-x4-comp5.
         03     cblte-audrec-cmdline-len        cblt-x4-comp5.
         03     cblte-audrec-os-name-len        cblt-x4-comp5.
         03     cblte-audrec-mc-name-len        cblt-x4-comp5.
         03     cblte-audrec-sys-name-len       cblt-x4-comp5.
         03     cblte-audrec-comp-name-len      cblt-x4-comp5.

         03     cblte-audrec-encoded-time       cblt-x4-comp5.
         03     cblte-audrec-hour               cblt-x4-comp5.
         03     cblte-audrec-minute             cblt-x4-comp5.
         03     cblte-audrec-second             cblt-x4-comp5.
         03     cblte-audrec-millisecond        cblt-x4-comp5.
         03     cblte-audrec-encoded-date       cblt-x4-comp5.
         03     cblte-audrec-year               cblt-x4-comp5.
         03     cblte-audrec-month              cblt-x4-comp5.
         03     cblte-audrec-day                cblt-x4-comp5.

         03     cblte-audrec-reserved1          cblt-x4-comp5 occurs 7.

         03     cblte-audrec-appname            cblt-pointer.
         03     cblte-audrec-cmdline            cblt-pointer.
         03     cblte-audrec-os-name            cblt-pointer.
         03     cblte-audrec-mc-name            cblt-pointer.
         03     cblte-audrec-sys-name           cblt-pointer.
         03     cblte-audrec-comp-name          cblt-pointer.
         03     cblte-audrec-event-len          cblt-pointer.
         03     cblte-audrec-event-type         cblt-pointer.
         03     cblte-audrec-event-data         cblt-pointer.
         03     cblte-audrec-reserved2          cblt-pointer occurs 7.
