Device-Cdio
view release on metacpan or search on metacpan
swig/perliso9660.swg view on Meta::CPAN
%constant long int EVD_SECTOR = ISO_EVD_SECTOR ;
%constant long int LEN_ISONAME = LEN_ISONAME;
%constant long int MAX_SYSTEM_ID = ISO_MAX_SYSTEM_ID ;
%constant long int MAX_ISONAME = MAX_ISONAME;
%constant long int MAX_PREPARER_ID = ISO_MAX_PREPARER_ID ;
%constant long int MAX_ISOPATHNAME = MAX_ISOPATHNAME;
%constant long int FILE = ISO_FILE;
%constant long int EXISTENCE = ISO_EXISTENCE;
%constant long int DIRECTORY = ISO_DIRECTORY;
%constant long int ASSOCIATED = ISO_ASSOCIATED;
%constant long int RECORD = ISO_RECORD;
%constant long int PROTECTION = ISO_PROTECTION;
%constant long int DRESERVED1 = ISO_DRESERVED1;
%constant long int DRESERVED2 = ISO_DRESERVED2;
%constant long int MULTIEXTENT = ISO_MULTIEXTENT;
%constant long int VD_BOOT_RECORD = ISO_VD_BOOT_RECORD;
%constant long int VD_PRIMARY = ISO_VD_PRIMARY;
%constant long int VD_SUPPLEMENTARY = ISO_VD_SUPPLEMENTARY;
%constant long int VD_PARITION = ISO_VD_PARITION;
%constant long int VD_END = ISO_VD_END;
%constant long int MAX_PUBLISHER_ID = ISO_MAX_PUBLISHER_ID;
%constant long int MAX_APPLICATION_ID = ISO_MAX_APPLICATION_ID;
%constant long int MAX_VOLUME_ID = ISO_MAX_VOLUME_ID;
%constant long int MAX_VOLUMESET_ID = ISO_MAX_VOLUMESET_ID;
%constant long int STANDARD_ID = ISO_STANDARD_ID;
%constant long int NOCHECK = ISO9660_NOCHECK;
%constant long int SEVEN_BIT = ISO9660_7BIT;
%constant long int ACHARS = ISO9660_ACHARS;
%constant long int DCHARS = ISO9660_DCHARS;
%constant long int EXTENSION_JOLIET_LEVEL1 = ISO_EXTENSION_JOLIET_LEVEL1;
%constant long int EXTENSION_JOLIET_LEVEL2 = ISO_EXTENSION_JOLIET_LEVEL2;
%constant long int EXTENSION_JOLIET_LEVEL3 = ISO_EXTENSION_JOLIET_LEVEL3;
%constant long int EXTENSION_ROCK_RIDGE = ISO_EXTENSION_ROCK_RIDGE;
%constant long int EXTENSION_HIGH_SIERRA = ISO_EXTENSION_HIGH_SIERRA;
%constant long int EXTENSION_ALL = ISO_EXTENSION_ALL;
%constant long int EXTENSION_NONE = ISO_EXTENSION_NONE;
%constant long int EXTENSION_JOLIET = ISO_EXTENSION_JOLIET;
/* Set up to allow functions to return stat lists of type "stat
*". We'll use a typedef so we can make sure to isolate this.
*/
%inline %{
typedef CdioList_t IsoStatList_t;
typedef iso9660_stat_t IsoStat_t;
%}
typedef CdioList_t IsoStatList_t;
typedef iso9660_stat_t IsoStat_t;
%typemap(out) IsoStat_t *{
// $1 is of type IsoStatList_t
iso9660_stat_t *p_statbuf = result;
if (!result) goto out;
PPCODE:
/* Have Perl compute the length of the string using strlen() */
XPUSHs(sv_2mortal(newSVpv(p_statbuf->filename, 0)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->lsn)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->size)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->secsize)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->type)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_sec)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_min)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_hour)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_mday)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_mon)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_year)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_wday)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_yday)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_isdst)));
argvi += 16;
free (p_statbuf);
out: ;
}
%typemap(out) IsoStatList_t *{
// $1 is of type IsoStatList_t
CdioISO9660FileList_t *p_entlist = result;
CdioListNode_t *p_entnode;
unsigned int num = 0;
if (!result) goto out;
PPCODE:
/* For each element in the array of strings, create a new
* mortalscalar, and stuff it into the above array. */
_CDIO_LIST_FOREACH (p_entnode, p_entlist) {
iso9660_stat_t *p_statbuf =
(iso9660_stat_t *) _cdio_list_node_data (p_entnode);
/* Have perl compute the length of the string using strlen() */
XPUSHs(sv_2mortal(newSVpv(p_statbuf->filename, 0)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->lsn)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->size)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->secsize)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->type)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_sec)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_min)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_hour)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_mday)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_mon)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_year)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_wday)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_yday)));
XPUSHs(sv_2mortal(newSViv(p_statbuf->tm.tm_isdst)));
num += 14;
}
iso9660_filelist_free(p_entlist);
argvi += num + 2;
out: ;
}
/*!
Open an ISO 9660 image for reading. Maybe in the future we will have
a mode. NULL is returned on error.
*/
%rename iso9660_open open_iso;
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.
*/
%rename iso9660_open_ext open_ext;
iso9660_t *iso9660_open_ext (const char *psz_path,
iso_extension_mask_t iso_extension_mask);
/*!
Open an ISO 9660 image for reading with some tolerence for positioning
of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set
the eventual offset to adjust by (as long as that is <= i_fuzz).
Maybe in the future we will have a mode. NULL is returned on error.
@see iso9660_open
*/
%rename iso9660_open_fuzzy open_fuzzy;
iso9660_t *iso9660_open_fuzzy (const char *psz_path /*flags, mode */,
uint16_t i_fuzz);
/*!
Open an ISO 9660 image for reading with some tolerence for positioning
of the ISO9660 image. We scan for ISO_STANDARD_ID and use that to set
the eventual offset to adjust by (as long as that is <= i_fuzz).
( run in 0.456 second using v1.01-cache-2.11-cpan-5511b514fd6 )