-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpro.h
More file actions
56 lines (43 loc) · 1.12 KB
/
cpro.h
File metadata and controls
56 lines (43 loc) · 1.12 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef __CPRO_H__
#define __CPRO_H__
#include "ast.h"
#define CPRO_MIN (60)
#define CPRO_DAY (3600 * 24)
#define READ_BUF_MAX 10240
#define xpfree(var_) \
do { \
if (var_ != NULL) \
{ \
pfree(var_); \
var_ = NULL; \
} \
} while (0)
#define xpstrdup(tgtvar_, srcvar_) \
do { \
if (srcvar_) \
tgtvar_ = pstrdup(srcvar_); \
else \
tgtvar_ = NULL; \
} while (0)
#define xstreq(tgtvar_, srcvar_) \
(((tgtvar_ == NULL) && (srcvar_ == NULL)) || \
((tgtvar_ != NULL) && (srcvar_ != NULL) && (strcmp(tgtvar_, srcvar_) == 0)))
#define PG_CONNECT_PARAMS "hostaddr=127.0.0.1 port=%d user=%s dbname=%s"
typedef struct cprodbstatSharedState
{
LWLock *lock; /* protects hashtable search/modification */
bool is_enable; /* Whether to enable the feature or not */
int cwc_snapid;
slock_t elock; /* protects the variable `is_enable` */
} cprodbstatSharedState;
typedef struct cprodbstatworkernode
{
char addr[32];
int port;
} cprodbstatworkernode;
typedef struct cprostorage
{
uint64 *cpro_arr;
int cpu_num;
} cprostorage;
#endif