refactor: split monolithic modules and extract shared components
- Remove dead socket.c/socket.h (accumulated duplicate symbols) - Extract compression.h/c (data_compress/decompress from data.c) - Extract io.h/c (low-level I/O from protocol.c) - Extract metadata.h/c (unified metadata wire format from file.c, chunk.c, utils.c) - Split client.c into client_cli.c (CLI parsing) + client_send.c (send logic) - Move receiver pipeline threads from server.c to multiprocessing.c - Move to_disk/file_restore_metadata from utils.c to file.c/metadata.c - Fix const qualifiers on to_disk and str_dup signatures - Suppress chown unused-result warning
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#ifndef TRANSPORT_TCP_H
|
||||
#define TRANSPORT_TCP_H
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef struct Server {
|
||||
struct sockaddr_in address;
|
||||
unsigned int address_length;
|
||||
int file_descriptor;
|
||||
} Server;
|
||||
|
||||
typedef struct Client {
|
||||
struct sockaddr_in address;
|
||||
unsigned int address_length;
|
||||
int file_descriptor;
|
||||
pid_t ssh_child_pid;
|
||||
} Client;
|
||||
|
||||
Server *server_create(int port);
|
||||
void server_listen(Server *server, void (*handler)(int file_descriptor));
|
||||
void server_delete(Server **server);
|
||||
Client *client_create();
|
||||
void client_connect(Client *client, char *host, int port);
|
||||
void client_disconnect(Client *client);
|
||||
void client_delete(Client *client);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user