diff options
Diffstat (limited to 'other/fizzbounce/client.h')
| -rw-r--r-- | other/fizzbounce/client.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/other/fizzbounce/client.h b/other/fizzbounce/client.h new file mode 100644 index 0000000..23f8b35 --- /dev/null +++ b/other/fizzbounce/client.h | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | |||
| 2 | #include <netinet/in.h> | ||
| 3 | #include <pthread.h> | ||
| 4 | |||
| 5 | #ifndef FIZZ_CLIENT_H | ||
| 6 | #define FIZZ_CLIENT_H | ||
| 7 | |||
| 8 | typedef struct client { | ||
| 9 | pthread_t tid; /* thread id */ | ||
| 10 | pthread_mutex_t cl_mutex; /* client mutex */ | ||
| 11 | int cs; /* client socket */ | ||
| 12 | struct sockaddr_in csa; | ||
| 13 | |||
| 14 | char *connip; | ||
| 15 | unsigned short connport; | ||
| 16 | char *ircip, *ircport; | ||
| 17 | int ss; /* control connection socket to server */ | ||
| 18 | struct sockaddr_in css; /* server socket address */ | ||
| 19 | } client; | ||
| 20 | |||
| 21 | /* cl_handle | ||
| 22 | * | ||
| 23 | * thread that handles one client. once a new client connects this thread | ||
| 24 | * is started and handles anything the client wants. | ||
| 25 | * client *cl is a new client structure, which has to be initialized already | ||
| 26 | * | ||
| 27 | * returns nothing | ||
| 28 | */ | ||
| 29 | |||
| 30 | void *cl_handle (client *cl); | ||
| 31 | |||
| 32 | /* cl_add | ||
| 33 | * | ||
| 34 | * adds a new client and returns | ||
| 35 | * NULL on failure | ||
| 36 | * client * to new client if succes | ||
| 37 | */ | ||
| 38 | client *cl_add (void); | ||
| 39 | |||
| 40 | /* cl_init | ||
| 41 | * | ||
| 42 | * initializes a fresh client structure =) | ||
| 43 | */ | ||
| 44 | void cl_init (client *cl); | ||
| 45 | |||
| 46 | #endif | ||
| 47 | |||
