extern "C" {
#endif
-__BEGIN_DECLS
-
#include <glib.h>
-extern gboolean tcore_debug;
+gboolean tcore_debug();
#ifdef FEATURE_DLOG_DEBUG
#define TCORE_LOG_TAG "UNKNOWN"
#endif
-#define info(fmt,args...) do { if(tcore_debug) RLOG(LOG_INFO, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
-#define msg(fmt,args...) do { if(tcore_debug) RLOG(LOG_DEBUG, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
-#define dbg(fmt,args...) do { if(tcore_debug) RLOG(LOG_DEBUG, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
+#define info(fmt,args...) do { if(tcore_debug()) RLOG(LOG_INFO, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
+#define msg(fmt,args...) do { if(tcore_debug()) RLOG(LOG_DEBUG, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
+#define dbg(fmt,args...) do { if(tcore_debug()) RLOG(LOG_DEBUG, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
#define warn(fmt,args...) do { RLOG(LOG_WARN, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
#define err(fmt,args...) do { RLOG(LOG_ERROR, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
#define fatal(fmt,args...) do { RLOG(LOG_FATAL, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
*/
void tcore_log(enum tcore_log_type type, enum tcore_log_priority priority, const char *tag, const char *fmt, ...);
-#define info(fmt,args...) do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
-#define msg(fmt,args...) do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
-#define dbg(fmt,args...) do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_DEBUG, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define info(fmt,args...) do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define msg(fmt,args...) do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, TCORE_LOG_TAG, fmt "\n", ##args); } while (0)
+#define dbg(fmt,args...) do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_DEBUG, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
#define warn(fmt,args...) do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_WARN, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
#define err(fmt,args...) do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_ERROR, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
#define fatal(fmt,args...) do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_FATAL, TCORE_LOG_TAG, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
-#define info_ex(tag,fmt,args...) do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
-#define msg_ex(tag,fmt,args...) do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, tag, fmt "\n", ##args); } while (0)
-#define dbg_ex(tag,fmt,args...) do { if(tcore_debug) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_DEBUG, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define info_ex(tag,fmt,args...) do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
+#define msg_ex(tag,fmt,args...) do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_INFO, tag, fmt "\n", ##args); } while (0)
+#define dbg_ex(tag,fmt,args...) do { if(tcore_debug()) tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_DEBUG, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
#define warn_ex(tag,fmt,args...) do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_WARN, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
#define err_ex(tag,fmt,args...) do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_ERROR, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
#define fatal_ex(tag,fmt,args...) do { tcore_log(TCORE_LOG_TYPE_RADIO, TCORE_LOG_FATAL, tag, "<%s:%d> " fmt "\n", __func__, __LINE__, ##args); } while (0)
#define TCORE_LOG_FUNC fprintf
#endif
-#define info(fmt,args...) do { if(tcore_debug) TCORE_LOG_FUNC(TCORE_LOG_FILE, fmt "\n", ##args); fflush(TCORE_LOG_FILE);} while (0)
-#define msg(fmt,args...) do { if(tcore_debug) TCORE_LOG_FUNC(TCORE_LOG_FILE, fmt "\n", ##args); fflush(TCORE_LOG_FILE);} while (0)
-#define dbg(fmt,args...) do { if(tcore_debug) TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_LIGHTGRAY "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);} while (0)
+#define info(fmt,args...) do { if(tcore_debug()) TCORE_LOG_FUNC(TCORE_LOG_FILE, fmt "\n", ##args); fflush(TCORE_LOG_FILE);} while (0)
+#define msg(fmt,args...) do { if(tcore_debug()) TCORE_LOG_FUNC(TCORE_LOG_FILE, fmt "\n", ##args); fflush(TCORE_LOG_FILE);} while (0)
+#define dbg(fmt,args...) do { if(tcore_debug()) TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_LIGHTGRAY "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);} while (0)
#define warn(fmt,args...) do {TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_YELLOW "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);} while (0)
#define err(fmt,args...) do {TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_LIGHTRED "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);} while (0)
#define fatal(fmt,args...) do {TCORE_LOG_FUNC(TCORE_LOG_FILE, ANSI_COLOR_LIGHTRED "<%s:%s> " ANSI_COLOR_NORMAL fmt "\n", __FILE__, __FUNCTION__, ##args); fflush(TCORE_LOG_FILE);} while (0)
#endif
-__END_DECLS
-
#ifdef __cplusplus
}
#endif
#define TAB_SPACE " "
#define MAX_BUF_SIZE 255
-gboolean tcore_debug = TRUE;
+static gboolean _tcore_debug = TRUE;
+
+gboolean tcore_debug()
+{
+ return _tcore_debug;
+}
static gboolean _find_gsm_code_exception_table(unsigned short src);
static int _get_gsm_code_size(unsigned short *src, int src_len);
unsigned short unicode;
} GsmUniTable;
-const GsmUniTable gsm_unicode2_table[] = {
+static const GsmUniTable gsm_unicode2_table[] = {
{0x14, 0x005E}, {0x28, 0x007B}, {0x29, 0x007D}, {0x2F, 0x005C},
{0x3C, 0x005B}, {0x3D, 0x007E}, {0x3E, 0x005D}, {0x40, 0x007C},
{0x65, 0x20AC}
};
-const GsmUniTable gsm_unicode_table[] = {
+static const GsmUniTable gsm_unicode_table[] = {
{0x00, 0x0040}, {0x01, 0x00A3}, {0x02, 0x0024}, {0x03, 0x00A5},
{0x04, 0x00E8}, {0x05, 0x00E9}, {0x06, 0x00F9}, {0x07, 0x00EC}, {0x08, 0x00F2},
{0x09, 0x00E7}, {0x0B, 0x00D8}, {0x0C, 0x00F8}, {0x0E, 0x00C5}, {0x0F, 0x00E5},
void tcore_util_set_log(gboolean enable)
{
- tcore_debug = enable;
+ _tcore_debug = enable;
}
gboolean tcore_util_is_country_NA(char *plmn)