From 939e287c87519e710ad3963dc09b563acb197c1c Mon Sep 17 00:00:00 2001 From: Fufu Fang Date: Fri, 3 Sep 2021 21:39:31 +0100 Subject: [PATCH] adjusted includes --- src/cache.c | 2 +- src/cache.h | 12 +++++------- src/link.c | 3 +-- src/link.h | 33 +++------------------------------ src/main.c | 5 ++--- src/network.c | 2 +- src/network.h | 32 ++++++++++++++++++++++++++++++++ src/sonic.c | 6 +++--- src/util.c | 8 +++++--- 9 files changed, 53 insertions(+), 50 deletions(-) diff --git a/src/cache.c b/src/cache.c index f79a5ef..60c5105 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1,8 +1,8 @@ #include "cache.h" #include "config.h" -#include "util.h" #include "log.h" +#include "util.h" #include diff --git a/src/cache.h b/src/cache.h index d781eb0..5b1947b 100644 --- a/src/cache.h +++ b/src/cache.h @@ -9,16 +9,14 @@ * separate folders. */ -#include -#include -#include - -/** - * \brief cache data type - */ typedef struct Cache Cache; #include "link.h" +#include "network.h" + +#include +#include +#include /** * \brief Type definition for a cache segment diff --git a/src/link.c b/src/link.c index a571174..27dc58d 100644 --- a/src/link.c +++ b/src/link.c @@ -1,8 +1,7 @@ #include "link.h" -#include "util.h" -#include "network.h" #include "log.h" +#include "util.h" #include diff --git a/src/link.h b/src/link.h index 7b54e7e..313c5dd 100644 --- a/src/link.h +++ b/src/link.h @@ -8,11 +8,12 @@ typedef struct Link Link; typedef struct LinkTable LinkTable; -typedef struct TransferStruct TransferStruct; +#include "cache.h" #include "config.h" +#include "network.h" #include "sonic.h" -#include "cache.h" + #include /** @@ -26,34 +27,6 @@ typedef enum { LINK_UNINITIALISED_FILE = 'U' } LinkType; -/** - * \brief specify the type of data transfer - */ -typedef enum { - FILESTAT = 's', - DATA = 'd' -} TransferType; - -/** - * \brief For storing transfer data and metadata - */ -struct TransferStruct { - /** \brief The array to store the data */ - char *data; - /** \brief The current size of the array */ - size_t curr_size; - /** \brief The type of transfer being done */ - TransferType type; - /** \brief Whether transfer is in progress */ - volatile int transferring; - /** \brief The link associated with the transfer */ - Link *link; - /** \brief The minium requested size */ - size_t min_req_size; - /** \brief Whether we have sent off the minimally requested data*/ - int min_data_sent; -}; - /** * \brief link table type * \details index 0 contains the Link for the base URL diff --git a/src/main.c b/src/main.c index ebfc995..76aff8f 100644 --- a/src/main.c +++ b/src/main.c @@ -1,8 +1,7 @@ -#include "util.h" -#include "link.h" #include "fuse_local.h" -#include "network.h" +#include "link.h" #include "log.h" +#include "util.h" #include #include diff --git a/src/network.c b/src/network.c index 8e19a3b..64c0792 100644 --- a/src/network.c +++ b/src/network.c @@ -1,7 +1,7 @@ #include "network.h" -#include "util.h" #include "log.h" +#include "util.h" #include diff --git a/src/network.h b/src/network.h index 3c96729..c97dcc4 100644 --- a/src/network.h +++ b/src/network.h @@ -6,8 +6,40 @@ * \brief network related functions */ +typedef struct TransferStruct TransferStruct; + #include "link.h" +#include + +/** + * \brief specify the type of data transfer + */ +typedef enum { + FILESTAT = 's', + DATA = 'd' +} TransferType; + +/** + * \brief For storing transfer data and metadata + */ +struct TransferStruct { + /** \brief The array to store the data */ + char *data; + /** \brief The current size of the array */ + size_t curr_size; + /** \brief The type of transfer being done */ + TransferType type; + /** \brief Whether transfer is in progress */ + volatile int transferring; + /** \brief The link associated with the transfer */ + Link *link; + /** \brief The minium requested size */ + size_t min_req_size; + /** \brief Whether we have sent off the minimally requested data*/ + int min_data_sent; +}; + /** \brief HTTP response codes */ typedef enum { HTTP_OK = 200, diff --git a/src/sonic.c b/src/sonic.c index e62bcb9..144cf75 100644 --- a/src/sonic.c +++ b/src/sonic.c @@ -1,10 +1,10 @@ #include "sonic.h" #include "config.h" -#include "util.h" -#include "link.h" -#include "network.h" #include "log.h" +#include "link.h" + +#include "util.h" #include diff --git a/src/util.c b/src/util.c index bd2ea1b..be9adec 100644 --- a/src/util.c +++ b/src/util.c @@ -1,15 +1,17 @@ -#include "config.h" #include "util.h" + +#include "config.h" #include "log.h" #include #include +#include #include -#include #include #include -#include +#include + /** * \brief Backtrace buffer size