xref: /illumos-gate/usr/src/head/pkgstrct.h (revision 4c28a617e3922d92a58e813a5b955eb526b9c386)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
22 /*	  All Rights Reserved	*/
23 
24 /*
25  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
26  * Use is subject to license terms.
27  */
28 
29 #ifndef	_PKGSTRCT_H
30 #define	_PKGSTRCT_H
31 
32 #include <time.h>
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 #define	CLSSIZ	64
39 #define	PKGSIZ	64
40 #define	ATRSIZ	64
41 
42 #define	BADFTYPE	'?'
43 #define	BADMODE		(mode_t)ULONG_MAX
44 #define	BADOWNER	"?"
45 #define	BADGROUP	"?"
46 #define	BADMAJOR	(major_t)ULONG_MAX
47 #define	BADMINOR	(minor_t)ULONG_MAX
48 #define	BADCLASS	"none"
49 #define	BADINPUT	1 /* not EOF */
50 #define	BADCONT		(-1L)
51 
52 extern char	*errstr;
53 
54 struct ainfo {
55 	char	*local;
56 	mode_t	mode;
57 	char	owner[ATRSIZ+1];
58 	char	group[ATRSIZ+1];
59 	major_t	major;
60 	minor_t	minor;
61 };
62 
63 struct cinfo {
64 	long		cksum;
65 	fsblkcnt_t	size;
66 	time_t		modtime;
67 };
68 
69 struct pinfo {
70 	char	status;
71 	char	pkg[PKGSIZ+1];
72 	char	editflag;
73 	char	aclass[ATRSIZ+1];
74 	struct pinfo
75 		*next;
76 };
77 
78 struct cfent {
79 	short	volno;
80 	char	ftype;
81 	char	pkg_class[CLSSIZ+1];
82 	int	pkg_class_idx;
83 	char	*path;
84 	struct ainfo ainfo;
85 	struct cinfo cinfo;
86 	short	npkgs;
87 	struct pinfo
88 		*pinfo;
89 };
90 
91 /* averify() & cverify() error codes */
92 #define	VE_EXIST	0x0001
93 #define	VE_FTYPE	0x0002
94 #define	VE_ATTR		0x0004
95 #define	VE_CONT		0x0008
96 #define	VE_FAIL		0x0010
97 #define	VE_TIME		0x0020
98 
99 #ifdef	__cplusplus
100 }
101 #endif
102 
103 #endif	/* _PKGSTRCT_H */
104