-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathme_config.h
95 lines (78 loc) · 2.05 KB
/
me_config.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* Description:
* History: [email protected], 2017/03/16, create
*/
# ifndef _ME_CONFIG_H_
# define _ME_CONFIG_H_
# include <math.h>
# include <stdio.h>
# include <error.h>
# include <errno.h>
# include <ctype.h>
# include <string.h>
# include <stdlib.h>
# include <unistd.h>
# include <assert.h>
# include <inttypes.h>
# include "nw_svr.h"
# include "nw_clt.h"
# include "nw_job.h"
# include "nw_timer.h"
# include "ut_log.h"
# include "ut_sds.h"
# include "ut_cli.h"
# include "ut_misc.h"
# include "ut_list.h"
# include "ut_mysql.h"
# include "ut_signal.h"
# include "ut_define.h"
# include "ut_config.h"
# include "ut_decimal.h"
# include "ut_rpc_clt.h"
# include "ut_rpc_svr.h"
# include "ut_rpc_cmd.h"
# include "ut_skiplist.h"
# define ASSET_NAME_MAX_LEN 15
# define BUSINESS_NAME_MAX_LEN 31
# define SOURCE_MAX_LEN 31
# define ORDER_BOOK_MAX_LEN 101
# define ORDER_LIST_MAX_LEN 101
# define MAX_PENDING_OPERLOG 100
# define MAX_PENDING_HISTORY 1000
# define MAX_PENDING_MESSAGE 1000
struct asset {
char *name;
int prec_save;
int prec_show;
};
struct market {
char *name;
char *stock;
char *money;
int fee_prec;
int stock_prec;
int money_prec;
mpd_t *min_amount;
};
struct settings {
bool debug;
process_cfg process;
log_cfg log;
alert_cfg alert;
rpc_svr_cfg svr;
cli_svr_cfg cli;
mysql_cfg db_log;
mysql_cfg db_history;
size_t asset_num;
struct asset *assets;
size_t market_num;
struct market *markets;
char *brokers;
int slice_interval;
int slice_keeptime;
int history_thread;
double cache_timeout;
};
extern struct settings settings;
int init_config(const char *path);
# endif