Skip to content

Commit

Permalink
adjusted includes
Browse files Browse the repository at this point in the history
  • Loading branch information
fangfufu committed Sep 3, 2021
1 parent 6819ad0 commit 939e287
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 50 deletions.
2 changes: 1 addition & 1 deletion src/cache.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "cache.h"

#include "config.h"
#include "util.h"
#include "log.h"
#include "util.h"

#include <sys/stat.h>

Expand Down
12 changes: 5 additions & 7 deletions src/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
* separate folders.
*/

#include <stdio.h>
#include <stdint.h>
#include <pthread.h>

/**
* \brief cache data type
*/
typedef struct Cache Cache;

#include "link.h"
#include "network.h"

#include <stdio.h>
#include <stdint.h>
#include <pthread.h>

/**
* \brief Type definition for a cache segment
Expand Down
3 changes: 1 addition & 2 deletions src/link.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include "link.h"

#include "util.h"
#include "network.h"
#include "log.h"
#include "util.h"

#include <gumbo.h>

Expand Down
33 changes: 3 additions & 30 deletions src/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <curl/curl.h>

/**
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
@@ -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 <getopt.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/network.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "network.h"

#include "util.h"
#include "log.h"
#include "util.h"

#include <openssl/crypto.h>

Expand Down
32 changes: 32 additions & 0 deletions src/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,40 @@
* \brief network related functions
*/

typedef struct TransferStruct TransferStruct;

#include "link.h"

#include <curl/curl.h>

/**
* \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,
Expand Down
6 changes: 3 additions & 3 deletions src/sonic.c
Original file line number Diff line number Diff line change
@@ -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 <expat.h>

Expand Down
8 changes: 5 additions & 3 deletions src/util.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#include "config.h"
#include "util.h"

#include "config.h"
#include "log.h"

#include <openssl/md5.h>
#include <uuid/uuid.h>

#include <errno.h>
#include <execinfo.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>


/**
* \brief Backtrace buffer size
Expand Down

0 comments on commit 939e287

Please sign in to comment.