diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2022-06-06 22:03:57 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2022-06-08 20:06:12 +0200 |
commit | d5d61d18c89af3f6743b7c56774eebdfdcc87b2c (patch) | |
tree | b4299c1af7e194e9083d4de1bce382102ea46e95 /src/toast.h | |
download | OFQT-d5d61d18c89af3f6743b7c56774eebdfdcc87b2c.tar.gz OFQT-d5d61d18c89af3f6743b7c56774eebdfdcc87b2c.zip |
Release 0.1.00.1.0
Diffstat (limited to 'src/toast.h')
-rw-r--r-- | src/toast.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/toast.h b/src/toast.h new file mode 100644 index 0000000..5a99fbb --- /dev/null +++ b/src/toast.h @@ -0,0 +1,51 @@ +#ifndef TOAST_H +#define TOAST_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <stddef.h> + +enum TYPE_ENUM { + TYPE_WRITE = 0, + TYPE_MKDIR = 1, + TYPE_DELETE = 2, +}; + +extern const char* TYPE_STRINGS[]; + +struct file_info { + enum TYPE_ENUM type; + char* path; + char* hash; + char* object; +}; + +struct revision_t { + struct file_info* files; + size_t file_count; +}; + +char* getToastDir(char* dir); +int getLatestRemoteRevision(char*); +int getLocalRevision(char*); +void setLocalRevision(char*, int); +char* getLocalRemote(char*); +void setLocalRemote(char*, char*); + +struct revision_t* getRevisionData(char*, int); +struct revision_t* fastFowardRevisions(char* url, int from, int to); +void freeRevision(struct revision_t* rev); + +size_t downloadObject(char*, char*, struct file_info*); +int applyObject(char*, struct file_info*); +void removeObjects(char*); + +int verifyFileHash(char*, struct file_info*); + +#ifdef __cplusplus +} +#endif + +#endif
\ No newline at end of file |