From 4ec818aabd47817fb803ee7545e44c3681b21cbf Mon Sep 17 00:00:00 2001 From: rocky Date: Wed, 1 Mar 2006 20:48:55 +0000 Subject: [PATCH] Document iso9660_name_translate{,_ext} more accurately. --- include/cdio/iso9660.h | 26 ++++++++++++++++++-------- lib/iso9660/iso9660.c | 26 ++++++++++++++++++-------- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/include/cdio/iso9660.h b/include/cdio/iso9660.h index f5dc71e0..c126ff8a 100644 --- a/include/cdio/iso9660.h +++ b/include/cdio/iso9660.h @@ -1,5 +1,5 @@ /* - $Id: iso9660.h,v 1.81 2006/03/01 14:19:59 rocky Exp $ + $Id: iso9660.h,v 1.82 2006/03/01 20:48:55 rocky Exp $ Copyright (C) 2000 Herbert Valerio Riedel Copyright (C) 2003, 2004, 2005, 2006 Rocky Bernstein @@ -680,22 +680,32 @@ bool iso9660_isdchar (int c); bool iso9660_isachar (int c); /*! - Convert ISO-9660 file name that stored in a directory entry into + Convert an ISO-9660 file name that stored in a directory entry into what's usually listed as the file name in a listing. Lowercase name, and remove trailing ;1's or .;1's and turn the other ;'s into version numbers. - The length of the translated string is returned. + @param psz_oldname the ISO-9660 filename to be translated. + @param psz_newname returned string. The caller allocates this and + it should be at least the size of psz_oldname. + @return length of the translated string is returned. */ -int iso9660_name_translate(const char *psz_oldname, char *psz_newname); +int iso9660_name_translate(const char *psz_oldname, + /*out*/ char *psz_newname); /*! - Convert ISO-9660 file name that stored in a directory entry into + Convert an ISO-9660 file name that stored in a directory entry into what's usually listed as the file name in a listing. Lowercase - name if not using Joliet extension. Remove trailing ;1's or .;1's and - turn the other ;'s into version numbers. + name if no Joliet Extension interpretation. Remove trailing ;1's or + .;1's and turn the other ;'s into version numbers. - The length of the translated string is returned. + @param psz_oldname the ISO-9660 filename to be translated. + @param psz_newname returned string. The caller allocates this and + it should be at least the size of psz_oldname. + @param i_joliet_level 0 if not using Joliet Extension. Otherwise the + Joliet level. + @return length of the translated string is returned. It will be no greater + than the length of psz_oldname. */ int iso9660_name_translate_ext(const char *psz_old, char *psz_new, uint8_t i_joliet_level); diff --git a/lib/iso9660/iso9660.c b/lib/iso9660/iso9660.c index 1e81b839..30347164 100644 --- a/lib/iso9660/iso9660.c +++ b/lib/iso9660/iso9660.c @@ -1,5 +1,5 @@ /* - $Id: iso9660.c,v 1.16 2005/11/06 19:15:43 rocky Exp $ + $Id: iso9660.c,v 1.17 2006/03/01 20:48:55 rocky Exp $ Copyright (C) 2000 Herbert Valerio Riedel Copyright (C) 2003, 2004, 2005 Rocky Bernstein @@ -51,7 +51,7 @@ const char ISO_STANDARD_ID[] = {'C', 'D', '0', '0', '1'}; #include #endif -static const char _rcsid[] = "$Id: iso9660.c,v 1.16 2005/11/06 19:15:43 rocky Exp $"; +static const char _rcsid[] = "$Id: iso9660.c,v 1.17 2006/03/01 20:48:55 rocky Exp $"; /* Variables to hold debugger-helping enumerations */ enum iso_enum1_s iso_enums1; @@ -282,12 +282,16 @@ iso9660_set_ltime (const struct tm *_tm, /*out*/ iso9660_ltime_t *pvd_date) } /*! - Convert ISO-9660 file name that stored in a directory entry into + Convert an ISO-9660 file name that stored in a directory entry into what's usually listed as the file name in a listing. Lowercase name, and remove trailing ;1's or .;1's and turn the other ;'s into version numbers. - The length of the translated string is returned. + @param psz_oldname the ISO-9660 filename to be translated. + @param psz_newname returned string. The caller allocates this and + it should be at least the size of psz_oldname. + @return length of the translated string is returned. It will be no greater + than the length of psz_oldname. */ int iso9660_name_translate(const char *psz_old, char *psz_new) @@ -296,12 +300,18 @@ iso9660_name_translate(const char *psz_old, char *psz_new) } /*! - Convert ISO-9660 file name that stored in a directory entry into + Convert an ISO-9660 file name that stored in a directory entry into what's usually listed as the file name in a listing. Lowercase - name if not using Joliet extension. Remove trailing ;1's or .;1's and - turn the other ;'s into version numbers. + name if no Joliet Extension interpretation. Remove trailing ;1's or + .;1's and turn the other ;'s into version numbers. - The length of the translated string is returned. + @param psz_oldname the ISO-9660 filename to be translated. + @param psz_newname returned string. The caller allocates this and + it should be at least the size of psz_oldname. + @param i_joliet_level 0 if not using Joliet Extension. Otherwise the + Joliet level. + @return length of the translated string is returned. It will be no greater + than the length of psz_oldname. */ int iso9660_name_translate_ext(const char *psz_oldname, char *psz_newname,