diff options
| author | Louis Burda <quent.burda@gmail.com> | 2021-04-29 17:54:54 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2021-04-29 17:54:54 +0200 |
| commit | a50aacd30adb87698eb775ef5c7615c65e57a11d (patch) | |
| tree | 6088cc031eb204c7c1e75a49cf92aef003557433 /service/src/stlfile.h | |
| parent | 008b5f74235a7fd04852e6f640429269f1ec4845 (diff) | |
| download | enowars5-service-stldoctor-a50aacd30adb87698eb775ef5c7615c65e57a11d.tar.gz enowars5-service-stldoctor-a50aacd30adb87698eb775ef5c7615c65e57a11d.zip | |
very basic binary file parsing and skeleton for state-machine based parsing of ascii format
Diffstat (limited to 'service/src/stlfile.h')
| -rw-r--r-- | service/src/stlfile.h | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/service/src/stlfile.h b/service/src/stlfile.h index 424b61b..00cf28d 100644 --- a/service/src/stlfile.h +++ b/service/src/stlfile.h @@ -3,14 +3,36 @@ #include <stdlib.h> #include <string.h> +#include <stdint.h> +#include <endian.h> + +enum { + KW_SOLID_BEGIN, + KW_SOLID_END, + KW_FACET, + KW_OUTER, + KW_VERTEX +}; + +enum { + TYPE_ASCII, + TYPE_BIN +}; + +struct stack { + int *data; + size_t count, cap; +}; struct parseinfo { char fmtbuf[256]; - int attrs; + char header[80]; + int type, valid; + unsigned int loopcount; + float bbw, bbh; char *namehash, *infopath, *stlpath; }; -struct parseinfo* parse_file(char *buf, size_t len); -void free_parseinfo(struct parseinfo *info); +int parse_file(struct parseinfo *info, char *buf, size_t len); -#endif // STLFILE_H +#endif /* STLFILE_H */ |
