summaryrefslogblamecommitdiffstats
path: root/src/metainfo.h
blob: 774b91aff6bf8c6caf91a9503619d07316848a25 (plain) (tree)




































                                                                          
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);