-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.h
36 lines (32 loc) · 854 Bytes
/
common.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
#ifndef COMMON_H
#define COMMON_H
#define _MYSQL_USER "root"
#define _MYSQL_PASS ""
#define _MYSQL_DATABASE "fs"
#define _MYSQL_HOST "localhost"
#define _MYSQL_PORT 0
#define ACTION_CREATE 0
#define ACTION_CHMOD 1
#define ACTION_CHOWN 2
#define ACTION_RENAME 3
#define ACTION_DELETE 4
#define IS_ROOT(path) (strcmp("/",path) == 0)
#define COPY(a,b,len) bcopy(a,b,len)
#define _E(fmt,arg...) printf("ERR: %s()\t" fmt " [%s:%d]\n",__func__,##arg,__FILE__,__LINE__)
#define SAYX(rc,fmt,arg...) do { \
_E(fmt,##arg); \
clean_exit(rc); \
} while(0);
#if DEBUG >= 1
# define _D(fmt,arg...) printf("%s()\t" fmt " [%s:%d]\n",__func__,##arg,__FILE__,__LINE__)
#else
# define _D(fmt,arg...)
#endif
#ifndef min
# define min(a,b) a > b ? b : a
#endif
#ifndef max
# define max(a,b) a > b ? a : b
#endif
void clean_exit(int rc);
#endif