xref: /openbsd-src/usr.sbin/makefs/cd9660/iso_rrip.h (revision 8a44b1e0db2307315b98f85a583c888d3bac26d7)
1*8a44b1e0Snatano /*	$OpenBSD: iso_rrip.h,v 1.1 2016/10/18 16:50:55 natano Exp $	*/
2*8a44b1e0Snatano /*	$NetBSD: iso_rrip.h,v 1.4 2005/12/03 17:34:43 christos Exp $	*/
3*8a44b1e0Snatano 
4*8a44b1e0Snatano /*-
5*8a44b1e0Snatano  * Copyright (c) 1993, 1994
6*8a44b1e0Snatano  *	The Regents of the University of California.  All rights reserved.
7*8a44b1e0Snatano  *
8*8a44b1e0Snatano  * This code is derived from software contributed to Berkeley
9*8a44b1e0Snatano  * by Pace Willisson (pace@blitz.com).  The Rock Ridge Extension
10*8a44b1e0Snatano  * Support code is derived from software contributed to Berkeley
11*8a44b1e0Snatano  * by Atsushi Murai (amurai@spec.co.jp).
12*8a44b1e0Snatano  *
13*8a44b1e0Snatano  * Redistribution and use in source and binary forms, with or without
14*8a44b1e0Snatano  * modification, are permitted provided that the following conditions
15*8a44b1e0Snatano  * are met:
16*8a44b1e0Snatano  * 1. Redistributions of source code must retain the above copyright
17*8a44b1e0Snatano  *    notice, this list of conditions and the following disclaimer.
18*8a44b1e0Snatano  * 2. Redistributions in binary form must reproduce the above copyright
19*8a44b1e0Snatano  *    notice, this list of conditions and the following disclaimer in the
20*8a44b1e0Snatano  *    documentation and/or other materials provided with the distribution.
21*8a44b1e0Snatano  * 3. Neither the name of the University nor the names of its contributors
22*8a44b1e0Snatano  *    may be used to endorse or promote products derived from this software
23*8a44b1e0Snatano  *    without specific prior written permission.
24*8a44b1e0Snatano  *
25*8a44b1e0Snatano  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26*8a44b1e0Snatano  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27*8a44b1e0Snatano  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28*8a44b1e0Snatano  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29*8a44b1e0Snatano  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30*8a44b1e0Snatano  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31*8a44b1e0Snatano  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32*8a44b1e0Snatano  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33*8a44b1e0Snatano  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34*8a44b1e0Snatano  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35*8a44b1e0Snatano  * SUCH DAMAGE.
36*8a44b1e0Snatano  *
37*8a44b1e0Snatano  *	@(#)iso_rrip.h	8.2 (Berkeley) 1/23/94
38*8a44b1e0Snatano  */
39*8a44b1e0Snatano 
40*8a44b1e0Snatano #ifndef _ISOFS_CD9660_ISO_RRIP_H_
41*8a44b1e0Snatano #define _ISOFS_CD9660_ISO_RRIP_H_
42*8a44b1e0Snatano 
43*8a44b1e0Snatano /*
44*8a44b1e0Snatano  *	Analyze function flag (similar to RR field bits)
45*8a44b1e0Snatano  */
46*8a44b1e0Snatano #define	ISO_SUSP_ATTR		0x0001
47*8a44b1e0Snatano #define	ISO_SUSP_DEVICE		0x0002
48*8a44b1e0Snatano #define	ISO_SUSP_SLINK		0x0004
49*8a44b1e0Snatano #define	ISO_SUSP_ALTNAME	0x0008
50*8a44b1e0Snatano #define	ISO_SUSP_CLINK		0x0010
51*8a44b1e0Snatano #define	ISO_SUSP_PLINK		0x0020
52*8a44b1e0Snatano #define	ISO_SUSP_RELDIR		0x0040
53*8a44b1e0Snatano #define	ISO_SUSP_TSTAMP		0x0080
54*8a44b1e0Snatano #define	ISO_SUSP_IDFLAG		0x0100
55*8a44b1e0Snatano #define	ISO_SUSP_EXTREF		0x0200
56*8a44b1e0Snatano #define	ISO_SUSP_CONT		0x0400
57*8a44b1e0Snatano #define	ISO_SUSP_OFFSET		0x0800
58*8a44b1e0Snatano #define	ISO_SUSP_STOP		0x1000
59*8a44b1e0Snatano #define	ISO_SUSP_UNKNOWN	0x8000
60*8a44b1e0Snatano 
61*8a44b1e0Snatano typedef struct {
62*8a44b1e0Snatano 	struct iso_node	*inop;
63*8a44b1e0Snatano 	int		fields;		/* interesting fields in this analysis */
64*8a44b1e0Snatano 	daddr_t		iso_ce_blk;	/* block of continuation area */
65*8a44b1e0Snatano 	off_t		iso_ce_off;	/* offset of continuation area */
66*8a44b1e0Snatano 	int		iso_ce_len;	/* length of continuation area */
67*8a44b1e0Snatano 	struct iso_mnt	*imp;		/* mount structure */
68*8a44b1e0Snatano 	ino_t		*inump;		/* inode number pointer */
69*8a44b1e0Snatano 	char		*outbuf;	/* name/symbolic link output area */
70*8a44b1e0Snatano 	u_short		*outlen;	/* length of above */
71*8a44b1e0Snatano 	u_short		maxlen;		/* maximum length of above */
72*8a44b1e0Snatano 	int		cont;		/* continuation of above */
73*8a44b1e0Snatano } ISO_RRIP_ANALYZE;
74*8a44b1e0Snatano 
75*8a44b1e0Snatano int cd9660_rrip_analyze(struct iso_directory_record *isodir,
76*8a44b1e0Snatano 			    struct iso_node *inop, struct iso_mnt *imp);
77*8a44b1e0Snatano int cd9660_rrip_getname(struct iso_directory_record *isodir,
78*8a44b1e0Snatano 			    char *outbuf, u_short *outlen,
79*8a44b1e0Snatano 			    ino_t *inump, struct iso_mnt *imp);
80*8a44b1e0Snatano int cd9660_rrip_getsymname(struct iso_directory_record *isodir,
81*8a44b1e0Snatano 			       char *outbuf, u_short *outlen,
82*8a44b1e0Snatano 			       struct iso_mnt *imp);
83*8a44b1e0Snatano int cd9660_rrip_offset(struct iso_directory_record *isodir,
84*8a44b1e0Snatano 			   struct iso_mnt *imp);
85*8a44b1e0Snatano 
86*8a44b1e0Snatano #endif /* _ISOFS_CD9660_ISO_RRIP_H_ */
87