diff options
Diffstat (limited to 'fmd.c')
-rw-r--r-- | fmd.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -13,12 +13,14 @@ static const char *MAGIC = "FMD002\r\n"; +// checkmagic: check the fmd magic number static void checkmagic(FILE *f) { for (size_t i = 0; i < strlen(MAGIC); i++) assert(fgetc(f) == MAGIC[i]); } +// betoul: read big endian 32 bit unsigned integer static inline unsigned long betoul(FILE *src) { unsigned long ret = 0; @@ -34,6 +36,7 @@ static inline unsigned long betoul(FILE *src) return ret; } +// readfloats: read ieee754 32 bit floating point numbers void readfloats(float *dest, int count, FILE *src) { assert(dest != NULL); @@ -43,6 +46,7 @@ void readfloats(float *dest, int count, FILE *src) dest[i] = ieee754f(betoul(src)); } +// fmd_load: read a FMD file void fmd_load(struct fmd *fmd, FILE *f) { assert(fmd != NULL); @@ -102,6 +106,7 @@ void fmd_load(struct fmd *fmd, FILE *f) } } +// fmd_free: free a previously loaded FMD file void fmd_free(struct fmd *fmd) { assert(fmd); |