Add abstract app core APIs
[platform/core/appfw/app-core.git] / src / ui_base / appcore_ui_base_private.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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 #pragma once
18
19 #define LOG_TAG "APP_CORE_UI_BASE"
20
21 #include <stdio.h>
22 #include <stdbool.h>
23 #include <dlog.h>
24
25 #ifndef EXPORT_API
26 #  define EXPORT_API __attribute__ ((visibility("default")))
27 #endif
28
29 #ifndef _DLOG_H_
30 #  define _ERR(fmt, arg...) \
31         do { fprintf(stderr, "appcore: "fmt"\n", ##arg); } while (0)
32
33 #  define _INFO(fmt, arg...) \
34         do { fprintf(stdout, fmt"\n", ##arg); } while (0)
35
36 #  define _DBG(fmt, arg...) \
37         do { \
38                 if (getenv("APPCORE_DEBUG")) { \
39                         fprintf(stdout, fmt"\n", ##arg); \
40                 } \
41         } while (0)
42 #else
43 #  define _ERR(fmt, arg...) \
44         do { \
45                 fprintf(stderr, "appcore: "fmt"\n", ##arg); \
46                 LOGE(fmt, ##arg); \
47         } while (0)
48 #  define _INFO(...) LOGI(__VA_ARGS__)
49 #  define _DBG(...) LOGD(__VA_ARGS__)
50 #endif
51
52
53