From: Gilbok Lee Date: Wed, 4 Dec 2019 09:35:17 +0000 (+0900) Subject: Move private defines to radio_private.h X-Git-Tag: accepted/tizen/6.5/unified/20211028.095235^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_6.5_unified;p=platform%2Fcore%2Fapi%2Fradio.git Move private defines to radio_private.h [Version] 0.1.17 [Issue Type] move define Change-Id: I71209fd347bca5e2853dfae31f7137ee85f7b516 --- diff --git a/include/radio_private.h b/include/radio_private.h index 33ad713..573c64c 100644 --- a/include/radio_private.h +++ b/include/radio_private.h @@ -18,11 +18,41 @@ #define __TIZEN_MEDIA_RADIO_PRIVATE_H__ #include #include +#include #ifdef __cplusplus extern "C" { #endif +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "TIZEN_N_RADIO" + +/* +* Internal Macros +*/ +#define RADIO_CHECK_CONDITION(condition, error, msg) \ + do { \ + if (condition) { \ + } else { \ + LOGE("%s(0x%08x)", msg, error); \ + return error; \ + } \ + } while (0) + +#define RADIO_INSTANCE_CHECK(radio) \ + RADIO_CHECK_CONDITION(radio != NULL, RADIO_ERROR_INVALID_PARAMETER, "RADIO_ERROR_INVALID_PARAMETER") + +#define RADIO_STATE_CHECK(radio, expected_state) \ + RADIO_CHECK_CONDITION(radio->state == expected_state, RADIO_ERROR_INVALID_STATE, "RADIO_ERROR_INVALID_STATE") + +#define RADIO_NULL_ARG_CHECK(arg) \ + RADIO_CHECK_CONDITION(arg != NULL, RADIO_ERROR_INVALID_PARAMETER, "RADIO_ERROR_INVALID_PARAMETER") + +#define RADIO_SUPPORT_CHECK(arg) \ + RADIO_CHECK_CONDITION(arg != false, RADIO_ERROR_NOT_SUPPORTED, "RADIO_ERROR_NOT_SUPPORTED") + typedef enum { _RADIO_EVENT_TYPE_SCAN_INFO, _RADIO_EVENT_TYPE_SCAN_STOP, diff --git a/packaging/capi-media-radio.spec b/packaging/capi-media-radio.spec index 6ee72c1..c37e5dd 100644 --- a/packaging/capi-media-radio.spec +++ b/packaging/capi-media-radio.spec @@ -1,6 +1,6 @@ Name: capi-media-radio Summary: A Radio library in Tizen Native API -Version: 0.1.16 +Version: 0.1.17 Release: 1 Group: API/C API License: Apache-2.0 diff --git a/src/radio.c b/src/radio.c index e3c2803..1ac0dcd 100644 --- a/src/radio.c +++ b/src/radio.c @@ -19,39 +19,8 @@ #include #include #include -#include -#include #include -#ifdef LOG_TAG -#undef LOG_TAG -#endif -#define LOG_TAG "TIZEN_N_RADIO" - -/* -* Internal Macros -*/ -#define RADIO_CHECK_CONDITION(condition, error, msg) \ - do { \ - if (condition) { \ - } else { \ - LOGE("%s(0x%08x)", msg, error); \ - return error; \ - } \ - } while (0) - -#define RADIO_INSTANCE_CHECK(radio) \ - RADIO_CHECK_CONDITION(radio != NULL, RADIO_ERROR_INVALID_PARAMETER, "RADIO_ERROR_INVALID_PARAMETER") - -#define RADIO_STATE_CHECK(radio, expected_state) \ - RADIO_CHECK_CONDITION(radio->state == expected_state, RADIO_ERROR_INVALID_STATE, "RADIO_ERROR_INVALID_STATE") - -#define RADIO_NULL_ARG_CHECK(arg) \ - RADIO_CHECK_CONDITION(arg != NULL, RADIO_ERROR_INVALID_PARAMETER, "RADIO_ERROR_INVALID_PARAMETER") - -#define RADIO_SUPPORT_CHECK(arg) \ - RADIO_CHECK_CONDITION(arg != false, RADIO_ERROR_NOT_SUPPORTED, "RADIO_ERROR_NOT_SUPPORTED") - /* * Internal Implementation */