YACDB
Yet Another C(rappy) Database
utils.h
1#ifndef UTILS_H
2#define UTILS_H
3
4#include <stdlib.h>
5#include <stdio.h>
6
7const char *SERVER_IP = "127.0.0.1";
8
9#define REPLY_SIZE 2000
10#define LINE_SIZE 100
11#define SERVER_PORT 4000
12#define DEBUG 0
13#define DEBUG_PRINT(stuff...) \
14 if (DEBUG) \
15 printf(stuff);
16
17void exit_msg(char *msg, int err)
18{
19 fprintf(stderr, "Error - %s: ", msg);
20 if (err)
21 perror(NULL);
22 exit(1);
23}
24
25#endif