Merge branch 'tizen_2.2' of ssh://review.tizendev.org:29418/apps/livebox/data-provide...
[platform/framework/web/data-provider-slave.git] / include / conf.h
1 /*
2  * Copyright 2013  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 struct conf {
18         int width;
19         int height;
20
21         int base_width;
22         int base_height;
23         double minimum_period;
24
25         struct {
26                 char *script;
27                 char *abi;
28                 char *pd_group;
29                 double period;
30         } default_conf;
31
32         struct {
33                 char *name;
34                 char *secured;
35                 char *abi;
36         } launch_key;
37
38         double default_packet_time;
39
40         char *empty_content;
41         char *empty_title;
42
43         char *default_content;
44         char *default_title;
45
46         unsigned long minimum_space;
47
48         char *replace_tag;
49
50         double slave_ttl;
51         double slave_activate_time;
52         double slave_relaunch_time;
53         int slave_relaunch_count;
54
55         int max_log_line;
56         int max_log_file;
57
58         unsigned long sqlite_flush_max;
59
60         struct {
61                 char *conf;
62                 char *image;
63                 char *script;
64                 char *root;
65                 char *script_port;
66                 char *slave_log;
67                 char *reader;
68                 char *always;
69                 char *db;
70                 char *module;
71                 char *input;
72         } path;
73
74         int max_size_type;
75
76         int slave_max_load;
77
78         double ping_time;
79
80         int use_sw_backend;
81         char *provider_method;
82         int debug_mode;
83         int overwrite_content;
84         int com_core_thread;
85         int use_xmonitor;
86 };
87
88 extern struct conf g_conf;
89
90 extern int conf_loader(void);
91
92 #define BASE_W                  g_conf.base_width
93 #define BASE_H                  g_conf.base_height
94
95 #define CR 13
96 #define LF 10
97
98 #define USE_XMONITOR            g_conf.use_xmonitor
99 #define USE_SW_BACKEND          g_conf.use_sw_backend
100 #define PROVIDER_METHOD         g_conf.provider_method
101 #define DEBUG_MODE              g_conf.debug_mode
102 #define OVERWRITE_CONTENT       g_conf.overwrite_content
103 #define COM_CORE_THREAD         g_conf.com_core_thread
104
105 #define MINIMUM_PERIOD          g_conf.minimum_period
106
107 #define DEFAULT_SCRIPT          g_conf.default_conf.script
108 #define DEFAULT_ABI             g_conf.default_conf.abi
109 #define DEFAULT_GROUP           g_conf.default_conf.pd_group
110 #define DEFAULT_PERIOD          g_conf.default_conf.period
111 #define PRIORITY_NO_CHANGE      -1.0f
112
113 #define BUNDLE_SLAVE_NAME       g_conf.launch_key.name
114 #define BUNDLE_SLAVE_SECURED    g_conf.launch_key.secured
115 #define BUNDLE_SLAVE_ABI        g_conf.launch_key.abi
116 #define PACKET_TIME             g_conf.default_packet_time
117 #define CONTENT_NO_CHANGE       g_conf.empty_content
118 #define TITLE_NO_CHANGE         g_conf.empty_title
119 #define DEFAULT_TITLE           g_conf.default_title
120 #define DEFAULT_CONTENT         g_conf.default_content
121 #define MINIMUM_SPACE           g_conf.minimum_space
122
123 #define IMAGE_PATH              g_conf.path.image
124 #define SCRIPT_PATH             g_conf.path.script
125 #define SCRIPT_PORT_PATH        g_conf.path.script_port
126 #define CONF_PATH               g_conf.path.conf
127 #define ROOT_PATH               g_conf.path.root
128 #define SLAVE_LOG_PATH          g_conf.path.slave_log
129 #define READER_PATH             g_conf.path.reader
130 #define ALWAYS_PATH             g_conf.path.always
131 #define MODULE_PATH             g_conf.path.module
132 #define INPUT_PATH              g_conf.path.input
133
134 #define REPLACE_TAG_APPID       g_conf.replace_tag
135 #define SLAVE_TTL               g_conf.slave_ttl
136 #define SLAVE_ACTIVATE_TIME     g_conf.slave_activate_time
137 #define SLAVE_RELAUNCH_TIME     g_conf.slave_relaunch_time
138 #define SLAVE_RELAUNCH_COUNT    g_conf.slave_relaunch_count
139
140 #define MAX_LOG_LINE            g_conf.max_log_line
141 #define MAX_LOG_FILE            g_conf.max_log_file
142
143 #define SQLITE_FLUSH_MAX        g_conf.sqlite_flush_max
144 #define DBFILE                  g_conf.path.db
145
146 #define SLAVE_MAX_LOAD          g_conf.slave_max_load
147 #define DEFAULT_PING_TIME       g_conf.ping_time
148
149 #define MAX_ABI         256
150 #define MAX_PKGNAME     512
151 #define DELAY_TIME      0.0000001f
152 #define DEFAULT_CLUSTER "user,created"
153 #define MINIMUM_REACTIVATION_TIME       10
154
155 #define HAPI __attribute__((visibility("hidden")))
156
157 /* Set language */
158 #if !defined(LOCALEDIR)
159 #define LOCALEDIR "/usr/share/locale"
160 #endif
161
162 /* Set language */
163 #if !defined(PACKAGE)
164 #define PACKAGE "data-provider-slave"
165 #endif
166
167 #define DATA_MASTER "data-provider-master"
168
169 #define DEFAULT_LIFE_TIMER      20
170 #define DEFAULT_LOAD_TIMER      20
171 #define MINIMUM_UPDATE_INTERVAL 0.1f
172
173 /*!
174  * \note
175  * NO_ALARM is used for disabling the alarm code
176  * This will turn off the alarm for checking the return of livebox functions
177  */
178 #define NO_ALARM 1
179
180 /*!
181  * \note
182  * This is default action.
183  * This will enable the 'alarm' for checking the return time of livebox functions
184  */
185 #define USE_ALARM 0
186
187 //#define DLAPI __attribute__((visibility("default")))
188
189 /* End of a file */