libcdio  2.1.0
About: GNU libcdio is a library for CD-ROM and CD image access.
  Fossies Dox: libcdio-2.1.0.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

rock.c File Reference
#include <cdio/iso9660.h>
#include <cdio/logging.h>
#include <cdio/bytesex.h>
#include "filemode.h"
Include dependency graph for rock.c:

Go to the source code of this file.

Macros

#define CDIO_MKDEV(ma, mi)   ((ma)<<16 | (mi))
 
#define SIG(A, B)   ((A) | ((B) << 8)) /* isonum_721() */
 
#define CHECK_SP(FAIL)
 
#define CONTINUE_DECLS
 
#define CHECK_CE
 
#define SETUP_ROCK_RIDGE(DE, CHR, LEN)
 
#define add_time(FLAG, TIME_FIELD)
 
#define BUF_COUNT   16
 
#define BUF_SIZE   sizeof("drwxrwxrwx")
 

Functions

static bool realloc_symlink (iso9660_stat_t *p_stat, uint8_t i_grow)
 
int get_rock_ridge_filename (iso9660_dir_t *p_iso9660_dir, char *psz_name, iso9660_stat_t *p_stat)
 
static int parse_rock_ridge_stat_internal (iso9660_dir_t *p_iso9660_dir, iso9660_stat_t *p_stat, int regard_xa)
 
int parse_rock_ridge_stat (iso9660_dir_t *p_iso9660_dir, iso9660_stat_t *p_stat)
 
static char * _getbuf (void)
 
const char * iso9660_get_rock_attr_str (posix_mode_t st_mode)
 
mode_t iso9660_get_posix_filemode_from_rock (const iso_rock_statbuf_t *rr)
 

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
 

Macro Definition Documentation

◆ add_time

#define add_time (   FLAG,
  TIME_FIELD 
)
Value:
if (rr->u.TF.flags & FLAG) { \
p_stat->rr.TIME_FIELD.b_used = true; \
p_stat->rr.TIME_FIELD.b_longdate = \
(0 != (rr->u.TF.flags & ISO_ROCK_TF_LONG_FORM)); \
if (p_stat->rr.TIME_FIELD.b_longdate) { \
memcpy(&(p_stat->rr.TIME_FIELD.t.ltime), \
&(rr->u.TF.time_bytes[cnt]), \
sizeof(iso9660_ltime_t)); \
cnt += sizeof(iso9660_ltime_t); \
} else { \
memcpy(&(p_stat->rr.TIME_FIELD.t.dtime), \
&(rr->u.TF.time_bytes[cnt]), \
sizeof(iso9660_dtime_t)); \
cnt += sizeof(iso9660_dtime_t); \
} \
}

Definition at line 127 of file rock.c.

◆ BUF_COUNT

#define BUF_COUNT   16

Definition at line 522 of file rock.c.

◆ BUF_SIZE

#define BUF_SIZE   sizeof("drwxrwxrwx")

Definition at line 523 of file rock.c.

◆ CDIO_MKDEV

#define CDIO_MKDEV (   ma,
  mi 
)    ((ma)<<16 | (mi))

Definition at line 44 of file rock.c.

◆ CHECK_CE

#define CHECK_CE
Value:
{ cont_extent = from_733(*rr->u.CE.extent); \
cont_offset = from_733(*rr->u.CE.offset); \
cont_size = from_733(*rr->u.CE.size); \
(void)cont_extent; (void)cont_offset, (void)cont_size; }

Definition at line 103 of file rock.c.

◆ CHECK_SP

#define CHECK_SP (   FAIL)
Value:
if(rr->u.SP.magic[0] != 0xbe) FAIL; \
if(rr->u.SP.magic[1] != 0xef) FAIL; \
p_stat->rr.s_rock_offset = rr->u.SP.skip;

Definition at line 91 of file rock.c.

◆ CONTINUE_DECLS

#define CONTINUE_DECLS
Value:
int cont_extent = 0, cont_offset = 0, cont_size = 0; \
void *buffer = NULL

Definition at line 99 of file rock.c.

◆ SETUP_ROCK_RIDGE

#define SETUP_ROCK_RIDGE (   DE,
  CHR,
  LEN 
)
Value:
{ \
LEN= sizeof(iso9660_dir_t) + DE->filename.len; \
if(LEN & 1) LEN++; \
CHR = ((unsigned char *) DE) + LEN; \
LEN = *((unsigned char *) DE) - LEN; \
if (0xff != p_stat->rr.s_rock_offset) \
{ \
LEN -= p_stat->rr.s_rock_offset; \
CHR += p_stat->rr.s_rock_offset; \
if (LEN<0) LEN=0; \
} \
}

Definition at line 109 of file rock.c.

◆ SIG

#define SIG (   A,
 
)    ((A) | ((B) << 8)) /* isonum_721() */

Definition at line 86 of file rock.c.

Function Documentation

◆ _getbuf()

static char* _getbuf ( void  )
static

Definition at line 527 of file rock.c.

References BUF_COUNT, and BUF_SIZE.

Referenced by iso9660_get_rock_attr_str().

◆ get_rock_ridge_filename()

◆ iso9660_get_posix_filemode_from_rock()

mode_t iso9660_get_posix_filemode_from_rock ( const iso_rock_statbuf_t rr)

Returns POSIX mode bitstring for a given file.

Definition at line 625 of file rock.c.

References iso_rock_statbuf_s::st_mode.

Referenced by iso9660_get_posix_filemode().

◆ iso9660_get_rock_attr_str()

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-rw-r--
lrwxrwxrwx

A description of the characters in the string follows The 1st character is either "b" for a block device, "c" for a character device, "d" if the entry is a directory, "l" for a symbolic link, "p" for a pipe or FIFO, "s" for a "socket", or "-" if none of the these.

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.

Definition at line 576 of file rock.c.

References _getbuf(), ISO_ROCK_IRGRP, ISO_ROCK_IROTH, ISO_ROCK_IRUSR, ISO_ROCK_ISGID, ISO_ROCK_ISUID, ISO_ROCK_IWGRP, ISO_ROCK_IWOTH, ISO_ROCK_IWUSR, ISO_ROCK_IXGRP, ISO_ROCK_IXOTH, ISO_ROCK_IXUSR, S_ISLNK, and S_ISSOCK.

◆ parse_rock_ridge_stat()

int parse_rock_ridge_stat ( iso9660_dir_t p_iso9660_dir,
iso9660_stat_t p_stat 
)

◆ parse_rock_ridge_stat_internal()

◆ realloc_symlink()

static bool realloc_symlink ( iso9660_stat_t p_stat,
uint8_t  i_grow 
)
static

Variable Documentation

◆ iso_rock_enums

Definition at line 46 of file rock.c.

◆ iso_rock_nm_flag

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.

Definition at line 47 of file rock.c.

◆ iso_rock_sl_flag

iso_rock_sl_flag_t iso_rock_sl_flag

Definition at line 48 of file rock.c.

◆ iso_rock_tf_flag

iso_rock_tf_flag_t iso_rock_tf_flag

Definition at line 49 of file rock.c.

iso9660_dir_t
struct iso9660_dir_s iso9660_dir_t
Definition: iso9660.h:229
iso9660_ltime_t
struct iso9660_ltime_s iso9660_ltime_t
Definition: iso9660.h:228
NULL
#define NULL
Definition: types.h:184
iso9660_ltime_s
ISO-9660 longer-format time structure.
Definition: iso9660.h:207
buffer
char buffer[6][CDIO_CD_FRAMESIZE_RAW]
Definition: cdinfo-linux.c:201
iso9660_dtime_t
struct iso9660_dtime_s iso9660_dtime_t
Definition: iso9660.h:196
ISO_ROCK_TF_LONG_FORM
Definition: rock.h:210
from_733
static CDIO_INLINE uint32_t from_733(uint64_t p)
Definition: bytesex.h:212
iso9660_dtime_s
ISO-9660 shorter-format time structure. See ECMA 9.1.5.
Definition: iso9660.h:184