auditxml revision 11bc41c8d344c50e04ea4015552fe4efbf0cdfc4
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# CDDL HEADER START
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# The contents of this file are subject to the terms of the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Common Development and Distribution License (the "License").
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# You may not use this file except in compliance with the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# See the License for the specific language governing permissions
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# and limitations under the License.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# When distributing Covered Code, include this CDDL HEADER in each
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# If applicable, add the following below this CDDL HEADER, with the
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# fields enclosed by brackets "[]" replaced with your own identifying
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# information: Portions Copyright [yyyy] [name of copyright owner]
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# CDDL HEADER END
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Use is subject to license terms.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# auditxml takes the audit record description (.xml file) and
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# generates the files needed for the C audit api.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwUsage: $prog [options] <xml-input-file>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw -d Enable debug output
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw -e pfx Internal event prefix (default: AUE)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw -i pfx Interface prefix (default: adt)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw External event prefix is uppercase version of this string.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw -o dir Output directory (default: current dir)
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwour $debug = 0; # normal use is to set via the file being parsed.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw # <debug set="on"/> or <debug set="off"/> or <debug/>
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw # if the set attribute is omitted, debug state is toggled
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw # Override with appDebug, but toggle won't do what you
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwmy $appDebug = 0; # used after return from "new auditxml";
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw# Process command-line options
3db3f65c6274eb042354801a308c8e9bc4994553amw# where everything comes from and where it goes:
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw$filename =~ s|.*/||g;
3db3f65c6274eb042354801a308c8e9bc4994553amwDO NOT EDIT. This file is auto generated by the Solaris Audit
3db3f65c6274eb042354801a308c8e9bc4994553amwsystem from $filename.
3db3f65c6274eb042354801a308c8e9bc4994553amw# trim leading/trailing newlines
3db3f65c6274eb042354801a308c8e9bc4994553amw generateAPIFile($event, $eventId, $eventType, $eventHeader, $idNo)
3db3f65c6274eb042354801a308c8e9bc4994553amw generateTableC($event, $eventId, $eventType, $eventHeader, $omit);
my $file = shift;
my $notice = $genNotice;
my $extDef;
@{$xlateEventTable{$eventId}};
my $entry;
my $externalRoot = $externalName;
$externalRoot =~ s/${pfx_AUE}_//;
my $externalId = $eventId;
$externalId =~ s/${pfx_AUE}_/${pfx_ADT}_/;
$entry =~ s/selfReference/$structName/;
my $firstEvent = 1;
$firstEvent = 0;
my @preloads = @{$xlateDefault{$id}};
my $fieldName = shift @preloads;
my $listName;
my @listName;
my $listValue;
my $listLength = $#listValue + 1;
my $ffirst = 1;
$ffirst = 0;
my $ffirst = 1;
$ffirst = 0;
my $file = shift;
my $xmlDoc = shift;
my @Hfile;
my $notice = $genNotice;
my $shortName = uc $listName;
$shortName =~ s/_TEXT//;
my $listValue;
my $j = $#listValue;
$line =~ s/\t\t/\t/;
$eline =~ s/ {8}//;
my $externalId = $eventId;
$externalId =~ s/${pfx_AUE}_/${pfx_ADT}_/;
my $entry;
$entry =~ s/termid/adt_termid_t/;
$outputState[$header] = 0;
$outputState[$header] = 1;
my $elementName = $eventId;
$elementName =~ s/^${pfx_AUE}_/${pfx_adt}_/;
$elementName =~ s/_t$//;
my $event = shift;
my $eventId = shift;
my $eventType = shift;
my $eventHeader = shift;
my $omit = shift;
my $entryRef;
my @inputOrder;
$firstTokenIndex = $j;
last;
my $sequence = 0;
$enumGroup =~ s/^msg\s*//i;
my $tsol = 0;
my $token;
my $tokenName;
print STDERR
$sequence++;
my $xlateLabelInc = 0;
my $dataType;
my $dataSize;
my $entryType = ${$entryDef{$type}}[0];
my $typeCount = 1;
$type =~ s/\[\]//;
$xlateLabelInc = 1;
@list = @{$xlateDefault{$eventId}};
$xlateDefault{$eventId} = \@list;
my $dataType;
my $entryType = ${$entryDef{$dtype}}[0];
$type =~ s/\[\]//;
$xlateLabelInc = 1;
@list = @{$xlateDefault{$eventId}};
$xlateDefault{$eventId} = \@list;
my $event = shift;
my $eventId = shift;
my $eventType = shift;
my $eventHeader = shift;
my $idNo = shift;
print STDERR
$#id = $#type;
$#type = $#id;
$eventExtra{$eventId} = [$eventHeader, $idNo];
my $textList = shift;
my $entry;
my @entry;
[\@entry, [$header, $start, $public, $deprecated]];
my $header_index = shift;
# $header = 0 is a special case; it is for adt_event.h
# $header > 0 creates adt_event_N.h, where N = $header
my $header;
$HfileName[$header] = $tmp[$#tmp];
my @Hfile = @_;
my $header;