42 lines
1.5 KiB
C
42 lines
1.5 KiB
C
/* ************************************************************************** */
|
|
/* _____ _ */
|
|
/* parse/addin.c |_ _|__ _ _| |__ ___ _ _ */
|
|
/* | Project: libg1m | |/ _ \| | | | '_ \ / _ \ | | | */
|
|
/* | | (_) | |_| | | | | __/ |_| | */
|
|
/* By: thomas <thomas@touhey.fr> |_|\___/ \__,_|_| |_|\___|\__, |.fr */
|
|
/* Last updated: 2016/11/02 14:47:49 |___/ */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
#include <libg1m/internals.h>
|
|
|
|
/**
|
|
* g1m_parse_addin:
|
|
* Parse "normal" add-in (after Standard Header).
|
|
*
|
|
* @arg handle the handle.
|
|
* @arg stream the stream to parse from.
|
|
* @return the error code (0 if ok).
|
|
*/
|
|
|
|
int g1m_parse_addin(g1m_t *handle, FILE *stream)
|
|
{
|
|
/* get the subheader */
|
|
DREAD(hd, g1a_subheader)
|
|
|
|
/* correct subheader endianess */
|
|
hd.filesize = be32toh(hd.filesize);
|
|
|
|
/* log info about the subheader */
|
|
log_info("internal name is '%.8s'", hd.internal_name);
|
|
log_info("estrips count is %hhu", hd.estrips_count);
|
|
log_info("version is %.10s", hd.version);
|
|
log_info("creation date is %.14s", hd.creation_date);
|
|
|
|
/* skip size */
|
|
SKIP(hd.filesize - sizeof(struct standard_header)
|
|
- sizeof(struct g1a_subheader))
|
|
|
|
/* no errors */
|
|
return (0);
|
|
}
|