Archived
1
0
Fork 0
This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
libg1m/src/parse/addin.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);
}