diff --git a/include/chat/misc.h b/include/chat/misc.h index 3436508..2eec6a5 100644 --- a/include/chat/misc.h +++ b/include/chat/misc.h @@ -19,9 +19,9 @@ along with this program. If not, see . #ifndef WHY2_CHAT_MISC_H #define WHY2_CHAT_MISC_H -void send_socket(char *text, int socket); //send socket.... wtf did you expect -char *read_socket(int socket); //read lol -void *communicate_thread(void *arg); //COMMUNICATION THREAD -void register_connection(int socket); //ADD SOCKET TO LIST +void why2_send_socket(char *text, int socket); //send socket.... wtf did you expect +char *why2_read_socket(int socket); //read lol +void *why2_communicate_thread(void *arg); //COMMUNICATION THREAD +void why2_register_connection(int socket); //ADD SOCKET TO LIST #endif \ No newline at end of file diff --git a/src/chat/main/client.c b/src/chat/main/client.c index b739f97..e98eb3a 100644 --- a/src/chat/main/client.c +++ b/src/chat/main/client.c @@ -52,7 +52,7 @@ int main(void) printf("%s\n", line); - send_socket(line, listen_socket); + why2_send_socket(line, listen_socket); if (strcmp(line, "!exit\n") == 0) //USER REQUESTED PROGRAM EXIT { diff --git a/src/chat/main/server.c b/src/chat/main/server.c index 2cab26e..051d092 100644 --- a/src/chat/main/server.c +++ b/src/chat/main/server.c @@ -47,7 +47,7 @@ int main(void) if (accepted == -1) continue; - pthread_create(&thread, NULL, communicate_thread, &accepted); + pthread_create(&thread, NULL, why2_communicate_thread, &accepted); } return 0; diff --git a/src/chat/misc.c b/src/chat/misc.c index e0ee458..ec78bc2 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -107,7 +107,7 @@ node_t *get_node(int connection) } //GLOBAL -void send_socket(char *text, int socket) +void why2_send_socket(char *text, int socket) { unsigned short text_length = (unsigned short) strlen(text); char *final = why2_calloc(strlen(text) + 2, sizeof(char)); @@ -127,7 +127,7 @@ void send_socket(char *text, int socket) why2_deallocate(final); } -void *communicate_thread(void *arg) +void *why2_communicate_thread(void *arg) { printf("User connected.\t%d\n", *((int*) arg)); @@ -136,7 +136,7 @@ void *communicate_thread(void *arg) while (time(NULL) - startTime < 86400) //KEEP COMMUNICATION ALIVE FOR 24 HOURS { - received = read_socket(*((int*) arg)); //READ + received = why2_read_socket(*((int*) arg)); //READ if (received == NULL) return NULL; //FAILED; EXIT THREAD @@ -156,7 +156,7 @@ void *communicate_thread(void *arg) return NULL; } -char *read_socket(int socket) +char *why2_read_socket(int socket) { if (socket == -1) { @@ -183,7 +183,7 @@ char *read_socket(int socket) return content_buffer; } -void register_connection(int socket) +void why2_register_connection(int socket) { - push_to_list(socket); //PUSH + push_to_list(socket); //SEND } \ No newline at end of file