Regarding the edit files:
I tend to think of the edit files as CSV+, and I think the actual parsing bits of that could be factored out relatively easily.
The only thing the parsing code really needs to know is
(or am I missing something? I'm only really familiar with the parsing code from ToME where I ripped out the *.raw generation.)
AFAICT this would also be sufficient for things like vault definitions.
Everything else could be treated as opaque strings and we'd at least get some sharing of code.
EDIT: Either that or just use a standardized human-readable format like, say, JSON or YAML. I'm sure there are libraries for C for both of those.
I tend to think of the edit files as CSV+, and I think the actual parsing bits of that could be factored out relatively easily.
The only thing the parsing code really needs to know is
- what field type signifies a new record? ('N', usually)
- what (if any) separator character is used within a record field ('|', usually) for multi-valued fields (flags)
(or am I missing something? I'm only really familiar with the parsing code from ToME where I ripped out the *.raw generation.)
AFAICT this would also be sufficient for things like vault definitions.
Everything else could be treated as opaque strings and we'd at least get some sharing of code.
EDIT: Either that or just use a standardized human-readable format like, say, JSON or YAML. I'm sure there are libraries for C for both of those.
Comment