00001 00005 #include <unistd.h> //for close(), write(), read(), fstat(), 00006 #include <stdio.h> //for fprintf(), perror(), snprintf(), 00007 #include <stdlib.h> //for exit(), atoi(), 00008 #include <string.h> //for strlen(),strcpy() 00009 #include <strings.h> //for bzero(), 00010 #include <sys/socket.h> //for socket(), bind(), listen(), accept(), 00011 #include <sys/types.h> //for socket(), bind(), accpet(), fstat(), open() 00012 #include <netinet/in.h> //for struct sockaddr_in, 00013 #include <time.h> //for time(), time_t, 00014 #include <signal.h> //for sigaction(), 00015 #include <sys/select.h> //for select(), 00016 #include <fcntl.h> //for open(), 00017 #include <sys/time.h> //for time(), 00018 #include <arpa/inet.h> //for inet_ntoa(), 00019 #include <pthread.h> //for pthread_create(), pthread_exit() 00020 #include <gtk/gtk.h> //for all GTK functions.. 00021 00022 #define BUFFER 4096 00023 #define DATASIZE 100 00029 struct client_data{ 00030 int fd; 00031 char nick[DATASIZE]; 00032 char ip[DATASIZE]; 00033 }; 00034 00041 struct transmit_unit{ 00042 char nick[DATASIZE]; 00043 char time[DATASIZE]; 00044 char ip[DATASIZE]; 00045 char msg[BUFFER]; 00046 }; 00047 00048 GtkWidget *entry; 00049 GtkWidget *entry_ipaddress; 00050 GtkWidget *entry_nick; 00051 GtkWidget *entry_port; 00052 GtkTextBuffer *buffer; 00053 GtkTextIter iter; 00054 GtkListStore *list_store; 00055 GtkTreeIter t_iter; 00057 int socket_file_descriptor; 00058 char msg[BUFFER]; 00059 char nick[BUFFER]; 00060 char ip[BUFFER];