Tizen release 1.0
[pkgs/p/phone-lock.git] / phone-lock-common / include / phone-lock-util.h
1 /*
2  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved 
3  *
4  * This file is part of <phone-lock>
5  * Written by <Seungtaek Chung> <seungtaek.chung@samsung.com>, <Mi-Ju Lee> <miju52.lee@samsung.com>, <Xi Zhichan> <zhichan.xi@samsung.com>
6  *
7  * PROPRIETARY/CONFIDENTIAL
8  *
9  * This software is the confidential and proprietary information of SAMSUNG ELECTRONICS ("Confidential Information").
10  * You shall not disclose such Confidential Information and shall use it only in accordance
11  * with the terms of the license agreement you entered into with SAMSUNG ELECTRONICS.
12  * SAMSUNG make no representations or warranties about the suitability of the software,
13  * either express or implied, including but not limited to the implied warranties of merchantability,
14  * fitness for a particular purpose, or non-infringement.
15  * SAMSUNG shall not be liable for any damages suffered by licensee as a result of using,
16  * modifying or distributing this software or its derivatives.
17  *
18  */
19
20 #ifndef __PHONE_LOCK_UTIL_H__
21 #define __PHONE_LOCK_UTIL_H__
22
23 #include <dlog.h>
24 #include <Elementary.h>
25 #include <glib.h>
26
27 #ifdef  LOG_TAG
28 #undef  LOG_TAG
29 #endif
30
31 #define LOG_TAG "phone-lock"
32 #define LOGFILE "/tmp/phone-lock.log"
33
34 #define ENABLE_LOG_SYSTEM
35
36 void phone_lock_log_t(char *fmt, ...);
37
38 #ifdef ENABLE_LOG_SYSTEM
39 #define PHONE_LOCK_ERR(fmt, arg...)  LOGE("["LOG_TAG"%s:%d:E] "fmt,__FILE__,__LINE__, ##arg)
40 #define PHONE_LOCK_DBG(fmt, arg...)  LOGD("["LOG_TAG"%s:%d:D] "fmt,__FILE__,__LINE__, ##arg)
41 #define PHONE_LOCK_WARN(fmt, arg...) LOGW("["LOG_TAG"%s:%d:D] "fmt,__FILE__,__LINE__, ##arg)
42 #else
43 #define PHONE_LOCK_ERR(fmt, arg...)
44 #define PHONE_LOCK_DBG(fmt, arg...)
45 #define PHONE_LOCK_WARN(fmt, arg...)
46 #endif
47
48 #ifdef ENABLE_LOG_SYSTEM
49 #define _ERR(fmt, arg...) do { PHONE_LOCK_ERR(fmt, ##arg); phone_lock_log_t("["LOG_TAG":%d:E] "fmt,__LINE__, ##arg); } while(0)
50 #define _DBG(fmt, arg...) do { PHONE_LOCK_DBG(fmt, ##arg); phone_lock_log_t("["LOG_TAG":%d:D] "fmt,__LINE__, ##arg); } while(0)
51 #else
52 #define _ERR(...)
53 #define _DBG(...)
54 #endif
55
56 Evas_Object *phone_lock_create_win(const char *name);
57 int phone_lock_send_cmd(const char *cmd);
58 #endif                          /* __PHONE_LOCK_UTIL_H__ */