Split project over multiple files
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#ifndef CHUNK_SERVER_INCLUDED
|
||||
#define CHUNK_SERVER_INCLUDED
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include "tcp.h"
|
||||
|
||||
#define TAG_METADATA_SERVER 1
|
||||
#define TAG_CHUNK_SERVER 2
|
||||
|
||||
#define CHUNK_SERVER_RECONNECT_TIME 10000
|
||||
|
||||
typedef struct {
|
||||
char path[PATH_MAX];
|
||||
} ChunkStore;
|
||||
|
||||
typedef struct {
|
||||
Address addr;
|
||||
SHA256 hash;
|
||||
} PendingDownload;
|
||||
|
||||
typedef struct {
|
||||
int count;
|
||||
int capacity;
|
||||
PendingDownload *items;
|
||||
} PendingDownloadList;
|
||||
|
||||
typedef struct {
|
||||
Address metadata_server_addr;
|
||||
Time metadata_server_disconnect_time;
|
||||
TCP tcp;
|
||||
ChunkStore store;
|
||||
|
||||
bool downloading;
|
||||
PendingDownloadList pending_download_list;
|
||||
} ChunkServer;
|
||||
|
||||
int chunk_server_init(ChunkServer *state, int argc, char **argv);
|
||||
int chunk_server_free(ChunkServer *state);
|
||||
int chunk_server_step(ChunkServer *state);
|
||||
|
||||
#endif // CHUNK_SERVER_INCLUDED
|
||||
Reference in New Issue
Block a user