Exacct.pm revision df0345f7d6cc87cde9e532e8362f1aca053d98cc
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Exacct.pm contains wrappers for the exacct error functions and syscalls,
# and some 'shorthand' convenience functions.
#
require 5.8.4;
use strict;
use warnings;
our $VERSION = '1.5';
use XSLoader;
# @_Constants is set up by the XSUB bootstrap() function.
use base qw(Exporter);
#
# Extend the default Exporter::import to do optional inclusion of all the
# lower-level Exacct modules. Any export tag prefixed with 'EXACCT_' is
# interpreted as a request to import that tag from all the Exacct modules.
#
sub import
{
shift(@_);
foreach my $tag (@_) {
# Note: Modifies @_
my $new_tag = ":$1";
} else {
}
}
# Export the taglist with all "EXACCT_" prefixes removed.
# Do sub-module imports if required.
# ::Catalog
@my_tags);
# ::File and Fcntl
@my_tags);
require Fcntl;
# ::Object
@my_tags);
}
}
#
# Convenience functions - shorthand for fully qualified method names. Note that
# goto() is used to call the methods so that any errors will appear to come
# from the correct place. Because goto() does not understand method call syntax
# it is necessary to fake up the class a parameter by unshifting the appropriate
# class name onto the argument lists.
#
{
unshift(@_, 'Sun::Solaris::Exacct::Catalog');
}
sub ea_new_catalog
{
unshift(@_, 'Sun::Solaris::Exacct::Catalog');
}
sub ea_new_file
{
unshift(@_, 'Sun::Solaris::Exacct::File');
}
sub ea_new_item
{
unshift(@_, 'Sun::Solaris::Exacct::Item');
}
sub ea_new_group
{
unshift(@_, 'Sun::Solaris::Exacct::Group');
}
sub ea_dump_object
{
unshift(@_, 'Sun::Solaris::Exacct::Object');
}
1;