-
Notifications
You must be signed in to change notification settings - Fork 0
/
sys_ops.h
32 lines (28 loc) · 819 Bytes
/
sys_ops.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef OPS_HEAD
#define OPS_HEAD
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "game.h"
#define CONN_LIMIT 10
extern int user_count;
extern int comb_count;
extern int num_requests;
extern request *requests;
extern pthread_cond_t got_request;
extern int connfd[CONN_LIMIT];
void malloc_users_passwords(char ***, char ***);
void malloc_combinations(char ***);
void malloc_leaderboard(lb **);
void free_memory_users_passwords(char ***, char ***);
void free_memory_combinations(char ***);
void setup_threadpool(pthread_t *, int *, int);
void destroy_threadpool(pthread_t *, int *, int);
void* game_requests_loop(void *);
void add_request(request *);
request* get_request();
void initialise_leaderboard(char ***);
void close_connections();
void clear_pending_requests();
#endif