diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2023-02-27 00:14:33 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2023-02-27 00:14:33 +0100 |
commit | 07e8a1deaa45098e302e5bd85d1528c5c5992233 (patch) | |
tree | a61c78e27c8ee12718edd41dfa3f6506b8e5b983 /src/metainfo.h | |
parent | flask je prepočasen => src/metainfo.c (diff) | |
download | travnik-07e8a1deaa45098e302e5bd85d1528c5c5992233.tar travnik-07e8a1deaa45098e302e5bd85d1528c5c5992233.tar.gz travnik-07e8a1deaa45098e302e5bd85d1528c5c5992233.tar.bz2 travnik-07e8a1deaa45098e302e5bd85d1528c5c5992233.tar.lz travnik-07e8a1deaa45098e302e5bd85d1528c5c5992233.tar.xz travnik-07e8a1deaa45098e302e5bd85d1528c5c5992233.tar.zst travnik-07e8a1deaa45098e302e5bd85d1528c5c5992233.zip |
Diffstat (limited to '')
-rw-r--r-- | src/metainfo.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/metainfo.h b/src/metainfo.h new file mode 100644 index 0000000..774b91a --- /dev/null +++ b/src/metainfo.h @@ -0,0 +1,37 @@ +typedef unsigned inode_length_t; +struct inode { + char * name; + size_t length; + struct inode * next; + struct inode * child; + struct inode * parent; +}; +const struct inode * next_file (const struct inode * inode); +const struct inode * next_inode (const struct inode * inode, int * paths); +enum type { + UNSPEC = 0, + V1 = 1, + V2 = 2, + HYBRID = 1 | 2 +}; +char * type_str[] = { "UNSPEC", "V1", "V2", "HYBRID" }; +struct metainfo { + struct inode * files; + struct sockaddr_in6 ip; + time_t retrieved; + time_t created; + enum type type; + unsigned char sha1[20]; + unsigned char sha256[32]; + char * name; + char * client; + char * source; + char * publisher; + char * publisher_url; + char * comment; + unsigned filecount; + inode_length_t length; +}; +void metainfo_free (struct metainfo * metainfo); +struct metainfo * parse (const char * data, off_t size); +int directory (const char * path, struct metainfo *** out); |