![]() |
![]() |
![]() |
libInstPatch Reference Manual | ![]() |
---|---|---|---|---|
IpatchCramDecoderFileInfo; DecoderRelocEntry; IpatchCramDecoder; IpatchCramDecoderClass; IpatchCramDecoder* ipatch_cram_decoder_new (IpatchFile *cramfile); void ipatch_cram_decoder_set_cram_file (IpatchCramDecoder *decoder, IpatchFile *cramfile); gboolean ipatch_cram_decoder_start (IpatchCramDecoder *decoder, GError **err); IpatchCramDecoderFileInfo* ipatch_cram_decoder_next_file (IpatchCramDecoder *decoder, GError **err); void ipatch_cram_decoder_set_dest_file (IpatchCramDecoder *decoder, IpatchFile *dest); gboolean ipatch_cram_decoder_decode_file (IpatchCramDecoder *decoder, GError **err); gboolean ipatch_cram_decoder_decode_all (IpatchCramDecoder *decoder, const char *path, GError **err);
"comment" gchararray : Read "file-audio-md5" gchararray : Read "file-binary-md5" gchararray : Read "file-compress-size" guint64 : Read "file-date" guint : Read "file-flags" guint : Read "file-name" gchararray : Read "file-size" guint64 : Read "flags" guint : Read "read-version" guint : Read "software" gchararray : Read "version" guint : Read
An object for decoding (uncompressing) a CRAM file. The IpatchConverter interface may be a more convenient method for decoding a CRAM file.
typedef struct { char *filename; /* file name (can be contain a relative path) */ guint64 size; /* size of original file */ guint64 compress_size; /* total compressed size (incl. CRAM overhead) */ guint32 date; /* unix file timestamp or 0 if not set */ guint flags; /* per file flags */ } IpatchCramDecoderFileInfo;
IpatchCramDecoder* ipatch_cram_decoder_new (IpatchFile *cramfile);
Create a new Cram decoder instance.
cramfile : |
Source Cram file to decode or NULL to set later
|
Returns : | New Cram decoder with a refcount of 1 which the caller owns. |
void ipatch_cram_decoder_set_cram_file (IpatchCramDecoder *decoder, IpatchFile *cramfile);
Set the source Cram file object to decode from. Either passing
a cram file object to ipatch_cram_decoder_new()
or calling this function is
required before decoding can commence.
decoder : |
Cram decoder |
cramfile : |
Source Cram file object to decode from |
gboolean ipatch_cram_decoder_start (IpatchCramDecoder *decoder, GError **err);
This function loads the Cram header and gets ready for decoding.
IpatchCramDecoderFileInfo* ipatch_cram_decoder_next_file (IpatchCramDecoder *decoder, GError **err);
Start decode of next file in Cram source file. Decodes the file
header and returns the filename, original size and date
information. This function should be called until it returns NULL
which indicates no more files (or error).
ipatch_cram_decoder_set_dest_file()
and
ipatch_cram_decoder_decode_file()
can be called after this function
(provided NULL
is not returned) to decode a file at a time, if
they are not called before the next call to this function then the
current file is skipped.
See ipatch_cram_decoder_decode_all()
for an alternative decoding
method which just decodes all files to a specified path.
void ipatch_cram_decoder_set_dest_file (IpatchCramDecoder *decoder, IpatchFile *dest);
This function sets the file object to decode the current file in the
cram stream to. It can be called after ipatch_cram_decoder_next_file()
to
decode one file at a time. To extract all files in a CRAM file to a
directory call ipatch_cram_decoder_decode_all()
instead.
decoder : |
Cram decoder |
dest : |
Destination file object to decode current file to |
gboolean ipatch_cram_decoder_decode_file (IpatchCramDecoder *decoder, GError **err);
Decodes a single file from a cram stream. The
ipatch_cram_decoder_next_file()
and ipatch_cram_decoder_set_dest()
functions must be called before this, for each file in the stream.
gboolean ipatch_cram_decoder_decode_all (IpatchCramDecoder *decoder, const char *path, GError **err);
Decodes all files from a cram file to the specified path.
The ipatch_cram_decoder_start()
function must be called before this.
file-audio-md5
" property"file-audio-md5" gchararray : Read
Current file audio data MD5.
Default value: NULL
file-binary-md5
" property"file-binary-md5" gchararray : Read
Current file binary data MD5.
Default value: NULL
file-compress-size
" property"file-compress-size" guint64 : Read
Current file total compressed size.
Default value: 0
read-version
" property"read-version" guint : Read
Minimum required CRAM decoder version.
Default value: 0
software
" property"software" gchararray : Read
Software used to write the file.
Default value: NULL