2003-08-17 05:31:19 +00:00
|
|
|
|
/*
|
2003-08-31 02:51:41 +00:00
|
|
|
|
$Id: iso9660.h,v 1.5 2003/08/31 02:51:41 rocky Exp $
|
2003-08-17 05:31:19 +00:00
|
|
|
|
|
|
|
|
|
|
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
|
|
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
|
|
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __CDIO_ISO9660_H__
|
|
|
|
|
|
#define __CDIO_ISO9660_H__
|
|
|
|
|
|
|
|
|
|
|
|
/* Will eventually need/use glib.h */
|
|
|
|
|
|
#include <cdio/types.h>
|
|
|
|
|
|
|
|
|
|
|
|
#define MIN_TRACK_SIZE 4*75
|
|
|
|
|
|
|
|
|
|
|
|
#define MIN_ISO_SIZE MIN_TRACK_SIZE
|
|
|
|
|
|
|
|
|
|
|
|
#define ISO_BLOCKSIZE 2048
|
|
|
|
|
|
|
|
|
|
|
|
#define LEN_ISONAME 31
|
|
|
|
|
|
#define MAX_ISONAME 37
|
|
|
|
|
|
|
|
|
|
|
|
#define MAX_ISOPATHNAME 255
|
|
|
|
|
|
|
|
|
|
|
|
#define ISO_FILE 0
|
|
|
|
|
|
#define ISO_VD_PRIMARY 1
|
|
|
|
|
|
#define ISO_DIRECTORY 2
|
|
|
|
|
|
#define ISO_STANDARD_ID "CD001"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ISO_PVD_SECTOR 16
|
|
|
|
|
|
#define ISO_EVD_SECTOR 17
|
|
|
|
|
|
|
|
|
|
|
|
enum strncpy_pad_check {
|
|
|
|
|
|
ISO9660_NOCHECK = 0,
|
|
|
|
|
|
ISO9660_7BIT,
|
|
|
|
|
|
ISO9660_ACHARS,
|
|
|
|
|
|
ISO9660_DCHARS
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2003-08-31 01:01:39 +00:00
|
|
|
|
/* Opaque types ... */
|
|
|
|
|
|
|
|
|
|
|
|
/* Defined fully in iso9660_private.h */
|
2003-08-31 01:40:00 +00:00
|
|
|
|
typedef struct iso_primary_descriptor iso9660_pvd_t;
|
2003-08-31 02:51:41 +00:00
|
|
|
|
typedef struct iso_directory_record iso9660_dir_t;
|
2003-08-31 01:01:39 +00:00
|
|
|
|
|
2003-08-17 05:31:19 +00:00
|
|
|
|
char *
|
|
|
|
|
|
iso9660_strncpy_pad(char dst[], const char src[], size_t len,
|
|
|
|
|
|
enum strncpy_pad_check _check);
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
|
iso9660_isdchar (int c);
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
|
iso9660_isachar (int c);
|
|
|
|
|
|
|
|
|
|
|
|
/* file/dirname's */
|
|
|
|
|
|
bool
|
|
|
|
|
|
iso9660_pathname_valid_p (const char pathname[]);
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
|
iso9660_dirname_valid_p (const char pathname[]);
|
|
|
|
|
|
|
|
|
|
|
|
char *
|
|
|
|
|
|
iso9660_pathname_isofy (const char pathname[], uint16_t version);
|
|
|
|
|
|
|
|
|
|
|
|
/* volume descriptors */
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
iso9660_set_pvd (void *pd, const char volume_id[], const char application_id[],
|
|
|
|
|
|
const char publisher_id[], const char preparer_id[],
|
|
|
|
|
|
uint32_t iso_size, const void *root_dir,
|
|
|
|
|
|
uint32_t path_table_l_extent, uint32_t path_table_m_extent,
|
|
|
|
|
|
uint32_t path_table_size);
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
iso9660_set_evd (void *pd);
|
|
|
|
|
|
|
|
|
|
|
|
/* directory tree */
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
iso9660_dir_init_new (void *dir, uint32_t self, uint32_t ssize,
|
|
|
|
|
|
uint32_t parent, uint32_t psize);
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
iso9660_dir_init_new_su (void *dir, uint32_t self, uint32_t ssize,
|
|
|
|
|
|
const void *ssu_data, unsigned ssu_size,
|
|
|
|
|
|
uint32_t parent, uint32_t psize,
|
|
|
|
|
|
const void *psu_data, unsigned psu_size);
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
iso9660_dir_add_entry_su (void *dir, const char name[], uint32_t extent,
|
|
|
|
|
|
uint32_t size, uint8_t flags, const void *su_data,
|
|
|
|
|
|
unsigned su_size);
|
|
|
|
|
|
|
|
|
|
|
|
unsigned
|
|
|
|
|
|
iso9660_dir_calc_record_size (unsigned namelen, unsigned int su_len);
|
|
|
|
|
|
|
|
|
|
|
|
/* pathtable */
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
iso9660_pathtable_init (void *pt);
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int
|
|
|
|
|
|
iso9660_pathtable_get_size (const void *pt);
|
|
|
|
|
|
|
|
|
|
|
|
uint16_t
|
|
|
|
|
|
iso9660_pathtable_l_add_entry (void *pt, const char name[], uint32_t extent,
|
|
|
|
|
|
uint16_t parent);
|
|
|
|
|
|
|
|
|
|
|
|
uint16_t
|
|
|
|
|
|
iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent,
|
|
|
|
|
|
uint16_t parent);
|
|
|
|
|
|
|
2003-08-31 01:01:39 +00:00
|
|
|
|
uint8_t
|
2003-08-31 02:51:41 +00:00
|
|
|
|
iso9660_get_dir_len(const iso9660_dir_t *idr);
|
2003-08-31 01:01:39 +00:00
|
|
|
|
|
2003-08-31 01:32:05 +00:00
|
|
|
|
#if FIXME
|
2003-08-31 01:01:39 +00:00
|
|
|
|
uint8_t
|
2003-08-31 02:51:41 +00:00
|
|
|
|
iso9660_get_dir_size(const iso9660_dir_t *idr);
|
2003-08-31 01:01:39 +00:00
|
|
|
|
|
2003-08-31 01:32:05 +00:00
|
|
|
|
lsn_t
|
2003-08-31 02:51:41 +00:00
|
|
|
|
iso9660_get_dir_extent(const iso9660_dir_t *idr);#
|
2003-08-31 01:32:05 +00:00
|
|
|
|
#endif
|
2003-08-17 05:31:19 +00:00
|
|
|
|
|
|
|
|
|
|
uint8_t
|
2003-08-31 01:40:00 +00:00
|
|
|
|
iso9660_get_pvd_type(const iso9660_pvd_t *pvd);
|
2003-08-17 05:31:19 +00:00
|
|
|
|
|
|
|
|
|
|
const char *
|
2003-08-31 01:40:00 +00:00
|
|
|
|
iso9660_get_pvd_id(const iso9660_pvd_t *pvd);
|
2003-08-17 05:31:19 +00:00
|
|
|
|
|
|
|
|
|
|
int
|
2003-08-31 01:40:00 +00:00
|
|
|
|
iso9660_get_pvd_space_size(const iso9660_pvd_t *pvd);
|
2003-08-17 05:31:19 +00:00
|
|
|
|
|
|
|
|
|
|
int
|
2003-08-31 01:40:00 +00:00
|
|
|
|
iso9660_get_pvd_block_size(const iso9660_pvd_t *pvd) ;
|
2003-08-17 05:31:19 +00:00
|
|
|
|
|
|
|
|
|
|
int
|
2003-08-31 01:40:00 +00:00
|
|
|
|
iso9660_get_pvd_version(const iso9660_pvd_t *pvd) ;
|
2003-08-31 01:01:39 +00:00
|
|
|
|
|
|
|
|
|
|
lsn_t
|
2003-08-31 01:40:00 +00:00
|
|
|
|
iso9660_get_root_lsn(const iso9660_pvd_t *pvd);
|
2003-08-17 05:31:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __CDIO_ISO9660_H__ */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Local variables:
|
|
|
|
|
|
* c-file-style: "gnu"
|
|
|
|
|
|
* tab-width: 8
|
|
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
|
|
* End:
|
|
|
|
|
|
*/
|