refactor: change project structure

This commit is contained in:
2025-10-26 17:51:41 +01:00
parent 33a12aaf73
commit 0293b0f5c0
25 changed files with 585 additions and 555 deletions

View File

@@ -1,8 +1,6 @@
#ifndef CWS_COLORS_H
#define CWS_COLORS_H
#include <stdio.h>
/* ANSI color escape sequences */
#define RED "\033[31m"
#define GREEN "\033[32m"

View File

@@ -0,0 +1,16 @@
#ifndef CWS_HASH_UTILS_H
#define CWS_HASH_UTILS_H
unsigned int my_str_hash_fn(const void *key);
bool my_str_equal_fn(const void *a, const void *b);
void my_str_free_fn(void *value);
unsigned int my_int_hash_fn(const void *key);
bool my_int_equal_fn(const void *a, const void *b);
void my_int_free_key_fn(void *key);
#endif

View File

@@ -33,13 +33,4 @@ cws_server_ret cws_fd_set_nonblocking(int sockfd);
void cws_utils_get_client_ip(struct sockaddr_storage *sa, char *ip);
/* Functions used for hash maps */
unsigned int my_str_hash_fn(const void *key);
bool my_str_equal_fn(const void *a, const void *b);
void my_str_free_fn(void *value);
unsigned int my_int_hash_fn(const void *key);
bool my_int_equal_fn(const void *a, const void *b);
void my_int_free_key_fn(void *key);
#endif

View File

@@ -1,10 +0,0 @@
#ifndef CWS_SOCKET_H
#define CWS_SOCKET_H
#include <myclib/mystring.h>
#include <sys/types.h>
ssize_t cws_read_data(int sockfd, string_s *str);
ssize_t cws_send_data(int sockfd, char *buffer, int len, int flags);
#endif