1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 #ifndef COMMON_H
4 #define COMMON_H
5 
6 #ifdef HAVE_CONFIG_H
7  #include <config.h>
8 #endif
9 
10 #include <unistd.h>
11 #include <stdlib.h>
12 #include <stdint.h>             /* uint32_t */
13 #include <sys/types.h>          /* size_t */
14 #include <errno.h>
15 #include <string.h>
16 #include <limits.h>
17 #include <stdio.h>
18 #include <utime.h>
19 
20 #include <glib.h>
21 #include <glib/gstdio.h>
22 
23 #define EMPTY_SHA1  "0000000000000000000000000000000000000000"
24 
25 #define CURRENT_ENC_VERSION 3
26 
27 #define DEFAULT_PROTO_VERSION 1
28 #define CURRENT_PROTO_VERSION 7
29 
30 #define CURRENT_REPO_VERSION 1
31 
32 /* For compatibility with the old protocol, use an UUID for signature.
33  * Listen manager on the server will use the new block tx protocol if it
34  * receives this signature as "token".
35  */
36 #define BLOCK_PROTOCOL_SIGNATURE "529319a0-577f-4d6b-a6c3-3c20f56f290c"
37 
38 #define SEAF_PATH_MAX 4096
39 
40 #ifndef ccnet_warning
41 #define ccnet_warning(fmt, ...) g_warning("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
42 #endif
43 
44 #ifndef ccnet_error
45 #define ccnet_error(fmt, ...)   g_error("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
46 #endif
47 
48 #ifndef ccnet_message
49 #define ccnet_message(fmt, ...) g_message("%s(%d): " fmt, __FILE__, __LINE__, ##__VA_ARGS__)
50 #endif
51 
52 #ifndef ccnet_debug
53 #define ccnet_debug(fmt, ...) g_debug(fmt, ##__VA_ARGS__)
54 #endif
55 
56 #define DEFAULT_CONFIG_DIR "~/.ccnet"
57 
58 #endif
59