> writetostore(outfile, fr->p1, TMRI_PARAMREC);
Probably because TMRI_PARAMREC is your typedef struct, not an enum
> getnextchunk(p, file, TYPE_PARAMREC);
This appears to be correct use of the enum.
Oh and all your realloc calls are poor.
Never do p = realloc( p, size );
Always assign to a temp pointer first.
That's some f-ugly code there - those functions are way too long.
Next time, add a comment to the code along the lines of
/* This line generates the foo error message */
Also, try compiling more often than once a day, or however long it took you to type in that code.