libcdio  0.83
rock.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2005, 2006 2008 Rocky Bernstein <rocky@gnu.org>
3 
4  See also rock.c by Eric Youngdale (1993) from GNU/Linux
5  This is Copyright 1993 Yggdrasil Computing, Incorporated
6 
7  This program is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
28 
29 #ifndef __CDIO_ROCK_H__
30 #define __CDIO_ROCK_H__
31 
32 #include <cdio/types.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
37 
38 /* MSYS 1.0.10 with MinGW 3.4.2 (and perhaps others) don't have
39  S_ISSOCK() or S_ISLNK() macros, so we'll roll our own. */
40 #if !defined(HAVE_S_ISSOCK) && !defined(S_ISSOCK)
41 #define S_ISSOCK(st_mode) ((((st_mode)) & 0170000) == (0140000))
42 #endif
43 
44 #if !defined(HAVE_S_ISLNK) && !defined(S_ISLNK)
45 #define S_ISLNK(st_mode) ((((st_mode)) & 0170000) == (0010000))
46 #endif
47 
53 extern enum iso_rock_enums {
54  ISO_ROCK_IRUSR = 000400,
55  ISO_ROCK_IWUSR = 000200,
56  ISO_ROCK_IXUSR = 000100,
57  ISO_ROCK_IRGRP = 000040,
58  ISO_ROCK_IWGRP = 000020,
59  ISO_ROCK_IXGRP = 000010,
60  ISO_ROCK_IROTH = 000004,
61  ISO_ROCK_IWOTH = 000002,
62  ISO_ROCK_IXOTH = 000001,
64  ISO_ROCK_ISUID = 004000,
65  ISO_ROCK_ISGID = 002000,
66  ISO_ROCK_ISVTX = 001000,
68  ISO_ROCK_ISSOCK = 0140000,
69  ISO_ROCK_ISLNK = 0120000,
70  ISO_ROCK_ISREG = 0100000,
71  ISO_ROCK_ISBLK = 060000,
72  ISO_ROCK_ISCHR = 020000,
73  ISO_ROCK_ISDIR = 040000,
74  ISO_ROCK_ISFIFO = 010000
76 
77 #define ISO_ROCK_IRUSR 000400
78 #define ISO_ROCK_IWUSR 000200
79 #define ISO_ROCK_IXUSR 000100
80 #define ISO_ROCK_IRGRP 000040
81 #define ISO_ROCK_IWGRP 000020
82 #define ISO_ROCK_IXGRP 000010
83 #define ISO_ROCK_IROTH 000004
84 #define ISO_ROCK_IWOTH 000002
85 #define ISO_ROCK_IXOTH 000001
87 #define ISO_ROCK_ISUID 004000
88 #define ISO_ROCK_ISGID 002000
89 #define ISO_ROCK_ISVTX 001000
91 #define ISO_ROCK_ISSOCK 0140000
92 #define ISO_ROCK_ISLNK 0120000
93 #define ISO_ROCK_ISREG 0100000
94 #define ISO_ROCK_ISBLK 060000
95 #define ISO_ROCK_ISCHR 020000
96 #define ISO_ROCK_ISDIR 040000
97 #define ISO_ROCK_ISFIFO 010000
100 #define ISO_ROCK_ENFMT ISO_ROCK_ISGID
101 
103 
110 typedef struct iso_su_sp_s{
111  unsigned char magic[2];
112  uint8_t skip;
114 
116 typedef struct iso_su_er_s {
118  unsigned char len_des;
119  unsigned char len_src;
123 
124 typedef struct iso_su_ce_s {
125  char extent[8];
126  char offset[8];
127  char size[8];
128 } iso_su_ce_t;
129 
131 typedef struct iso_rock_px_s {
141 
150 typedef struct iso_rock_pn_s {
156 
158 typedef enum {
164 
165 #define ISO_ROCK_SL_CONTINUE 1
166 #define ISO_ROCK_SL_CURRENT 2
167 #define ISO_ROCK_SL_PARENT 4
168 #define ISO_ROCK_SL_ROOT 8
169 
170 typedef struct iso_rock_sl_part_s {
171  uint8_t flags;
172  uint8_t len;
175 
177 typedef struct iso_rock_sl_s {
178  unsigned char flags;
179  iso_rock_sl_part_t link;
181 
185 typedef enum {
190 
191 #define ISO_ROCK_NM_CONTINUE 1
192 #define ISO_ROCK_NM_CURRENT 2
193 #define ISO_ROCK_NM_PARENT 4
194 
195 
196 typedef struct iso_rock_nm_s {
197  unsigned char flags;
200 
202 typedef struct iso_rock_cl_s {
203  char location[1];
205 
207 typedef struct iso_rock_pl_s {
208  char location[1];
210 
212 typedef enum {
222 
223 /* These are the bits and their meanings for flags in the TF structure. */
224 #define ISO_ROCK_TF_CREATE 1
225 #define ISO_ROCK_TF_MODIFY 2
226 #define ISO_ROCK_TF_ACCESS 4
227 #define ISO_ROCK_TF_ATTRIBUTES 8
228 #define ISO_ROCK_TF_BACKUP 16
229 #define ISO_ROCK_TF_EXPIRATION 32
230 #define ISO_ROCK_TF_EFFECTIVE 64
231 #define ISO_ROCK_TF_LONG_FORM 128
232 
234 typedef struct iso_rock_tf_s {
235  uint8_t flags;
248 
250 typedef struct iso_rock_sf_s {
253  uint8_t table_depth;
255 
256 typedef struct iso_extension_record_s {
257  char signature[2];
264  union {
265  iso_su_sp_t SP;
267  iso_su_er_t ER;
270  iso_rock_px_t PX;
271  iso_rock_pn_t PN;
272  iso_rock_sl_t SL;
273  iso_rock_nm_t NM;
274  iso_rock_cl_t CL;
275  iso_rock_pl_t PL;
276  iso_rock_tf_t TF;
277  } u;
279 
280 typedef struct iso_rock_time_s {
281  bool b_used;
283  bool b_longdate;
285  union
286  {
289  } t;
291 
292 typedef struct iso_rock_statbuf_s {
301  uint8_t s_rock_offset;
302  int i_symlink;
304  char *psz_symlink;
306  iso_rock_time_t create;
307  iso_rock_time_t modify;
310  iso_rock_time_t access;
312  iso_rock_time_t attributes;
314  iso_rock_time_t backup;
315  iso_rock_time_t expiration;
317  iso_rock_time_t effective;
319  uint32_t i_rdev;
324 
326 
328 int get_rock_ridge_filename(iso9660_dir_t * de, /*out*/ char * retname,
329  /*out*/ iso9660_stat_t *p_stat);
330 
331  int parse_rock_ridge_stat(iso9660_dir_t *de, /*out*/ iso9660_stat_t *p_stat);
332 
336  mode_t
338 
372 const char *iso9660_get_rock_attr_str(posix_mode_t st_mode);
373 
381 
382 #ifdef __cplusplus
383 }
384 #endif /* __cplusplus */
385 
386 #endif /* __ISO_ROCK_H__ */
387 
388 /*
389  * Local variables:
390  * c-file-style: "gnu"
391  * tab-width: 8
392  * indent-tabs-mode: nil
393  * End:
394  */

Generated for libcdio by doxygen 1.8.1.1