X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/copy_structured?a=blobdiff_plain;f=src%2Fserver%2Fio.h;h=9c7de70ec384332e82b23d9b2c9c8dc0ac3e9fb2;hb=784a54c9ef27aa2bf0754b2761aee06cbbde270e;hp=02f8e9017d2dadc7c2bc6b6581f6b8a3f0d4193c;hpb=e1cdb7bd32c3622659a56a2ecc5c883fda0c92b7;p=plomrogue diff --git a/src/server/io.h b/src/server/io.h index 02f8e90..9c7de70 100644 --- a/src/server/io.h +++ b/src/server/io.h @@ -7,8 +7,28 @@ #ifndef IO_H #define IO_H +#include /* size_t */ +#include /* uint8_t, uint32_t */ +#include /* FILE */ +#include "cleanup.h" /* enum cleanup_flag */ + +/* Wrapper to reading in config files from "path" for DB entries of "size + * starting at "entry_start", to be unset by "cleanup" and reading in individual + * entry data line by line via "read"(). Assumes all entries start with the + * items collected in the EntrySkeleton struct. + */ +struct EntrySkeleton +{ + uint8_t id; + struct EntrySkeleton * next; +}; +extern void read_config_file(char * path, enum cleanup_flag cleanup, + size_t size, struct EntrySkeleton ** entry_start, + void (* read) (char *, uint32_t, char *, + struct EntrySkeleton *, FILE *)); + /* Return single \0-terminated string read from input queue (world.queue); or, * if queue is empty and world.turn is unequal world.last_update_turn, update * world state file at world.path_worldstate (and update world.last_update_turn