-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.h
More file actions
52 lines (40 loc) · 822 Bytes
/
interface.h
File metadata and controls
52 lines (40 loc) · 822 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __INTERFACE_H
#define __INTERFACE_H
#include <time.h>
#include "protocol.h"
#include <netinet/in.h>
struct args_t
{
char id[XTYPE_ID_LENGTH];
int socket_domain;
int socket_type;
int socket_protocol;
struct sockaddr_storage socket_address;
};
extern struct args_t args;
struct player_info
{
char id[XTYPE_ID_LENGTH];
uint32_t position;
};
#define XTYPE_GAME_WAITING 0
#define XTYPE_GAME_RUNNING 1
#define XTYPE_GAME_END 2
#define XTYPE_GAME_READY 3
struct ifinfo_t
{
uint8_t game_state;
uint32_t file_size;
char *text_buffer;
uint32_t offset_buffer;
uint32_t position;
uint32_t text_size;
struct player_info infos[XTYPE_MAX_PLAYERS];
int infos_count;
time_t duration;
int me_ready;
} ifinfo;
extern struct ifinfo_t ifinfo;
int get_window_width ();
void draw ();
#endif