libcdio  0.93
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
rock.h File Reference

Things related to the Rock Ridge Interchange Protocol (RRIP) More...

#include <cdio/types.h>

Go to the source code of this file.

Data Structures

struct  iso_su_sp_s
 
struct  iso_su_er_s
 
struct  iso_su_ce_s
 
struct  iso_rock_px_s
 
struct  iso_rock_pn_s
 
struct  iso_rock_sl_part_s
 
struct  iso_rock_sl_s
 
struct  iso_rock_nm_s
 
struct  iso_rock_cl_s
 
struct  iso_rock_pl_s
 
struct  iso_rock_tf_s
 
struct  iso_rock_sf_s
 
struct  iso_extension_record_s
 
struct  iso_rock_time_s
 
struct  iso_rock_statbuf_s
 

Macros

#define ISO_ROCK_IRUSR   000400 /** read permission (owner) */
 
#define ISO_ROCK_IWUSR   000200 /** write permission (owner) */
 
#define ISO_ROCK_IXUSR   000100 /** execute permission (owner) */
 
#define ISO_ROCK_IRGRP   000040 /** read permission (group) */
 
#define ISO_ROCK_IWGRP   000020 /** write permission (group) */
 
#define ISO_ROCK_IXGRP   000010 /** execute permission (group) */
 
#define ISO_ROCK_IROTH   000004 /** read permission (other) */
 
#define ISO_ROCK_IWOTH   000002 /** write permission (other) */
 
#define ISO_ROCK_IXOTH   000001 /** execute permission (other) */
 
#define ISO_ROCK_ISUID   004000 /** set user ID on execution */
 
#define ISO_ROCK_ISGID   002000 /** set group ID on execution */
 
#define ISO_ROCK_ISVTX   001000 /** save swapped text even after use */
 
#define ISO_ROCK_ISSOCK   0140000 /** socket */
 
#define ISO_ROCK_ISLNK   0120000 /** symbolic link */
 
#define ISO_ROCK_ISREG   0100000 /** regular */
 
#define ISO_ROCK_ISBLK   060000 /** block special */
 
#define ISO_ROCK_ISCHR   020000 /** character special */
 
#define ISO_ROCK_ISDIR   040000 /** directory */
 
#define ISO_ROCK_ISFIFO   010000 /** pipe or FIFO */
 
#define ISO_ROCK_ENFMT   ISO_ROCK_ISGID
 
#define ISO_ROCK_SL_CONTINUE   1
 
#define ISO_ROCK_SL_CURRENT   2
 
#define ISO_ROCK_SL_PARENT   4
 
#define ISO_ROCK_SL_ROOT   8
 
#define ISO_ROCK_NM_CONTINUE   1
 
#define ISO_ROCK_NM_CURRENT   2
 
#define ISO_ROCK_NM_PARENT   4
 
#define ISO_ROCK_TF_CREATE   1
 
#define ISO_ROCK_TF_MODIFY   2
 
#define ISO_ROCK_TF_ACCESS   4
 
#define ISO_ROCK_TF_ATTRIBUTES   8
 
#define ISO_ROCK_TF_BACKUP   16
 
#define ISO_ROCK_TF_EXPIRATION   32
 
#define ISO_ROCK_TF_EFFECTIVE   64
 
#define ISO_ROCK_TF_LONG_FORM   128
 

Typedefs

typedef PRAGMA_BEGIN_PACKED
struct iso_su_sp_s 
iso_su_sp_t
 
typedef struct iso_su_er_s iso_su_er_t
 
typedef struct iso_su_ce_s iso_su_ce_t
 
typedef struct iso_rock_px_s iso_rock_px_t
 
typedef struct iso_rock_pn_s iso_rock_pn_t
 
typedef struct iso_rock_sl_part_s iso_rock_sl_part_t
 
typedef struct iso_rock_sl_s iso_rock_sl_t
 
typedef struct iso_rock_nm_s iso_rock_nm_t
 
typedef struct iso_rock_cl_s iso_rock_cl_t
 
typedef struct iso_rock_pl_s iso_rock_pl_t
 
typedef struct iso_rock_tf_s iso_rock_tf_t
 
typedef struct iso_rock_sf_s iso_rock_sf_t
 
typedef struct
iso_extension_record_s 
iso_extension_record_t
 
typedef struct iso_rock_time_s iso_rock_time_t
 
typedef struct iso_rock_statbuf_s iso_rock_statbuf_t
 

Enumerations

enum  iso_rock_enums {
  ISO_ROCK_IRUSR = 000400, ISO_ROCK_IWUSR = 000200, ISO_ROCK_IXUSR = 000100, ISO_ROCK_IRGRP = 000040,
  ISO_ROCK_IWGRP = 000020, ISO_ROCK_IXGRP = 000010, ISO_ROCK_IROTH = 000004, ISO_ROCK_IWOTH = 000002,
  ISO_ROCK_IXOTH = 000001, ISO_ROCK_ISUID = 004000, ISO_ROCK_ISGID = 002000, ISO_ROCK_ISVTX = 001000,
  ISO_ROCK_ISSOCK = 0140000, ISO_ROCK_ISLNK = 0120000, ISO_ROCK_ISREG = 0100000, ISO_ROCK_ISBLK = 060000,
  ISO_ROCK_ISCHR = 020000, ISO_ROCK_ISDIR = 040000, ISO_ROCK_ISFIFO = 010000
}
 
enum  iso_rock_sl_flag_t { ISO_ROCK_SL_CONTINUE = 1, ISO_ROCK_SL_CURRENT = 2, ISO_ROCK_SL_PARENT = 4, ISO_ROCK_SL_ROOT = 8 }
 
enum  iso_rock_nm_flag_t { ISO_ROCK_NM_CONTINUE = 1, ISO_ROCK_NM_CURRENT = 2, ISO_ROCK_NM_PARENT = 4 }
 
enum  iso_rock_tf_flag_t {
  ISO_ROCK_TF_CREATE = 1, ISO_ROCK_TF_MODIFY = 2, ISO_ROCK_TF_ACCESS = 4, ISO_ROCK_TF_ATTRIBUTES = 8,
  ISO_ROCK_TF_BACKUP = 16, ISO_ROCK_TF_EXPIRATION = 32, ISO_ROCK_TF_EFFECTIVE = 64, ISO_ROCK_TF_LONG_FORM = 128
}
 

Functions

PRAGMA_END_PACKED int get_rock_ridge_filename (iso9660_dir_t *de, char *retname, iso9660_stat_t *p_stat)
 
int parse_rock_ridge_stat (iso9660_dir_t *de, iso9660_stat_t *p_stat)
 
mode_t iso9660_get_posix_filemode_from_rock (const iso_rock_statbuf_t *rr)
 
const char * iso9660_get_rock_attr_str (posix_mode_t st_mode)
 

Variables

enum iso_rock_enums iso_rock_enums
 
iso_rock_nm_flag_t iso_rock_nm_flag
 
iso_rock_sl_flag_t iso_rock_sl_flag
 
iso_rock_tf_flag_t iso_rock_tf_flag
 

Detailed Description

Things related to the Rock Ridge Interchange Protocol (RRIP)

Applications will probably not include this directly but via the iso9660.h header.

Macro Definition Documentation

#define ISO_ROCK_ENFMT   ISO_ROCK_ISGID

Enforced file locking (shared w/set group ID)

#define ISO_ROCK_IRGRP   000040 /** read permission (group) */
#define ISO_ROCK_IROTH   000004 /** read permission (other) */
#define ISO_ROCK_IRUSR   000400 /** read permission (owner) */
#define ISO_ROCK_ISBLK   060000 /** block special */
#define ISO_ROCK_ISCHR   020000 /** character special */
#define ISO_ROCK_ISDIR   040000 /** directory */
#define ISO_ROCK_ISFIFO   010000 /** pipe or FIFO */
#define ISO_ROCK_ISGID   002000 /** set group ID on execution */
#define ISO_ROCK_ISLNK   0120000 /** symbolic link */
#define ISO_ROCK_ISREG   0100000 /** regular */
#define ISO_ROCK_ISSOCK   0140000 /** socket */
#define ISO_ROCK_ISUID   004000 /** set user ID on execution */
#define ISO_ROCK_ISVTX   001000 /** save swapped text even after use */
#define ISO_ROCK_IWGRP   000020 /** write permission (group) */
#define ISO_ROCK_IWOTH   000002 /** write permission (other) */
#define ISO_ROCK_IWUSR   000200 /** write permission (owner) */
#define ISO_ROCK_IXGRP   000010 /** execute permission (group) */
#define ISO_ROCK_IXOTH   000001 /** execute permission (other) */
#define ISO_ROCK_IXUSR   000100 /** execute permission (owner) */
#define ISO_ROCK_NM_CONTINUE   1
#define ISO_ROCK_NM_CURRENT   2
#define ISO_ROCK_NM_PARENT   4
#define ISO_ROCK_SL_CONTINUE   1
#define ISO_ROCK_SL_CURRENT   2
#define ISO_ROCK_SL_PARENT   4
#define ISO_ROCK_SL_ROOT   8
#define ISO_ROCK_TF_ACCESS   4
#define ISO_ROCK_TF_ATTRIBUTES   8
#define ISO_ROCK_TF_BACKUP   16
#define ISO_ROCK_TF_CREATE   1
#define ISO_ROCK_TF_EFFECTIVE   64
#define ISO_ROCK_TF_EXPIRATION   32
#define ISO_ROCK_TF_LONG_FORM   128
#define ISO_ROCK_TF_MODIFY   2

Typedef Documentation

typedef struct iso_rock_cl_s iso_rock_cl_t

Child link. See Section 4.1.5.1

typedef struct iso_rock_nm_s iso_rock_nm_t
typedef struct iso_rock_pl_s iso_rock_pl_t

Parent link. See Section 4.1.5.2

typedef struct iso_rock_pn_s iso_rock_pn_t

POSIX device number, PN. A PN is mandatory if the file type recorded in the "PX" File Mode field for a Directory Record indicates a character or block device (ISO_ROCK_ISCHR | ISO_ROCK_ISBLK). This entry is ignored for other (non-Direcotry) file types. No more than one "PN" is recorded in the System Use Area of a Directory Record.

See Rock Ridge Section 4.1.2

typedef struct iso_rock_px_s iso_rock_px_t

POSIX file attributes, PX. See Rock Ridge Section 4.1.2

typedef struct iso_rock_sf_s iso_rock_sf_t

File data in sparse format. See Rock Ridge Section 4.1.7

typedef struct iso_rock_sl_s iso_rock_sl_t

Symbolic link. See Rock Ridge Section 4.1.3

typedef struct iso_rock_tf_s iso_rock_tf_t

Time stamp(s) for a file. See Rock Ridge Section 4.1.6

typedef struct iso_su_ce_s iso_su_ce_t
typedef struct iso_su_er_s iso_su_er_t

system-use extension record

The next two structs are used by the system-use-sharing protocol (SUSP), in which the Rock Ridge extensions are embedded. It is quite possible that other extensions are present on the disk, and this is fine as long as they all use SUSP.

system-use-sharing protocol

Enumeration Type Documentation

An enumeration for some of the ISO_ROCK_* #defines below. This isn't really an enumeration one would really use in a program it is to be helpful in debuggers where wants just to refer to the ISO_ROCK_* names and get something.

Enumerator
ISO_ROCK_IRUSR 

read permission (owner)

ISO_ROCK_IWUSR 

write permission (owner)

ISO_ROCK_IXUSR 

execute permission (owner)

ISO_ROCK_IRGRP 

read permission (group)

ISO_ROCK_IWGRP 

write permission (group)

ISO_ROCK_IXGRP 

execute permission (group)

ISO_ROCK_IROTH 

read permission (other)

ISO_ROCK_IWOTH 

write permission (other)

ISO_ROCK_IXOTH 

execute permission (other)

ISO_ROCK_ISUID 

set user ID on execution

ISO_ROCK_ISGID 

set group ID on execution

ISO_ROCK_ISVTX 

save swapped text even after use

ISO_ROCK_ISSOCK 

socket

ISO_ROCK_ISLNK 

symbolic link

ISO_ROCK_ISREG 

regular

ISO_ROCK_ISBLK 

block special

ISO_ROCK_ISCHR 

character special

ISO_ROCK_ISDIR 

directory

ISO_ROCK_ISFIFO 

pipe or FIFO

Alternate name. See Rock Ridge Section 4.1.4

These are the bits and their meanings for flags in the NM structure.

Enumerator
ISO_ROCK_NM_CONTINUE 
ISO_ROCK_NM_CURRENT 
ISO_ROCK_NM_PARENT 

These are the bits and their meanings for flags in the SL structure.

Enumerator
ISO_ROCK_SL_CONTINUE 
ISO_ROCK_SL_CURRENT 
ISO_ROCK_SL_PARENT 
ISO_ROCK_SL_ROOT 

These are the bits and their meanings for flags in the TF structure.

Enumerator
ISO_ROCK_TF_CREATE 
ISO_ROCK_TF_MODIFY 
ISO_ROCK_TF_ACCESS 
ISO_ROCK_TF_ATTRIBUTES 
ISO_ROCK_TF_BACKUP 
ISO_ROCK_TF_EXPIRATION 
ISO_ROCK_TF_EFFECTIVE 
ISO_ROCK_TF_LONG_FORM 

Function Documentation

PRAGMA_END_PACKED int get_rock_ridge_filename ( iso9660_dir_t de,
char *  retname,
iso9660_stat_t p_stat 
)

return length of name field; 0: not found, -1: to be ignored

mode_t iso9660_get_posix_filemode_from_rock ( const iso_rock_statbuf_t rr)

Returns POSIX mode bitstring for a given file.

const char* iso9660_get_rock_attr_str ( posix_mode_t  st_mode)

Returns a string which interpreting the POSIX mode st_mode. For example:

drwxrws---
-rw---Sr--
lrwxrwxrwx

A description of the characters in the string follows The 1st character is either "d" if the entry is a directory, "l" is a symbolic link or "-" if neither.

The 2nd to 4th characters refer to permissions for a user while the the 5th to 7th characters refer to permissions for a group while, and the 8th to 10h characters refer to permissions for everyone.

In each of these triplets the first character (2, 5, 8) is "r" if the entry is allowed to be read.

The second character of a triplet (3, 6, 9) is "w" if the entry is allowed to be written.

The third character of a triplet (4, 7, 10) is "x" if the entry is executable but not user (for character 4) or group (for characters 6) settable and "s" if the item has the corresponding user/group set.

For a directory having an executable property on ("x" or "s") means the directory is allowed to be listed or "searched". If the execute property is not allowed for a group or user but the corresponding group/user is set "S" indicates this. If none of these properties holds the "-" indicates this.

int parse_rock_ridge_stat ( iso9660_dir_t de,
iso9660_stat_t p_stat 
)

Variable Documentation

iso_rock_nm_flag_t iso_rock_nm_flag

These variables are not used, but are defined to facilatate debugging by letting us use enumerations values (which also correspond to #define's inside a debugged program.

iso_rock_sl_flag_t iso_rock_sl_flag
iso_rock_tf_flag_t iso_rock_tf_flag