Reorganize header so download stuff is at the end
authorJonathan Dieter <jdieter@gmail.com>
Mon, 16 Apr 2018 09:42:52 +0000 (12:42 +0300)
committerJonathan Dieter <jdieter@gmail.com>
Mon, 16 Apr 2018 09:42:52 +0000 (12:42 +0300)
Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
include/zck.h

index 82f311b64ca356a3d12a95a35ed6e013b74dfa92..673bf25e34dc944c4d624a2cb03ba49493257cc4 100644 (file)
@@ -40,6 +40,8 @@ typedef enum zck_log_type {
     ZCK_LOG_ERROR
 } zck_log_type;
 
+typedef struct zckCtx zckCtx;
+typedef struct zckHash zckHash;
 
 /* Contains an index item pointing to a chunk */
 typedef struct zckIndexItem {
@@ -61,38 +63,6 @@ typedef struct zckIndex {
     zckIndexItem *first;
 } zckIndex;
 
-/* Contains a single range */
-typedef struct zckRangeItem {
-    size_t start;
-    size_t end;
-    struct zckRangeItem *next;
-    struct zckRangeItem *prev;
-} zckRangeItem;
-
-/* Contains a series of ranges, information about them, a link to the first
- * range item, and an index describing what information is in the ranges */
-typedef struct zckRange {
-    unsigned int count;
-    unsigned int segments;
-    unsigned int max_ranges;
-    zckRangeItem *first;
-    zckIndex index;
-} zckRange;
-
-typedef struct zckDLPriv zckDLPriv;
-typedef struct zckCtx zckCtx;
-typedef struct zckHash zckHash;
-
-/* Contains a zchunk download context */
-typedef struct zckDL {
-    size_t dl;
-    size_t ul;
-    int dst_fd;
-    char *boundary;
-    zckRange info;
-    zckDLPriv *priv;
-    struct zckCtx *zck;
-} zckDL;
 
 /*******************************************************************
  * Reading a zchunk file
@@ -220,6 +190,40 @@ const char *zck_hash_name_from_type(int hash_type);
 int zck_hash_check_data(zckCtx *zck, int dst_fd);
 
 
+/*******************************************************************
+ * Downloading (should this go in a separate header and library?)
+ *******************************************************************/
+/* Contains a single range */
+typedef struct zckRangeItem {
+    size_t start;
+    size_t end;
+    struct zckRangeItem *next;
+    struct zckRangeItem *prev;
+} zckRangeItem;
+
+/* Contains a series of ranges, information about them, a link to the first
+ * range item, and an index describing what information is in the ranges */
+typedef struct zckRange {
+    unsigned int count;
+    unsigned int segments;
+    unsigned int max_ranges;
+    zckRangeItem *first;
+    zckIndex index;
+} zckRange;
+
+typedef struct zckDLPriv zckDLPriv;
+
+/* Contains a zchunk download context */
+typedef struct zckDL {
+    size_t dl;
+    size_t ul;
+    int dst_fd;
+    char *boundary;
+    zckRange info;
+    zckDLPriv *priv;
+    struct zckCtx *zck;
+} zckDL;
+
 /*******************************************************************
  * Ranges
  *******************************************************************/
@@ -237,7 +241,7 @@ void zck_range_close(zckRange *info);
 
 
 /*******************************************************************
- * Downloading (should this go in a separate header and library?)
+ * Downloading
  *******************************************************************/
 /* Initialize curl stuff, should be run at beginning of any program using any
  * following functions */