diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c4c306118..2af57d6b7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -116,6 +116,7 @@ set (ERESSEA_SRC magic.c market.c morale.c + orderfile.c randenc.c renumber.c volcano.c diff --git a/src/orderfile.c b/src/orderfile.c new file mode 100644 index 000000000..9f044ddbe --- /dev/null +++ b/src/orderfile.c @@ -0,0 +1,30 @@ +#include "orderfile.h" + +#include +#include + +#include +#include + +#include +void read_orders(stream *strm) +{ + faction *f = NULL; + unit *u = NULL; + char line[1024]; + + line = strm->api->readln(strm->handle, line, sizeof(line)); +} + +void read_orderfile(const char *filename) +{ + stream strm; + FILE * F = fopen(filename, "r"); + if (!F) { + return; + } + fstream_init(&strm, F); + read_orders(&strm); + fstream_done(&strm); + fclose(F); +} diff --git a/src/orderfile.h b/src/orderfile.h new file mode 100644 index 000000000..11364d361 --- /dev/null +++ b/src/orderfile.h @@ -0,0 +1,18 @@ +#ifndef H_ORDERFILE +#define H_ORDERFILE + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + struct stream; + + void read_orderfile(const char *filename); + void read_orders(struct stream *strm); + +#ifdef __cplusplus +} +#endif +#endif