src/commands/simple/writeisofs.c File Reference

#include <errno.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>
#include <ctype.h>
#include <ibm/partition.h>
#include <sys/stat.h>
#include <sys/types.h>

Go to the source code of this file.

Classes

struct  pvd
struct  bootrecord
struct  bc_validation
struct  bc_initial
struct  dir
struct  node

Defines

#define Writefield(fd, f)   Write(fd, &(f), sizeof(f))
#define min(a, b)   ((a) < (b) ? (a) : (b))
#define FLAG_DIR   2
#define NAMELEN   (DIRSIZ+5)
#define ISONAMELEN   12
#define PLATFORM_80X86   0
#define ISO_SECTOR   2048
#define VIRTUAL_SECTOR   512
#define CURRENTDIR   "."
#define PARENTDIR   ".."
#define INDICATE_BOOTABLE   0x88
#define BOOTMEDIA_UNSPECIFIED   -1
#define BOOTMEDIA_NONE   0
#define BOOTMEDIA_120M   1
#define BOOTMEDIA_144M   2
#define BOOTMEDIA_288M   3
#define BOOTMEDIA_HARDDISK   4
#define MINDIRLEN   1
#define MAXDIRLEN   31
#define MAXLEVEL   8

Typedefs

typedef unsigned char u_int8_t
typedef unsigned short int u_int16_t
typedef unsigned long int u_int32_t

Functions

int get_system_type (int fd)
ssize_t Write (int fd, void *buf, ssize_t len)
off_t Lseek (int fd, off_t pos, int rel)
void writesector (int fd, char *block, int *currentsector)
void seeksector (int fd, int sector, int *currentsector)
void seekwritesector (int fd, int sector, char *block, int *currentsector)
ssize_t Read (int fd, void *buf, ssize_t len)
void both16 (unsigned char *both, unsigned short i16)
void both32 (unsigned char *both, unsigned long i32)
void maketree (struct node *thisdir, char *name, int level)
void little32 (unsigned char *dest, u_int32_t src)
void little16 (unsigned char *dest, u_int16_t src)
void big32 (unsigned char *dest, u_int32_t src)
void big16 (unsigned char *dest, u_int16_t src)
void traversetree (struct node *root, int level, int littleendian, int maxlevel, int *bytes, int fd, int parentrecord, int *recordno)
int makepathtables (struct node *root, int littleendian, int *bytes, int fd)
ssize_t write_direntry (char *origname, u_int32_t sector, u_int32_t size, int isdir, int fd)
void writedata (struct node *parent, struct node *root, int fd, int *currentsector, int dirs, struct dir *rootentry, int rootsize, int remove_after)
void writebootcatalog (int fd, int *currentsector, int imagesector, int imagesectors)
int writebootimage (char *bootimage, int bootfd, int fd, int *currentsector)
void writebootrecord (int fd, int *currentsector, int bootcatalogsector)
int main (int argc, char *argv[])

Variables

char * optarg
int optind
int n_reserved_pathtableentries = 0
int n_used_pathtableentries = 0
int bootmedia = BOOTMEDIA_UNSPECIFIED
unsigned long bootseg = 0
int system_type = 0


Define Documentation

#define BOOTMEDIA_120M   1

Definition at line 113 of file writeisofs.c.

#define BOOTMEDIA_144M   2

Definition at line 114 of file writeisofs.c.

#define BOOTMEDIA_288M   3

Definition at line 115 of file writeisofs.c.

#define BOOTMEDIA_HARDDISK   4

Definition at line 116 of file writeisofs.c.

#define BOOTMEDIA_NONE   0

Definition at line 112 of file writeisofs.c.

#define BOOTMEDIA_UNSPECIFIED   -1

Definition at line 111 of file writeisofs.c.

#define CURRENTDIR   "."

Definition at line 42 of file writeisofs.c.

#define FLAG_DIR   2

Definition at line 30 of file writeisofs.c.

#define INDICATE_BOOTABLE   0x88

Definition at line 109 of file writeisofs.c.

#define ISO_SECTOR   2048

Definition at line 39 of file writeisofs.c.

#define ISONAMELEN   12

Definition at line 36 of file writeisofs.c.

#define MAXDIRLEN   31

Definition at line 256 of file writeisofs.c.

#define MAXLEVEL   8

Definition at line 258 of file writeisofs.c.

#define min ( a,
b   )     ((a) < (b) ? (a) : (b))

Definition at line 27 of file writeisofs.c.

#define MINDIRLEN   1

Definition at line 255 of file writeisofs.c.

#define NAMELEN   (DIRSIZ+5)

Definition at line 35 of file writeisofs.c.

#define PARENTDIR   ".."

Definition at line 43 of file writeisofs.c.

#define PLATFORM_80X86   0

Definition at line 37 of file writeisofs.c.

#define VIRTUAL_SECTOR   512

Definition at line 40 of file writeisofs.c.

#define Writefield ( fd,
f   )     Write(fd, &(f), sizeof(f))

Definition at line 17 of file writeisofs.c.


Typedef Documentation

typedef unsigned short int u_int16_t

Definition at line 23 of file writeisofs.c.

typedef unsigned long int u_int32_t

Definition at line 24 of file writeisofs.c.

typedef unsigned char u_int8_t

Definition at line 22 of file writeisofs.c.


Function Documentation

void big16 ( unsigned char *  dest,
u_int16_t  src 
)

Definition at line 423 of file writeisofs.c.

void big32 ( unsigned char *  dest,
u_int32_t  src 
)

Definition at line 413 of file writeisofs.c.

void both16 ( unsigned char *  both,
unsigned short  i16 
)

Definition at line 231 of file writeisofs.c.

void both32 ( unsigned char *  both,
unsigned long  i32 
)

Definition at line 242 of file writeisofs.c.

int get_system_type ( int  fd  ) 

Definition at line 1098 of file writeisofs.c.

void little16 ( unsigned char *  dest,
u_int16_t  src 
)

Definition at line 404 of file writeisofs.c.

void little32 ( unsigned char *  dest,
u_int32_t  src 
)

Definition at line 393 of file writeisofs.c.

off_t Lseek ( int  fd,
off_t  pos,
int  rel 
)

Definition at line 183 of file writeisofs.c.

int main ( int argc  ,
char *  argv[] 
)

Definition at line 833 of file writeisofs.c.

int makepathtables ( struct node root,
int  littleendian,
int *  bytes,
int  fd 
)

Definition at line 491 of file writeisofs.c.

void maketree ( struct node thisdir,
char *  name,
int  level 
)

Definition at line 278 of file writeisofs.c.

ssize_t Read ( int  fd,
void *  buf,
ssize_t  len 
)

Definition at line 219 of file writeisofs.c.

void seeksector ( int  fd,
int  sector,
int *  currentsector 
)

Definition at line 205 of file writeisofs.c.

void seekwritesector ( int  fd,
int  sector,
char *  block,
int *  currentsector 
)

Definition at line 212 of file writeisofs.c.

void traversetree ( struct node root,
int  level,
int  littleendian,
int  maxlevel,
int *  bytes,
int  fd,
int  parentrecord,
int *  recordno 
)

Definition at line 432 of file writeisofs.c.

ssize_t Write ( int  fd,
void *  buf,
ssize_t  len 
)

Definition at line 171 of file writeisofs.c.

ssize_t write_direntry ( char *  origname,
u_int32_t  sector,
u_int32_t  size,
int  isdir,
int  fd 
)

Definition at line 515 of file writeisofs.c.

void writebootcatalog ( int  fd,
int *  currentsector,
int  imagesector,
int  imagesectors 
)

Definition at line 710 of file writeisofs.c.

int writebootimage ( char *  bootimage,
int  bootfd,
int  fd,
int *  currentsector 
)

Definition at line 769 of file writeisofs.c.

void writebootrecord ( int  fd,
int *  currentsector,
int  bootcatalogsector 
)

Definition at line 796 of file writeisofs.c.

void writedata ( struct node parent,
struct node root,
int  fd,
int *  currentsector,
int  dirs,
struct dir rootentry,
int  rootsize,
int  remove_after 
)

Definition at line 592 of file writeisofs.c.

void writesector ( int  fd,
char *  block,
int *  currentsector 
)

Definition at line 197 of file writeisofs.c.


Variable Documentation

int bootmedia = BOOTMEDIA_UNSPECIFIED

Definition at line 164 of file writeisofs.c.

unsigned long bootseg = 0

Definition at line 165 of file writeisofs.c.

Definition at line 163 of file writeisofs.c.

Definition at line 163 of file writeisofs.c.

char* optarg

Definition at line 31 of file getopt.c.

int optind

Definition at line 29 of file getopt.c.

int system_type = 0

Definition at line 166 of file writeisofs.c.


Generated on Tue Mar 9 04:36:44 2010 for Minix by  doxygen 1.5.8