xref: /illumos-gate/usr/src/head/pkgstrct.h (revision b4203d75)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5a20d514eSny  * Common Development and Distribution License (the "License").
6a20d514eSny  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
22*b4203d75SMarcel Telka /*	  All Rights Reserved	*/
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate /*
25a20d514eSny  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
26a20d514eSny  * Use is subject to license terms.
277c478bd9Sstevel@tonic-gate  */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifndef	_PKGSTRCT_H
307c478bd9Sstevel@tonic-gate #define	_PKGSTRCT_H
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <time.h>
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
357c478bd9Sstevel@tonic-gate extern "C" {
367c478bd9Sstevel@tonic-gate #endif
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate #define	CLSSIZ	64
397c478bd9Sstevel@tonic-gate #define	PKGSIZ	64
407c478bd9Sstevel@tonic-gate #define	ATRSIZ	64
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate #define	BADFTYPE	'?'
437c478bd9Sstevel@tonic-gate #define	BADMODE		(mode_t)ULONG_MAX
447c478bd9Sstevel@tonic-gate #define	BADOWNER	"?"
457c478bd9Sstevel@tonic-gate #define	BADGROUP	"?"
467c478bd9Sstevel@tonic-gate #define	BADMAJOR	(major_t)ULONG_MAX
477c478bd9Sstevel@tonic-gate #define	BADMINOR	(minor_t)ULONG_MAX
487c478bd9Sstevel@tonic-gate #define	BADCLASS	"none"
497c478bd9Sstevel@tonic-gate #define	BADINPUT	1 /* not EOF */
507c478bd9Sstevel@tonic-gate #define	BADCONT		(-1L)
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate extern char	*errstr;
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate struct ainfo {
557c478bd9Sstevel@tonic-gate 	char	*local;
567c478bd9Sstevel@tonic-gate 	mode_t	mode;
577c478bd9Sstevel@tonic-gate 	char	owner[ATRSIZ+1];
587c478bd9Sstevel@tonic-gate 	char	group[ATRSIZ+1];
597c478bd9Sstevel@tonic-gate 	major_t	major;
607c478bd9Sstevel@tonic-gate 	minor_t	minor;
617c478bd9Sstevel@tonic-gate };
627c478bd9Sstevel@tonic-gate 
637c478bd9Sstevel@tonic-gate struct cinfo {
64a20d514eSny 	long		cksum;
65a20d514eSny 	fsblkcnt_t	size;
66a20d514eSny 	time_t		modtime;
677c478bd9Sstevel@tonic-gate };
687c478bd9Sstevel@tonic-gate 
697c478bd9Sstevel@tonic-gate struct pinfo {
707c478bd9Sstevel@tonic-gate 	char	status;
717c478bd9Sstevel@tonic-gate 	char	pkg[PKGSIZ+1];
727c478bd9Sstevel@tonic-gate 	char	editflag;
737c478bd9Sstevel@tonic-gate 	char	aclass[ATRSIZ+1];
747c478bd9Sstevel@tonic-gate 	struct pinfo
757c478bd9Sstevel@tonic-gate 		*next;
767c478bd9Sstevel@tonic-gate };
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate struct cfent {
797c478bd9Sstevel@tonic-gate 	short	volno;
807c478bd9Sstevel@tonic-gate 	char	ftype;
817c478bd9Sstevel@tonic-gate 	char	pkg_class[CLSSIZ+1];
827c478bd9Sstevel@tonic-gate 	int	pkg_class_idx;
837c478bd9Sstevel@tonic-gate 	char	*path;
847c478bd9Sstevel@tonic-gate 	struct ainfo ainfo;
857c478bd9Sstevel@tonic-gate 	struct cinfo cinfo;
867c478bd9Sstevel@tonic-gate 	short	npkgs;
877c478bd9Sstevel@tonic-gate 	struct pinfo
887c478bd9Sstevel@tonic-gate 		*pinfo;
897c478bd9Sstevel@tonic-gate };
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate /* averify() & cverify() error codes */
927c478bd9Sstevel@tonic-gate #define	VE_EXIST	0x0001
937c478bd9Sstevel@tonic-gate #define	VE_FTYPE	0x0002
947c478bd9Sstevel@tonic-gate #define	VE_ATTR		0x0004
957c478bd9Sstevel@tonic-gate #define	VE_CONT		0x0008
967c478bd9Sstevel@tonic-gate #define	VE_FAIL		0x0010
977c478bd9Sstevel@tonic-gate #define	VE_TIME		0x0020
987c478bd9Sstevel@tonic-gate 
997c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1007c478bd9Sstevel@tonic-gate }
1017c478bd9Sstevel@tonic-gate #endif
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate #endif	/* _PKGSTRCT_H */
104