1Exacct::Catalog(3PERL)      Perl Library Functions      Exacct::Catalog(3PERL)
2
3
4

NAME

6       Exacct::Catalog - exacct catalog tag manipulation
7

SYNOPSIS

9       use Sun::Solaris::Exacct::Catalog qw(:ALL);
10       my $ea_cat = Sun::Solaris::Exacct::Catalog->new(
11           &EXT_UINT64 | &EXC_DEFAULT | &EXD_PROC_PID);
12
13

DESCRIPTION

15       This class provides a wrapper around the 32-bit integer used as a cata‐
16       log tag.  The catalog tag is represented as a Perl object blessed  into
17       the  Sun::Solaris::Exacct::Catalog class so that methods can be used to
18       manipulate fields in a catalog tag.
19
20   Constants
21       All the EXT_*, EXC_*, and EXD_* macros are provided as constants.  Con‐
22       stants passed to the methods below can either be the integer value such
23       as EXT_UINT8 or the string representation such as  "EXT_UINT8".
24
25   Functions
26       None.
27
28   Class methods
29       register($cat_pfx, $catalog_id, $export, @idlist)
30
31           This method is used to register application-defined libexacct(3LIB)
32           catalogs      with     the     exacct     Perl     library.     See
33           </usr/include/sys/exacct_catalog.h> for details of the catalog  tag
34           format.   This  method allows symbolic names and strings to be used
35           for manipulating application-defined catalogs. The first two param‐
36           eters  define the catalog prefix and associated numeric catalog ID.
37           If the $export parameter is true, the constants are  exported  into
38           the  caller's  package. The final parameter is a list of (id, name)
39           pairs that identify the required constants. The  constants  created
40           by  this  method  are  formed by appending $cat_pfx and "_" to each
41           name in the list, replacing any spaces with  underscore  characters
42           and  converting  the  resulting string to uppercase characters. The
43           $catalog_name value is also created as a constant by  prefixing  it
44           with  EXC_  and  converting  it  to uppercase characters. Its value
45           becomes that of $catalog_id shifted left by 24 bits.  For  example,
46           the following call:
47
48             Sun::Solaris::Exacct::Catalog->ea_register("MYCAT", 0x01, 1,
49                FIRST => 0x00000001, SECOND => 0x00000010);
50
51           results in the definition of the following constants:
52
53             EXC_MYCAT    0x01 << 24
54             MYCAT_FIRST  0x00000001
55             MYCAT_SECOND 0x00000010
56
57           Only  the catalog ID value of 0x01 is available for application use
58           (EXC_LOCAL). All other values are reserved.  While it  is  possible
59           to  use  values  other  than  0x01, they might conflict with future
60           extensions to the libexacct file format.
61
62           If any errors are detected during this method, a string is returned
63           containing the appropriate error message. If the call is sucessful,
64           undef is returned.
65
66
67       new($integer)
68       new($cat_obj)
69       new($type, $catalog, $id)
70
71           This method creates and returns a new Catalog object,  which  is  a
72           wrapper  around  a 32-bit integer catalog tag. Three possible argu‐
73           ment lists can be given. The first variant is to  pass  an  integer
74           formed  by  bitwise-inclusive  OR of the appropriate EX[TCD]_* con‐
75           stants. The second variant is to pass an  existing  Catalog  object
76           that will be copied. The final variant is to pass in the type, cat‐
77           alog and ID fields as separate values. Each of these values can  be
78           either an appropriate integer constant or the string representation
79           of the constant.
80
81
82   Object methods
83       value()          This method allows the value of the catalog tag to  be
84                        queried.  In  a  scalar  context it returns the 32-bit
85                        integer representing the tag. In  a  list  context  it
86                        returns a (type, catalog, id) triplet, where each mem‐
87                        ber of the triplet is a dual-typed scalar.
88
89
90       type()           This method returns the type field of the catalog  tag
91                        as a dual-typed scalar.
92
93
94       catalog()        This  method  returns the catalog field of the catalog
95                        tag as a dual-typed scalar.
96
97
98       id()             This method returns the id field of the catalog tag as
99                        a dual-typed scalar.
100
101
102       type_str()       These  methods  return  string  representations of the
103       catalog_str()    appropriate value. These methods can be used for  tex‐
104       id_str()         tual  output of the various catalog fields. The string
105                        representations of the constants are formed by  remov‐
106                        ing  the  EXT_,  EXC_,  or  EXD_ prefix, replacing any
107                        underscore characters with spaces, and converting  the
108                        remaining string to lowercase characters.
109
110
111   Exports
112       By default nothing is exported from this module. The following tags can
113       be used to selectively import constants and functions defined  in  this
114       module:
115
116       :CONSTANTS    EXT_*, EXC_*, and EXD_*
117
118
119       :ALL          :CONSTANTS
120
121

ATTRIBUTES

123       See attributes(5) for descriptions of the following attributes:
124
125
126
127
128       ┌─────────────────────────────┬─────────────────────────────┐
129       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
130       ├─────────────────────────────┼─────────────────────────────┤
131       │Availability                 │SUNWpl5u                     │
132       ├─────────────────────────────┼─────────────────────────────┤
133       │Interface Stability          │Evolving                     │
134       └─────────────────────────────┴─────────────────────────────┘
135

SEE ALSO

137       Exacct(3PERL),        Exacct::File(3PERL),       Exacct::Object(3PERL),
138       Exacct::Object::Group(3PERL),    Exacct::Object::Item(3PERL),    libex‐
139       acct(3LIB), attributes(5)
140
141
142
143SunOS 5.11                        1 Dec 2002            Exacct::Catalog(3PERL)
Impressum