libcdio  2.1.0
rock.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2005, 2006 2008, 2012 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 
43 extern enum iso_rock_enums {
44  ISO_ROCK_IRUSR = 000400,
45  ISO_ROCK_IWUSR = 000200,
46  ISO_ROCK_IXUSR = 000100,
47  ISO_ROCK_IRGRP = 000040,
48  ISO_ROCK_IWGRP = 000020,
49  ISO_ROCK_IXGRP = 000010,
50  ISO_ROCK_IROTH = 000004,
51  ISO_ROCK_IWOTH = 000002,
52  ISO_ROCK_IXOTH = 000001,
54  ISO_ROCK_ISUID = 004000,
55  ISO_ROCK_ISGID = 002000,
56  ISO_ROCK_ISVTX = 001000,
58  ISO_ROCK_ISSOCK = 0140000,
59  ISO_ROCK_ISLNK = 0120000,
60  ISO_ROCK_ISREG = 0100000,
61  ISO_ROCK_ISBLK = 060000,
62  ISO_ROCK_ISCHR = 020000,
63  ISO_ROCK_ISDIR = 040000,
64  ISO_ROCK_ISFIFO = 010000
66 
67 #define ISO_ROCK_IRUSR 000400
68 #define ISO_ROCK_IWUSR 000200
69 #define ISO_ROCK_IXUSR 000100
70 #define ISO_ROCK_IRGRP 000040
71 #define ISO_ROCK_IWGRP 000020
72 #define ISO_ROCK_IXGRP 000010
73 #define ISO_ROCK_IROTH 000004
74 #define ISO_ROCK_IWOTH 000002
75 #define ISO_ROCK_IXOTH 000001
77 #define ISO_ROCK_ISUID 004000
78 #define ISO_ROCK_ISGID 002000
79 #define ISO_ROCK_ISVTX 001000
81 #define ISO_ROCK_ISSOCK 0140000
82 #define ISO_ROCK_ISLNK 0120000
83 #define ISO_ROCK_ISREG 0100000
84 #define ISO_ROCK_ISBLK 060000
85 #define ISO_ROCK_ISCHR 020000
86 #define ISO_ROCK_ISDIR 040000
87 #define ISO_ROCK_ISFIFO 010000
90 #define ISO_ROCK_ENFMT ISO_ROCK_ISGID
91 
93 
100 typedef struct iso_su_sp_s{
101  unsigned char magic[2];
102  uint8_t skip;
104 
106 typedef struct iso_su_er_s {
108  unsigned char len_des;
109  unsigned char len_src;
113 
114 typedef struct iso_su_ce_s {
115  char extent[8];
116  char offset[8];
117  char size[8];
118 } iso_su_ce_t;
119 
121 typedef struct iso_rock_px_s {
131 
140 typedef struct iso_rock_pn_s {
146 
148 typedef enum {
154 
155 #define ISO_ROCK_SL_CONTINUE 1
156 #define ISO_ROCK_SL_CURRENT 2
157 #define ISO_ROCK_SL_PARENT 4
158 #define ISO_ROCK_SL_ROOT 8
159 
160 typedef struct iso_rock_sl_part_s {
161  uint8_t flags;
162  uint8_t len;
165 
167 typedef struct iso_rock_sl_s {
168  unsigned char flags;
171 
175 typedef enum {
180 
181 #define ISO_ROCK_NM_CONTINUE 1
182 #define ISO_ROCK_NM_CURRENT 2
183 #define ISO_ROCK_NM_PARENT 4
184 
185 
186 typedef struct iso_rock_nm_s {
187  unsigned char flags;
190 
192 typedef struct iso_rock_cl_s {
193  char location[1];
195 
197 typedef struct iso_rock_pl_s {
198  char location[1];
200 
202 typedef enum {
212 
213 /* These are the bits and their meanings for flags in the TF structure. */
214 #define ISO_ROCK_TF_CREATE 1
215 #define ISO_ROCK_TF_MODIFY 2
216 #define ISO_ROCK_TF_ACCESS 4
217 #define ISO_ROCK_TF_ATTRIBUTES 8
218 #define ISO_ROCK_TF_BACKUP 16
219 #define ISO_ROCK_TF_EXPIRATION 32
220 #define ISO_ROCK_TF_EFFECTIVE 64
221 #define ISO_ROCK_TF_LONG_FORM 128
222 
224 typedef struct iso_rock_tf_s {
225  uint8_t flags;
238 
240 typedef struct iso_rock_sf_s {
243  uint8_t table_depth;
245 
246 typedef struct iso_extension_record_s {
247  char signature[2];
254  union {
267  } u;
269 
270 typedef struct iso_rock_time_s {
271  bool b_used;
273  bool b_longdate;
275  union
276  {
279  } t;
281 
282 typedef struct iso_rock_statbuf_s {
291  uint8_t s_rock_offset;
292  int i_symlink;
294  char *psz_symlink;
309  uint32_t i_rdev;
314 
316 
318 int get_rock_ridge_filename(iso9660_dir_t * de, /*out*/ char * retname,
319  /*out*/ iso9660_stat_t *p_stat);
320 
321  int parse_rock_ridge_stat(iso9660_dir_t *de, /*out*/ iso9660_stat_t *p_stat);
322 
326  mode_t
328 
362 const char *iso9660_get_rock_attr_str(posix_mode_t st_mode);
363 
371 
372 #ifdef __cplusplus
373 }
374 #endif /* __cplusplus */
375 
376 #endif /* CDIO_ROCK_H_ */
377 
378 /*
379  * Local variables:
380  * c-file-style: "gnu"
381  * tab-width: 8
382  * indent-tabs-mode: nil
383  * End:
384  */
iso_rock_time_t
struct iso_rock_time_s iso_rock_time_t
iso_rock_statbuf_s::i_rdev
uint32_t i_rdev
Definition: rock.h:309
ISO_ROCK_IXUSR
#define ISO_ROCK_IXUSR
Definition: rock.h:69
iso_rock_pn_s::dev_low
iso733_t dev_low
Definition: rock.h:143
iso_rock_pl_s
Definition: rock.h:197
ISO_ROCK_TF_EFFECTIVE
#define ISO_ROCK_TF_EFFECTIVE
Definition: rock.h:220
ISO_ROCK_ISBLK
#define ISO_ROCK_ISBLK
Definition: rock.h:84
iso_rock_statbuf_s::b3_rock
bool_3way_t b3_rock
Definition: rock.h:283
iso_extension_record_s::PN
iso_rock_pn_t PN
Definition: rock.h:261
iso_rock_time_s::b_longdate
bool b_longdate
Definition: rock.h:273
bool_3way_t
bool_3way_t
Definition: types.h:236
iso_rock_tf_s::flags
uint8_t flags
Definition: rock.h:225
posix_uid_t
uint32_t posix_uid_t
Definition: posix.h:28
iso_rock_statbuf_s::s_rock_offset
uint8_t s_rock_offset
Definition: rock.h:291
ISO_ROCK_TF_ATTRIBUTES
#define ISO_ROCK_TF_ATTRIBUTES
Definition: rock.h:217
iso_rock_sl_part_t
struct iso_rock_sl_part_s iso_rock_sl_part_t
iso_rock_sl_s
Definition: rock.h:167
iso_rock_pn_s
Definition: rock.h:140
iso_su_er_s::len_des
unsigned char len_des
Definition: rock.h:108
iso_rock_statbuf_s::i_symlink_max
int i_symlink_max
Definition: rock.h:293
iso_su_ce_t
struct iso_su_ce_s iso_su_ce_t
iso_rock_pn_s::dev_high
iso733_t dev_high
Definition: rock.h:141
ISO_ROCK_IRUSR
#define ISO_ROCK_IRUSR
Definition: rock.h:67
iso_extension_record_s::version
iso711_t version
Definition: rock.h:253
iso_rock_sl_part_s::text
char text[EMPTY_ARRAY_SIZE]
Definition: rock.h:163
iso_rock_sl_flag_t
iso_rock_sl_flag_t
Definition: rock.h:148
iso_rock_px_s::st_gid
iso733_t st_gid
Definition: rock.h:128
iso_rock_px_s
Definition: rock.h:121
types.h
Common type definitions used pervasively in libcdio.
ISO_ROCK_ISDIR
#define ISO_ROCK_ISDIR
Definition: rock.h:86
iso9660_get_rock_attr_str
const char * iso9660_get_rock_attr_str(posix_mode_t st_mode)
iso_rock_statbuf_s::create
iso_rock_time_t create
Definition: rock.h:296
iso_extension_record_s::u
union iso_extension_record_s::@13 u
iso_extension_record_s::CE
iso_su_ce_t CE
Definition: rock.h:259
iso_rock_sf_t
struct iso_rock_sf_s iso_rock_sf_t
iso_su_sp_s
Definition: rock.h:100
iso_rock_statbuf_s::i_symlink
int i_symlink
Definition: rock.h:292
get_rock_ridge_filename
PRAGMA_END_PACKED int get_rock_ridge_filename(iso9660_dir_t *de, char *retname, iso9660_stat_t *p_stat)
iso_su_ce_s::extent
char extent[8]
Definition: rock.h:115
iso733_t
uint64_t iso733_t
Definition: iso9660.h:56
iso9660_stat_s
Unix stat-like version of iso9660_dir.
Definition: iso9660.h:530
ISO_ROCK_ISGID
#define ISO_ROCK_ISGID
Definition: rock.h:78
iso_rock_statbuf_s::st_gid
posix_gid_t st_gid
Definition: rock.h:290
iso_rock_time_s::t
union iso_rock_time_s::@14 t
ISO_ROCK_IROTH
#define ISO_ROCK_IROTH
Definition: rock.h:73
ISO_ROCK_SL_CONTINUE
#define ISO_ROCK_SL_CONTINUE
Definition: rock.h:155
iso_extension_record_s::PX
iso_rock_px_t PX
Definition: rock.h:260
iso_extension_record_s::ER
iso_su_er_t ER
Definition: rock.h:257
iso_rock_sl_s::link
iso_rock_sl_part_t link
Definition: rock.h:169
iso_su_er_s
Definition: rock.h:106
iso_rock_sl_t
struct iso_rock_sl_s iso_rock_sl_t
iso_su_sp_s::skip
uint8_t skip
Definition: rock.h:102
iso_rock_tf_t
struct iso_rock_tf_s iso_rock_tf_t
ISO_ROCK_ISVTX
#define ISO_ROCK_ISVTX
Definition: rock.h:79
iso_rock_pl_s::location
char location[1]
Definition: rock.h:198
iso_rock_time_s::ltime
iso9660_ltime_t ltime
Definition: rock.h:277
iso_rock_nm_flag_t
iso_rock_nm_flag_t
Definition: rock.h:175
iso_rock_sf_s::table_depth
uint8_t table_depth
Definition: rock.h:243
iso_rock_tf_s
Definition: rock.h:224
iso_su_er_t
struct iso_su_er_s iso_su_er_t
ISO_ROCK_ISREG
#define ISO_ROCK_ISREG
Definition: rock.h:83
iso_rock_statbuf_t
struct iso_rock_statbuf_s iso_rock_statbuf_t
ISO_ROCK_IWOTH
#define ISO_ROCK_IWOTH
Definition: rock.h:74
ISO_ROCK_IXGRP
#define ISO_ROCK_IXGRP
Definition: rock.h:72
ISO_ROCK_NM_PARENT
#define ISO_ROCK_NM_PARENT
Definition: rock.h:183
iso_rock_sl_part_s
Definition: rock.h:160
posix_gid_t
uint32_t posix_gid_t
Definition: posix.h:29
iso_rock_statbuf_s::st_nlinks
posix_nlink_t st_nlinks
Definition: rock.h:288
iso_rock_statbuf_s::st_mode
posix_mode_t st_mode
Definition: rock.h:287
iso_rock_nm_s::flags
unsigned char flags
Definition: rock.h:187
ISO_ROCK_ISUID
#define ISO_ROCK_ISUID
Definition: rock.h:77
iso_rock_nm_s
Definition: rock.h:186
iso_su_er_s::len_src
unsigned char len_src
Definition: rock.h:109
iso_su_er_s::len_id
iso711_t len_id
Definition: rock.h:107
iso_extension_record_s::CL
iso_rock_cl_t CL
Definition: rock.h:264
posix_mode_t
uint32_t posix_mode_t
Definition: posix.h:26
iso_rock_cl_s::location
char location[1]
Definition: rock.h:193
ISO_ROCK_ISLNK
#define ISO_ROCK_ISLNK
Definition: rock.h:82
ISO_ROCK_TF_EXPIRATION
#define ISO_ROCK_TF_EXPIRATION
Definition: rock.h:219
iso_rock_time_s
Definition: rock.h:270
iso9660_dir_s
Format of an ISO-9660 directory record.
Definition: iso9660.h:248
iso_rock_tf_flag
iso_rock_tf_flag_t iso_rock_tf_flag
iso_rock_time_s::b_used
bool b_used
Definition: rock.h:271
iso_rock_sf_s::virtual_size_high
iso733_t virtual_size_high
Definition: rock.h:241
ISO_ROCK_TF_MODIFY
#define ISO_ROCK_TF_MODIFY
Definition: rock.h:215
iso_rock_cl_t
struct iso_rock_cl_s iso_rock_cl_t
iso_rock_sf_s::virtual_size_low
iso733_t virtual_size_low
Definition: rock.h:242
ISO_ROCK_IRGRP
#define ISO_ROCK_IRGRP
Definition: rock.h:70
iso_rock_enums
iso_rock_enums
Definition: rock.h:43
ISO_ROCK_SL_ROOT
#define ISO_ROCK_SL_ROOT
Definition: rock.h:158
ISO_ROCK_IWUSR
#define ISO_ROCK_IWUSR
Definition: rock.h:68
iso9660_ltime_s
ISO-9660 longer-format time structure.
Definition: iso9660.h:207
ISO_ROCK_NM_CURRENT
#define ISO_ROCK_NM_CURRENT
Definition: rock.h:182
iso_rock_px_s::st_nlinks
iso733_t st_nlinks
Definition: rock.h:124
iso_rock_px_t
struct iso_rock_px_s iso_rock_px_t
iso_rock_cl_s
Definition: rock.h:192
iso_rock_statbuf_s::backup
iso_rock_time_t backup
Definition: rock.h:304
iso_rock_statbuf_s::effective
iso_rock_time_t effective
Definition: rock.h:307
ISO_ROCK_TF_BACKUP
#define ISO_ROCK_TF_BACKUP
Definition: rock.h:218
iso_rock_statbuf_s::access
iso_rock_time_t access
Definition: rock.h:300
PRAGMA_END_PACKED
#define PRAGMA_END_PACKED
Definition: types.h:169
iso9660_get_posix_filemode_from_rock
mode_t iso9660_get_posix_filemode_from_rock(const iso_rock_statbuf_t *rr)
iso_extension_record_s::signature
char signature[2]
Definition: rock.h:247
iso_su_ce_s
Definition: rock.h:114
iso_extension_record_s::SL
iso_rock_sl_t SL
Definition: rock.h:262
iso_rock_px_s::st_uid
iso733_t st_uid
Definition: rock.h:126
iso_extension_record_s::PL
iso_rock_pl_t PL
Definition: rock.h:265
GNUC_PACKED
#define GNUC_PACKED
Definition: types.h:151
iso_extension_record_s::TF
iso_rock_tf_t TF
Definition: rock.h:266
iso_extension_record_s
Definition: rock.h:246
posix_nlink_t
uint32_t posix_nlink_t
Definition: posix.h:27
iso_extension_record_s::SP
iso_su_sp_t SP
Definition: rock.h:255
iso_rock_sl_part_s::flags
uint8_t flags
Definition: rock.h:161
iso_rock_pn_t
struct iso_rock_pn_s iso_rock_pn_t
iso_su_ce_s::size
char size[8]
Definition: rock.h:117
ISO_ROCK_IXOTH
#define ISO_ROCK_IXOTH
Definition: rock.h:75
iso_rock_sf_s
Definition: rock.h:240
iso_rock_sl_s::flags
unsigned char flags
Definition: rock.h:168
parse_rock_ridge_stat
int parse_rock_ridge_stat(iso9660_dir_t *de, iso9660_stat_t *p_stat)
iso_rock_tf_s::time_bytes
uint8_t time_bytes[EMPTY_ARRAY_SIZE]
Definition: rock.h:226
ISO_ROCK_NM_CONTINUE
#define ISO_ROCK_NM_CONTINUE
Definition: rock.h:181
ISO_ROCK_SL_CURRENT
#define ISO_ROCK_SL_CURRENT
Definition: rock.h:156
iso_rock_sl_part_s::len
uint8_t len
Definition: rock.h:162
iso_rock_statbuf_s
Definition: rock.h:282
iso_extension_record_s::len
iso711_t len
Definition: rock.h:250
ISO_ROCK_TF_ACCESS
#define ISO_ROCK_TF_ACCESS
Definition: rock.h:216
iso_rock_statbuf_s::psz_symlink
char * psz_symlink
Definition: rock.h:294
iso_rock_statbuf_s::st_uid
posix_uid_t st_uid
Definition: rock.h:289
ISO_ROCK_ISSOCK
#define ISO_ROCK_ISSOCK
Definition: rock.h:81
ISO_ROCK_ISCHR
#define ISO_ROCK_ISCHR
Definition: rock.h:85
iso_extension_record_t
struct iso_extension_record_s iso_extension_record_t
iso_rock_sl_flag
iso_rock_sl_flag_t iso_rock_sl_flag
EMPTY_ARRAY_SIZE
#define EMPTY_ARRAY_SIZE
Definition: iso9660.h:62
iso_rock_statbuf_s::attributes
iso_rock_time_t attributes
Definition: rock.h:302
ISO_ROCK_SL_PARENT
#define ISO_ROCK_SL_PARENT
Definition: rock.h:157
ISO_ROCK_IWGRP
#define ISO_ROCK_IWGRP
Definition: rock.h:71
iso_rock_nm_s::name
char name[EMPTY_ARRAY_SIZE]
Definition: rock.h:188
iso_su_ce_s::offset
char offset[8]
Definition: rock.h:116
PRAGMA_BEGIN_PACKED
#define PRAGMA_BEGIN_PACKED
Definition: types.h:168
ISO_ROCK_ISFIFO
#define ISO_ROCK_ISFIFO
Definition: rock.h:87
iso711_t
uint8_t iso711_t
ISO 9660 Integer and Character types.
Definition: iso9660.h:49
iso_su_sp_t
PRAGMA_BEGIN_PACKED struct iso_su_sp_s iso_su_sp_t
iso_su_er_s::ext_ver
iso711_t ext_ver
Definition: rock.h:110
iso_extension_record_s::NM
iso_rock_nm_t NM
Definition: rock.h:263
iso_rock_px_s::st_mode
iso733_t st_mode
Definition: rock.h:122
iso9660_dtime_s
ISO-9660 shorter-format time structure. See ECMA 9.1.5.
Definition: iso9660.h:184
iso_rock_statbuf_s::modify
iso_rock_time_t modify
Definition: rock.h:297
iso_su_er_s::data
char data[EMPTY_ARRAY_SIZE]
Definition: rock.h:111
iso_rock_nm_flag
iso_rock_nm_flag_t iso_rock_nm_flag
iso_rock_tf_flag_t
iso_rock_tf_flag_t
Definition: rock.h:202
ISO_ROCK_TF_CREATE
#define ISO_ROCK_TF_CREATE
Definition: rock.h:214
iso_su_sp_s::magic
unsigned char magic[2]
Definition: rock.h:101
iso_rock_nm_t
struct iso_rock_nm_s iso_rock_nm_t
ISO_ROCK_TF_LONG_FORM
#define ISO_ROCK_TF_LONG_FORM
Definition: rock.h:221
iso_rock_pl_t
struct iso_rock_pl_s iso_rock_pl_t
iso_rock_time_s::dtime
iso9660_dtime_t dtime
Definition: rock.h:278
iso_rock_statbuf_s::expiration
iso_rock_time_t expiration
Definition: rock.h:305

Generated for libcdio by doxygen 1.8.17