aboutsummaryrefslogtreecommitdiffstats
path: root/fmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'fmd.c')
-rw-r--r--fmd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fmd.c b/fmd.c
index d4aa647..ce08570 100644
--- a/fmd.c
+++ b/fmd.c
@@ -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);