-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.h
37 lines (32 loc) · 1.05 KB
/
utils.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
33
34
35
36
37
/* Copyright 2023 Sima Alexandru (312CA) */
#ifndef UTILS_H_
#define UTILS_H_
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
/* useful macro for handling error codes */
#define DIE(assertion, call_description) \
do { \
if (assertion) { \
fprintf(stderr, "(%s, %d): ", __FILE__, __LINE__); \
perror(call_description); \
exit(errno); \
} \
} while (0)
/**
* @brief Calculeaza hashul asociat unui server.
*
* @param a labelul serverului
*
* @return hashul calculat
*/
unsigned int hash_function_servers(void *a);
/**
* @brief Calculeaza hashul unei chei.
*
* @param a stringul reprezentand cheia
*
* @return hashul calculat
*/
unsigned int hash_function_key(void *a);
#endif /* UTILS_H_ */