-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.h
More file actions
38 lines (29 loc) · 880 Bytes
/
helpers.h
File metadata and controls
38 lines (29 loc) · 880 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
#ifndef _HELPERS_H
#define _HELPERS_H 1
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
/*
* Macro de verificare a erorilor
* Exemplu:
* int fd = open(file_name, O_RDONLY);
* DIE(fd == -1, "open failed");
*/
#define DIE(assertion, call_description) \
do { \
if (assertion) { \
fprintf(stderr, "(%s, %d): ", \
__FILE__, __LINE__); \
perror(call_description); \
exit(EXIT_FAILURE); \
} \
} while(0)
#define BUFLEN 50000 // dimensiunea maxima a calupului de date
#define MAX_CLIENTS 100 // numarul maxim de clienti in asteptare
void displayMainMenu() {
std::cout << "|| 1. Enter the chat ||" << std::endl;
std::cout << "|| 2. Display active users ||" << std::endl;
std::cout << "|| 3. Send private message ||" << std::endl;
std::cout << "|| 4. Play a game ||" << std::endl;
}
#endif