diff --git a/example/iso1.c b/example/iso1.c index ec37ee90..d77be3a8 100644 --- a/example/iso1.c +++ b/example/iso1.c @@ -1,5 +1,5 @@ /* - $Id: iso1.c,v 1.2 2004/11/21 22:30:55 rocky Exp $ + $Id: iso1.c,v 1.3 2005/01/12 11:34:51 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -52,8 +52,8 @@ int main(int argc, const char *argv[]) { - CdioList *entlist; - CdioListNode *entnode; + CdioList_t *entlist; + CdioListNode_t *entnode; iso9660_t *p_iso = iso9660_open (ISO9660_IMAGE); diff --git a/include/cdio/bytesex.h b/include/cdio/bytesex.h index e29ff61b..3100f947 100644 --- a/include/cdio/bytesex.h +++ b/include/cdio/bytesex.h @@ -1,7 +1,8 @@ /* - $Id: bytesex.h,v 1.1 2004/10/22 01:13:38 rocky Exp $ + $Id: bytesex.h,v 1.2 2005/01/12 11:34:52 rocky Exp $ Copyright (C) 2000, 2004 Herbert Valerio Riedel + Copyright (C) 2005 Rocky Bernstein 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 @@ -25,18 +26,26 @@ #include #include -/* generic byteswap routines */ +/** \file bytesex.h + * \brief Generic Byte-swapping routines. + Note: this header will is slated to get removed and libcdio will use + glib.h routines instead. +*/ + +/** 16-bit big-endian to little-endian */ #define UINT16_SWAP_LE_BE_C(val) ((uint16_t) ( \ (((uint16_t) (val) & (uint16_t) 0x00ffU) << 8) | \ (((uint16_t) (val) & (uint16_t) 0xff00U) >> 8))) +/** 32-bit big-endian to little-endian */ #define UINT32_SWAP_LE_BE_C(val) ((uint32_t) ( \ (((uint32_t) (val) & (uint32_t) 0x000000ffU) << 24) | \ (((uint32_t) (val) & (uint32_t) 0x0000ff00U) << 8) | \ (((uint32_t) (val) & (uint32_t) 0x00ff0000U) >> 8) | \ (((uint32_t) (val) & (uint32_t) 0xff000000U) >> 24))) +/** 64-bit big-endian to little-endian */ #define UINT64_SWAP_LE_BE_C(val) ((uint64_t) ( \ (((uint64_t) (val) & (uint64_t) UINT64_C(0x00000000000000ff)) << 56) | \ (((uint64_t) (val) & (uint64_t) UINT64_C(0x000000000000ff00)) << 40) | \ @@ -99,7 +108,7 @@ uint64_t uint64_swap_le_be (const uint64_t val) # define UINT64_TO_LE(val) ((uint64_t) (val)) #endif -/* symmetric conversions */ +/** symmetric conversions */ #define UINT8_FROM_BE(val) (UINT8_TO_BE (val)) #define UINT8_FROM_LE(val) (UINT8_TO_LE (val)) #define UINT16_FROM_BE(val) (UINT16_TO_BE (val)) @@ -109,7 +118,7 @@ uint64_t uint64_swap_le_be (const uint64_t val) #define UINT64_FROM_BE(val) (UINT64_TO_BE (val)) #define UINT64_FROM_LE(val) (UINT64_TO_LE (val)) -/* converter function template */ +/** converter function template */ #define CVT_TO_FUNC(bits) \ static inline uint ## bits ## _t \ uint ## bits ## _to_be (uint ## bits ## _t val) \ @@ -134,7 +143,7 @@ CVT_TO_FUNC(64) #define uint64_from_be(val) (uint64_to_be (val)) #define uint64_from_le(val) (uint64_to_le (val)) -/* ISO9660 related stuff */ +/** ISO9660-related field conversion routines */ #define to_711(i) uint8_to_le(i) #define from_711(i) uint8_from_le(i) diff --git a/include/cdio/ds.h b/include/cdio/ds.h index 7c208fab..c39e8364 100644 --- a/include/cdio/ds.h +++ b/include/cdio/ds.h @@ -1,7 +1,8 @@ /* - $Id: ds.h,v 1.2 2004/11/22 01:03:53 rocky Exp $ + $Id: ds.h,v 1.3 2005/01/12 11:34:52 rocky Exp $ Copyright (C) 2000, 2004 Herbert Valerio Riedel + Copyright (C) 2005 Rocky Bernstein 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 @@ -17,56 +18,70 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Note: this header will is slated to get removed and libcdio will use - glib.h routines instead. + +/** \file ds.h + * \brief The top-level header for list-related data structures. + + Note: this header will is slated to get removed and libcdio will use + glib.h routines instead. */ + #ifndef __CDIO_DS_H__ #define __CDIO_DS_H__ #include -/* opaque... */ -typedef struct _CdioList CdioList; -typedef struct _CdioListNode CdioListNode; +/** opaque types... */ +typedef struct _CdioList CdioList_t; +typedef struct _CdioListNode CdioListNode_t; -typedef int (*_cdio_list_cmp_func) (void *data1, void *data2); +typedef int (*_cdio_list_cmp_func_t) (void *p_data1, void *p_data2); +typedef int (*_cdio_list_iterfunc_t) (void *p_data, void *p_user_data); -typedef int (*_cdio_list_iterfunc) (void *data, void *user_data); +/** The below are given compatibility with old code. Please use + the above type names, not these. */ +#define CdioList CdioList_t +#define CdioListNode CdioListNode_t +#define _cdio_list_cmp_func _cdio_list_cmp_func_t +#define _cdio_list_iterfunc _cdio_list_iterfunc_t #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -/* methods */ -CdioList *_cdio_list_new (void); +/** methods */ +CdioList_t *_cdio_list_new (void); -void _cdio_list_free (CdioList *list, int free_data); +void _cdio_list_free (CdioList_t *p_list, int free_data); -unsigned _cdio_list_length (const CdioList *list); +unsigned _cdio_list_length (const CdioList_t *list); -void _cdio_list_prepend (CdioList *list, void *data); +void _cdio_list_prepend (CdioList_t *p_list, void *p_data); -void _cdio_list_append (CdioList *list, void *data); +void _cdio_list_append (CdioList_t *p_list, void *p_data); -void _cdio_list_foreach (CdioList *list, _cdio_list_iterfunc func, void *user_data); +void _cdio_list_foreach (CdioList_t *p_list, _cdio_list_iterfunc_t func, + void *p_user_data); -CdioListNode *_cdio_list_find (CdioList *list, _cdio_list_iterfunc cmp_func, void *user_data); +CdioListNode_t *_cdio_list_find (CdioList_t *p_list, + _cdio_list_iterfunc_t cmp_func, + void *p_user_data); #define _CDIO_LIST_FOREACH(node, list) \ for (node = _cdio_list_begin (list); node; node = _cdio_list_node_next (node)) -/* node ops */ +/** node operations */ -CdioListNode *_cdio_list_begin (const CdioList *list); +CdioListNode *_cdio_list_begin (const CdioList_t *p_list); -CdioListNode *_cdio_list_end (CdioList *list); +CdioListNode *_cdio_list_end (CdioList_t *p_list); -CdioListNode *_cdio_list_node_next (CdioListNode *node); +CdioListNode *_cdio_list_node_next (CdioListNode_t *p_node); -void _cdio_list_node_free (CdioListNode *node, int free_data); +void _cdio_list_node_free (CdioListNode_t *p_node, int i_free_data); -void *_cdio_list_node_data (CdioListNode *node); +void *_cdio_list_node_data (CdioListNode_t *p_node); #ifdef __cplusplus } diff --git a/include/cdio/iso9660.h b/include/cdio/iso9660.h index a86c70cf..019c444f 100644 --- a/include/cdio/iso9660.h +++ b/include/cdio/iso9660.h @@ -1,8 +1,8 @@ /* - $Id: iso9660.h,v 1.55 2004/11/21 22:32:03 rocky Exp $ + $Id: iso9660.h,v 1.56 2005/01/12 11:34:52 rocky Exp $ Copyright (C) 2000 Herbert Valerio Riedel - Copyright (C) 2003, 2004 Rocky Bernstein + Copyright (C) 2003, 2004, 2005 Rocky Bernstein See also iso9660.h by Eric Youngdale (1993). @@ -361,14 +361,14 @@ typedef struct _iso9660 iso9660_t; Open an ISO 9660 image for reading. Maybe in the future we will have a mode. NULL is returned on error. */ - iso9660_t *iso9660_open (const char *psz_pathname /*flags, mode */); + iso9660_t *iso9660_open (const char *psz_path /*flags, mode */); /*! Open an ISO 9660 image for reading allowing various ISO 9660 extensions. Maybe in the future we will have a mode. NULL is returned on error. */ - iso9660_t *iso9660_open_ext (const char *psz_pathname, + iso9660_t *iso9660_open_ext (const char *psz_path, iso_extension_mask_t iso_extension_mask); /*! @@ -501,27 +501,27 @@ char *iso9660_strncpy_pad(char dst[], const char src[], size_t len, ======================================================================*/ /*! - Check that pathname is a valid ISO-9660 directory name. + Check that psz_path is a valid ISO-9660 directory name. A valid directory name should not start out with a slash (/), dot (.) or null byte, should be less than 37 characters long, have no more than 8 characters in a directory component which is separated by a /, and consist of only DCHARs. - True is returned if pathname is valid. + True is returned if psz_path is valid. */ -bool iso9660_dirname_valid_p (const char pathname[]); +bool iso9660_dirname_valid_p (const char psz_path[]); /*! - Take pathname and a version number and turn that into a ISO-9660 + Take psz_path and a version number and turn that into a ISO-9660 pathname. (That's just the pathname followd by ";" and the version number. For example, mydir/file.ext -> MYDIR/FILE.EXT;1 for version 1. The resulting ISO-9660 pathname is returned. */ -char *iso9660_pathname_isofy (const char pathname[], uint16_t i_version); +char *iso9660_pathname_isofy (const char psz_path[], uint16_t i_version); /*! - Check that pathname is a valid ISO-9660 pathname. + Check that psz_path is a valid ISO-9660 pathname. A valid pathname contains a valid directory name, if one appears and the filename portion should be no more than 8 characters for the @@ -529,9 +529,9 @@ char *iso9660_pathname_isofy (const char pathname[], uint16_t i_version); dot). There should be exactly one dot somewhere in the filename portion and the filename should be composed of only DCHARs. - True is returned if pathname is valid. + True is returned if psz_path is valid. */ -bool iso9660_pathname_valid_p (const char pathname[]); +bool iso9660_pathname_valid_p (const char psz_path[]); /*===================================================================== directory tree @@ -577,48 +577,45 @@ iso9660_stat_t *iso9660_find_ifs_lsn(const iso9660_t *p_iso, lsn_t i_lsn); /*! - Get file status for pathname into stat. NULL is returned on error. + Return file status for psz_path. NULL is returned on error. */ -iso9660_stat_t *iso9660_fs_stat (CdIo *p_cdio, const char pathname[]); +iso9660_stat_t *iso9660_fs_stat (CdIo *p_cdio, const char psz_path[]); -/*! - Get file status for pathname into stat. NULL is returned on error. - pathname version numbers in the ISO 9660 - name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names - are lowercased. +/*! + Return file status for path name psz_path. NULL is returned on error. + pathname version numbers in the ISO 9660 name are dropped, i.e. ;1 + is removed and if level 1 ISO-9660 names are lowercased. */ iso9660_stat_t *iso9660_fs_stat_translate (CdIo *p_cdio, - const char pathname[], + const char psz_path[], bool b_mode2); -/*! - Get file status for pathname into stat. NULL is returned on error. +/*! + Return file status for pathname. NULL is returned on error. */ -iso9660_stat_t *iso9660_ifs_stat (iso9660_t *p_iso, const char pathname[]); +iso9660_stat_t *iso9660_ifs_stat (iso9660_t *p_iso, const char psz_path[]); -/*! - Get file status for pathname into stat. NULL is returned on error. - pathname version numbers in the ISO 9660 - name are dropped, i.e. ;1 is removed and if level 1 ISO-9660 names - are lowercased. +/*! Return file status for path name psz_path. NULL is returned on + error. pathname version numbers in the ISO 9660 name are dropped, + i.e. ;1 is removed and if level 1 ISO-9660 names are lowercased. */ iso9660_stat_t *iso9660_ifs_stat_translate (iso9660_t *p_iso, - const char pathname[]); + const char psz_path[]); -/*! - Read pathname (a directory) and return a list of iso9660_stat_t - of the files inside that. The caller must free the returned result. +/*! Read psz_path (a directory) and return a list of iso9660_stat_t + pointers for the files inside that directory. The caller must free the + returned result. */ -CdioList * iso9660_fs_readdir (CdIo *p_cdio, const char pathname[], - bool b_mode2); +CdioList_t * iso9660_fs_readdir (CdIo *p_cdio, const char psz_path[], + bool b_mode2); -/*! - Read pathname (a directory) and return a list of iso9660_stat_t - of the files inside that. The caller must free the returned result. +/*! Read psz_path (a directory) and return a list of iso9660_stat_t + pointers for the files inside that directory. The caller must free + the returned result. */ -CdioList * iso9660_ifs_readdir (iso9660_t *p_iso, const char pathname[]); +CdioList_t * iso9660_ifs_readdir (iso9660_t *p_iso, const char psz_path[]); /*! Return the PVD's application ID. @@ -703,7 +700,7 @@ char *iso9660_get_system_id(const iso9660_pvd_t *p_pvd); is some problem in getting this and false is returned. */ bool iso9660_ifs_get_system_id(iso9660_t *p_iso, - /*out*/ char **p_psz_system_id); + /*out*/ char **p_psz_system_id); /*! Return the LSN of the root directory for pvd. @@ -751,9 +748,9 @@ uint16_t iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent, uint16_t parent); -/*===================================================================== - Volume Descriptors -======================================================================*/ + /**===================================================================== + Volume Descriptors + ======================================================================*/ void iso9660_set_pvd (void *pd, const char volume_id[], const char application_id[], diff --git a/lib/driver/ds.c b/lib/driver/ds.c index 9a82e447..ba65c489 100644 --- a/lib/driver/ds.c +++ b/lib/driver/ds.c @@ -1,7 +1,8 @@ /* - $Id: ds.c,v 1.1 2004/12/18 17:29:32 rocky Exp $ + $Id: ds.c,v 1.2 2005/01/12 11:34:52 rocky Exp $ Copyright (C) 2000 Herbert Valerio Riedel + Copyright (C) 2005 Rocky Bernstein 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 @@ -30,208 +31,210 @@ #include #include "cdio_assert.h" -static const char _rcsid[] = "$Id: ds.c,v 1.1 2004/12/18 17:29:32 rocky Exp $"; +static const char _rcsid[] = "$Id: ds.c,v 1.2 2005/01/12 11:34:52 rocky Exp $"; struct _CdioList { unsigned length; - CdioListNode *begin; - CdioListNode *end; + CdioListNode_t *begin; + CdioListNode_t *end; }; struct _CdioListNode { - CdioList *list; + CdioList_t *list; - CdioListNode *next; + CdioListNode_t *next; void *data; }; /* impl */ -CdioList * +CdioList_t * _cdio_list_new (void) { - CdioList *new_obj = _cdio_malloc (sizeof (CdioList)); + CdioList_t *p_new_obj = _cdio_malloc (sizeof (CdioList_t)); - return new_obj; + return p_new_obj; } void -_cdio_list_free (CdioList *list, int free_data) +_cdio_list_free (CdioList_t *p_list, int free_data) { - while (_cdio_list_length (list)) - _cdio_list_node_free (_cdio_list_begin (list), free_data); + while (_cdio_list_length (p_list)) + _cdio_list_node_free (_cdio_list_begin (p_list), free_data); - free (list); + free (p_list); } unsigned -_cdio_list_length (const CdioList *list) +_cdio_list_length (const CdioList_t *p_list) { - cdio_assert (list != NULL); + cdio_assert (p_list != NULL); - return list->length; + return p_list->length; } void -_cdio_list_prepend (CdioList *list, void *data) +_cdio_list_prepend (CdioList_t *p_list, void *p_data) { - CdioListNode *new_node; + CdioListNode_t *p_new_node; - cdio_assert (list != NULL); + cdio_assert (p_list != NULL); - new_node = _cdio_malloc (sizeof (CdioListNode)); + p_new_node = _cdio_malloc (sizeof (CdioListNode_t)); - new_node->list = list; - new_node->next = list->begin; - new_node->data = data; + p_new_node->list = p_list; + p_new_node->next = p_list->begin; + p_new_node->data = p_data; - list->begin = new_node; - if (list->length == 0) - list->end = new_node; + p_list->begin = p_new_node; + if (p_list->length == 0) + p_list->end = p_new_node; - list->length++; + p_list->length++; } void -_cdio_list_append (CdioList *list, void *data) +_cdio_list_append (CdioList_t *p_list, void *p_data) { - cdio_assert (list != NULL); + cdio_assert (p_list != NULL); - if (list->length == 0) + if (p_list->length == 0) { - _cdio_list_prepend (list, data); + _cdio_list_prepend (p_list, p_data); } else { - CdioListNode *new_node = _cdio_malloc (sizeof (CdioListNode)); + CdioListNode_t *p_new_node = _cdio_malloc (sizeof (CdioListNode_t)); - new_node->list = list; - new_node->next = NULL; - new_node->data = data; + p_new_node->list = p_list; + p_new_node->next = NULL; + p_new_node->data = p_data; - list->end->next = new_node; - list->end = new_node; + p_list->end->next = p_new_node; + p_list->end = p_new_node; - list->length++; + p_list->length++; } } void -_cdio_list_foreach (CdioList *list, _cdio_list_iterfunc func, void *user_data) +_cdio_list_foreach (CdioList_t *p_list, _cdio_list_iterfunc_t func, + void *p_user_data) { - CdioListNode *node; + CdioListNode_t *node; - cdio_assert (list != NULL); + cdio_assert (p_list != NULL); cdio_assert (func != 0); - for (node = _cdio_list_begin (list); + for (node = _cdio_list_begin (p_list); node != NULL; node = _cdio_list_node_next (node)) - func (_cdio_list_node_data (node), user_data); + func (_cdio_list_node_data (node), p_user_data); } -CdioListNode * -_cdio_list_find (CdioList *list, _cdio_list_iterfunc cmp_func, void *user_data) +CdioListNode_t * +_cdio_list_find (CdioList_t *p_list, _cdio_list_iterfunc_t cmp_func, + void *p_user_data) { - CdioListNode *node; + CdioListNode_t *p_node; - cdio_assert (list != NULL); + cdio_assert (p_list != NULL); cdio_assert (cmp_func != 0); - for (node = _cdio_list_begin (list); - node != NULL; - node = _cdio_list_node_next (node)) - if (cmp_func (_cdio_list_node_data (node), user_data)) + for (p_node = _cdio_list_begin (p_list); + p_node != NULL; + p_node = _cdio_list_node_next (p_node)) + if (cmp_func (_cdio_list_node_data (p_node), p_user_data)) break; - return node; + return p_node; } -CdioListNode * -_cdio_list_begin (const CdioList *list) +CdioListNode_t * +_cdio_list_begin (const CdioList_t *p_list) { - cdio_assert (list != NULL); + cdio_assert (p_list != NULL); - return list->begin; + return p_list->begin; } -CdioListNode * -_cdio_list_end (CdioList *list) +CdioListNode_t * +_cdio_list_end (CdioList_t *p_list) { - cdio_assert (list != NULL); + cdio_assert (p_list != NULL); - return list->end; + return p_list->end; } -CdioListNode * -_cdio_list_node_next (CdioListNode *node) +CdioListNode_t * +_cdio_list_node_next (CdioListNode_t *p_node) { - if (node) - return node->next; + if (p_node) + return p_node->next; return NULL; } void -_cdio_list_node_free (CdioListNode *node, int free_data) +_cdio_list_node_free (CdioListNode_t *p_node, int free_data) { - CdioList *list; - CdioListNode *prev_node; + CdioList_t *p_list; + CdioListNode_t *prev_node; - cdio_assert (node != NULL); + cdio_assert (p_node != NULL); - list = node->list; + p_list = p_node->list; - cdio_assert (_cdio_list_length (list) > 0); + cdio_assert (_cdio_list_length (p_list) > 0); if (free_data) - free (_cdio_list_node_data (node)); + free (_cdio_list_node_data (p_node)); - if (_cdio_list_length (list) == 1) + if (_cdio_list_length (p_list) == 1) { - cdio_assert (list->begin == list->end); + cdio_assert (p_list->begin == p_list->end); - list->end = list->begin = NULL; - list->length = 0; - free (node); + p_list->end = p_list->begin = NULL; + p_list->length = 0; + free (p_node); return; } - cdio_assert (list->begin != list->end); + cdio_assert (p_list->begin != p_list->end); - if (list->begin == node) + if (p_list->begin == p_node) { - list->begin = node->next; - free (node); - list->length--; + p_list->begin = p_node->next; + free (p_node); + p_list->length--; return; } - for (prev_node = list->begin; prev_node->next; prev_node = prev_node->next) - if (prev_node->next == node) + for (prev_node = p_list->begin; prev_node->next; prev_node = prev_node->next) + if (prev_node->next == p_node) break; cdio_assert (prev_node->next != NULL); - if (list->end == node) - list->end = prev_node; + if (p_list->end == p_node) + p_list->end = prev_node; - prev_node->next = node->next; + prev_node->next = p_node->next; - list->length--; + p_list->length--; - free (node); + free (p_node); } void * -_cdio_list_node_data (CdioListNode *node) +_cdio_list_node_data (CdioListNode_t *p_node) { - if (node) - return node->data; + if (p_node) + return p_node->data; return NULL; } diff --git a/lib/driver/image/nrg.c b/lib/driver/image/nrg.c index edbb9aa1..53e1a0d1 100644 --- a/lib/driver/image/nrg.c +++ b/lib/driver/image/nrg.c @@ -1,7 +1,7 @@ /* - $Id: nrg.c,v 1.5 2005/01/04 04:33:36 rocky Exp $ + $Id: nrg.c,v 1.6 2005/01/12 11:34:52 rocky Exp $ - Copyright (C) 2003, 2004 Rocky Bernstein + Copyright (C) 2003, 2004, 2005 Rocky Bernstein Copyright (C) 2001, 2003 Herbert Valerio Riedel This program is free software; you can redistribute it and/or modify @@ -46,7 +46,7 @@ #include "_cdio_stdio.h" #include "nrg.h" -static const char _rcsid[] = "$Id: nrg.c,v 1.5 2005/01/04 04:33:36 rocky Exp $"; +static const char _rcsid[] = "$Id: nrg.c,v 1.6 2005/01/12 11:34:52 rocky Exp $"; /* reader */ @@ -69,7 +69,7 @@ typedef struct { #include "image_common.h" static bool parse_nrg (_img_private_t *env, const char *psz_cue_name); -static uint32_t _stat_size_nrg (void *user_data); +static uint32_t _stat_size_nrg (void *p_user_data); /* Updates internal track TOC, so we can later simulate ioctl(CDROMREADTOCENTRY). @@ -785,9 +785,9 @@ _init_nrg (_img_private_t *p_env) information in each sector. */ static off_t -_lseek_nrg (void *user_data, off_t offset, int whence) +_lseek_nrg (void *p_user_data, off_t offset, int whence) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; /* real_offset is the real byte offset inside the disk image The number below was determined empirically. @@ -829,16 +829,16 @@ _lseek_nrg (void *user_data, off_t offset, int whence) boundaries. */ static ssize_t -_read_nrg (void *user_data, void *buf, size_t size) +_read_nrg (void *p_user_data, void *buf, size_t size) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; return cdio_stream_read(p_env->gen.data_source, buf, size, 1); } static uint32_t -_stat_size_nrg (void *user_data) +_stat_size_nrg (void *p_user_data) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; return p_env->size; } @@ -848,12 +848,12 @@ _stat_size_nrg (void *user_data) from LSN. Returns 0 if no error. */ static int -_read_audio_sectors_nrg (void *user_data, void *data, lsn_t lsn, +_read_audio_sectors_nrg (void *p_user_data, void *data, lsn_t lsn, unsigned int nblocks) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; - CdioListNode *node; + CdioListNode_t *node; if (lsn >= p_env->size) { @@ -888,13 +888,13 @@ _read_audio_sectors_nrg (void *user_data, void *data, lsn_t lsn, } static int -_read_mode1_sector_nrg (void *user_data, void *data, lsn_t lsn, +_read_mode1_sector_nrg (void *p_user_data, void *data, lsn_t lsn, bool b_form2) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; - CdioListNode *node; + CdioListNode_t *node; if (lsn >= p_env->size) { @@ -942,10 +942,10 @@ _read_mode1_sector_nrg (void *user_data, void *data, lsn_t lsn, Returns 0 if no error. */ static int -_read_mode1_sectors_nrg (void *user_data, void *data, lsn_t lsn, +_read_mode1_sectors_nrg (void *p_user_data, void *data, lsn_t lsn, bool b_form2, unsigned nblocks) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; @@ -960,13 +960,13 @@ _read_mode1_sectors_nrg (void *user_data, void *data, lsn_t lsn, } static int -_read_mode2_sector_nrg (void *user_data, void *data, lsn_t lsn, - bool b_form2) +_read_mode2_sector_nrg (void *p_user_data, void *data, lsn_t lsn, + bool b_form2) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; char buf[CDIO_CD_FRAMESIZE_RAW] = { 0, }; - CdioListNode *node; + CdioListNode_t *node; if (lsn >= p_env->size) { @@ -1015,10 +1015,10 @@ _read_mode2_sector_nrg (void *user_data, void *data, lsn_t lsn, Returns 0 if no error. */ static int -_read_mode2_sectors_nrg (void *user_data, void *data, lsn_t lsn, +_read_mode2_sectors_nrg (void *p_user_data, void *data, lsn_t lsn, bool b_form2, unsigned nblocks) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; int i; int retval; unsigned int blocksize = b_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE; @@ -1036,9 +1036,9 @@ _read_mode2_sectors_nrg (void *user_data, void *data, lsn_t lsn, Free memory resources associated with NRG object. */ static void -_free_nrg (void *user_data) +_free_nrg (void *p_user_data) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; if (NULL == p_env) return; if (NULL != p_env->mapping) @@ -1046,7 +1046,7 @@ _free_nrg (void *user_data) /* The remaining part of the image is like the other image drivers, so free that in the same way. */ - _free_image(user_data); + _free_image(p_user_data); } /*! @@ -1111,9 +1111,9 @@ get_hwinfo_nrg ( const CdIo *p_cdio, /*out*/ cdio_hwinfo_t *hw_info) CDIO_INVALID_TRACK is returned on error. */ static track_format_t -get_track_format_nrg(void *user_data, track_t track_num) +get_track_format_nrg(void *p_user_data, track_t track_num) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; if (track_num > p_env->gen.i_tracks || track_num == 0) return TRACK_FORMAT_ERROR; @@ -1141,9 +1141,9 @@ get_track_format_nrg(void *user_data, track_t track_num) FIXME: there's gotta be a better design for this and get_track_format? */ static bool -_get_track_green_nrg(void *user_data, track_t track_num) +_get_track_green_nrg(void *p_user_data, track_t track_num) { - _img_private_t *p_env = user_data; + _img_private_t *p_env = p_user_data; if (track_num > p_env->gen.i_tracks || track_num == 0) return false; diff --git a/lib/driver/image_common.h b/lib/driver/image_common.h index b0e31490..f7d1d2bf 100644 --- a/lib/driver/image_common.h +++ b/lib/driver/image_common.h @@ -1,5 +1,5 @@ /* - $Id: image_common.h,v 1.4 2005/01/04 04:33:36 rocky Exp $ + $Id: image_common.h,v 1.5 2005/01/12 11:34:52 rocky Exp $ Copyright (C) 2004, 2005 Rocky Bernstein @@ -58,7 +58,7 @@ typedef struct { /* This is a hack because I don't really understnad NERO better. */ bool is_cues; - CdioList *mapping; /* List of track information */ + CdioList_t *mapping; /* List of track information */ uint32_t size; #endif } _img_private_t; diff --git a/lib/iso9660/iso9660_fs.c b/lib/iso9660/iso9660_fs.c index 6643550c..8c8bce16 100644 --- a/lib/iso9660/iso9660_fs.c +++ b/lib/iso9660/iso9660_fs.c @@ -1,5 +1,5 @@ /* - $Id: iso9660_fs.c,v 1.2 2005/01/02 22:43:41 rocky Exp $ + $Id: iso9660_fs.c,v 1.3 2005/01/12 11:34:52 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2003, 2004 Rocky Bernstein @@ -51,7 +51,7 @@ #include -static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.2 2005/01/02 22:43:41 rocky Exp $"; +static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.3 2005/01/12 11:34:52 rocky Exp $"; /* Implementation of iso9660_t type */ struct _iso9660 { @@ -1050,7 +1050,7 @@ iso9660_ifs_stat_translate (iso9660_t *p_iso, const char pathname[]) Read pathname (a directory) and return a list of iso9660_stat_t of the files inside that. The caller must free the returned result. */ -CdioList * +CdioList_t * iso9660_fs_readdir (CdIo_t *p_cdio, const char pathname[], bool b_mode2) { iso9660_stat_t *p_stat; @@ -1070,7 +1070,7 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char pathname[], bool b_mode2) { unsigned offset = 0; uint8_t *_dirbuf = NULL; - CdioList *retval = _cdio_list_new (); + CdioList_t *retval = _cdio_list_new (); if (p_stat->size != ISO_BLOCKSIZE * p_stat->secsize) { @@ -1121,7 +1121,7 @@ iso9660_fs_readdir (CdIo_t *p_cdio, const char pathname[], bool b_mode2) Read pathname (a directory) and return a list of iso9660_stat_t of the files inside that. The caller must free the returned result. */ -CdioList * +CdioList_t * iso9660_ifs_readdir (iso9660_t *p_iso, const char pathname[]) { iso9660_stat_t *p_stat; @@ -1141,7 +1141,7 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char pathname[]) long int ret; unsigned offset = 0; uint8_t *_dirbuf = NULL; - CdioList *retval = _cdio_list_new (); + CdioList_t *retval = _cdio_list_new (); if (p_stat->size != ISO_BLOCKSIZE * p_stat->secsize) { @@ -1184,9 +1184,9 @@ iso9660_ifs_readdir (iso9660_t *p_iso, const char pathname[]) static iso9660_stat_t * find_fs_lsn_recurse (CdIo_t *p_cdio, const char pathname[], lsn_t lsn) { - CdioList *entlist = iso9660_fs_readdir (p_cdio, pathname, true); - CdioList *dirlist = _cdio_list_new (); - CdioListNode *entnode; + CdioList_t *entlist = iso9660_fs_readdir (p_cdio, pathname, true); + CdioList_t *dirlist = _cdio_list_new (); + CdioListNode_t *entnode; cdio_assert (entlist != NULL); diff --git a/src/cd-info.c b/src/cd-info.c index fbbbe10b..dedfa7b8 100644 --- a/src/cd-info.c +++ b/src/cd-info.c @@ -1,5 +1,5 @@ /* - $Id: cd-info.c,v 1.108 2005/01/09 00:10:49 rocky Exp $ + $Id: cd-info.c,v 1.109 2005/01/12 11:34:52 rocky Exp $ Copyright (C) 2003, 2004, 2005 Rocky Bernstein Copyright (C) 1996, 1997, 1998 Gerd Knorr @@ -538,9 +538,9 @@ print_iso9660_recurse (CdIo_t *p_cdio, const char pathname[], cdio_fs_anal_t fs, bool b_mode2) { - CdioList *entlist; - CdioList *dirlist = _cdio_list_new (); - CdioListNode *entnode; + CdioList_t *entlist; + CdioList_t *dirlist = _cdio_list_new (); + CdioListNode_t *entnode; uint8_t i_joliet_level; i_joliet_level = (opts.no_joliet) diff --git a/src/iso-info.c b/src/iso-info.c index 5068d594..fbb82ca4 100644 --- a/src/iso-info.c +++ b/src/iso-info.c @@ -1,5 +1,5 @@ /* - $Id: iso-info.c,v 1.18 2004/12/18 21:24:25 rocky Exp $ + $Id: iso-info.c,v 1.19 2005/01/12 11:34:52 rocky Exp $ Copyright (C) 2004 Rocky Bernstein @@ -165,9 +165,9 @@ _log_handler (cdio_log_level_t level, const char message[]) static void print_iso9660_recurse (iso9660_t *p_iso, const char pathname[]) { - CdioList *entlist; - CdioList *dirlist = _cdio_list_new (); - CdioListNode *entnode; + CdioList_t *entlist; + CdioList_t *dirlist = _cdio_list_new (); + CdioListNode_t *entnode; uint8_t i_joliet_level = iso9660_ifs_get_joliet_level(p_iso); entlist = iso9660_ifs_readdir (p_iso, pathname); diff --git a/test/vcd_demo_toc.right b/test/vcd_demo_toc.right new file mode 100644 index 00000000..59814dd2 --- /dev/null +++ b/test/vcd_demo_toc.right @@ -0,0 +1,91 @@ +This is free software; see the source for copying conditions. +There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. +__________________________________ + +CD-ROM Track List (1 - 3) + #: MSF LSN Type Green? Copy? Channels Premphasis? + 1: 00:02:00 000000 XA true yes + 2: 00:17:57 001182 XA true yes + 3: 00:24:71 001721 XA true yes +170: 00:30:10 002110 leadout (4 MB raw, 4 MB formatted) +Media Catalog Number (MCN): not available +__________________________________ +CD Analysis Report +CD-ROM with CD-RTOS and ISO 9660 filesystem +ISO 9660: 1032 blocks, label `V0469 ' +Application: +Preparer : LKVCDIMAGER 5.0.7.10(WIN32) +Publisher : LAURENS KOEHOORN +System : CD-RTOS CD-BRIDGE +Volume : V0469 +Volume Set : +ISO9660 filesystem +/: + d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 . + d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. + d d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00 ext + d d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00 mpegav + d d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00 segment + d d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00 sources + d d---1xrxrxr 0 0 [fn 00] [LSN 25] 2048 Jul 14 1978 00:00 vcd + +/EXT/: + d d---1xrxrxr 0 0 [fn 00] [LSN 19] 2048 Jul 14 1978 00:00 . + d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. + - ----1xrxrxr 0 0 [fn 01] [LSN 375] 65536 Jul 14 1978 00:00 lot_x.vcd + - ----1xrxrxr 0 0 [fn 01] [LSN 407] 144 Jul 14 1978 00:00 psd_x.vcd + +/MPEGAV/: + d d---1xrxrxr 0 0 [fn 00] [LSN 20] 2048 Jul 14 1978 00:00 . + d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. + - ---2-xrxrxr 0 0 [fn 01] [LSN 1182] 904036 ( 796672) Jul 14 1978 00:00 avseq01.dat + - ---2-xrxrxr 0 0 [fn 02] [LSN 1721] 904036 ( 796672) Jul 14 1978 00:00 avseq02.dat + +/SEGMENT/: + d d---1xrxrxr 0 0 [fn 00] [LSN 21] 2048 Jul 14 1978 00:00 . + d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. + - ---2-xrxrxr 0 0 [fn 01] [LSN 225] 220780 ( 194560) Jul 14 1978 00:00 item0001.dat + +/Sources/: + d d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00 . + d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. + d d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00 html + - ----1xrxrxr 0 0 [fn 01] [LSN 434] 842 Dec 11 2002 10:33 index.htm + - ----1xrxrxr 0 0 [fn 01] [LSN 435] 1216557 Jan 07 2003 18:01 menu.ppm + - ----1xrxrxr 0 0 [fn 01] [LSN 1030] 2793 Jan 07 2003 18:08 source.xml + +/Sources/HTML/: + d d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00 . + d d---1xrxrxr 0 0 [fn 00] [LSN 22] 2048 Jul 14 1978 00:00 .. + - ----1xrxrxr 0 0 [fn 01] [LSN 425] 1067 Jan 07 2003 17:51 0.xml + - ----1xrxrxr 0 0 [fn 01] [LSN 426] 1067 Jan 07 2003 17:51 1.xml + d d---1xrxrxr 0 0 [fn 00] [LSN 24] 2048 Jul 14 1978 00:00 img + - ----1xrxrxr 0 0 [fn 01] [LSN 427] 1327 Jan 07 2003 17:51 movies.css + - ----1xrxrxr 0 0 [fn 01] [LSN 428] 12024 Jan 07 2003 17:51 toc.xsl + +/Sources/HTML/img/: + d d---1xrxrxr 0 0 [fn 00] [LSN 24] 2048 Jul 14 1978 00:00 . + d d---1xrxrxr 0 0 [fn 00] [LSN 23] 2048 Jul 14 1978 00:00 .. + - ----1xrxrxr 0 0 [fn 01] [LSN 408] 1999 Nov 13 2002 07:27 al.gif + - ----1xrxrxr 0 0 [fn 01] [LSN 409] 7626 Jan 07 2003 17:42 loeki_groep_01.gif + - ----1xrxrxr 0 0 [fn 01] [LSN 413] 9986 Jan 07 2003 17:42 loeki_groep_02.gif + - ----1xrxrxr 0 0 [fn 01] [LSN 418] 207 Nov 14 2002 19:33 a_left.gif + - ----1xrxrxr 0 0 [fn 01] [LSN 419] 207 Nov 14 2002 19:33 a_right.gif + - ----1xrxrxr 0 0 [fn 01] [LSN 420] 441 Nov 13 2002 10:54 animatie.gif + - ----1xrxrxr 0 0 [fn 01] [LSN 421] 250 Nov 14 2002 11:44 face_up2.gif + - ----1xrxrxr 0 0 [fn 01] [LSN 422] 259 Nov 13 2002 11:09 familie.gif + - ----1xrxrxr 0 0 [fn 01] [LSN 423] 1010 Nov 14 2002 11:52 goldstar2.gif + - ----1xrxrxr 0 0 [fn 01] [LSN 424] 1783 Nov 13 2002 07:15 vcd.gif + +/VCD/: + d d---1xrxrxr 0 0 [fn 00] [LSN 25] 2048 Jul 14 1978 00:00 . + d d---1xrxrxr 0 0 [fn 00] [LSN 18] 2048 Jul 14 1978 00:00 .. + - ----1xrxrxr 0 0 [fn 00] [LSN 151] 2048 Jul 14 1978 00:00 entries.vcd + - ----1xrxrxr 0 0 [fn 00] [LSN 150] 2048 Jul 14 1978 00:00 info.vcd + - ----1xrxrxr 0 0 [fn 00] [LSN 152] 65536 Jul 14 1978 00:00 lot.vcd + - ----1xrxrxr 0 0 [fn 00] [LSN 184] 72 Jul 14 1978 00:00 psd.vcd + +XA sectors Video CD +session #2 starts at track 2, LSN: 1182, ISO 9660 blocks: 1032 +ISO 9660: 1032 blocks, label `V0469 '