4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * exacct item, group, and object definitions as well as structure manipulation
34 * and conversion routines are given in sys/exacct.h.
36 #include <sys/exacct.h>
37 #include <sys/exacct_catalog.h>
44 * ea_open positioning options: passed in via the aflags argument, these flags
45 * determine whether the newly opened file is positioned for reading prior to
46 * its first record, or after its last.
48 #define EO_HEAD 0x0 /* open file positioned at first object */
49 #define EO_TAIL 0x1 /* open file positioned at last object */
50 #define EO_POSN_MSK 0x1
53 * ea_open validation options: passed in via the aflags argument, these flags
54 * specify whether the open operation should validate the header on the input
55 * file. The EO_NO_VALID_HDR is useful in the case that no header is present on
56 * the file, but the version and file type checks are omitted, meaning that
57 * incompatibilities might not be caught immediately.
59 #define EO_VALID_HDR 0x0 /* validate header on opening file */
60 #define EO_NO_VALID_HDR 0x2 /* omit header validation */
61 #define EO_VALIDATE_MSK 0x2
63 typedef struct _ea_file
{
64 void *ef_opaque_ptr
[8];
65 offset_t ef_opaque_off
[3];
69 extern int ea_error(void);
70 extern int ea_open(ea_file_t
*, const char *, const char *, int, int, mode_t
);
71 extern int ea_fdopen(ea_file_t
*, int, const char *, int, int);
72 extern void ea_clear(ea_file_t
*);
73 extern int ea_close(ea_file_t
*);
74 extern int ea_match_object_catalog(ea_object_t
*, ea_catalog_t
);
75 extern ea_object_type_t
ea_next_object(ea_file_t
*, ea_object_t
*);
76 extern ea_object_type_t
ea_previous_object(ea_file_t
*, ea_object_t
*);
77 extern ea_object_type_t
ea_get_object(ea_file_t
*, ea_object_t
*);
78 extern ea_object_type_t
ea_unpack_object(ea_object_t
**, int, void *, size_t);
79 extern int ea_write_object(ea_file_t
*, ea_object_t
*);
80 extern const char *ea_get_creator(ea_file_t
*);
81 extern const char *ea_get_hostname(ea_file_t
*);
82 extern ea_object_t
*ea_copy_object(const ea_object_t
*);
83 extern ea_object_t
*ea_copy_object_tree(const ea_object_t
*);
84 extern ea_object_t
*ea_get_object_tree(ea_file_t
*, uint32_t);
90 #endif /* _EXACCT_H */