isoread.c File Reference

#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <sys/times.h>
#include <unistd.h>

Include dependency graph for isoread.c:

Go to the source code of this file.

Data Structures

struct  iso9660_descriptor
struct  high_sierra_descriptor
struct  dir_entry

Defines

#define ISO9660_ID   "CD001"
#define HIGH_SIERRA_ID   "CDROM"
#define BLOCK_SIZE   2048
#define BLOCK_SHIFT   11
#define STDOUT   stdout
#define STDERR   stderr
#define NULL_DIR   (struct dir_entry *) 0
#define MAX_NAME_LENGTH   255
#define MAX_PATH_LENGTH   1024
#define NR_OF_CHARS   13
#define NR_OF_BLANKS   2
#define NR_OF_COLS   (80 / (NR_OF_CHARS + NR_OF_BLANKS))
#define LOWER_CASE(CHR)   (CHR >= 'A' && CHR <= 'Z' ? CHR | 0x20 : CHR)
#define IS_DOT(PTR)   (PTR->name_length[0] == 1 && PTR->name[0] == 0 ? 1 : 0)
#define IS_DOT_DOT(PTR)   (PTR->name_length[0] == 1 && PTR->name[0] == 1 ? 1 : 0)
#define IS_DIR(PTR)   (PTR->flags[-High_Sierra] & 2 ? 1 : 0)

Functions

 _PROTOTYPE (int main,(int argc, char **argv))
 _PROTOTYPE (int iso_cmp,(char *name, struct dir_entry *dir_ptr, int dir_flag))
 _PROTOTYPE (void list_dir,(struct dir_entry *dir_ptr))
 _PROTOTYPE (struct dir_entry *look_up,(char *name))
 _PROTOTYPE (void recurse_dir,(char *path, struct dir_entry *dir_ptr))
 _PROTOTYPE (void read_device,(long offset, int nr_of_bytes, char *buffer))
 _PROTOTYPE (int valid_fs,(void))
 _PROTOTYPE (void usage,(void))
 _PROTOTYPE (void print_date,(char *date))
 _PROTOTYPE (void iso_info,(struct iso9660_descriptor *vol_desc))
 _PROTOTYPE (void hs_info,(struct high_sierra_descriptor *vol_desc))
 _PROTOTYPE (int iso_711,(char *c))
 _PROTOTYPE (long iso_731,(char *c))
int iso_cmp (char *name, struct dir_entry *dir_ptr, int dir_flag)
void usage ()
int main (int argc, char **argv)
dir_entrylook_up (char *path)
void recurse_dir (char *path, struct dir_entry *dir_ptr)
void list_dir (struct dir_entry *dir_ptr)
void print_dir_date (char *date)
void list_file (struct dir_entry *dir_ptr)
void print_date (char *date)
void iso_info (struct iso9660_descriptor *vol_desc)
void hs_info (struct high_sierra_descriptor *vol_desc)
int valid_fs ()
void read_device (long offset, int nr_of_bytes, char *buffer)
int iso_711 (char *c)
int iso_712 (char *c)
int iso_721 (char *c)
int iso_722 (char *c)
int iso_723 (char *c)
long iso_731 (char *c)
long iso_732 (char *c)
long iso_733 (char *c)

Variables

char Buffer [BLOCK_SIZE]
int Device
iso9660_descriptorIso_Vol_Desc
high_sierra_descriptorHs_Vol_Desc
int High_Sierra = 0
int Iso9660 = 0
char months [] = "JanFebMarAprMayJunJulAugSepOctNovDec"
int Read_File = 0
int Read_Dir = 0
int Read_Info = 0
int Recurse = 0
int Verbose = 0
int ByteOffset = 0
int Aflag = 0


Define Documentation

#define BLOCK_SHIFT   11
 

Definition at line 44 of file isoread.c.

Referenced by list_dir(), look_up(), and recurse_dir().

#define BLOCK_SIZE   2048
 

Definition at line 43 of file isoread.c.

#define HIGH_SIERRA_ID   "CDROM"
 

Definition at line 42 of file isoread.c.

#define IS_DIR PTR   )     (PTR->flags[-High_Sierra] & 2 ? 1 : 0)
 

Definition at line 142 of file isoread.c.

#define IS_DOT PTR   )     (PTR->name_length[0] == 1 && PTR->name[0] == 0 ? 1 : 0)
 

Definition at line 140 of file isoread.c.

Referenced by list_dir(), and recurse_dir().

#define IS_DOT_DOT PTR   )     (PTR->name_length[0] == 1 && PTR->name[0] == 1 ? 1 : 0)
 

Definition at line 141 of file isoread.c.

Referenced by list_dir(), and recurse_dir().

#define ISO9660_ID   "CD001"
 

Definition at line 41 of file isoread.c.

Referenced by valid_fs().

#define LOWER_CASE CHR   )     (CHR >= 'A' && CHR <= 'Z' ? CHR | 0x20 : CHR)
 

Definition at line 137 of file isoread.c.

Referenced by iso_cmp(), list_dir(), main(), and recurse_dir().

#define MAX_NAME_LENGTH   255
 

Definition at line 129 of file isoread.c.

Referenced by look_up().

#define MAX_PATH_LENGTH   1024
 

Definition at line 130 of file isoread.c.

Referenced by main(), and recurse_dir().

#define NR_OF_BLANKS   2
 

Definition at line 133 of file isoread.c.

Referenced by list_dir().

#define NR_OF_CHARS   13
 

Definition at line 132 of file isoread.c.

Referenced by list_dir().

#define NR_OF_COLS   (80 / (NR_OF_CHARS + NR_OF_BLANKS))
 

Definition at line 134 of file isoread.c.

Referenced by list_dir().

#define NULL_DIR   (struct dir_entry *) 0
 

Definition at line 128 of file isoread.c.

#define STDERR   stderr
 

Definition at line 127 of file isoread.c.

#define STDOUT   stdout
 

Definition at line 126 of file isoread.c.


Function Documentation

_PROTOTYPE long  iso_731,
(char *c
 

_PROTOTYPE int  iso_711,
(char *c
 

_PROTOTYPE void  hs_info,
(struct high_sierra_descriptor *vol_desc) 
 

_PROTOTYPE void  iso_info,
(struct iso9660_descriptor *vol_desc) 
 

_PROTOTYPE void  print_date,
(char *date) 
 

_PROTOTYPE void  usage,
(void) 
 

_PROTOTYPE int  valid_fs,
(void) 
 

_PROTOTYPE void  read_device,
(long offset, int nr_of_bytes, char *buffer
 

_PROTOTYPE void  recurse_dir,
(char *path, struct dir_entry *dir_ptr) 
 

_PROTOTYPE struct dir_entry look_up,
(char *name
 

_PROTOTYPE void  list_dir,
(struct dir_entry *dir_ptr) 
 

_PROTOTYPE int  iso_cmp,
(char *name, struct dir_entry *dir_ptr, int dir_flag) 
 

_PROTOTYPE int  main,
(int argc, char **argv) 
 

void hs_info struct high_sierra_descriptor vol_desc  ) 
 

Definition at line 713 of file isoread.c.

References fprintf(), i, iso_723(), iso_733(), and STDOUT.

int iso_711 char *  c  ) 
 

Definition at line 792 of file isoread.c.

Referenced by iso_cmp(), list_dir(), look_up(), print_dir_date(), and recurse_dir().

int iso_712 char *  c  ) 
 

Definition at line 799 of file isoread.c.

References n.

int iso_721 char *  c  ) 
 

Definition at line 809 of file isoread.c.

int iso_722 char *  c  ) 
 

Definition at line 815 of file isoread.c.

int iso_723 char *  c  ) 
 

Definition at line 821 of file isoread.c.

References exit(), fprintf(), and STDERR.

Referenced by hs_info(), and iso_info().

long iso_731 char *  c  ) 
 

Definition at line 832 of file isoread.c.

long iso_732 char *  c  ) 
 

Definition at line 842 of file isoread.c.

long iso_733 char *  c  ) 
 

Definition at line 851 of file isoread.c.

References exit(), fprintf(), i, and STDERR.

Referenced by hs_info(), iso_info(), list_dir(), list_file(), look_up(), and recurse_dir().

int iso_cmp char *  name,
struct dir_entry dir_ptr,
int  dir_flag
 

Definition at line 187 of file isoread.c.

References i, if(), iso_711(), LOWER_CASE, dir_entry::name, dir_entry::name_length, and strlen().

Referenced by look_up().

void iso_info struct iso9660_descriptor vol_desc  ) 
 

Definition at line 682 of file isoread.c.

References fprintf(), i, iso_723(), iso_733(), print_date(), and STDOUT.

void list_dir struct dir_entry dir_ptr  ) 
 

Definition at line 505 of file isoread.c.

References BLOCK_SHIFT, BLOCK_SIZE, column, fprintf(), i, IS_DIR, IS_DOT, IS_DOT_DOT, isatty, iso_711(), iso_733(), j, LOWER_CASE, NR_OF_BLANKS, NR_OF_CHARS, NR_OF_COLS, offset, print_dir_date(), read_device(), skip, STDOUT, and STDOUT_FILENO.

void list_file struct dir_entry dir_ptr  ) 
 

Definition at line 625 of file isoread.c.

References BLOCK_SIZE, c, fprintf(), i, iso_733(), read_device(), size, and STDOUT.

struct dir_entry* look_up char *  path  ) 
 

Definition at line 355 of file isoread.c.

References BLOCK_SHIFT, BLOCK_SIZE, dir_entry::ext_attr_length, dir_entry::first_block, Hs_Vol_Desc, i, iso_711(), iso_733(), iso_cmp(), Iso_Vol_Desc, j, dir_entry::length, MAX_NAME_LENGTH, offset, read_device(), high_sierra_descriptor::root_dir_entry, iso9660_descriptor::root_dir_entry, dir_entry::size, and strlen().

int main int  argc,
char **  argv
 

Definition at line 230 of file isoread.c.

References basename, errno, exit(), file_name, fprintf(), i, input_file, j, LOWER_CASE, MAX_PATH_LENGTH, O_RDONLY, open, path, STDERR, strcmp, strerror(), and usage.

void print_date char *  date  ) 
 

Definition at line 660 of file isoread.c.

References fprintf(), and STDOUT.

void print_dir_date char *  date  ) 
 

Definition at line 603 of file isoread.c.

References fprintf(), iso_711(), m, and STDOUT.

Referenced by list_dir().

void read_device long  offset,
int  nr_of_bytes,
char *  buffer
 

Definition at line 766 of file isoread.c.

References errno, exit(), fflush(), fprintf(), lseek, read, SEEK_SET, STDERR, stdout, and strerror().

Referenced by list_dir(), list_file(), look_up(), recurse_dir(), and valid_fs().

void recurse_dir char *  path,
struct dir_entry dir_ptr
 

Definition at line 430 of file isoread.c.

References BLOCK_SHIFT, BLOCK_SIZE, Buffer, dir_entry::ext_attr_length, dir_entry::first_block, fprintf(), i, if(), IS_DIR, IS_DOT, IS_DOT_DOT, iso_711(), iso_733(), j, dir_entry::length, list_dir, LOWER_CASE, MAX_PATH_LENGTH, offset, path_length, read_device(), dir_entry::size, STDOUT, and strlen().

void usage void   ) 
 

Definition at line 218 of file isoread.c.

References exit(), fprintf(), and STDERR.

int valid_fs  ) 
 

Definition at line 732 of file isoread.c.

References BLOCK_SIZE, Hs_Vol_Desc, i, iso9660_descriptor::id, ISO9660_ID, Iso_Vol_Desc, read_device(), and strncmp().


Variable Documentation

int Aflag = 0
 

Definition at line 185 of file isoread.c.

char Buffer[BLOCK_SIZE]
 

Definition at line 168 of file isoread.c.

Referenced by _buf_flush(), buf_init(), invalidate_buffer(), recurse_dir(), and rl_check_ints().

int ByteOffset = 0
 

Definition at line 184 of file isoread.c.

int Device
 

Definition at line 169 of file isoread.c.

Referenced by Defdev(), and user_interface().

int High_Sierra = 0
 

Definition at line 172 of file isoread.c.

struct high_sierra_descriptor* Hs_Vol_Desc
 

Definition at line 171 of file isoread.c.

Referenced by look_up(), and valid_fs().

int Iso9660 = 0
 

Definition at line 173 of file isoread.c.

struct iso9660_descriptor* Iso_Vol_Desc
 

Definition at line 170 of file isoread.c.

Referenced by look_up(), and valid_fs().

char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec"
 

Definition at line 176 of file isoread.c.

int Read_Dir = 0
 

Definition at line 180 of file isoread.c.

int Read_File = 0
 

Definition at line 179 of file isoread.c.

int Read_Info = 0
 

Definition at line 181 of file isoread.c.

int Recurse = 0
 

Definition at line 182 of file isoread.c.

int Verbose = 0
 

Definition at line 183 of file isoread.c.

Referenced by bttyout(), chkinvok(), countem(), main(), readline(), vfile(), wcputsec(), zdlread(), zgethex(), zperr(), zputhex(), and zsendfdata().


Generated on Fri Apr 14 23:06:47 2006 for minix by  doxygen 1.4.6