Split project over multiple files

This commit is contained in:
2025-10-28 17:24:25 +01:00
parent 017c2c3428
commit c5a21608d7
24 changed files with 5145 additions and 5113 deletions
+42
View File
@@ -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