/* These defines must be located before #include <dlog.h> */
#define TIZEN_ENGINEER_MODE
-// TODO: Investigate why this macro is defined somewhere else
+/* TODO: Investigate why this macro is defined somewhere else */
#ifndef TIZEN_DEBUG_ENABLE
#define TIZEN_DEBUG_ENABLE
#endif
* @param[out] val Value to be returned when expression is true
*/
#define auth_adaptor_retv_if(expr, val) do { \
- if(expr) { \
- LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, auth_adaptor_gettid()); \
- return (val); \
- } \
- } while (0)
+ if (expr) { \
+ LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, auth_adaptor_gettid()); \
+ return (val); \
+ } \
+ } while (0)
/**
* @brief Prints debug messages
* @param[in] args Arguments to be displayed
*/
#define auth_adaptor_debug(fmt, arg...) do { \
- LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, auth_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, auth_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints info messages
* @param[in] args Arguments to be displayed
*/
#define auth_adaptor_info(fmt, arg...) do { \
- LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, auth_adaptor_gettid() ,##arg); \
- } while (0)
+ LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, auth_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints warning messages
* @param[in] args Arguments to be displayed
*/
#define auth_adaptor_warning(fmt, arg...) do { \
- LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET,auth_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET, auth_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints error messages
* @param[in] args Arguments to be displayed
*/
#define auth_adaptor_error(fmt, arg...) do { \
- LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET,auth_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET, auth_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints fatal messages
* @param[in] args Arguments to be displayed
*/
#define auth_adaptor_fatal(fmt, arg...) do { \
- LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET,auth_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET, auth_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints debug message on entry to particular function
* @param[in] args Arguments to be displayed
*/
#define auth_adaptor_debug_func(fmt, arg...) do { \
- LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, auth_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, auth_adaptor_gettid(), ##arg); \
+ } while (0)
#define plugin_req_enter() do { \
auth_adaptor_info("[ENTER] plugin API call -)) -)) -)) -)) -)) -)) -)) -)) -)) -))"); \
/**
* @brief Enumerations of error code for Auth Adaptor
*/
-typedef enum auth_error_code_e
-{
+typedef enum auth_error_code_e {
AUTH_ADAPTOR_ERROR_NONE = 0,
AUTH_ADAPTOR_ERROR_LAUNCH = 1, /**< 1 ~ 99: internal error*/
AUTH_ADAPTOR_ERROR_INIT = 2,
/**
* @brief Enumerations of error code for Auth Plugin Internal Error
*/
-typedef enum _auth_plugin_internal_error_code_e
-{
- AUTH_PLUGIN_ERROR_HTTP_BAD_REQUEST = 400,
- AUTH_PLUGIN_ERROR_HTTP_UNAUTHORIZED = 401,
- AUTH_PLUGIN_ERROR_HTTP_FORBIDDEN = 403,
- AUTH_PLUGIN_ERROR_HTTP_NOT_FOUND = 404,
- AUTH_PLUGIN_ERROR_HTTP_METHOD_NOT_ALLOWED = 405,
- AUTH_PLUGIN_ERROR_HTTP_BAD_GATEWAY = 502,
- AUTH_PLUGIN_ERROR_HTTP_SERVICE_UNAVAILBLE = 503,
- AUTH_PLUGIN_ERROR_HTTP_INSUFFICIENT_AUTH = 507,
- AUTH_PLUGIN_ERROR_HTTP_ETC = 598,
- AUTH_PLUGIN_ERROR_HTTP_UNKNOWN = 599,
-
- AUTH_PLUGIN_ERROR_CURL_COULDNT_CONNECT = 601,
- AUTH_PLUGIN_ERROR_CURL_TIMEOUT = 602,
- AUTH_PLUGIN_ERROR_CURL_ETC = 698,
- AUTH_PLUGIN_ERROR_CURL_UNKNOWN = 699,
-
- AUTH_PLUGIN_ERROR_FILE_OPEN_FAILED = 701,
- AUTH_PLUGIN_ERROR_FILE_NOT_EXIST = 702,
- AUTH_PLUGIN_ERROR_FILE_ETC = 798,
- AUTH_PLUGIN_ERROR_FILE_UNKNOWN = 799,
-
- AUTH_PLUGIN_ERROR_MEMORY_ALLOCATION_FAILED = 801,
- AUTH_PLUGIN_ERROR_MEMORY_ETC = 898,
- AUTH_PLUGIN_ERROR_MEMORY_UNKNOWN = 899,
-
- AUTH_PLUGIN_ERROR_THREAD_CREATE_FAILED = 901,
- AUTH_PLUGIN_ERROR_THREAD_STOPPED = 902,
- AUTH_PLUGIN_ERROR_THREAD_ETC = 908,
- AUTH_PLUGIN_ERROR_THREAD_UNNOWN = 909,
+typedef enum _auth_plugin_internal_error_code_e {
+ AUTH_PLUGIN_ERROR_HTTP_BAD_REQUEST = 400,
+ AUTH_PLUGIN_ERROR_HTTP_UNAUTHORIZED = 401,
+ AUTH_PLUGIN_ERROR_HTTP_FORBIDDEN = 403,
+ AUTH_PLUGIN_ERROR_HTTP_NOT_FOUND = 404,
+ AUTH_PLUGIN_ERROR_HTTP_METHOD_NOT_ALLOWED = 405,
+ AUTH_PLUGIN_ERROR_HTTP_BAD_GATEWAY = 502,
+ AUTH_PLUGIN_ERROR_HTTP_SERVICE_UNAVAILBLE = 503,
+ AUTH_PLUGIN_ERROR_HTTP_INSUFFICIENT_AUTH = 507,
+ AUTH_PLUGIN_ERROR_HTTP_ETC = 598,
+ AUTH_PLUGIN_ERROR_HTTP_UNKNOWN = 599,
+
+ AUTH_PLUGIN_ERROR_CURL_COULDNT_CONNECT = 601,
+ AUTH_PLUGIN_ERROR_CURL_TIMEOUT = 602,
+ AUTH_PLUGIN_ERROR_CURL_ETC = 698,
+ AUTH_PLUGIN_ERROR_CURL_UNKNOWN = 699,
+
+ AUTH_PLUGIN_ERROR_FILE_OPEN_FAILED = 701,
+ AUTH_PLUGIN_ERROR_FILE_NOT_EXIST = 702,
+ AUTH_PLUGIN_ERROR_FILE_ETC = 798,
+ AUTH_PLUGIN_ERROR_FILE_UNKNOWN = 799,
+
+ AUTH_PLUGIN_ERROR_MEMORY_ALLOCATION_FAILED = 801,
+ AUTH_PLUGIN_ERROR_MEMORY_ETC = 898,
+ AUTH_PLUGIN_ERROR_MEMORY_UNKNOWN = 899,
+
+ AUTH_PLUGIN_ERROR_THREAD_CREATE_FAILED = 901,
+ AUTH_PLUGIN_ERROR_THREAD_STOPPED = 902,
+ AUTH_PLUGIN_ERROR_THREAD_ETC = 908,
+ AUTH_PLUGIN_ERROR_THREAD_UNNOWN = 909,
AUTH_PLUGIN_ERROR_CALLBACK_TIME_OUT = 997,
- AUTH_PLUGIN_ERROR_ETC = 998,
- AUTH_PLUGIN_ERROR_UNKNOWN = 999,
-}auth_plugin_internal_error_code_e;
+ AUTH_PLUGIN_ERROR_ETC = 998,
+ AUTH_PLUGIN_ERROR_UNKNOWN = 999,
+} auth_plugin_internal_error_code_e;
/**
* @brief The handle for Auth Plugin
/**
* @brief Describes infromation about Plugin Context
*/
-typedef struct auth_adaptor_plugin_context_s
-{
- // Context variables
+typedef struct auth_adaptor_plugin_context_s {
+ /* Context variables */
int context_id;
auth_adaptor_plugin_h plugin_handle;
- // User define (input by service-adaptor)
- char *user_id;
- char *user_password;
- char *app_id;
- char *app_secret;
+ /* User define (input by service-adaptor) */
+ char *user_id;
+ char *user_password;
+ char *app_id;
+ char *app_secret;
char *service_name;
- // Plugin define (input by plugin)
- char *plugin_uri; // mandatory (package id)
- void *plugin_data; // optional
+ /* Plugin define (input by plugin) */
+ char *plugin_uri; /* mandatory (package id) */
+ void *plugin_data; /* optional */
- // Plugin define (input by server response after autholization)
- char *access_token;
+ /* Plugin define (input by server response after autholization) */
+ char *access_token;
char *refresh_token;
char *uid;
- // For product feature
+ /* For product feature */
char *msisdn;
char *imsi;
- char *plugin_name;
-// char *cluster_name;
+ char *plugin_name;
+ /* char *cluster_name; */
} auth_adaptor_plugin_context_t;
typedef struct auth_adaptor_plugin_context_s *auth_adaptor_plugin_context_h;
/**
* @brief Describes infromation about error code from plugin internal
*/
-typedef struct auth_adaptor_error_code_s
-{
- int64_t code;
- char *msg;
+typedef struct auth_adaptor_error_code_s {
+ int64_t code;
+ char *msg;
} auth_adaptor_error_code_t;
/**
* @brief The handle for error code
/**
* @brief Describes infromation about Plugin Handle
*/
-typedef struct auth_adaptor_plugin_handle_s
-{
- // Mandatory functions to handle plugin in adaptor
+typedef struct auth_adaptor_plugin_handle_s {
+ /* Mandatory functions to handle plugin in adaptor */
auth_error_code_t (*create_context)(auth_adaptor_plugin_context_h *context,
const char *user_id,
const char *user_password,
auth_error_code_t (*destroy_handle)(struct auth_adaptor_plugin_handle_s *handle);
auth_error_code_t (*set_listener)(auth_adaptor_plugin_listener_h listener);
auth_error_code_t (*unset_listener)(void);
- // Mandatory end
+ /* Mandatory end */
- // Optional
- auth_error_code_t (*is_auth)(auth_adaptor_plugin_context_h context,
+ /* Optional */
+ auth_error_code_t (*is_auth)(auth_adaptor_plugin_context_h context,
void *request,
int *is_auth,
auth_adaptor_error_code_h *error,
void *response);
- auth_error_code_t (*join)(auth_adaptor_plugin_context_h context,
+ auth_error_code_t (*join)(auth_adaptor_plugin_context_h context,
const char *device_id,
void *request,
auth_adaptor_error_code_h *error,
void *response);
- auth_error_code_t (*login)(auth_adaptor_plugin_context_h context,
+ auth_error_code_t (*login)(auth_adaptor_plugin_context_h context,
void *request,
auth_adaptor_error_code_h *error,
void *response);
- auth_error_code_t (*refresh_access_token)(auth_adaptor_plugin_context_h context,
+ auth_error_code_t (*refresh_access_token)(auth_adaptor_plugin_context_h context,
void *request,
auth_adaptor_error_code_h *error,
void *response);
- auth_error_code_t (*set_service_status)(auth_adaptor_plugin_context_h context,
+ auth_error_code_t (*set_service_status)(auth_adaptor_plugin_context_h context,
const int service_id,
const int status,
void *request,
auth_adaptor_error_code_h *error,
void *response);
- auth_error_code_t (*get_service_status)(auth_adaptor_plugin_context_h context,
+ auth_error_code_t (*get_service_status)(auth_adaptor_plugin_context_h context,
const int service_id,
void *request,
int *status,
auth_adaptor_error_code_h *error,
void *response);
- auth_error_code_t (*get_service_policy)(auth_adaptor_plugin_context_h context,
+ auth_error_code_t (*get_service_policy)(auth_adaptor_plugin_context_h context,
const int service_id,
void *request,
char **default_status,
unsigned char **res_bundle_raw,
int *res_len,
auth_adaptor_error_code_h *error);
- // Optional end
+ /* Optional end */
- // Mandatory
- char *plugin_uri; // package id
- // Mandatory end
+ /* Mandatory */
+ char *plugin_uri; /* package id */
+ /* Mandatory end */
} auth_adaptor_plugin_handle_t;
typedef struct auth_adaptor_plugin_handle_s *auth_adaptor_plugin_handle_h;
/**
* @brief Describes infromation about Callback Listener (referenced by Service Adaptor)
*/
-typedef struct auth_adaptor_listener_s
-{
+typedef struct auth_adaptor_listener_s {
/*
void (*login_reply)(char *imsi,
char *plugin_uri,
/**
* @brief Describes infromation about Callback Listener (referenced by Auth Plugin)
*/
-typedef struct auth_adaptor_plugin_listener_s
-{
+typedef struct auth_adaptor_plugin_listener_s {
/*
auth_adaptor_plugin_login_reply_cb auth_adaptor_login_reply;
*/
const char *plugin_path);
-// For 3rd party plugin packages
+/* For 3rd party plugin packages */
EXPORT_API
int auth_adaptor_load_plugin_from_package(auth_adaptor_h adaptor,
const char *package_id,
EXPORT_API
GList *auth_adaptor_get_plugins(auth_adaptor_h adaptor);
-////////////////////////////////////////////////////////////
-// Adaptor get Element Functions
-////////////////////////////////////////////////////////////
+/**********************************************************/
+/* Adaptor get Element Functions */
+/**********************************************************/
/*
* @brief Get Access token allocated by 'strdup'(Use after 'auth_adaptor_login' function)
EXPORT_API
char *auth_adaptor_get_msisdn_dup(auth_adaptor_plugin_context_h context);
-////////////////////////////////////////////////////////////
-// Adaptor Plugin call Functions
-////////////////////////////////////////////////////////////
+/**********************************************************/
+/* Adaptor Plugin call Functions */
+/**********************************************************/
/**
* @brief Check Account Registration [Sync API]
/* These defines must be located before #include <dlog.h> */
#define TIZEN_ENGINEER_MODE
-// TODO: Investigate why this macro is defined somewhere else
+/* TODO: Investigate why this macro is defined somewhere else */
#ifndef TIZEN_DEBUG_ENABLE
#define TIZEN_DEBUG_ENABLE
#endif
* @param[out] val Value to be returned when expression is true
*/
#define contact_adaptor_retv_if(expr, val) do { \
- if(expr) { \
- LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, contact_adaptor_gettid()); \
- return (val); \
- } \
- } while (0)
+ if (expr) { \
+ LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, contact_adaptor_gettid()); \
+ return (val); \
+ } \
+ } while (0)
/**
* @brief Prints debug messages
* @param[in] args Arguments to be displayed
*/
#define contact_adaptor_debug(fmt, arg...) do { \
- LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, contact_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, contact_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints info messages
* @param[in] args Arguments to be displayed
*/
#define contact_adaptor_info(fmt, arg...) do { \
- LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, contact_adaptor_gettid() ,##arg); \
- } while (0)
+ LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, contact_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints warning messages
* @param[in] args Arguments to be displayed
*/
#define contact_adaptor_warning(fmt, arg...) do { \
- LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET,contact_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET, contact_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints error messages
* @param[in] args Arguments to be displayed
*/
#define contact_adaptor_error(fmt, arg...) do { \
- LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET,contact_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET, contact_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints fatal messages
* @param[in] args Arguments to be displayed
*/
#define contact_adaptor_fatal(fmt, arg...) do { \
- LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET,contact_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET, contact_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints debug message on entry to particular function
* @param[in] args Arguments to be displayed
*/
#define contact_adaptor_debug_func(fmt, arg...) do { \
- LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, contact_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, contact_adaptor_gettid(), ##arg); \
+ } while (0)
#define plugin_req_enter() do { \
contact_adaptor_info("[ENTER] plugin API call -)) -)) -)) -)) -)) -)) -)) -)) -)) -))"); \
/**
* @brief Contact Adaptor error code
*/
-typedef enum contact_error_code_e
-{
+typedef enum contact_error_code_e {
CONTACT_ADAPTOR_ERROR_NONE = 0,
CONTACT_ADAPTOR_ERROR_LAUNCH = 1, /**< 1 ~ 99: internal error*/
- CONTACT_ADAPTOR_ERROR_INIT = 2,
- CONTACT_ADAPTOR_ERROR_DEINIT = 3,
- CONTACT_ADAPTOR_ERROR_CREATE = 4,
- CONTACT_ADAPTOR_ERROR_DESTROY = 5,
- CONTACT_ADAPTOR_ERROR_START = 6,
- CONTACT_ADAPTOR_ERROR_STOP = 7,
- CONTACT_ADAPTOR_ERROR_CONNECT = 8,
- CONTACT_ADAPTOR_ERROR_DISCONNECT = 9,
- CONTACT_ADAPTOR_ERROR_NOT_FOUND = 10,
- CONTACT_ADAPTOR_ERROR_CORRUPTED = 11,
- CONTACT_ADAPTOR_ERROR_UNSUPPORTED = 12,
- CONTACT_ADAPTOR_ERROR_INVALID_HANDLE = 13,
- CONTACT_ADAPTOR_ERROR_INVALID_ARGUMENT = 14,
- CONTACT_ADAPTOR_ERROR_INVALID_ARGUMENT_TYPE = 15,
- CONTACT_ADAPTOR_ERROR_NOT_AUTHORIZED = 16,
- CONTACT_ADAPTOR_ERROR_ADAPTOR_INTERNAL = 17,
- CONTACT_ADAPTOR_ERROR_PLUGIN_INTERNAL = 18,
- CONTACT_ADAPTOR_ERROR_SERVER_INTERNAL = 19,
- CONTACT_ADAPTOR_ERROR_DBUS = 20,
- CONTACT_ADAPTOR_ERROR_CALLBACK_TIME_OUT = 21,
+ CONTACT_ADAPTOR_ERROR_INIT = 2,
+ CONTACT_ADAPTOR_ERROR_DEINIT = 3,
+ CONTACT_ADAPTOR_ERROR_CREATE = 4,
+ CONTACT_ADAPTOR_ERROR_DESTROY = 5,
+ CONTACT_ADAPTOR_ERROR_START = 6,
+ CONTACT_ADAPTOR_ERROR_STOP = 7,
+ CONTACT_ADAPTOR_ERROR_CONNECT = 8,
+ CONTACT_ADAPTOR_ERROR_DISCONNECT = 9,
+ CONTACT_ADAPTOR_ERROR_NOT_FOUND = 10,
+ CONTACT_ADAPTOR_ERROR_CORRUPTED = 11,
+ CONTACT_ADAPTOR_ERROR_UNSUPPORTED = 12,
+ CONTACT_ADAPTOR_ERROR_INVALID_HANDLE = 13,
+ CONTACT_ADAPTOR_ERROR_INVALID_ARGUMENT = 14,
+ CONTACT_ADAPTOR_ERROR_INVALID_ARGUMENT_TYPE = 15,
+ CONTACT_ADAPTOR_ERROR_NOT_AUTHORIZED = 16,
+ CONTACT_ADAPTOR_ERROR_ADAPTOR_INTERNAL = 17,
+ CONTACT_ADAPTOR_ERROR_PLUGIN_INTERNAL = 18,
+ CONTACT_ADAPTOR_ERROR_SERVER_INTERNAL = 19,
+ CONTACT_ADAPTOR_ERROR_DBUS = 20,
+ CONTACT_ADAPTOR_ERROR_CALLBACK_TIME_OUT = 21,
CONTACT_ADAPTOR_ERROR_MAX
} contact_error_code_t;
-typedef enum _contact_plugin_internal_error_code_e
-{
+typedef enum _contact_plugin_internal_error_code_e {
CONTACT_PLUGIN_ERROR_HTTP_BAD_REQUEST = 400,
CONTACT_PLUGIN_ERROR_HTTP_UNAUTHORIZED = 401,
CONTACT_PLUGIN_ERROR_HTTP_FORBIDDEN = 403,
/**
* @brief Contact Adaptor plugin context structure
*/
-typedef struct contact_adaptor_plugin_context_s
-{
+typedef struct contact_adaptor_plugin_context_s {
char *duid; /**< header: access control >*/
char *access_token; /**< header: access control >*/
void *plugin_info; /**< plugin's own context >*/
- // Adaptor define
+ /* Adaptor define */
char *plugin_uri;
char *service_name;
/**
* @brief Contact Adaptor error code
*/
-typedef struct contact_adaptor_error_code_s
-{
+typedef struct contact_adaptor_error_code_s {
int64_t code;
char *msg;
/**
* @brief Contact Adaptor contact API information request format
*/
-typedef struct contact_adaptor_contact_info_req_s
-{
+typedef struct contact_adaptor_contact_info_req_s {
char *tp; /**< mandatory >*/
char *id; /**< mandatory >*/
char *pn; /**< mandatory >*/
/**
* @brief Contact Adaptor contact API request format
*/
-typedef struct contact_adaptor_contact_req_s
-{
+typedef struct contact_adaptor_contact_req_s {
long long int tt;
contact_adaptor_contact_info_req_h *cts;
unsigned int cts_len;
} contact_adaptor_contact_req_t;
typedef struct contact_adaptor_contact_req_s *contact_adaptor_contact_req_h;
-typedef enum
-{
+typedef enum {
CONTACT_ADAPTOR_REQUEST_SET = 1,
CONTACT_ADAPTOR_REQUEST_DEL = 2,
} contact_adaptor_request_type_e;
-typedef struct contact_adaptor_contact_image_s
-{
+typedef struct contact_adaptor_contact_image_s {
int req_type;
- int no; /**< mandatory >*/
+ int no; /**< mandatory >*/
char *img; /**< mandatory >*/
} contact_adaptor_contact_image_t;
typedef struct contact_adaptor_contact_image_s *contact_adaptor_contact_image_h;
/**
* @brief Contact Adaptor contact API information response format
*/
-typedef struct contact_adaptor_contact_info_res_s
-{
+typedef struct contact_adaptor_contact_info_res_s {
char *duid; /**< mandatory >*/
char *id; /**< mandatory >*/
char *msisdn; /**< mandatory >*/
char *prsc; /**< optional >*/
char *status; /**< optional >*/
unsigned int sids; /**< optional >*/
- int type; /**< optional >*/
- char *url; /**< optional >*/
+ int type; /**< optional >*/
+ char *url; /**< optional >*/
} contact_adaptor_contact_info_res_t;
typedef struct contact_adaptor_contact_info_res_s *contact_adaptor_contact_info_res_h;
/**
* @brief Contact Adaptor contact API response format
*/
-typedef struct contact_adaptor_contact_res_s
-{
- long long int tt;
- contact_adaptor_contact_info_res_h *cts;
- unsigned int cts_len;
+typedef struct contact_adaptor_contact_res_s {
+ long long int tt;
+ contact_adaptor_contact_info_res_h *cts;
+ unsigned int cts_len;
} contact_adaptor_contact_res_t;
typedef struct contact_adaptor_contact_res_s *contact_adaptor_contact_res_h;
/**
* @brief Contact Adaptor profile API request format
*/
-typedef struct contact_adaptor_profile_req_s
-{
+typedef struct contact_adaptor_profile_req_s {
char* cc;
char* pn;
char* nm;
unsigned int mail_len;
char* org;
char* prsc;
- char* status;
+ char* status;
} contact_adaptor_profile_req_t;
typedef struct contact_adaptor_profile_req_s *contact_adaptor_profile_req_h;
/**
* @brief Contact Adaptor profile API response format
*/
-typedef struct contact_adaptor_profile_res_s
-{
+typedef struct contact_adaptor_profile_res_s {
char* nm;
char* img;
char* prsc;
- char* status;
+ char* status;
} contact_adaptor_profile_res_t;
typedef struct contact_adaptor_profile_res_s *contact_adaptor_profile_res_h;
/**
* @brief Contact Adaptor profile API image file path format
*/
-typedef struct contact_adaptor_file_path_s
-{
+typedef struct contact_adaptor_file_path_s {
char** file_paths;
unsigned int file_paths_len;
/**
* @brief Contact Adaptor privacy API information request format
*/
-typedef struct contact_adaptor_privacy_info_req_s
-{
+typedef struct contact_adaptor_privacy_info_req_s {
char* cc;
char* pn;
/**
* @brief Contact Adaptor privacy API request format
*/
-typedef struct contact_adaptor_privacy_req_s
-{
+typedef struct contact_adaptor_privacy_req_s {
unsigned int lvl;
contact_adaptor_privacy_info_req_h* cts;
unsigned int cts_len;
/**
* @brief Contact Adaptor privacy API response format
*/
-typedef struct contact_adaptor_privacy_res_s
-{
+typedef struct contact_adaptor_privacy_res_s {
unsigned int lvl;
unsigned int prscon;
/**
* @brief Contact Adaptor presence API information format
*/
-typedef struct contact_adaptor_presence_info_s
-{
+typedef struct contact_adaptor_presence_info_s {
char *prsc;
unsigned int prscon;
char *status;
/**
* @brief Contact Adaptor listener for Service Adaptor
*/
-typedef struct contact_adaptor_listener_s
-{
- contact_adaptor_service_on_message_received_cb _on_message_received;
+typedef struct contact_adaptor_listener_s {
+ contact_adaptor_service_on_message_received_cb _on_message_received;
} contact_adaptor_listener_t;
typedef struct contact_adaptor_listener_s *contact_adaptor_listener_h;
/**
* @brief Contact Adaptor listener for plugins
*/
-typedef struct contact_adaptor_plugin_listener_s
-{
- contact_adaptor_plugin_on_message_received_cb _on_message_received;
+typedef struct contact_adaptor_plugin_listener_s {
+ contact_adaptor_plugin_on_message_received_cb _on_message_received;
} contact_adaptor_plugin_listener_t;
typedef struct contact_adaptor_plugin_listener_s *contact_adaptor_plugin_listener_h;
/**
* @brief Contact Adaptor plugin handle
*/
-typedef struct contact_adaptor_plugin_handle_s
-{
+typedef struct contact_adaptor_plugin_handle_s {
/**< mandatory >*/
contact_error_code_t (*create_context)(contact_adaptor_plugin_context_h *context,
const char *duid,
/**< optional >*/
contact_error_code_t (*new_contact_list)(contact_adaptor_plugin_context_h context,
- contact_adaptor_contact_req_h request,
+ contact_adaptor_contact_req_h request,
void *user_data,
- contact_adaptor_contact_res_h *response,
+ contact_adaptor_contact_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
contact_error_code_t (*set_contact_list)(contact_adaptor_plugin_context_h context,
- contact_adaptor_contact_req_h request,
+ contact_adaptor_contact_req_h request,
void *user_data,
- contact_adaptor_contact_res_h *response,
+ contact_adaptor_contact_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
contact_error_code_t (*get_contact_infos_latest)(contact_adaptor_plugin_context_h context,
- contact_adaptor_contact_req_h request,
+ contact_adaptor_contact_req_h request,
void *user_data,
- contact_adaptor_contact_res_h *response,
+ contact_adaptor_contact_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
- contact_error_code_t (*get_contact_infos_polling)(contact_adaptor_plugin_context_h context,
- contact_adaptor_contact_req_h request,
+ contact_error_code_t (*get_contact_infos_polling)(contact_adaptor_plugin_context_h context,
+ contact_adaptor_contact_req_h request,
void *user_data,
- contact_adaptor_contact_res_h *response,
+ contact_adaptor_contact_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
- contact_error_code_t (*set_me_profile_with_push)(contact_adaptor_plugin_context_h context,
- contact_adaptor_profile_req_h request,
+ contact_error_code_t (*set_me_profile_with_push)(contact_adaptor_plugin_context_h context,
+ contact_adaptor_profile_req_h request,
void *user_data,
- contact_adaptor_profile_res_h *response,
+ contact_adaptor_profile_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
- contact_error_code_t (*get_profile)(contact_adaptor_plugin_context_h context,
- contact_adaptor_profile_req_h request,
+ contact_error_code_t (*get_profile)(contact_adaptor_plugin_context_h context,
+ contact_adaptor_profile_req_h request,
void *user_data,
- contact_adaptor_profile_res_h *response,
+ contact_adaptor_profile_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
- contact_error_code_t (*set_me_profile_image_meta_with_push)
+ contact_error_code_t (*set_me_profile_image_meta_with_push)
(contact_adaptor_plugin_context_h context,
contact_adaptor_contact_image_h *imgs,
unsigned int imgs_len,
void *user_data,
- contact_adaptor_error_code_h *error,
+ contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
- contact_error_code_t (*delete_me_profile_image_meta_with_push)
+ contact_error_code_t (*delete_me_profile_image_meta_with_push)
(contact_adaptor_plugin_context_h context,
void *user_data,
- contact_adaptor_error_code_h *error,
+ contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
- contact_error_code_t (*set_me_profile_privacy)(contact_adaptor_plugin_context_h context,
- contact_adaptor_privacy_req_h request,
+ contact_error_code_t (*set_me_profile_privacy)(contact_adaptor_plugin_context_h context,
+ contact_adaptor_privacy_req_h request,
void *user_data,
- contact_adaptor_privacy_res_h *response,
- contact_adaptor_error_code_h *error,
+ contact_adaptor_privacy_res_h *response,
+ contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
- contact_error_code_t (*get_me_profile_privacy)(contact_adaptor_plugin_context_h context,
- contact_adaptor_privacy_req_h request,
+ contact_error_code_t (*get_me_profile_privacy)(contact_adaptor_plugin_context_h context,
+ contact_adaptor_privacy_req_h request,
void *user_data,
- contact_adaptor_privacy_res_h *response,
- contact_adaptor_error_code_h *error,
+ contact_adaptor_privacy_res_h *response,
+ contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
- contact_error_code_t (*set_me_presence_with_push)(contact_adaptor_plugin_context_h context,
- contact_adaptor_presence_info_h request,
+ contact_error_code_t (*set_me_presence_with_push)(contact_adaptor_plugin_context_h context,
+ contact_adaptor_presence_info_h request,
void *user_data,
- contact_adaptor_presence_info_h *response,
+ contact_adaptor_presence_info_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
/**< optional >*/
- contact_error_code_t (*set_me_presence_on_off_with_push)(contact_adaptor_plugin_context_h context,
- contact_adaptor_presence_info_h request,
+ contact_error_code_t (*set_me_presence_on_off_with_push)(contact_adaptor_plugin_context_h context,
+ contact_adaptor_presence_info_h request,
void *user_data,
- contact_adaptor_presence_info_h *response,
+ contact_adaptor_presence_info_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
void **server_data);
/**< mandatory >*/
- char *plugin_uri; // get from config file
+ char *plugin_uri; /* get from config file */
} contact_adaptor_plugin_handle_t;
typedef struct contact_adaptor_plugin_handle_s *contact_adaptor_plugin_handle_h;
*
* @param[in] context specifies Contact Adaptor Plugin Context handle
* @param[in] new_access_token specifies New access token
- * @return contact_adaptor_error_code_h on success, otherwise NULL value
+ * @return contact_adaptor_error_code_h on success, otherwise NULL value
*/
EXPORT_API
contact_error_code_t contact_adaptor_refresh_access_token(contact_adaptor_plugin_context_h context,
*
* @param[in] context specifies Contact Adaptor Plugin Context handle
* @param[in] new_access_token specifies New access token
- * @return contact_adaptor_error_code_h on success, otherwise NULL value
+ * @return contact_adaptor_error_code_h on success, otherwise NULL value
*/
EXPORT_API
contact_error_code_t contact_adaptor_refresh_uid(contact_adaptor_plugin_context_h context,
*
* @param[in] code specifies error code number
* @param[in] msg specifies error message
-* @return contact_adaptor_error_code_h on success, otherwise NULL value
+* @return contact_adaptor_error_code_h on success, otherwise NULL value
*/
EXPORT_API
contact_adaptor_error_code_h contact_adaptor_create_error_code(const int64_t code,
*/
EXPORT_API
contact_error_code_t contact_adaptor_set_server_info(contact_adaptor_plugin_h plugin,
- contact_adaptor_plugin_context_h context,
- GHashTable *server_info,
- void *user_data,
- contact_adaptor_error_code_h *error,
- void **server_data);
+ contact_adaptor_plugin_context_h context,
+ GHashTable *server_info,
+ void *user_data,
+ contact_adaptor_error_code_h *error,
+ void **server_data);
/**
* @brief Resets contact information in Contact server and upload native contact information of device to
EXPORT_API
contact_error_code_t contact_adaptor_new_contact_list(contact_adaptor_plugin_h plugin,
contact_adaptor_plugin_context_h context,
- contact_adaptor_contact_req_h request,
+ contact_adaptor_contact_req_h request,
void *user_data,
- contact_adaptor_contact_res_h *response,
+ contact_adaptor_contact_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
EXPORT_API
contact_error_code_t contact_adaptor_set_contact_list(contact_adaptor_plugin_h plugin,
contact_adaptor_plugin_context_h context,
- contact_adaptor_contact_req_h request,
+ contact_adaptor_contact_req_h request,
void *user_data,
- contact_adaptor_contact_res_h *response,
+ contact_adaptor_contact_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
EXPORT_API
contact_error_code_t contact_adaptor_get_contact_infos_latest(contact_adaptor_plugin_h plugin,
contact_adaptor_plugin_context_h context,
- contact_adaptor_contact_req_h request,
+ contact_adaptor_contact_req_h request,
void *user_data,
- contact_adaptor_contact_res_h *response,
+ contact_adaptor_contact_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
EXPORT_API
contact_error_code_t contact_adaptor_get_contact_infos_polling(contact_adaptor_plugin_h plugin,
contact_adaptor_plugin_context_h context,
- contact_adaptor_contact_req_h request,
+ contact_adaptor_contact_req_h request,
void *user_data,
- contact_adaptor_contact_res_h *response,
+ contact_adaptor_contact_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
*/
EXPORT_API
contact_error_code_t contact_adaptor_set_me_profile_with_push(contact_adaptor_plugin_h plugin,
- contact_adaptor_plugin_context_h context,
- contact_adaptor_profile_req_h request,
+ contact_adaptor_plugin_context_h context,
+ contact_adaptor_profile_req_h request,
void *user_data,
- contact_adaptor_profile_res_h *response,
+ contact_adaptor_profile_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
*/
EXPORT_API
contact_error_code_t contact_adaptor_get_profile(contact_adaptor_plugin_h plugin,
- contact_adaptor_plugin_context_h context,
- contact_adaptor_profile_req_h request,
+ contact_adaptor_plugin_context_h context,
+ contact_adaptor_profile_req_h request,
void *user_data,
- contact_adaptor_profile_res_h *response,
+ contact_adaptor_profile_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
*/
EXPORT_API
contact_error_code_t contact_adaptor_set_me_profile_image_meta_with_push(contact_adaptor_plugin_h plugin,
- contact_adaptor_plugin_context_h context,
+ contact_adaptor_plugin_context_h context,
contact_adaptor_contact_image_h *imgs,
unsigned int imgs_len,
void *user_data,
EXPORT_API
contact_error_code_t contact_adaptor_delete_me_profile_image_meta_with_push(
contact_adaptor_plugin_h plugin,
- contact_adaptor_plugin_context_h context,
+ contact_adaptor_plugin_context_h context,
void *user_data,
contact_adaptor_error_code_h *error,
void **server_data);
*/
EXPORT_API
contact_error_code_t contact_adaptor_set_me_profile_privacy(contact_adaptor_plugin_h plugin,
- contact_adaptor_plugin_context_h context,
- contact_adaptor_privacy_req_h request,
+ contact_adaptor_plugin_context_h context,
+ contact_adaptor_privacy_req_h request,
void *user_data,
- contact_adaptor_privacy_res_h *response,
+ contact_adaptor_privacy_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
*/
EXPORT_API
contact_error_code_t contact_adaptor_get_me_profile_privacy(contact_adaptor_plugin_h plugin,
- contact_adaptor_plugin_context_h context,
- contact_adaptor_privacy_req_h request,
+ contact_adaptor_plugin_context_h context,
+ contact_adaptor_privacy_req_h request,
void *user_data,
- contact_adaptor_privacy_res_h *response,
+ contact_adaptor_privacy_res_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
*/
EXPORT_API
contact_error_code_t contact_adaptor_set_me_presence_with_push(contact_adaptor_plugin_h plugin,
- contact_adaptor_plugin_context_h context,
+ contact_adaptor_plugin_context_h context,
contact_adaptor_presence_info_h request,
void *user_data,
contact_adaptor_presence_info_h *response,
*/
EXPORT_API
contact_error_code_t contact_adaptor_set_me_presence_on_off_with_push(contact_adaptor_plugin_h plugin,
- contact_adaptor_plugin_context_h context,
- contact_adaptor_presence_info_h request,
+ contact_adaptor_plugin_context_h context,
+ contact_adaptor_presence_info_h request,
void *user_data,
- contact_adaptor_presence_info_h *response,
+ contact_adaptor_presence_info_h *response,
contact_adaptor_error_code_h *error,
void **server_data);
EXPORT_API
contact_error_code_t contact_adaptor_set_me_profile_type(contact_adaptor_plugin_h plugin,
- contact_adaptor_plugin_context_h context,
+ contact_adaptor_plugin_context_h context,
int req_type,
void *user_data,
char **url,
\r
/* These defines must be located before #include <dlog.h> */\r
#define TIZEN_ENGINEER_MODE\r
-// TODO: Investigate why this macro is defined somewhere else\r
+/* TODO: Investigate why this macro is defined somewhere else */\r
#ifndef TIZEN_DEBUG_ENABLE\r
#define TIZEN_DEBUG_ENABLE\r
#endif\r
* @param[out] val Value to be returned when expression is true\r
*/\r
#define message_adaptor_retv_if(expr, val) do { \\r
- if(expr) { \\r
- LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, message_adaptor_gettid()); \\r
- return (val); \\r
- } \\r
- } while (0)\r
+ if (expr) { \\r
+ LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, message_adaptor_gettid()); \\r
+ return (val); \\r
+ } \\r
+ } while (0)\r
\r
/**\r
* @brief Prints debug messages\r
* @param[in] args Arguments to be displayed\r
*/\r
#define message_adaptor_debug(fmt, arg...) do { \\r
- LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, message_adaptor_gettid(), ##arg); \\r
- } while (0)\r
+ LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, message_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
/**\r
* @brief Prints info messages\r
* @param[in] args Arguments to be displayed\r
*/\r
#define message_adaptor_info(fmt, arg...) do { \\r
- LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, message_adaptor_gettid() ,##arg); \\r
- } while (0)\r
+ LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, message_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
/**\r
* @brief Prints warning messages\r
* @param[in] args Arguments to be displayed\r
*/\r
#define message_adaptor_warning(fmt, arg...) do { \\r
- LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET,message_adaptor_gettid(), ##arg); \\r
- } while (0)\r
+ LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET, message_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
/**\r
* @brief Prints error messages\r
* @param[in] args Arguments to be displayed\r
*/\r
#define message_adaptor_error(fmt, arg...) do { \\r
- LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET,message_adaptor_gettid(), ##arg); \\r
- } while (0)\r
+ LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET, message_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
/**\r
* @brief Prints fatal messages\r
* @param[in] args Arguments to be displayed\r
*/\r
#define message_adaptor_fatal(fmt, arg...) do { \\r
- LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET,message_adaptor_gettid(), ##arg); \\r
- } while (0)\r
+ LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET, message_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
/**\r
* @brief Prints debug message on entry to particular function\r
* @param[in] args Arguments to be displayed\r
*/\r
#define message_adaptor_debug_func(fmt, arg...) do { \\r
- LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, message_adaptor_gettid(), ##arg); \\r
- } while (0)\r
+ LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, message_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
#define plugin_req_enter() do { \\r
message_adaptor_info("[ENTER] plugin API call -)) -)) -)) -)) -)) -)) -)) -)) -)) -))"); \\r
/**
* Message adaptor error code
*/
-typedef enum message_error_code_e
-{
+typedef enum message_error_code_e {
MESSAGE_ADAPTOR_ERROR_NONE = 0,
MESSAGE_ADAPTOR_ERROR_LAUNCH = 1, /**< 1 ~ 99: internal error*/
MESSAGE_ADAPTOR_ERROR_INIT = 2,
MESSAGE_ADAPTOR_ERROR_INVALID_ARGUMENT_TYPE = 15,
MESSAGE_ADAPTOR_ERROR_NOT_AUTHORIZED = 16,
MESSAGE_ADAPTOR_ERROR_ADAPTOR_INTERNAL = 17,
- MESSAGE_ADAPTOR_ERROR_PLUGIN_INTERNAL = 18, // input error code and message issued from curl or http or message_plugin_internal_error_code_e(defined by developer manually)
- MESSAGE_ADAPTOR_ERROR_SERVER_INTERNAL = 19, // input error code and message issued from server.
+ MESSAGE_ADAPTOR_ERROR_PLUGIN_INTERNAL = 18, /* input error code and message issued from curl or http or message_plugin_internal_error_code_e(defined by developer manually) */
+ MESSAGE_ADAPTOR_ERROR_SERVER_INTERNAL = 19, /* input error code and message issued from server. */
MESSAGE_ADAPTOR_ERROR_DBUS = 20,
- MESSAGE_ADAPTOR_ERROR_TIME_OUT = 21,
+ MESSAGE_ADAPTOR_ERROR_TIME_OUT = 21,
MESSAGE_ADAPTOR_ERROR_MAX
} message_error_code_t;
* @ brief Message plugin internal error code
* @ details When a plugin returns MESSAGE_ADAPTOR_ERROR_PLUGIN_INTERNAL, input this number to message_adaptor_error_code_s.code
*/
-typedef enum _message_plugin_internal_error_code_e
-{
+typedef enum _message_plugin_internal_error_code_e {
MESSAGE_PLUGIN_ERROR_HTTP_BAD_REQUEST = 400,
MESSAGE_PLUGIN_ERROR_HTTP_UNAUTHORIZED = 401,
MESSAGE_PLUGIN_ERROR_HTTP_FORBIDDEN = 403,
MESSAGE_PLUGIN_ERROR_NETWORK_DEVICE_OFFLINE = 601,
MESSAGE_PLUGIN_ERROR_NETWORK_DEVICE_CONFUSED = 602,
MESSAGE_PLUGIN_ERROR_NETWORK_SOCKET_ISSUE = 603,
- MESSAGE_PLUGIN_ERROR_NETWORK_SERVER_NOT_RESPONSE= 604,
+ MESSAGE_PLUGIN_ERROR_NETWORK_SERVER_NOT_RESPONSE = 604,
MESSAGE_PLUGIN_ERROR_NEWTORK_ETC = 648,
MESSAGE_PLUGIN_ERROR_NEWTORK_UNKNOWN = 649,
MESSAGE_PLUGIN_ERROR_UNKNOWN = 999,
} message_plugin_internal_error_code_e;
-typedef enum _message_connection_policy_e
-{
+typedef enum _message_connection_policy_e {
MESSAGE_CONNECTION_POLICY_AUTO = 0,
MESSAGE_CONNECTION_POLICY_CONNECT = 1,
MESSAGE_CONNECTION_POLICY_DISCONNECT = 2,
/**
* @ brief Message plugin's TCP connection state flag
*/
-typedef enum message_connection_state_e
-{
- MESSAGE_CONNECTION_STATE_INIT = 0, // init value (after create_context)
- MESSAGE_CONNECTION_STATE_READY = 1, // thread running (after connect) before channel_auth
- MESSAGE_CONNECTION_STATE_CONNECT = 2, // connection authenticated (after channel_auth_reply)
- MESSAGE_CONNECTION_STATE_DISCONNECTED = 3, // connection was stopped explicitly (after disconnect)
- MESSAGE_CONNECTION_STATE_INTERRUPTED = 4, // connection was stopped inadventently (by network/server/etc issue)
+typedef enum message_connection_state_e {
+ MESSAGE_CONNECTION_STATE_INIT = 0, /* init value (after create_context) */
+ MESSAGE_CONNECTION_STATE_READY = 1, /* thread running (after connect) before channel_auth */
+ MESSAGE_CONNECTION_STATE_CONNECT = 2, /* connection authenticated (after channel_auth_reply) */
+ MESSAGE_CONNECTION_STATE_DISCONNECTED = 3, /* connection was stopped explicitly (after disconnect) */
+ MESSAGE_CONNECTION_STATE_INTERRUPTED = 4, /* connection was stopped inadventently (by network/server/etc issue) */
MESSAGE_CONNECTION_STATE_MAX = 5,
} message_connection_state_t;
/**
* @ brief Message adaptor error code
*/
-typedef struct message_adaptor_error_code_s
-{
+typedef struct message_adaptor_error_code_s {
char *code;
char *msg;
} message_adaptor_error_code_t;
/**
* @ brief Message adaptor violated user structure
*/
-typedef struct message_adaptor_did_violation_users_s
-{
+typedef struct message_adaptor_did_violation_users_s {
long long int usera;
long long int userb;
} message_adaptor_did_violation_users_t;
/**
* @ brief Message adaptor wrong receiver structure
*/
-typedef struct
-{
+typedef struct {
long long int *invalid_receivers;
unsigned int invalid_receivers_len;
long long int *interrupted_receivers;
/**
* @ brief Message adaptor chat message structure
*/
-typedef struct
-{
+typedef struct {
long long int msg_id;
int msg_type;
char *chatmsg;
/**
* @ brief Message adaptor processed message structure
*/
-typedef struct
-{
+typedef struct {
long long int msg_id;
long long int sent_time;
} message_adaptor_processed_msg_s;
/**
* @ brief Message adaptor deliveryAck structure
*/
-typedef struct
-{
+typedef struct {
long long int userId;
long long int msgId;
long long int timestamp;
/**
* @ brief Message adaptor read_ack structure
*/
-typedef struct
-{
+typedef struct {
long long int userId;
long long int msgId;
long long int timestamp;
/**
* @ brief Message adaptor ordered chat member structure
*/
-typedef struct
-{
+typedef struct {
long long int userId;
long long int available;
char *name;
/**
* @ brief Message adaptor inbox entry structure
*/
-typedef struct _message_inboxentry
-{
+typedef struct _message_inboxentry {
long long int msgId;
int msgType;
long long int sender;
/**
* @ brief Message adaptor plugin context structure
*/
-typedef struct message_adaptor_plugin_context_s
-{
+typedef struct message_adaptor_plugin_context_s {
long long int duid;
char *access_token;
char *app_id;
message_connection_state_t connection_state;
message_connection_policy_e connection_policy;
- // Encryption
+ /* Encryption */
unsigned char enc_key[32];
unsigned char enc_vec[16];
- //bool enc_key_updated;
+ /* bool enc_key_updated; */
unsigned char gpb_key[32];
unsigned char gpb_vec[16];
- //bool gpb_key_updated;
+ /* bool gpb_key_updated; */
unsigned char exp_key[32];
unsigned char exp_vec[16];
- //bool exp_key_updated;
+ /* bool exp_key_updated; */
char *plugin_uri;
/**
* @ brief Message adaptor result code for internal use
*/
-typedef enum message_plugin_result_code_e
-{
+typedef enum message_plugin_result_code_e {
MESSAGE_PLUGIN_RESULT_SUCCEDED = 0,
MESSAGE_PLUGIN_RESULT_FAILED = -1,
MESSAGE_PLUGIN_RESULT_CANCELED = -2
} message_plugin_result_code_t;
-typedef struct curl_cb_data_s
-{
+typedef struct curl_cb_data_s {
char *data;
int size;
} curl_cb_data_t;
/**
* @ brief Message adaptor phone number structure
*/
-typedef struct
-{
+typedef struct {
char *phonenumber;
char *ccc;
} message_adaptor_phone_number_s;
/**
* @ brief Message adaptor chat id structure
*/
-typedef struct
-{
+typedef struct {
long long int chatid;
char *msisdn;
} message_adaptor_chat_id_s;
/**
* @ brief Message adaptor plugin handle
*/
-typedef struct message_adaptor_plugin_handle_s
-{
- // Mandatory functions to handle plugin in adaptor
- //struct message_adaptor_plugin_handle_s * (*create_plugin_handle)(void);
+typedef struct message_adaptor_plugin_handle_s {
+ /* Mandatory functions to handle plugin in adaptor */
+ /* struct message_adaptor_plugin_handle_s * (*create_plugin_handle)(void); */
message_error_code_t (*create_context)(message_adaptor_plugin_context_h *context,
char *duid,
char *access_token,
message_adaptor_phone_number_s **phone_numbers,
unsigned int phone_numbers_len,
void *user_data,
- message_adaptor_chat_id_s ***chat_ids,
- unsigned int *chat_ids_len,
- message_adaptor_error_code_t **error_code,
- void **server_data);
+ message_adaptor_chat_id_s ***chat_ids,
+ unsigned int *chat_ids_len,
+ message_adaptor_error_code_t **error_code,
+ void **server_data);
message_error_code_t (*request_msisdn) (message_adaptor_plugin_context_h handle,
char *uid,
message_error_code_t (*client_echo_reply) (message_adaptor_plugin_context_h context,
long long int *request_id,
- message_adaptor_error_code_t **error_code,
- void *user_data);
+ message_adaptor_error_code_t **error_code,
+ void *user_data);
message_error_code_t (*create_chatroom_request)(message_adaptor_plugin_context_h context,
long long int *request_id,
long long int *request_id,
long long int *chatroom_id,
message_adaptor_chat_msg_s *msgs,
- message_adaptor_error_code_t **error_code,
- void *user_data);
+ message_adaptor_error_code_t **error_code,
+ void *user_data);
message_error_code_t (*allow_chat_request)(message_adaptor_plugin_context_h context,
long long int *request_id,
long long int *request_id,
message_adaptor_end_chat_s **end_chats,
int *end_chats_len,
- message_adaptor_error_code_t **error_code,
- void *user_data);
+ message_adaptor_error_code_t **error_code,
+ void *user_data);
message_error_code_t (*unseal_message_request)(message_adaptor_plugin_context_h context,
long long int *request_id,
long long int *sender_id,
long long int *message_id,
const char *message_detail,
- message_adaptor_error_code_t **error_code,
- void *user_data);
+ message_adaptor_error_code_t **error_code,
+ void *user_data);
message_error_code_t (*save_call_log_request)(message_adaptor_plugin_context_h context,
long long int *request_id,
long long int *call_sender_id,
long long int *call_receiver_id,
int *conversaction_second,
- message_adaptor_error_code_t **error_code,
- void *user_data);
+ message_adaptor_error_code_t **error_code,
+ void *user_data);
message_error_code_t (*current_time_request)(message_adaptor_plugin_context_h context,
long long int *request_id,
- message_adaptor_error_code_t **error_code,
- void *user_data);
+ message_adaptor_error_code_t **error_code,
+ void *user_data);
message_error_code_t (*is_typing)(message_adaptor_plugin_context_h context,
long long int *request_id,
char **state,
int *chat_type,
int *refreshtime,
- message_adaptor_error_code_t **error_code,
- void *user_data);
+ message_adaptor_error_code_t **error_code,
+ void *user_data);
- //message_error_code_t (*message_set_key)(message_adaptor_plugin_context_h context, char *key, bool is_gpb);
+ /* message_error_code_t (*message_set_key)(message_adaptor_plugin_context_h context, char *key, bool is_gpb); */
message_error_code_t (*connect_to_server)(message_adaptor_plugin_context_h context);
message_error_code_t (*decode_push_message)(message_adaptor_plugin_context_h context, char *in_msg, char **out_msg);
message_error_code_t (*disconnect_to_server)(message_adaptor_plugin_context_h context);
message_error_code_t (*get_connection_state)(message_adaptor_plugin_context_h context,
message_connection_state_t *state);
- char *plugin_uri; // get from config file
+ char *plugin_uri; /* get from config file */
} message_adaptor_plugin_handle_t;
typedef struct message_adaptor_plugin_handle_s *message_adaptor_plugin_handle_h;
-typedef struct message_adaptor_listener_s
-{
- void (*client_echo_cb)(message_adaptor_plugin_context_h context,
+typedef struct message_adaptor_listener_s {
+ void (*client_echo_cb)(message_adaptor_plugin_context_h context,
long long int request_id,
message_adaptor_error_code_t **error_code,
void *server_data);
void (*completion_cb)(message_adaptor_plugin_context_h context,
message_connection_state_t state,
message_adaptor_error_code_t **error_code,
- void *server_data );
+ void *server_data);
} message_adaptor_listener_t;
* Message adaptor listener for plugins
* Listener is used by plugins
*/
-typedef struct message_adaptor_plugin_listener_s
-{
+typedef struct message_adaptor_plugin_listener_s {
message_adaptor_plugin_client_echo_cb message_adaptor_client_echo;
message_adaptor_plugin_create_chatroom_reply_cb message_adaptor_create_chatroom_reply;
message_adaptor_plugin_change_chatroom_meta_reply_cb message_adaptor_change_chatroom_meta_reply;
/**
* Loads plugin from selected path
*/
- EXPORT_API
+EXPORT_API
int message_adaptor_load_plugin(message_adaptor_h adaptor, const char *plugin_path);
/**
* Unloads selected plugin
*/
- EXPORT_API
+EXPORT_API
int message_adaptor_unload_plugin(message_adaptor_h adaptor, message_adaptor_plugin_h plugin);
- EXPORT_API
+EXPORT_API
message_error_code_t message_adaptor_set_connected(message_adaptor_plugin_h plugin, int connected);
- EXPORT_API
+EXPORT_API
message_error_code_t message_adaptor_wait_connected(message_adaptor_plugin_h plugin);
/**
* Gets plugin name
*/
- EXPORT_API
+EXPORT_API
const char *message_adaptor_get_plugin_uri(message_adaptor_plugin_h plugin);
/**
EXPORT_API
message_adaptor_plugin_h message_adaptor_get_plugin_by_name(message_adaptor_h adaptor, const char *plugin_uri);
-////////////////////////////////////////////////////////////
-// Adaptor Plugin call Functions
-////////////////////////////////////////////////////////////
+/**********************************************************/
+/* Adaptor Plugin call Functions */
+/**********************************************************/
/**
* @brief Set server information for Message Plugin
message_error_code_t message_adaptor_get_key(message_adaptor_plugin_h plugin,
message_adaptor_plugin_context_h context,
char **in_gcmid,
- char **in_del_gcm_id,
- char **key,
- char **expiredkey,
- char **gpbauthkey,
- message_adaptor_error_code_t **error_code,
- void **server_data);
+ char **in_del_gcm_id,
+ char **key,
+ char **expiredkey,
+ char **gpbauthkey,
+ message_adaptor_error_code_t **error_code,
+ void **server_data);
/**
* @brief Request Chat ID corresponds to MSISDN to remote server
* @retval error code defined in message_error_code_e - MESSAGE_ADAPTOR_ERROR_NONE if Successful
*/
EXPORT_API
-message_error_code_t message_adaptor_request_msisdn (message_adaptor_plugin_h plugin,
+message_error_code_t message_adaptor_request_msisdn(message_adaptor_plugin_h plugin,
message_adaptor_plugin_context_h handle,
long long int *chat_ids,
unsigned int chat_ids_len,
* @retval error code defined in message_error_code_t
*/
EXPORT_API
-message_error_code_t message_adaptor_client_echo_reply (message_adaptor_plugin_h plugin,
+message_error_code_t message_adaptor_client_echo_reply(message_adaptor_plugin_h plugin,
message_adaptor_plugin_context_h context,
long long int request_id,
message_adaptor_error_code_t **error_code,
* @param[in] chatroom_id specifies chatroom ID
* @param[in] max_count specifies the max number of ForwardUnreadMessage (default : 500)
* @param[in] need_delivery_ack specifies whether receive delivery ack data or not (0 - do not receive delivery ack data, 1 - receive delivery ack data)
-* @param[in] need_delivery_ack_timestamp specifies latest receipt time of delivery ack data
-* @param[in] need_read_ack specifies whether receive water mark data or not (0 - do not receive water mark data, 1 - receive read_ack data)
-* @param[in] last_read_ack_timestamp specifies time of last read_ack
-* @param[in] need_ordered_chat_member_list specifies whether need odered chat memebr list or not
+* @param[in] need_delivery_ack_timestamp specifies latest receipt time of delivery ack data
+* @param[in] need_read_ack specifies whether receive water mark data or not (0 - do not receive water mark data, 1 - receive read_ack data)
+* @param[in] last_read_ack_timestamp specifies time of last read_ack
+* @param[in] need_ordered_chat_member_list specifies whether need odered chat memebr list or not
* @param[in] user_data specifies additional user input data (unused)
* @param[out] error_code specifies error code
* @return MESSAGE_ADAPTOR_ERROR_NONE (0) on success, otherwise a positive error value
/* These defines must be located before #include <dlog.h> */
#define TIZEN_ENGINEER_MODE
-// TODO: Investigate why this macro is defined somewhere else
+/* TODO: Investigate why this macro is defined somewhere else */
#ifndef TIZEN_DEBUG_ENABLE
#define TIZEN_DEBUG_ENABLE
#endif
* @param[out] val Value to be returned when expression is true
*/
#define push_adaptor_retv_if(expr, val) do { \
- if(expr) { \
- LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, push_adaptor_gettid()); \
- return (val); \
- } \
- } while (0)
+ if (expr) { \
+ LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, push_adaptor_gettid()); \
+ return (val); \
+ } \
+ } while (0)
/**
* @brief Prints debug messages
* @param[in] args Arguments to be displayed
*/
#define push_adaptor_debug(fmt, arg...) do { \
- LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, push_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, push_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints info messages
* @param[in] args Arguments to be displayed
*/
#define push_adaptor_info(fmt, arg...) do { \
- LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, push_adaptor_gettid() ,##arg); \
- } while (0)
+ LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, push_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints warning messages
* @param[in] args Arguments to be displayed
*/
#define push_adaptor_warning(fmt, arg...) do { \
- LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET,push_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET, push_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints error messages
* @param[in] args Arguments to be displayed
*/
#define push_adaptor_error(fmt, arg...) do { \
- LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET,push_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET, push_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints fatal messages
* @param[in] args Arguments to be displayed
*/
#define push_adaptor_fatal(fmt, arg...) do { \
- LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET,push_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET, push_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints debug message on entry to particular function
* @param[in] args Arguments to be displayed
*/
#define push_adaptor_debug_func(fmt, arg...) do { \
- LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, push_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, push_adaptor_gettid(), ##arg); \
+ } while (0)
#define plugin_req_enter() do { \
push_adaptor_info("[ENTER] plugin API call -)) -)) -)) -)) -)) -)) -)) -)) -)) -))"); \
/**
* @brief Push Adaptor error code
*/
-typedef enum push_error_code_e
-{
+typedef enum push_error_code_e {
PUSH_ADAPTOR_ERROR_NONE = 0,
PUSH_ADAPTOR_ERROR_LAUNCH = 1, /**< 1 ~ 99: internal error*/
PUSH_ADAPTOR_ERROR_INIT = 2,
/**
* @brief Push Adaptor plugin context structure
*/
-typedef struct push_adaptor_plugin_context_s
-{
+typedef struct push_adaptor_plugin_context_s {
char *push_app_id; /**< unique key >*/
char *plugin_uri;
- void *plugin_info;
+ void *plugin_info;
int state; /* Adaptor defined and share with plugin (getter: adaptor, setter: plugin) */
} push_adaptor_plugin_context_t;
typedef struct push_adaptor_plugin_context_s *push_adaptor_plugin_context_h;
-typedef enum
-{
+typedef enum {
PUSH_ADAPTOR_STATE_DISCONNECTED = 0,
PUSH_ADAPTOR_STATE_CONNECTED = 1,
} push_adaptor_connection_state_e;
/**
* @brief Push Adaptor error code
*/
-typedef struct push_adaptor_error_code_s
-{
- int64_t code;
- char *msg;
+typedef struct push_adaptor_error_code_s {
+ int64_t code;
+ char *msg;
} push_adaptor_error_code_t;
typedef struct push_adaptor_error_code_s *push_adaptor_error_code_h;
/**
* @brief Push Adaptor notification data
*/
-typedef struct push_adaptor_notification_data_s
-{
- char *data;
- char *msg;
- long long int time_stamp;
+typedef struct push_adaptor_notification_data_s {
+ char *data;
+ char *msg;
+ long long int time_stamp;
char *sender;
char *app_id;
char *session_info;
* @see
*/
typedef void(*push_adaptor_service_on_notification_received_cb)
- (push_adaptor_notification_data_h notification, void *user_data);
+ (push_adaptor_notification_data_h notification, void *user_data);
/**
* @brief Callback for service_adaptor_connect_push_service API for push plugin
* @see
*/
typedef void(*push_adaptor_plugin_on_notification_received_cb)
- (push_adaptor_notification_data_h notification, void *user_data);
+ (push_adaptor_notification_data_h notification, void *user_data);
/**
* @brief Push Adaptor listener for Service Adaptor
*/
-typedef struct push_adaptor_listener_s
-{
- push_adaptor_service_on_notification_received_cb _on_notification_received;
+typedef struct push_adaptor_listener_s {
+ push_adaptor_service_on_notification_received_cb _on_notification_received;
} push_adaptor_listener_t;
typedef struct push_adaptor_listener_s *push_adaptor_listener_h;
/**
* @brief Push Adaptor listener for plugins
*/
-typedef struct push_adaptor_plugin_listener_s
-{
- push_adaptor_plugin_on_notification_received_cb _on_notification_received;
+typedef struct push_adaptor_plugin_listener_s {
+ push_adaptor_plugin_on_notification_received_cb _on_notification_received;
} push_adaptor_plugin_listener_t;
typedef struct push_adaptor_plugin_listener_s *push_adaptor_plugin_listener_h;
/**
* @brief Push Adaptor plugin handle
*/
-typedef struct push_adaptor_plugin_handle_s
-{
+typedef struct push_adaptor_plugin_handle_s {
/**< mandatory >*/
push_error_code_t (*create_context)(push_adaptor_plugin_context_h *context,
const char *push_app_id);
push_error_code_t (*connect)(push_adaptor_plugin_context_h context);
/**< optional >*/
- push_error_code_t (*disconnect)(push_adaptor_plugin_context_h context);
+ push_error_code_t (*disconnect)(push_adaptor_plugin_context_h context);
/**< optional >*/
push_error_code_t (*request_unread_notification)(push_adaptor_plugin_context_h context);
/**
* @brief Asynchronous request to get unread notifications
*
-* @param[in] plugin specifies push adaptor plugin handle
+* @param[in] plugin specifies push adaptor plugin handle
* @param[in] context specifies push adaptor plugin context handle
* @param[out] error specifies error code
* @return 0 on success, otherwise a positive error value
/*
EXPORT_API
push_error_code_t push_adaptor_register(push_adaptor_plugin_h, push_adaptor_plugin_context_h,
- void *svc_in, void *opt_in, void **svc_out, void **opt_out);
+ void *svc_in, void *opt_in, void **svc_out, void **opt_out);
EXPORT_API
push_error_code_t push_adaptor_deregister(push_adaptor_plugin_h, push_adaptor_plugin_context_h,
- void *svc_in, void *opt_in, void **svc_out, void **opt_out);
+ void *svc_in, void *opt_in, void **svc_out, void **opt_out);
EXPORT_API
push_error_code_t push_adaptor_get_notification_data(push_adaptor_plugin_h, push_adaptor_plugin_context_h,
- void *svc_in, void *opt_in, void **svc_out, void **opt_out);
+ void *svc_in, void *opt_in, void **svc_out, void **opt_out);
EXPORT_API
push_error_code_t push_adaptor_get_notification_message(push_adaptor_plugin_h, push_adaptor_plugin_context_h,
- void *svc_in, void *opt_in, void **svc_out, void **opt_out);
+ void *svc_in, void *opt_in, void **svc_out, void **opt_out);
EXPORT_API
push_error_code_t push_adaptor_get_notification_time(push_adaptor_plugin_h, push_adaptor_plugin_context_h,
- void *svc_in, void *opt_in, void **svc_out, void **opt_out);
+ void *svc_in, void *opt_in, void **svc_out, void **opt_out);
EXPORT_API
push_error_code_t push_adaptor_get_unread_notification(push_adaptor_plugin_h, push_adaptor_plugin_context_h,
- void *svc_in, void *opt_in, void **svc_out, void **opt_out);
+ void *svc_in, void *opt_in, void **svc_out, void **opt_out);
EXPORT_API
push_error_code_t push_adaptor_get_registration_id(push_adaptor_plugin_h, push_adaptor_plugin_context_h,
- void *svc_in, void *opt_in, void **svc_out, void **opt_out);
+ void *svc_in, void *opt_in, void **svc_out, void **opt_out);
EXPORT_API
push_error_code_t push_adaptor_free_notification(push_adaptor_plugin_h, push_adaptor_plugin_context_h,
- void *svc_in, void *opt_in, void **svc_out, void **opt_out);
+ void *svc_in, void *opt_in, void **svc_out, void **opt_out);
*/
#endif /* __PUSH_ADAPTOR_H__ */
#ifndef __SHOP_ADAPTOR_LOG_H__\r
#define __SHOP_ADAPTOR_LOG_H__\r
\r
-//#define WORK_IN_LOCAL\r
+/* #define WORK_IN_LOCAL */\r
\r
/**\r
* HOW TO USE IT:\r
\r
/* These defines must be located before #include <dlog.h> */\r
#define TIZEN_ENGINEER_MODE\r
-// TODO: Investigate why this macro is defined somewhere else\r
+/* TODO: Investigate why this macro is defined somewhere else */\r
#ifndef TIZEN_DEBUG_ENABLE\r
#define TIZEN_DEBUG_ENABLE\r
#endif\r
* @param[out] val Value to be returned when expression is true\r
*/\r
#define shop_adaptor_retv_if(expr, val) do { \\r
- if(expr) { \\r
- LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, shop_adaptor_gettid()); \\r
- return (val); \\r
- } \\r
- } while (0)\r
+ if (expr) { \\r
+ LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, shop_adaptor_gettid()); \\r
+ return (val); \\r
+ } \\r
+ } while (0)\r
\r
/**\r
* @brief Prints debug messages\r
* @param[in] args Arguments to be displayed\r
*/\r
#define shop_adaptor_debug(fmt, arg...) do { \\r
- LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, shop_adaptor_gettid(), ##arg); \\r
- } while (0)\r
+ LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, shop_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
/**\r
* @brief Prints info messages\r
* @param[in] args Arguments to be displayed\r
*/\r
#define shop_adaptor_info(fmt, arg...) do { \\r
- LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, shop_adaptor_gettid() ,##arg); \\r
- } while (0)\r
+ LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, shop_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
/**\r
* @brief Prints warning messages\r
* @param[in] args Arguments to be displayed\r
*/\r
#define shop_adaptor_warning(fmt, arg...) do { \\r
- LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET,shop_adaptor_gettid(), ##arg); \\r
- } while (0)\r
+ LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET, shop_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
/**\r
* @brief Prints error messages\r
* @param[in] args Arguments to be displayed\r
*/\r
#define shop_adaptor_error(fmt, arg...) do { \\r
- LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET,shop_adaptor_gettid(), ##arg); \\r
- } while (0)\r
+ LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET, shop_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
/**\r
* @brief Prints fatal messages\r
* @param[in] args Arguments to be displayed\r
*/\r
#define shop_adaptor_fatal(fmt, arg...) do { \\r
- LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET,shop_adaptor_gettid(), ##arg); \\r
- } while (0)\r
+ LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET, shop_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
/**\r
* @brief Prints debug message on entry to particular function\r
* @param[in] args Arguments to be displayed\r
*/\r
#define shop_adaptor_debug_func(fmt, arg...) do { \\r
- LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, shop_adaptor_gettid(), ##arg); \\r
- } while (0)\r
+ LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, shop_adaptor_gettid(), ##arg); \\r
+ } while (0)\r
\r
#define plugin_req_enter() do { \\r
shop_adaptor_info("[ENTER] plugin API call -)) -)) -)) -)) -)) -)) -)) -)) -)) -))"); \\r
/**
* @ brief Shop adaptor error code
*/
-typedef enum shop_error_code_e
-{
+typedef enum shop_error_code_e {
SHOP_ADAPTOR_ERROR_NONE = 0,
SHOP_ADAPTOR_ERROR_LAUNCH = 1, /**< 1 ~ 99: internal error*/
SHOP_ADAPTOR_ERROR_INIT = 2,
/**
* @brief Describes infromation about shop
*/
-typedef struct _service_adaptor_shop_info_s
-{
+typedef struct _service_adaptor_shop_info_s {
int category_id; /**< specifies category id of item*/
long item_id; /**< specifies item id*/
long sticker_id; /**< specifies sticker id*/
/**
* @ brief Describes infromation about item
*/
-typedef struct _service_adaptor_shop_item_s
-{
+typedef struct _service_adaptor_shop_item_s {
long item_id; /**< specifies item id*/
int category_id; /**< specifies category id of item*/
long *sticker_ids; /**< specifies sticker id*/
/**
* @ brief Shop adaptor plugin context structure
*/
-typedef struct shop_adaptor_plugin_context_s
-{
+typedef struct shop_adaptor_plugin_context_s {
char *duid;
char *access_token;
char *appid;
typedef struct shop_adaptor_plugin_context_s *shop_adaptor_plugin_context_h;
-typedef enum shop_plugin_result_code_e
-{
+typedef enum shop_plugin_result_code_e {
SHOP_PLUGIN_RESULT_SUCCEDED = 0,
SHOP_PLUGIN_RESULT_FAILED = -1,
SHOP_PLUGIN_RESULT_CANCELED = -2
/**
* @brief Enumerations of signal code for Service Adaptor
*/
-typedef enum _shop_adaptor_error_e
-{
+typedef enum _shop_adaptor_error_e {
SERVICE_ADAPTOR_ERROR_NONE = 0,
SERVICE_ADAPTOR_ERROR_INTERNAL = -1,
SERVICE_ADAPTOR_ERROR_DBUS = -2,
/**
* @brief Describes infromation about Service Adaptor's error
*/
-typedef struct shop_adaptor_error_code_s
-{
+typedef struct shop_adaptor_error_code_s {
int64_t code;
- char *msg;
+ char *msg;
} shop_adaptor_error_code_t;
typedef struct shop_adaptor_error_code_s *shop_adaptor_error_code_h;
-typedef struct shop_plugin_error_s
-{
- char *code;
- char *msg;
+typedef struct shop_plugin_error_s {
+ char *code;
+ char *msg;
} shop_plugin_error_t;
-typedef struct shop_adaptor_listener_s
-{
+typedef struct shop_adaptor_listener_s {
} shop_adaptor_listener_t;
typedef struct shop_adaptor_listener_s *shop_adaptor_listener_h;
* Shop adaptor listener for plugins (example)
* Listener is used by plugins
*/
-typedef struct shop_adaptor_plugin_listener_s
-{
+typedef struct shop_adaptor_plugin_listener_s {
} shop_adaptor_plugin_listener_t;
typedef struct shop_adaptor_plugin_listener_s *shop_adaptor_plugin_listener_h;
/**
* @ brief Shop adaptor plugin handle
*/
-typedef struct shop_adaptor_plugin_handle_s
-{
- // Mandatory functions to handle plugin in adaptor
- //struct shop_adaptor_plugin_handle_s * (*create_plugin_handle)(void);
+typedef struct shop_adaptor_plugin_handle_s {
+ /* Mandatory functions to handle plugin in adaptor */
+ /* struct shop_adaptor_plugin_handle_s * (*create_plugin_handle)(void); */
shop_error_code_t (*create_context)(shop_adaptor_plugin_context_h *context,
char *duid,
shop_error_code_t (*destroy_handle)(struct shop_adaptor_plugin_handle_s *handle);
shop_error_code_t (*set_listener)(shop_adaptor_plugin_listener_h listener);
shop_error_code_t (*unset_listener)(void);
- // Mandatory end
- // Optional
+ /* Mandatory end */
+ /* Optional */
shop_error_code_t (*get_item_list_v1) (shop_adaptor_plugin_context_h handle,
shop_adaptor_shop_info_s *info,
void *user_data,
shop_error_code_t (*set_server_info)(shop_adaptor_plugin_context_h handle,
GHashTable *server_info,
shop_adaptor_error_code_h *error_code);
- // Optional end
+ /* Optional end */
- // Mandatory
- char *plugin_uri; // get from config file
- // Mandatory end
+ /* Mandatory */
+ char *plugin_uri; /* get from config file */
+ /* Mandatory end */
} shop_adaptor_plugin_handle_t;
typedef struct shop_adaptor_plugin_handle_s *shop_adaptor_plugin_handle_h;
GHashTable *server_info,
shop_adaptor_error_code_h *error_code);
-////////////////////////////////////////////////////////////
-// Adaptor Plugin call Functions
-////////////////////////////////////////////////////////////
+/**********************************************************/
+/* Adaptor Plugin call Functions */
+/**********************************************************/
/**
* @brief Get List of Item
* @retval error code defined in shop_error_code_e - SHOP_ADAPTOR_ERROR_NONE if Successful
*/
EXPORT_API
-shop_error_code_t shop_adaptor_get_item_list_v1 (shop_adaptor_plugin_h plugin,
+shop_error_code_t shop_adaptor_get_item_list_v1(shop_adaptor_plugin_h plugin,
shop_adaptor_plugin_context_h context,
shop_adaptor_shop_info_s *info,
void *user_data,
/* These defines must be located before #include <dlog.h> */
#define TIZEN_ENGINEER_MODE
-// TODO: Investigate why this macro is defined somewhere else
+/* TODO: Investigate why this macro is defined somewhere else */
#ifndef TIZEN_DEBUG_ENABLE
#define TIZEN_DEBUG_ENABLE
#endif
* @param[out] val Value to be returned when expression is true
*/
#define storage_adaptor_retv_if(expr, val) do { \
- if(expr) { \
- LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, storage_adaptor_gettid()); \
- return (val); \
- } \
- } while (0)
+ if (expr) { \
+ LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, storage_adaptor_gettid()); \
+ return (val); \
+ } \
+ } while (0)
/**
* @brief Prints debug messages
* @param[in] args Arguments to be displayed
*/
#define storage_adaptor_debug(fmt, arg...) do { \
- LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, storage_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, storage_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints info messages
* @param[in] args Arguments to be displayed
*/
#define storage_adaptor_info(fmt, arg...) do { \
- LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, storage_adaptor_gettid() ,##arg); \
- } while (0)
+ LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, storage_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints warning messages
* @param[in] args Arguments to be displayed
*/
#define storage_adaptor_warning(fmt, arg...) do { \
- LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET,storage_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET, storage_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints error messages
* @param[in] args Arguments to be displayed
*/
#define storage_adaptor_error(fmt, arg...) do { \
- LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET,storage_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET, storage_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints fatal messages
* @param[in] args Arguments to be displayed
*/
#define storage_adaptor_fatal(fmt, arg...) do { \
- LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET,storage_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET, storage_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints debug message on entry to particular function
* @param[in] args Arguments to be displayed
*/
#define storage_adaptor_debug_func(fmt, arg...) do { \
- LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, storage_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, storage_adaptor_gettid(), ##arg); \
+ } while (0)
#define storage_adaptor_check_param_equal(compare, val, ret_val, exception_handling) {\
- if ( compare == val ) {\
+ if (compare == val) {\
LOGD(FONT_COLOR_PURPLE "[%d]<Line :%d>" "Parameter Check catched (equal) \n : Expected(%p) Value(%p)" FONT_COLOR_RESET, storage_adaptor_gettid(), __LINE__, compare, val);\
exception_handling;\
return ret_val;\
- }\
+ } \
}
#define plugin_req_enter() do { \
/**
* Storage adaptor error code
*/
-typedef enum storage_error_code_e
-{
+typedef enum storage_error_code_e {
STORAGE_ADAPTOR_ERROR_NONE = 0,
STORAGE_ADAPTOR_ERROR_LAUNCH = 1, /**< 1 ~ 99: internal error*/
STORAGE_ADAPTOR_ERROR_INIT = 2,
/**
* Storage adaptor error code
*/
-typedef enum _storage_plugin_internal_error_code_e
-{
- STORAGE_PLUGIN_ERROR_HTTP_BAD_REQUEST = 400,
- STORAGE_PLUGIN_ERROR_HTTP_UNAUTHORIZED = 401,
+typedef enum _storage_plugin_internal_error_code_e {
+ STORAGE_PLUGIN_ERROR_HTTP_BAD_REQUEST = 400,
+ STORAGE_PLUGIN_ERROR_HTTP_UNAUTHORIZED = 401,
STORAGE_PLUGIN_ERROR_HTTP_FORBIDDEN = 403,
STORAGE_PLUGIN_ERROR_HTTP_NOT_FOUND = 404,
STORAGE_PLUGIN_ERROR_HTTP_METHOD_NOT_ALLOWED = 405,
- STORAGE_PLUGIN_ERROR_HTTP_BAD_GATEWAY = 502,
+ STORAGE_PLUGIN_ERROR_HTTP_BAD_GATEWAY = 502,
STORAGE_PLUGIN_ERROR_HTTP_SERVICE_UNAVAILBLE = 503,
- STORAGE_PLUGIN_ERROR_HTTP_INSUFFICIENT_STORAGE = 507,
+ STORAGE_PLUGIN_ERROR_HTTP_INSUFFICIENT_STORAGE = 507,
STORAGE_PLUGIN_ERROR_HTTP_ETC = 598,
STORAGE_PLUGIN_ERROR_HTTP_UNKNOWN = 599,
STORAGE_PLUGIN_ERROR_FILE_OPEN_FAILED = 701,
STORAGE_PLUGIN_ERROR_FILE_NOT_EXIST = 702,
STORAGE_PLUGIN_ERROR_FILE_TRANSFER_CANCELED = 703,
- STORAGE_PLUGIN_ERROR_FILE_AREADY_EXIST = 704, // EEXIST
- STORAGE_PLUGIN_ERROR_FILE_ACCESS_DENIED = 705, // EACCES
+ STORAGE_PLUGIN_ERROR_FILE_AREADY_EXIST = 704, /* EEXIST */
+ STORAGE_PLUGIN_ERROR_FILE_ACCESS_DENIED = 705, /* EACCES */
STORAGE_PLUGIN_ERROR_FILE_ETC = 798,
STORAGE_PLUGIN_ERROR_FILE_UNKNOWN = 799,
/**
* Storage adaptor status code
*/
-typedef enum _storage_adaptor_transfer_state_e
-{
+typedef enum _storage_adaptor_transfer_state_e {
STORAGE_ADAPTOR_TRANSFER_STATE_IN_PROGRESS = 1,
STORAGE_ADAPTOR_TRANSFER_STATE_FINISHED = 2,
- STORAGE_ADAPTOR_TRANSFER_STATE_CANCELED = 3, // canceled by request
- STORAGE_ADAPTOR_TRANSFER_STATE_FAILED = 4, // canceled by system
+ STORAGE_ADAPTOR_TRANSFER_STATE_CANCELED = 3, /* canceled by request */
+ STORAGE_ADAPTOR_TRANSFER_STATE_FAILED = 4, /* canceled by system */
- STORAGE_ADAPTOR_TRANSFER_STATE_RESUME, // not use this version yet (Next feature)
- STORAGE_ADAPTOR_TRANSFER_STATE_PAUSED, // not use this version yet (Next feature)
+ STORAGE_ADAPTOR_TRANSFER_STATE_RESUME, /* not use this version yet (Next feature) */
+ STORAGE_ADAPTOR_TRANSFER_STATE_PAUSED, /* not use this version yet (Next feature) */
- // Private feature
+ /* Private feature */
STORAGE_ADAPTOR_TRANSFER_STATUS_PROGRESS = 1,
STORAGE_ADAPTOR_TRANSFER_STATUS_RESUME = 1,
STORAGE_ADAPTOR_TRANSFER_STATUS_PAUSE = 2,
- STORAGE_ADAPTOR_TRANSFER_STATUS_CANCEL = 3, // canceled by request
- STORAGE_ADAPTOR_TRANSFER_STATUS_STOPPED = 4, // canceled by system
+ STORAGE_ADAPTOR_TRANSFER_STATUS_CANCEL = 3, /* canceled by request */
+ STORAGE_ADAPTOR_TRANSFER_STATUS_STOPPED = 4, /* canceled by system */
STORAGE_ADAPTOR_TRANSFER_STATUS_FINISHED = 5
} storage_adaptor_transfer_state_e;
typedef storage_adaptor_transfer_state_e storage_adaptor_transfer_status_e;
-typedef enum
-{
+typedef enum {
STORAGE_ADAPTOR_FILE_ACCESS_READ = O_RDONLY,
STORAGE_ADAPTOR_FILE_ACCESS_WRITE = O_WRONLY|O_CREAT|O_EXCL,
} storage_adaptor_file_access_mode_e;
/**
* Storage adaptor content type
*/
-typedef enum _storage_adaptor_content_type_e
-{
- STORAGE_ADAPTOR_CONTENT_TYPE_DEFAULT = -1, // initalize value
+typedef enum _storage_adaptor_content_type_e {
+ STORAGE_ADAPTOR_CONTENT_TYPE_DEFAULT = -1, /* initalize value */
STORAGE_ADAPTOR_CONTENT_TYPE_IMGAE = 160,
STORAGE_ADAPTOR_CONTENT_TYPE_VIDEO = 161,
/**
* Storage adaptor plugin context structure
*/
-typedef struct storage_adaptor_plugin_context_s
-{
- // Context variables
+typedef struct storage_adaptor_plugin_context_s {
+ /* Context variables */
int context_id;
storage_adaptor_plugin_h plugin_handle;
- // User define (input by service-adaptor)
+ /* User define (input by service-adaptor) */
char *app_id;
char *app_secret;
char *access_token;
char *uid;
char *service_name;
- // Plugin define (input by plugin)
- char *plugin_uri; // mandatory (package id)
- void *plugin_data; // optional
+ /* Plugin define (input by plugin) */
+ char *plugin_uri; /* mandatory (package id) */
+ void *plugin_data; /* optional */
} storage_adaptor_plugin_context_t;
typedef struct storage_adaptor_plugin_context_s *storage_adaptor_plugin_context_h;
/**
* Structure for error code from server
*/
-typedef struct storage_adaptor_error_code_s
-{
+typedef struct storage_adaptor_error_code_s {
int64_t code;
char *msg;
} storage_adaptor_error_code_t;
typedef struct storage_adaptor_error_code_s *storage_adaptor_error_code_h;
-typedef struct _storage_adaptor_media_meta_s
-{
+typedef struct _storage_adaptor_media_meta_s {
char *mime_type;
char *title;
char *album;
char *extra_media_meta;
} storage_adaptor_media_meta_s;
-typedef struct _storage_adaptor_cloud_meta_s
-{
+typedef struct _storage_adaptor_cloud_meta_s {
char *service_name;
unsigned long long usage_byte;
unsigned long long quota_byte;
char *extra_cloud_meta;
} storage_adaptor_cloud_meta_s;
-// private only!!
+/* private only!! */
/**
* Structure Storage File Share token Infomation
*/
-typedef struct storage_adaptor_file_share_token_s
-{
+typedef struct storage_adaptor_file_share_token_s {
char *public_token;
char *auth_code;
} storage_adaptor_file_share_token_t;
/**
* Structure Storage File Infomation
*/
-typedef struct storage_adaptor_file_info_s
-{
- // Common
+typedef struct storage_adaptor_file_info_s {
+ /* Common */
char *plugin_uri; /**< specifies plugin name generated file_info */
char *object_id; /**< specifies file object id be used in storage */
char *storage_path; /**< specifies file path in storage */
unsigned long long file_size; /**< specifies file size (recomend byte)*/
int file_info_index; /**< specifies file info index (wide use; e.g : chunk upload, multi download)*/
- // private only!!
+ /* private only!! */
int revision;
unsigned long long timestamp;
char *type;
storage_adaptor_file_share_token_h file_share_token;
- // public defined
+ /* public defined */
unsigned long long created_time; /**< specifies timestamp */
unsigned long long modified_time; /**< specifies timestamp */
storage_adaptor_content_type_e content_type;
/**
* Storage adaptor plugin handle
*/
-typedef struct storage_adaptor_plugin_handle_s
-{
- // Mandatory functions to handle plugin in adaptor
+typedef struct storage_adaptor_plugin_handle_s {
+ /* Mandatory functions to handle plugin in adaptor */
storage_error_code_t (*create_context)(storage_adaptor_plugin_context_h *context,
const char *app_id,
const char *app_secret,
storage_error_code_t (*destroy_handle)(struct storage_adaptor_plugin_handle_s *handle);
storage_error_code_t (*set_listener)(storage_adaptor_plugin_listener_h listener);
storage_error_code_t (*unset_listener)(void);
- // Mandatory end
+ /* Mandatory end */
- // Optional
+ /* Optional */
- storage_error_code_t (*open_file) (storage_adaptor_plugin_context_h context, // Do Not define from plugin (TBD)
+ storage_error_code_t (*open_file) (storage_adaptor_plugin_context_h context, /* Do Not define from plugin (TBD) */
const char *file_path,
storage_adaptor_file_access_mode_e mode,
int *file_descriptor,
storage_adaptor_error_code_h *error);
- storage_error_code_t (*close_file) (storage_adaptor_plugin_context_h context, // Do Not define from plugin (TBD)
+ storage_error_code_t (*close_file) (storage_adaptor_plugin_context_h context, /* Do Not define from plugin (TBD) */
int file_descriptor,
storage_adaptor_error_code_h *error);
storage_error_code_t (*start_upload_task)(storage_adaptor_plugin_context_h context,
- int src_file_descriptor, // read only opened
+ int src_file_descriptor, /* read only opened */
const char *upload_dir_path,
const char *file_name,
bool need_progress,
storage_error_code_t (*start_download_task)(storage_adaptor_plugin_context_h context,
const char *storage_dir_path,
const char *file_name,
- int dst_file_descriptor, // write only opened
+ int dst_file_descriptor, /* write only opened */
bool need_progress,
storage_adaptor_error_code_h *error,
void *user_data);
storage_error_code_t (*start_download_thumb_task)(storage_adaptor_plugin_context_h context,
const char *storage_dir_path,
const char *file_name,
- int dst_file_descriptor, // write only opened
- int thumbnail_size, // level (defined plugin SPEC)
+ int dst_file_descriptor, /* write only opened */
+ int thumbnail_size, /* level (defined plugin SPEC) */
bool need_progress,
storage_adaptor_error_code_h *error,
void *user_data);
int file_descriptor,
storage_adaptor_error_code_h *error);
- // common (yet)
+ /* common (yet) */
storage_error_code_t (*set_server_info)(storage_adaptor_plugin_context_h context,
GHashTable *server_info,
void *request,
storage_adaptor_error_code_h *error,
void *response);
- // Optional end
- // common
+ /* Optional end */
+ /* common */
storage_error_code_t (*get_root_folder_path)(storage_adaptor_plugin_context_h context,
void *request,
char **root_folder_path,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*list)(storage_adaptor_plugin_context_h context,
const char *parent_folder_storage_path,
const char *folder_name,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*make_directory)(storage_adaptor_plugin_context_h context,
const char *parent_folder_storage_path,
const char *folder_name,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*upload_file_sync)(storage_adaptor_plugin_context_h context,
const char *parent_folder_storage_path,
const char *file_name,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*download_file_sync)(storage_adaptor_plugin_context_h context,
const char *parent_folder_storage_path,
const char *file_name,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*download_thumbnail)(storage_adaptor_plugin_context_h context,
const char *folder_path,
const char *file_name,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*delete_file)(storage_adaptor_plugin_context_h context,
const char *parent_folder_storage_path,
const char *file_name,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*remove_directory)(storage_adaptor_plugin_context_h context,
const char *parent_folder_storage_path,
const char *folder_name,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*move_file)(storage_adaptor_plugin_context_h context,
const char *parent_folder_storage_path,
const char *file_name,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*move_directory)(storage_adaptor_plugin_context_h context,
const char *parent_folder_storage_path,
const char *folder_name,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*set_transfer_state)(storage_adaptor_plugin_context_h context,
void *transfer_request_id,
storage_adaptor_transfer_state_e state,
storage_adaptor_error_code_h *error,
void *response);
- // common
+ /* common */
storage_error_code_t (*get_transfer_state)(storage_adaptor_plugin_context_h context,
void *transfer_request_id,
void *request,
storage_adaptor_error_code_h *error,
void *response);
- // Optional end
+ /* Optional end */
- // Mandatory
- char *plugin_uri; // get from config file
- // Mandatory end
+ /* Mandatory */
+ char *plugin_uri; /* get from config file */
+ /* Mandatory end */
} storage_adaptor_plugin_handle_t;
typedef struct storage_adaptor_plugin_handle_s *storage_adaptor_plugin_handle_h;
* Callback function variable for service adaptor
*/
-// private feature
+/* private feature */
typedef void (*storage_adaptor_service_download_file_async_reply_cb)(void *transfer_request_id,
char *download_file_local_path,
storage_adaptor_error_code_h error,
storage_adaptor_error_code_h error,
void *response);
-// public feature
+/* public feature */
typedef void (*storage_adaptor_service_download_state_changed_reply_cb)(long long int file_descriptor,
storage_adaptor_transfer_state_e state,
storage_adaptor_error_code_h error,
* Storage adaptor listener for service adaptor
* Listener is used by service adaptor
*/
-typedef struct storage_adaptor_listener_s
-{
-// private feature
+typedef struct storage_adaptor_listener_s {
+/*/ private feature */
void (*download_file_async_reply)(void *transfer_request_id,
char *download_file_local_path,
storage_adaptor_error_code_h error,
storage_adaptor_error_code_h error,
void *response);
-// public feature
+/* public feature */
void (*download_state_changed_reply)(long long int file_descriptor,
storage_adaptor_transfer_state_e state,
storage_adaptor_error_code_h error,
* Callback function variables for plugins
* These callbacks are expected to be support by plugins
*/
-// private feature
+/* private feature */
typedef void (*storage_adaptor_plugin_download_file_async_reply_cb)(void *transfer_request_id,
char *download_file_local_path,
storage_adaptor_error_code_h error,
storage_adaptor_error_code_h error,
void *response);
-// public feature
+/* public feature */
typedef void (*storage_adaptor_plugin_download_state_changed_reply_cb)(int file_descriptor,
storage_adaptor_transfer_state_e state,
storage_adaptor_error_code_h error,
* Storage adaptor listener for plugins
* Listener is used by plugins
*/
-typedef struct storage_adaptor_plugin_listener_s
-{
-// private feature
+typedef struct storage_adaptor_plugin_listener_s {
+/* private feature */
storage_adaptor_plugin_download_file_async_reply_cb storage_adaptor_download_file_async_reply;
- storage_adaptor_plugin_upload_file_async_reply_cb storage_adaptor_upload_file_async_reply;
- storage_adaptor_plugin_file_transfer_progress_reply_cb storage_adaptor_file_transfer_progress_reply;
+ storage_adaptor_plugin_upload_file_async_reply_cb storage_adaptor_upload_file_async_reply;
+ storage_adaptor_plugin_file_transfer_progress_reply_cb storage_adaptor_file_transfer_progress_reply;
-// public feature
+/* public feature */
storage_adaptor_plugin_download_state_changed_reply_cb storage_adaptor_download_state_changed_reply;
- storage_adaptor_plugin_upload_state_changed_reply_cb storage_adaptor_upload_state_changed_reply;
- storage_adaptor_plugin_task_progress_reply_cb storage_adaptor_task_progress_reply;
+ storage_adaptor_plugin_upload_state_changed_reply_cb storage_adaptor_upload_state_changed_reply;
+ storage_adaptor_plugin_task_progress_reply_cb storage_adaptor_task_progress_reply;
} storage_adaptor_plugin_listener_t;
/**
int storage_adaptor_load_plugin(storage_adaptor_h,
const char *plugin_path);
-// For 3rd party plugin packages
+/* For 3rd party plugin packages */
EXPORT_API
int storage_adaptor_load_plugin_from_package(storage_adaptor_h adaptor,
const char *package_id,
EXPORT_API
GList *storage_adaptor_get_plugins(storage_adaptor_h adaptor);
-////////////////////////////////////////////////////////////
-// Adaptor Util Functions
-////////////////////////////////////////////////////////////
+/**********************************************************/
+/* Adaptor Util Functions */
+/**********************************************************/
EXPORT_API
storage_adaptor_file_info_h storage_adaptor_create_file_info(void);
int storage_adaptor_destroy_file_info(storage_adaptor_file_info_h *file_info);
-////////////////////////////////////////////////////////////
-// Adaptor Plugin call Functions
-////////////////////////////////////////////////////////////
+/**********************************************************/
+/* Adaptor Plugin call Functions */
+/**********************************************************/
EXPORT_API
EXPORT_API
storage_error_code_t storage_adaptor_start_upload_task(storage_adaptor_plugin_h plugin,
storage_adaptor_plugin_context_h context,
- long long int src_file_descriptor, // read only opened
+ long long int src_file_descriptor, /* read only opened */
const char *upload_dir_path,
const char *file_name,
bool need_progress,
storage_adaptor_plugin_context_h context,
const char *storage_dir_path,
const char *file_name,
- long long int dst_file_descriptor, // write only opened
+ long long int dst_file_descriptor, /* write only opened */
bool need_progress,
storage_adaptor_error_code_h *error,
void *user_data);
storage_adaptor_plugin_context_h context,
const char *storage_dir_path,
const char *file_name,
- long long int dst_file_descriptor, // write only opened
- int thumbnail_size, // level (defined plugin SPEC)
+ long long int dst_file_descriptor, /* write only opened */
+ int thumbnail_size, /* level (defined plugin SPEC) */
bool need_progress,
storage_adaptor_error_code_h *error,
void *user_data);
#include "service_adaptor_client_type.h"
#include "service_adaptor_client_private.h"
-#define __safe_add_string(x) (x==NULL)?"":x
+#define __safe_add_string(x) (x == NULL) ? "" : x
#define SECURITY_SERVER_COOKIE_BUFFER_SIZE 21
/*==================================================================================================
- FUNCTION PROTOTYPES
+ FUNCTION PROTOTYPES
==================================================================================================*/
GDBusProxy *_dbus_get_sac_interface_proxy();
#define CONTACT_PROFILE_IMAGE_PATH_LEN 2048
-typedef struct _service_adaptor_profile_image_s
-{
+typedef struct _service_adaptor_profile_image_s {
service_adaptor_contact_request_type_e type;
int index;
char path[CONTACT_PROFILE_IMAGE_PATH_LEN];
#define __TIZEN_SOCIAL_SERVICE_ADAPTOR_DBUS_CLIENT_LAYER_H__
/*==================================================================================================
- FUNCTION PROTOTYPES
+ FUNCTION PROTOTYPES
==================================================================================================*/
/**
#include "service_adaptor_client_storage.h"
#include "service_adaptor_client_storage_internal.h"
-//////////////////////// private feature
+/* private feature */
#include "private/service-adaptor-client-storage.h"
-//////////////////////// private feature
+/* private feature */
void on_storage_signal(GDBusProxy *proxy,
gchar *sender_name,
#include "service_adaptor_client_type.h"
/*==================================================================================================
- FUNCTION PROTOTYPES
+ FUNCTION PROTOTYPES
==================================================================================================*/
/**
/**
* @brief Describes contact infromation for request
*/
-typedef struct _service_adaptor_contact_info_req_s
-{
+typedef struct _service_adaptor_contact_info_req_s {
char *tp; /**< specifies status as none*/
char *id; /**< specifies status as none*/
char *pn; /**< specifies status as none*/
/**
* @brief Describes request infromation about contact
*/
-typedef struct _service_adaptor_contact_req_s
-{
+typedef struct _service_adaptor_contact_req_s {
long long int tt; /**< specifies status as none*/
service_adaptor_contact_info_req_s **cts; /**< specifies status as none*/
unsigned int cts_len; /**< specifies status as none*/
/**
* @brief Describes contact infromation for response
*/
-typedef struct _service_adaptor_contact_info_res_s
-{
+typedef struct _service_adaptor_contact_info_res_s {
char *duid; /**< specifies status as none*/
char *id; /**< specifies status as none*/
char *msisdn; /**< specifies status as none*/
char *nm; /**< specifies status as none*/
char **evnt; /**< specifies status as none*/
unsigned int evnt_len; /**< specifies status as none*/
-// char *img; /**< specifies status as none*/
+ /* char *img; */ /**< specifies status as none*/
service_adaptor_profile_image_h *images;
unsigned int images_len;
char **adrs; /**< specifies status as none*/
/**
* @brief Describes response infromation about contact
*/
-typedef struct _service_adaptor_contact_res_s
-{
+typedef struct _service_adaptor_contact_res_s {
long long int tt; /**< specifies status as none*/
service_adaptor_contact_info_res_s **cts; /**< specifies status as none*/
unsigned int cts_len; /**< specifies status as none*/
/**
* @brief Describes request infromation about profile
*/
-typedef struct _service_adaptor_profile_req_s
-{
+typedef struct _service_adaptor_profile_req_s {
char *cc; /**< specifies status as none*/
char *pn; /**< specifies status as none*/
char *nm; /**< specifies status as none*/
/**
* @brief Describes response infromation about profile
*/
-typedef struct _service_adaptor_profile_res_s
-{
+typedef struct _service_adaptor_profile_res_s {
char *nm; /**< specifies status as none*/
char *img; /**< specifies status as none*/
char *prsc; /**< specifies status as none*/
/**
* @brief Describes privacy infromation for request
*/
-typedef struct _service_adaptor_privacy_info_req_s
-{
+typedef struct _service_adaptor_privacy_info_req_s {
char *cc; /**< specifies status as none*/
char *pn; /**< specifies status as none*/
} service_adaptor_privacy_info_req_s;
/**
* @brief Describes request infromation about privacy
*/
-typedef struct _service_adaptor_privacy_req_s
-{
+typedef struct _service_adaptor_privacy_req_s {
unsigned int lvl; /**< specifies status as none*/
service_adaptor_privacy_info_req_s **cts; /**< specifies status as none*/
unsigned int cts_len; /**< specifies status as none*/
/**
* @brief Describes response infromation about privacy
*/
-typedef struct _service_adaptor_privacy_res_s
-{
+typedef struct _service_adaptor_privacy_res_s {
unsigned int lvl; /**< specifies status as none*/
unsigned int prscon; /**< specifies status as none*/
} service_adaptor_privacy_res_s;
/**
* @brief Describes presence infromation for request
*/
-typedef struct _service_adaptor_presence_req_s
-{
+typedef struct _service_adaptor_presence_req_s {
char *prsc; /**< specifies status as none*/
char *status; /**< specifies status as none*/
unsigned int prscon; /**< specifies status as none*/
} service_adaptor_presence_req_s;
/*==================================================================================================
- FUNCTION PROTOTYPES
+ FUNCTION PROTOTYPES
==================================================================================================*/
/**
service_adaptor_error_s **error_code,
void *user_data);
-typedef enum
-{
+typedef enum {
SERVICE_ADAPTOR_CONTACT_SET = 1,
SERVICE_ADAPTOR_CONTACT_DELETE = 2,
} service_adaptor_contact_request_type_e;
-int service_adaptor_profile_image_create (service_adaptor_profile_image_h *image);
+int service_adaptor_profile_image_create(service_adaptor_profile_image_h *image);
-int service_adaptor_profile_image_set_element (service_adaptor_profile_image_h image,
+int service_adaptor_profile_image_set_element(service_adaptor_profile_image_h image,
service_adaptor_contact_request_type_e req_type,
int index,
const char *path);
-int service_adaptor_profile_image_get_index (service_adaptor_profile_image_h image, int *index);
+int service_adaptor_profile_image_get_index(service_adaptor_profile_image_h image, int *index);
-int service_adaptor_profile_image_get_url (service_adaptor_profile_image_h image, char **url);
+int service_adaptor_profile_image_get_url(service_adaptor_profile_image_h image, char **url);
-int service_adaptor_profile_image_get_req_type (service_adaptor_profile_image_h image, int *req_type);
+int service_adaptor_profile_image_get_req_type(service_adaptor_profile_image_h image, int *req_type);
-void service_adaptor_profile_image_destroy (service_adaptor_profile_image_h image);
+void service_adaptor_profile_image_destroy(service_adaptor_profile_image_h image);
#include "service-adaptor-client.h"
#include "service_adaptor_client_type.h"
-typedef enum _service_adaptor_connection_policy_e
-{
+typedef enum _service_adaptor_connection_policy_e {
SERVICE_ADAPTOR_CONNECTION_POLICY_AUTO = 0,
SERVICE_ADAPTOR_CONNECTION_POLICY_CONNECT = 1,
SERVICE_ADAPTOR_CONNECTION_POLICY_DISCONNECT = 2,
/**
* @brief Describes infromation about violation users of wrong receivers
*/
-typedef struct _service_adaptor_did_violation_users_s
-{
+typedef struct _service_adaptor_did_violation_users_s {
long long int usera;
long long int userb;
} service_adaptor_did_violation_users_s;
/**
* @brief Describes infromation about wrong receivers
*/
-typedef struct _service_adaptor_wrong_receiver_s
-{
+typedef struct _service_adaptor_wrong_receiver_s {
long long int *invalid_receivers; /**< specifies status as none*/
unsigned int invalid_receivers_len; /**< specifies status as none*/
long long int *interrupted_receivers; /**< specifies status as none*/
/**
* @brief Describes infromation about chat message
*/
-typedef struct _service_adaptor_chat_msg_s
-{
+typedef struct _service_adaptor_chat_msg_s {
long long int msg_id; /**< specifies status as none*/
int msg_type; /**< specifies status as none*/
char *chatmsg; /**< specifies status as none*/
/**
* @brief Describes infromation about processed message
*/
-typedef struct _service_adaptor_processed_msg_s
-{
+typedef struct _service_adaptor_processed_msg_s {
long long int msg_id; /**< specifies status as none*/
long long int sent_time; /**< specifies status as none*/
} service_adaptor_processed_msg_s;
/**
* @brief Describes infromation about delivery ack
*/
-typedef struct _service_adaptor_delivery_ack_s
-{
+typedef struct _service_adaptor_delivery_ack_s {
long long int user_id;
long long int msg_id;
long long int timestamp;
/**
* @brief Describes infromation about read_ack
*/
-typedef struct _service_adaptor_read_ack_s
-{
+typedef struct _service_adaptor_read_ack_s {
long long int user_id; /**< specifies status as none*/
long long int msg_id; /**< specifies status as none*/
long long int timestamp; /**< specifies status as none*/
/**
* @brief Describes infromation about ordered chat member
*/
-typedef struct _service_adaptor_ordered_chat_member_s
-{
+typedef struct _service_adaptor_ordered_chat_member_s {
long long int user_id; /**< specifies status as none*/
bool available; /**< specifies status as none*/
char *name; /**< specifies status as none*/
/**
* @brief Describes infromation about inbox message
*/
-typedef struct _service_adaptor_inbox_message_s
-{
+typedef struct _service_adaptor_inbox_message_s {
long long int msg_id; /**< specifies status as none*/
int msg_type; /**< specifies status as none*/
long long int sender; /**< specifies status as none*/
/**
* @brief Describes infromation about end chat
*/
-typedef struct _service_adaptor_end_chat_s
-{
+typedef struct _service_adaptor_end_chat_s {
long long int chatroom_id; /**< specifies status as none*/
bool deny_invitation;
} service_adaptor_end_chat_s;
/**
* @brief Describes infromation about phone number
*/
-typedef struct _service_adaptor_phone_number_s
-{
+typedef struct _service_adaptor_phone_number_s {
char *phonenumber; /**< specifies status as none*/
char *ccc; /**< specifies status as none*/
} service_adaptor_phone_number_s;
/**
* @brief Describes infromation about chat id
*/
-typedef struct _service_adaptor_chat_id_s
-{
+typedef struct _service_adaptor_chat_id_s {
long long int chatid; /**< specifies status as none*/
char *msisdn; /**< specifies status as none*/
} service_adaptor_chat_id_s;
* @pre service_adaptor_request_channel_auth will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_channel_auth_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_channel_auth_cb)(service_adaptor_h handle,
long long int request_id,
service_adaptor_error_s *error_code,
void *server_data);
* @pre service_adaptor_request_client_echo will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_client_echo_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_client_echo_cb)(service_adaptor_h handle,
long long int request_id,
service_adaptor_error_s *error_code,
void *server_data);
* @pre service_adaptor_request_create_chatroom will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_create_chatroom_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_create_chatroom_cb)(service_adaptor_h handle,
long long int request_id,
long long int chatroom_id,
int default_message_ttl,
void *server_data);
typedef void (*service_adaptor_reply_change_chatroom_meta_cb)(service_adaptor_h handle,
- long long int request_id,
- long long int chatroom_id,
- service_adaptor_error_s *error_code,
- void *server_data);
+ long long int request_id,
+ long long int chatroom_id,
+ service_adaptor_error_s *error_code,
+ void *server_data);
/**
* @pre service_adaptor_request_chat will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_chat_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_chat_cb)(service_adaptor_h handle,
long long int request_id,
long long int chatroom_id,
service_adaptor_processed_msg_s **processed_msgs,
* @pre service_adaptor_request_allow_chat will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_allow_chat_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_allow_chat_cb)(service_adaptor_h handle,
long long int request_id,
long long int chatroom_id,
service_adaptor_delivery_ack_s **delivery_acks,
* @pre service_adaptor_request_all_unread_message will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_all_unread_message_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_all_unread_message_cb)(service_adaptor_h handle,
long long int request_id,
service_adaptor_error_s *error_code,
void *server_data);
* @pre service_adaptor_register_forward_online_message_listener will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_request_forward_online_message_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_request_forward_online_message_cb)(service_adaptor_h handle,
long long int request_id,
long long int chatroom_id,
int chat_type,
* @pre service_adaptor_register_forward_online_message_listener will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_request_forward_unread_message_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_request_forward_unread_message_cb)(service_adaptor_h handle,
long long int request_id,
service_adaptor_inbox_message_s **inbox_msgs,
unsigned int inbox_msgs_len,
* @pre service_adaptor_request_read_message will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_read_message_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_read_message_cb)(service_adaptor_h handle,
long long int request_id,
long long int chatroom_id,
service_adaptor_error_s *error_code,
* @pre service_adaptor_request_invite_chat will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_invite_chat_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_invite_chat_cb)(service_adaptor_h handle,
long long int request_id,
long long int chatroom_id,
long long int sent_time,
* @pre service_adaptor_request_end_chat will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_end_chat_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_end_chat_cb)(service_adaptor_h handle,
long long int request_id,
service_adaptor_error_s *error_code,
void *server_data);
* @pre service_adaptor_request_unseal_message will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_unseal_message_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_unseal_message_cb)(service_adaptor_h handle,
long long int request_id,
long long int chatroom_id,
service_adaptor_error_s *error_code,
* @pre service_adaptor_request_save_call_log will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_save_call_log_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_save_call_log_cb)(service_adaptor_h handle,
long long int request_id,
service_adaptor_error_s *error_code,
void *server_data);
* @pre service_adaptor_request_current_time will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_reply_current_time_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_reply_current_time_cb)(service_adaptor_h handle,
long long int request_id,
long long int current_time_millis,
service_adaptor_error_s *error_code,
void *server_data);
/*==================================================================================================
- FUNCTION PROTOTYPES
+ FUNCTION PROTOTYPES
==================================================================================================*/
#ifdef NOT_IN_USE
/**
* @brief Describes push information
*/
-typedef struct _service_adaptor_push_notification_s
-{
+typedef struct _service_adaptor_push_notification_s {
char *data; /**< specifies status as none*/
char *message; /**< specifies status as none*/
long long int time; /**< specifies status as none*/
* @pre service_adaptor_connect_push_service will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_push_notification_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_push_notification_cb)(service_adaptor_h handle,
service_adaptor_push_notification_s *noti_info,
service_adaptor_error_s *error_code,
void *user_data);
/*==================================================================================================
- FUNCTION PROTOTYPES
+ FUNCTION PROTOTYPES
==================================================================================================*/
/**
/**
* @brief Describes infromation about shop
*/
-typedef struct _service_adaptor_shop_info_s
-{
+typedef struct _service_adaptor_shop_info_s {
int category_id; /**< specifies category id of item*/
long item_id; /**< specifies item id*/
long sticker_id; /**< specifies sticker id*/
/**
* @brief Describes infromation about item
*/
-typedef struct _service_adaptor_shop_item_s
-{
+typedef struct _service_adaptor_shop_item_s {
long item_id; /**< specifies category id of item*/
int category_id; /**< specifies category id of item*/
long *sticker_ids; /**< specifies category id of item*/
} service_adaptor_shop_item_s;
/*==================================================================================================
- FUNCTION PROTOTYPES
+ FUNCTION PROTOTYPES
==================================================================================================*/
/**
#include "service-adaptor-client.h"
-typedef enum _service_adaptor_file_status_code_e
-{
+typedef enum _service_adaptor_file_status_code_e {
SERVICE_ADAPTOR_TRANSFER_STATUS_PROGRESS = 1,
SERVICE_ADAPTOR_TRANSFER_STATUS_RESUME = 1,
SERVICE_ADAPTOR_TRANSFER_STATUS_PAUSE = 2,
- SERVICE_ADAPTOR_TRANSFER_STATUS_CANCEL = 3, // canceled by request
- SERVICE_ADAPTOR_TRANSFER_STATUS_STOPPED = 4, // canceled by system
+ SERVICE_ADAPTOR_TRANSFER_STATUS_CANCEL = 3, /* canceled by request */
+ SERVICE_ADAPTOR_TRANSFER_STATUS_STOPPED = 4, /* canceled by system */
SERVICE_ADAPTOR_TRANSFER_STATUS_FINISHED = 5
} service_adaptor_file_status_code_e;
-typedef enum _service_adaptor_thumbnail_size_e
-{
+typedef enum _service_adaptor_thumbnail_size_e {
SERVICE_ADAPTOR_THUMBNAIL_XSMALL = 96,
SERVICE_ADAPTOR_THUMBNAIL_SMALL = 200,
SERVICE_ADAPTOR_THUMBNAIL_MEDIUM = 500,
/**
* @brief Describes file description about download and upload
*/
-typedef struct _service_adaptor_file_s
-{
+typedef struct _service_adaptor_file_s {
int file_description; /**< specifies status as none*/
} service_adaptor_file_s;
/**
* @brief Describes file infromation about download and upload
*/
-typedef struct _service_adaptor_file_path_s
-{
+typedef struct _service_adaptor_file_path_s {
char **file_paths; /**< specifies status as none*/
unsigned int file_paths_len; /**< specifies status as none*/
} service_adaptor_file_path_s;
/**
* @brief Describes file status about transfer
*/
-typedef struct _service_adaptor_file_status_s
-{
+typedef struct _service_adaptor_file_status_s {
long long int total_size; /**< specifies status as none*/
long long int transferred_size; /**< specifies status as none*/
service_adaptor_file_status_code_e status; /**< specifies status as none*/
* @pre service_adaptor_request_channel_auth will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_file_progress_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_file_progress_cb)(service_adaptor_h handle,
service_adaptor_file_h file_handle,
unsigned long long transferred_size,
unsigned long long total_size,
* @pre service_adaptor_request_channel_auth will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_file_transfer_completion_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_file_transfer_completion_cb)(service_adaptor_h handle,
service_adaptor_file_h file_handle,
char *publish_url,
service_adaptor_error_s *error_code,
void *user_data);
/*==================================================================================================
- FUNCTION PROTOTYPES
+ FUNCTION PROTOTYPES
==================================================================================================*/
/**
* @brief Enumerations of result code for Service Adaptor
*/
-typedef enum _service_adaptor_result_e
-{
+typedef enum _service_adaptor_result_e {
SERVICE_ADAPTOR_RESULT_SUCCEEDED = SERVICE_ADAPTOR_ERROR_NONE, /**< specifies status as none*/
SERVICE_ADAPTOR_RESULT_FAILED = -1, /**< specifies status as none*/
- SERVICE_ADAPTOR_RESULT_CANCELED = -2 /**< specifies status as none*/
+ SERVICE_ADAPTOR_RESULT_CANCELED = -2 /**< specifies status as none*/
} __service_adaptor_result_e; /*TODO deplicate*/
typedef int service_adaptor_result_e; /* For version compatibility */
/**
* @brief Enumerations of error code for Service Adaptor
*/
-typedef enum _private_service_adaptor_error_e
-{
+typedef enum _private_service_adaptor_error_e {
SERVICE_ADAPTOR_ERROR_LAUNCH = 1, /**< 1 ~ 99: internal error*/
SERVICE_ADAPTOR_ERROR_INIT = 2,
SERVICE_ADAPTOR_ERROR_DEINIT = 3,
/**
* @brief Type of service in plugin (ext internal)
*/
-typedef enum
-{
+typedef enum {
SERVICE_PLUGIN_SERVICE_CONTACT = (0x01 << 2), /**< Contact service type flag */
SERVICE_PLUGIN_SERVICE_MESSAGE = (0x01 << 3), /**< Message service type flag */
SERVICE_PLUGIN_SERVICE_SHOP = (0x01 << 4), /**< Shop service type flag */
/**
* @brief Describes infromation about plugin
*/
-typedef struct _service_adaptor_plugin_s
-{
+typedef struct _service_adaptor_plugin_s {
char *name; /**< specifies status as none*/
bool login; /**< specifies status as none*/
} service_adaptor_plugin_s;
* @pre service_adaptor_connect() will invoke this callback.
* @see
*/
-typedef void(* service_adaptor_signal_cb)(service_adaptor_h handle,
+typedef void(*service_adaptor_signal_cb)(service_adaptor_h handle,
service_adaptor_signal_code_e signal,
char *msg);
/*==================================================================================================
- FUNCTION PROTOTYPES
+ FUNCTION PROTOTYPES
==================================================================================================*/
/* These defines must be located before #include <dlog.h> */
#define TIZEN_ENGINEER_MODE
-// TODO: Investigate why this macro is defined somewhere else
+/* TODO: Investigate why this macro is defined somewhere else */
#ifndef TIZEN_DEBUG_ENABLE
#define TIZEN_DEBUG_ENABLE
#endif
* @param[out] val Value to be returned when expression is true
*/
#define sac_retv_if(expr, val) do { \
- if(expr) { \
- LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, sac_gettid()); \
- return (val); \
- } \
- } while (0)
+ if (expr) { \
+ LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, sac_gettid()); \
+ return (val); \
+ } \
+ } while (0)
/**
* @brief Prints debug messages
* @param[in] args Arguments to be displayed
*/
#define sac_debug(fmt, arg...) do { \
- LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, sac_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, sac_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints info messages
* @param[in] args Arguments to be displayed
*/
#define sac_info(fmt, arg...) do { \
- LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, sac_gettid() ,##arg); \
- } while (0)
+ LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, sac_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints warning messages
* @param[in] args Arguments to be displayed
*/
#define sac_warning(fmt, arg...) do { \
- LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET,sac_gettid(), ##arg); \
- } while (0)
+ LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET, sac_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints error messages
* @param[in] args Arguments to be displayed
*/
#define sac_error(fmt, arg...) do { \
- LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET,sac_gettid(), ##arg); \
- } while (0)
+ LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET, sac_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints fatal messages
* @param[in] args Arguments to be displayed
*/
#define sac_fatal(fmt, arg...) do { \
- LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET,sac_gettid(), ##arg); \
- } while (0)
+ LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET, sac_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints debug message on entry to particular function
* @param[in] args Arguments to be displayed
*/
#define sac_debug_func(fmt, arg...) do { \
- LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, sac_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, sac_gettid(), ##arg); \
+ } while (0)
#define sac_api_start() do { \
sac_info("API start <%s>", __FUNCTION__); \
sac_info("API end <%s> : %d", __FUNCTION__, (int)ret); \
} while (0)
-#define FUNC_START() do{sac_debug_func(FONT_COLOR_BOLDBLACK">>>>>>>> Start\n%s"FONT_COLOR_RESET, __FUNCTION__);}while(0)
-#define FUNC_STEP() do{sac_debug_func(FONT_COLOR_BOLDBLACK"====== Step\n%s"FONT_COLOR_RESET, __FUNCTION__);}while(0)
-#define FUNC_STOP() do{sac_debug_func(FONT_COLOR_BOLDBLACK"<<==<<== Stop\n%s"FONT_COLOR_RESET, __FUNCTION__);}while(0)
-#define FUNC_END() do{sac_debug_func(FONT_COLOR_BOLDBLACK"<<<<<<<< End\n%s"FONT_COLOR_RESET, __FUNCTION__);}while(0)
+#define FUNC_START() do { sac_debug_func(FONT_COLOR_BOLDBLACK">>>>>>>> Start\n%s"FONT_COLOR_RESET, __FUNCTION__); } while (0)
+#define FUNC_STEP() do { sac_debug_func(FONT_COLOR_BOLDBLACK"====== Step\n%s"FONT_COLOR_RESET, __FUNCTION__); } while (0)
+#define FUNC_STOP() do { sac_debug_func(FONT_COLOR_BOLDBLACK"<<==<<== Stop\n%s"FONT_COLOR_RESET, __FUNCTION__); } while (0)
+#define FUNC_END() do { sac_debug_func(FONT_COLOR_BOLDBLACK"<<<<<<<< End\n%s"FONT_COLOR_RESET, __FUNCTION__); } while (0)
#ifdef __cplusplus
#define DLL_LOCAL
#else
#if __GNUC__ >= 4
- #define DLL_IMPORT __attribute__ ((visibility ("default")))
- #define DLL_EXPORT __attribute__ ((visibility ("default")))
- #define DLL_LOCAL __attribute__ ((visibility ("hidden")))
+ #define DLL_IMPORT __attribute__ ((visibility("default")))
+ #define DLL_EXPORT __attribute__ ((visibility("default")))
+ #define DLL_LOCAL __attribute__ ((visibility("hidden")))
#else
#define DLL_IMPORT
#define DLL_EXPORT
/**
* @brief Describes infromation about Service Adaptor
*/
-struct _service_adaptor_s
-{
+struct _service_adaptor_s {
void *on_signal;
-// struct _service_plugin_s **plugins; //TODO
-// int plugin_count; // TODO
+/* struct _service_plugin_s **plugins; */
+/* int plugin_count; /* TODO */
-/////////////////////// private feature
+/* private feature start */
char *service_name; /**< specifies status as none*/
char *user_id; /**< specifies status as none*/
char *app_id; /**< specifies status as none*/
GMutex set_auth_mutex;
service_adaptor_plugin_s *plugin; /**< specifies status as none*/
-/////////////////////// private feature
+/* private feature end */
};
-typedef struct _plugin_entry_s
-{
+typedef struct _plugin_entry_s {
char *plugin_uri;
int installed_mask;
-}plugin_entry_t;
+} plugin_entry_t;
-typedef enum _client_app_type_e
-{
+typedef enum _client_app_type_e {
CLIENT_APP_TYPE_APPLICATION = 1,
CLIENT_APP_TYPE_ETC = 0,
-}client_app_type_e;
+} client_app_type_e;
-struct _service_plugin_s
-{
+struct _service_plugin_s {
struct _service_adaptor_s *adaptor;
char *service_handle_name;
typedef struct _service_plugin_s service_plugin_s;
-void _service_adaptor_set_last_result (int code, const char *message);
+void _service_adaptor_set_last_result(int code, const char *message);
#define service_adaptor_set_last_result(code, msg) do { \
sac_error("Error occured (%d)(%s)", (int)(code), (msg)); \
/**
* Storage adaptor content type
*/
-typedef enum _service_storage_file_content_type_e
-{
- SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_DEFAULT = -1, // initalize value
+typedef enum _service_storage_file_content_type_e {
+ SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_DEFAULT = -1, /* initalize value */
SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_IMGAE = 160,
SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_VIDEO = 161,
SERVICE_ADAPTOR_STORAGE_CONTENT_TYPE_METADATA = 2048,
} service_storage_content_type_e;
-typedef struct _service_storage_media_meta_s
-{
+typedef struct _service_storage_media_meta_s {
char *mime_type;
char *title;
char *album;
char *extra_media_meta;
} service_storage_media_meta_s;
-typedef struct _service_storage_cloud_meta_s
-{
+typedef struct _service_storage_cloud_meta_s {
char *service_name;
unsigned long long usage_byte;
unsigned long long quota_byte;
/**
* @brief Describes file information description
*/
-struct _service_storage_file_s
-{
+struct _service_storage_file_s {
char *plugin_name; /**< specifies plugin name generated file_info */
char *object_id; /**< specifies file object id be used in storage */
char *storage_path; /**< specifies file path in storage */
#define TASK_MESSAGE_FORWARD_UNREAD_MESSAGE -101
#define TASK_MESSAGE_CHANNEL_DISCONNECTED_MESSAGE -102
-///////////////// private feature
+/* private feature start */
#define PRIVATE_SIGNAL_FILE_PROGRESS_ID 11000
#define PRIVATE_SIGNAL_FILE_TRANSFER_COMPLETION_ID 11001
-///////////////// private feature
+/* private feature end */
#define SIGNAL_STORAGE_FILE_PROGRESS_ID 1000
#define SIGNAL_STORAGE_FILE_STATE_CHANGED_ID 1001
#define SIGNAL_SERVICE_ADAPTOR 9000
-//////////////////////////////////////////////////////////////////////////////////
-///// Signal Task area
-//////////////////////
+/***************************************/
+/* Signal Task area start */
+/***************************************/
-typedef struct _service_storage_task_s
-{
+typedef struct _service_storage_task_s {
char *service_handle_name;
- long long int task_id; // file_uid (matched fd)
+ long long int task_id; /* file_uid (matched fd) */
void *param1;
void *param2;
void *param3;
- int operation; // 1: upload, 2: download, 3:thumbnail (TEMP)
+ int operation; /* 1: upload, 2: download, 3:thumbnail (TEMP) */
int state;
service_storage_task_state_cb state_callback;
void *state_user_data;
service_storage_task_progress_cb progress_callback;
void *progress_user_data;
-}service_storage_task_t;
+} service_storage_task_t;
/**
* @brief Describes infromation about task
*/
-typedef struct _service_adaptor_task_s
-{
+typedef struct _service_adaptor_task_s {
int64_t id; /**< specifies status as none*/
uint32_t callback; /**< specifies status as none*/
void *handle; /**< specifies status as none*/
* @brief Describes infromation about Service Adaptor's error
* @remarks 'msg' is need free()
*/
-typedef struct _service_adaptor_error_s
-{
+typedef struct _service_adaptor_error_s {
long long int code; /**< specifies status as none*/
char *msg; /**< specifies status as none*/
} service_adaptor_error_s;
/**
* @brief Enumerations of signal code for Service Adaptor
*/
-typedef enum _service_adaptor_signal_code_e
-{
+typedef enum _service_adaptor_signal_code_e {
SERVICE_ADAPTOR_SIGNAL_INITIALIZED = 1, /* Service adaptor finished initalization */
SERVICE_ADAPTOR_SIGNAL_NEW_PLUGIN = 2, /* New Plugins loaded in a running time */
SERVICE_ADAPTOR_SIGNAL_ACTIVATE_PLUGIN = 3, /* Some Plugins be activated by policy or user atholization or etc */
SERVICE_ADAPTOR_SIGNAL_SHUTDOWN = 4, /* Service adaptor was shutdowned by unsuspected issue */
} service_adaptor_signal_code_e;
-//////////////////////
-///// Signal Task area
-//////////////////////////////////////////////////////////////////////////////////
-
-
-//////////////////////////////////////////////////////////////////////////////////
-///// Storage Task area
-//////////////////////
-
-
-//////////////////////
-///// Storage Task area
-//////////////////////////////////////////////////////////////////////////////////
-
-
+/***************************************/
+/* Signal Task area end */
+/***************************************/
#ifdef __cplusplus
}
#define sac_check_param_null(val, val_name) {\
if (NULL == (val)) {\
- sac_error ("\"%s\" is NULL, return SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER(%d)", \
+ sac_error("\"%s\" is NULL, return SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER(%d)", \
(const char *)val_name, (int)SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER);\
return SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER;\
- }\
+ } \
}
#ifdef __cplusplus
/**
* @brief Describes infromation about Plugin Handle
*/
-typedef struct _service_provider_s
-{
- service_adaptor_error_e (*connect)(void);
- service_adaptor_error_e (*disconnect)(void);
+typedef struct _service_provider_s {
+ service_adaptor_error_e(*connect)(void);
+ service_adaptor_error_e(*disconnect)(void);
auth_provider_h auth_provider;
storage_provider_h storage_provider;
/* These defines must be located before #include <dlog.h> */
#define TIZEN_ENGINEER_MODE
-// TODO: Investigate why this macro is defined somewhere else
+/* TODO: Investigate why this macro is defined somewhere else */
#ifndef TIZEN_DEBUG_ENABLE
#define TIZEN_DEBUG_ENABLE
#endif
{
#endif /* __cplusplus */
- /**
- * Colors of font
- */
+/**
+ * Colors of font
+ */
#define FONT_COLOR_RESET "\033[0m"
#define FONT_COLOR_BLACK "\033[30m" /* Black */
#define FONT_COLOR_RED "\033[31m" /* Red */
* @param[out] val Value to be returned when expression is true
*/
#define LSP_LOG_retv_if(expr, val) do { \
- if(expr) { \
- LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, LSP_LOG_gettid()); \
- return (val); \
- } \
- } while (0)
+ if (expr) { \
+ LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, LSP_LOG_gettid()); \
+ return (val); \
+ } \
+ } while (0)
/**
* @brief Prints debug messages
* @param[in] args Arguments to be displayed
*/
#define LSP_LOG_debug(fmt, arg...) do { \
- LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, LSP_LOG_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, LSP_LOG_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints info messages
* @param[in] args Arguments to be displayed
*/
#define LSP_LOG_info(fmt, arg...) do { \
- LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, LSP_LOG_gettid() ,##arg); \
- } while (0)
+ LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, LSP_LOG_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints warning messages
* @param[in] args Arguments to be displayed
*/
#define LSP_LOG_warning(fmt, arg...) do { \
- LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET,LSP_LOG_gettid(), ##arg); \
- } while (0)
+ LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET, LSP_LOG_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints error messages
* @param[in] args Arguments to be displayed
*/
#define LSP_LOG_error(fmt, arg...) do { \
- LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET,LSP_LOG_gettid(), ##arg); \
- } while (0)
+ LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET, LSP_LOG_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints fatal messages
* @param[in] args Arguments to be displayed
*/
#define LSP_LOG_fatal(fmt, arg...) do { \
- LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET,LSP_LOG_gettid(), ##arg); \
- } while (0)
+ LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET, LSP_LOG_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints debug message on entry to particular function
* @param[in] args Arguments to be displayed
*/
#define LSP_LOG_debug_func(fmt, arg...) do { \
- LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, LSP_LOG_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, LSP_LOG_gettid(), ##arg); \
+ } while (0)
#ifdef __cplusplus
}
#include "pluginConfigTypes.h"
- /**
- * @brief ...
- **/
- typedef void *ConfigHandle;
-
- /**
- * @brief General-purpose, class for loading and reading configuration from
- * simple plaintext files.
- **/
-
- /**
- * @brief Creates a new empty Config object and returns an opaque "handle"
- *
- * @return ConfigHandle an opaque pointer to Config object.
- **/
- API
- ConfigHandle plugin_config_create();
-
- /**
- * @brief Destroy config object
- *
- * @param config_handle an opaque pointer to Config object
- * @return void
- **/
- API
- void plugin_config_delete(ConfigHandle config_handle);
-
- /**
- * @brief Loads the configuration from given file to memory.
- *
- * @param config_handle an opaque pointer to Config object
- * @param filepath configuration will be _loaded from given filepath
- * @param type expected type of configuration file, this value determines how
- * the file is parsed
- * @return void
- **/
- API
- void plugin_config_load(ConfigHandle config_handle, const char *filepath, PluginConfigType type);
-
- /**
- * @brief Unloads the configuration from the memory.
- *
- * The configuration is automatically un_loaded when the program is exitting,
- * so this method does not have to be executed unless you need to extremely
- * lower memory usage and few bytes matter.
- *
- * @param config_handle an opaque pointer to Config object
- * @return void
- **/
- API
- void plugin_config_unload(ConfigHandle config_handle);
-
- /**
- * @brief From _loaded configuration, gets string value attached to given key.
- *
- * @param config_handle an opaque pointer to Config object
- * @param section will return value attached to a key from this section
- * @param key will return value attached to this key
- * @return :string
- **/
- API
- const char *plugin_config_get_string(ConfigHandle config_handle, const char *section, const char *key);
-
- /**
- * @brief From _loaded configuration, gets integer value attached to given key.
- *
- * @param config_handle an opaque pointer to Config object
- * @param section will return value attached to a key from this section
- * @param key will return value attached to this key
- * @return int
- **/
- API
- int plugin_config_get_int(ConfigHandle config_handle, const char *section, const char *key);
-
- /**
- * @brief From _loaded configuration, gets double value attached to given key.
- *
- * @param config_handle an opaque pointer to Config object
- * @param section will return value attached to a key from this section
- * @param key will return value attached to this key
- * @return double
- **/
- API
- double plugin_config_get_double(ConfigHandle config_handle, const char *section, const char *key);
-
- /**
- * @brief Checks wheteher config file has been loaded.
- *
- * @param config_handle an opaque pointer to Config object
- * @return 0 if config is not loaded
- * 1 if config is loaded
- **/
- API
- bool plugin_config_is_loaded(ConfigHandle config_handle);
+/**
+* @brief ...
+**/
+typedef void *ConfigHandle;
+
+/**
+* @brief General-purpose, class for loading and reading configuration from
+* simple plaintext files.
+**/
+
+/**
+* @brief Creates a new empty Config object and returns an opaque "handle"
+*
+* @return ConfigHandle an opaque pointer to Config object.
+**/
+API
+ConfigHandle plugin_config_create();
+
+/**
+* @brief Destroy config object
+*
+* @param config_handle an opaque pointer to Config object
+* @return void
+**/
+API
+void plugin_config_delete(ConfigHandle config_handle);
+
+/**
+* @brief Loads the configuration from given file to memory.
+*
+* @param config_handle an opaque pointer to Config object
+* @param filepath configuration will be _loaded from given filepath
+* @param type expected type of configuration file, this value determines how
+* the file is parsed
+* @return void
+**/
+API
+void plugin_config_load(ConfigHandle config_handle, const char *filepath, PluginConfigType type);
+
+/**
+* @brief Unloads the configuration from the memory.
+*
+* The configuration is automatically un_loaded when the program is exitting,
+* so this method does not have to be executed unless you need to extremely
+* lower memory usage and few bytes matter.
+*
+* @param config_handle an opaque pointer to Config object
+* @return void
+**/
+API
+void plugin_config_unload(ConfigHandle config_handle);
+
+/**
+* @brief From _loaded configuration, gets string value attached to given key.
+*
+* @param config_handle an opaque pointer to Config object
+* @param section will return value attached to a key from this section
+* @param key will return value attached to this key
+* @return :string
+**/
+API
+const char *plugin_config_get_string(ConfigHandle config_handle, const char *section, const char *key);
+
+/**
+* @brief From _loaded configuration, gets integer value attached to given key.
+*
+* @param config_handle an opaque pointer to Config object
+* @param section will return value attached to a key from this section
+* @param key will return value attached to this key
+* @return int
+**/
+API
+int plugin_config_get_int(ConfigHandle config_handle, const char *section, const char *key);
+
+/**
+* @brief From _loaded configuration, gets double value attached to given key.
+*
+* @param config_handle an opaque pointer to Config object
+* @param section will return value attached to a key from this section
+* @param key will return value attached to this key
+* @return double
+**/
+API
+double plugin_config_get_double(ConfigHandle config_handle, const char *section, const char *key);
+
+/**
+* @brief Checks wheteher config file has been loaded.
+*
+* @param config_handle an opaque pointer to Config object
+* @return 0 if config is not loaded
+* 1 if config is loaded
+**/
+API
+bool plugin_config_is_loaded(ConfigHandle config_handle);
#ifdef __cplusplus
}
/* These defines must be located before #include <dlog.h> */
#define TIZEN_ENGINEER_MODE
-// TODO: Investigate why this macro is defined somewhere else
+/* TODO: Investigate why this macro is defined somewhere else */
#ifndef TIZEN_DEBUG_ENABLE
#define TIZEN_DEBUG_ENABLE
#endif
* @param[out] val Value to be returned when expression is true
*/
#define plugin_config_retv_if(expr, val) do { \
- if(expr) { \
+ if (expr) { \
LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, plugin_config_gettid()); \
return (val); \
} \
* @param[in] args Arguments to be displayed
*/
#define plugin_config_info(fmt, arg...) do { \
- LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, plugin_config_gettid() ,##arg); \
+ LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, plugin_config_gettid(), ##arg); \
} while (0)
/**
/**
* @brief Types of supported configuration files.
**/
-typedef enum PluginConfigType
-{
- /**
- * @brief INI file format, as defined here: https://en.wikipedia.org/wiki/INI_file#Format
- **/
- CCT_INI = 1,
+typedef enum PluginConfigType {
+ /**
+ * @brief INI file format, as defined here: https://en.wikipedia.org/wiki/INI_file#Format
+ **/
+ CCT_INI = 1,
- /**
- * @brief Git config file format, as defined here:
- **/
- CCT_GIT = 1 << 1,
+ /**
+ * @brief Git config file format, as defined here:
+ **/
+ CCT_GIT = 1 << 1,
- /**
- * @brief Three column CSV file, columns are: section, key, value.
- * They are separated with commas.
- **/
- CCT_CSV_COMMA = 1 << 2,
+ /**
+ * @brief Three column CSV file, columns are: section, key, value.
+ * They are separated with commas.
+ **/
+ CCT_CSV_COMMA = 1 << 2,
- /**
- * @brief Three column CSV file, columns are: section, key, value.
- * They are separated with tabs.
- **/
- CCT_CSV_TAB = 1 << 3,
+ /**
+ * @brief Three column CSV file, columns are: section, key, value.
+ * They are separated with tabs.
+ **/
+ CCT_CSV_TAB = 1 << 3,
- /**
- * @brief Three column CSV file, columns are: section, key, value.
- * They are separated with colons.
- **/
- CCT_CSV_COLON = 1 << 4,
+ /**
+ * @brief Three column CSV file, columns are: section, key, value.
+ * They are separated with colons.
+ **/
+ CCT_CSV_COLON = 1 << 4,
- /**
- * @brief Three column CSV file, columns are: section, key, value.
- * They are separated with semicolons.
- **/
- CCT_CSV_SEMICOLON = 1 << 5,
+ /**
+ * @brief Three column CSV file, columns are: section, key, value.
+ * They are separated with semicolons.
+ **/
+ CCT_CSV_SEMICOLON = 1 << 5,
- /**
- * @brief As the name suggessts.
- **/
- CCT_INVALID = 0
+ /**
+ * @brief As the name suggessts.
+ **/
+ CCT_INVALID = 0
} PluginConfigType;
#endif /* PLUGIN_CONFIG_TYPES */
{
#endif
-typedef enum
-{
+typedef enum {
PLUGIN_MESSAGE_TYPE_FUNCTION = 1,
PLUGIN_MESSAGE_TYPE_CALLBACK = 2,
} plugin_message_type_e;
#define PLUGIN_DATA_TYPE_LONG 'l'
*/
-// INT/LONG -> NUM (64bit)
+/* INT/LONG -> NUM (64bit) */
#define PLUGIN_DATA_TYPE_NUM 'n'
#define PLUGIN_DATA_TYPE_STRING 's'
#define PLUGIN_DATA_TYPE_BOOL 'b'
/*
-typedef enum
-{
+typedef enum {
PM_TYPE_FALSE = 0,
PM_TYPE_TRUE = 1,
} pmbool_type_e;
typedef char *pmstring;
typedef bool pmbool;
-typedef enum
-{
+typedef enum {
PLUGIN_MESSAGE_ELEMENT_CONTEXT_ID,
PLUGIN_MESSAGE_ELEMENT_FUNCTION_NAME,
PLUGIN_MESSAGE_ELEMENT_PARAMETER_MANDATORY,
* <br>Service adaptor provides functions kind of Auth, Storage and it will provides more kinds of service infra.
* <table>
* <tr>
- * <th>API</th>
+ * <th>API</th>
* <th>Description</th>
* </tr>
* <tr>
- * <td>@ref SERVICE_PLUGIN_MODULE</td>
+ * <td>@ref SERVICE_PLUGIN_MODULE</td>
* <td> Provide functions for handling service plugin</td>
* </tr>
* </table>
* <br>It means kind of plugin set, the APIs can set property for using service and handling service plugin.
* <table>
* <tr>
- * <th>API</th>
+ * <th>API</th>
* <th>Description</th>
* </tr>
* <tr>
- * <td>@ref SERVICE_ADAPTOR_STORAGE_MODULE</td>
+ * <td>@ref SERVICE_ADAPTOR_STORAGE_MODULE</td>
* <td> Provide functions for access and manage storage service</td>
* </tr>
* </table>
* @ingroup SERVICE_PLUGIN_MODULE
* @defgroup SERVICE_ADAPTOR_STORAGE_MODULE Storage
* @brief Provide functions for access and managing storage service
- * @section SERVICE_ADAPTOR_STORAGE_MODULE_HEADER Require Header
+ * @section SERVICE_ADAPTOR_STORAGE_MODULE_HEADER Require Header
* \#include <service_adaptor_client.h>
- * @section SERVICE_ADAPTOR_STORAGE_MODULE_OVERVIEW Overview
+ * @section SERVICE_ADAPTOR_STORAGE_MODULE_OVERVIEW Overview
* It privides common APIs for using various service infra
* <div>
* In this APIs, there are needed two kind of path types.
/**
* @brief Enumerations of result code for Service Adaptor
*/
-typedef enum
-{
+typedef enum {
SERVICE_ADAPTOR_ERROR_NONE = TIZEN_ERROR_NONE, /**< Success */
SERVICE_ADAPTOR_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Service plugin does not support API */
SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< The parameter is invalid */
SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED = TIZEN_ERROR_SERVICE_ADAPTOR | 0x02, /**< The error occured from Plugin, See detail from service_adaptor_get_last_result() and Plugin SPEC */
SERVICE_ADAPTOR_ERROR_NOT_AUTHORIZED = TIZEN_ERROR_SERVICE_ADAPTOR | 0x03, /**< Need Authorization */
SERVICE_ADAPTOR_ERROR_INVALID_STATE = TIZEN_ERROR_SERVICE_ADAPTOR | 0x04, /**< The handle state is invalid for processing API */
-}service_adaptor_error_e;
+} service_adaptor_error_e;
/**
* @brief The handle for connection and managing plugin handle of Service Adaptor
int service_mask,
void *user_data);
/*==================================================================================================
- FUNCTION PROTOTYPES
+ FUNCTION PROTOTYPES
==================================================================================================*/
/**
/**
* @brief Type of service in plugin
*/
-typedef enum
-{
+typedef enum {
SERVICE_PLUGIN_SERVICE_AUTH = (0x01 << 0), /**< Auth service type flag */
SERVICE_PLUGIN_SERVICE_STORAGE = (0x01 << 1), /**< Storage service type flag */
-}service_plugin_service_type_e;
+} service_plugin_service_type_e;
/**
* @brief Definition for the service_plugin property: The application id be issued from service provider for 3rd party developer.
/**
* @brief Type of storage task
*/
-typedef enum
-{
+typedef enum {
SERVICE_STORAGE_TASK_IN_PROGRESS = 1, /**< The task is progressing */
SERVICE_STORAGE_TASK_COMPLETED = 2, /**< The task was completed */
SERVICE_STORAGE_TASK_CANCELED = 3, /**< The task was canceled */
* @retval #SERVICE_ADAPTOR_ERROR_UNKNOWN Unknown error
* @pre API prerequires #service_plugin_start()
*/
-int service_storage_create_download_thumbnail_task (service_plugin_h plugin,
+int service_storage_create_download_thumbnail_task(service_plugin_h plugin,
const char *storage_path,
const char *download_path,
int thumbnail_size,
void dbus_ipc_server_layer_deinit();
#endif /* __DBUS_IPC_H__ */
-// EOF
gpointer user_data);
void dbus_send_to_push_with_activation(int bus_type,
- const char *bus_name,
- const char *object_path,
- const char *interface,
- const char *method,
- void **proxy,
- long long int timestamp,
- const char *data,
- const char *message);
+ const char *bus_name,
+ const char *object_path,
+ const char *interface,
+ const char *method,
+ void **proxy,
+ long long int timestamp,
+ const char *data,
+ const char *message);
#endif /* __DBUS_PUSH_ADAPTOR_H__ */
*/
#define SERVICE_ADAPTOR_START_KEY_PATH tzplatform_mkpath(TZ_SYS_SHARE, "/service-adaptor/.fingerprint")
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-///////////////////
-/////////////////// private feature
-///////////////////
-
+/***********************************************************************/
+/* private feature */
#define private_service_adaptor_essential_s_type_length 1
#define private_service_adaptor_essential_s_type \
"(" \
"s" /* char *service_file_name */ \
")"
-///////////////////
-/////////////////// private feature
-///////////////////
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-///////////////////
-/////////////////// public feature
-///////////////////
+/* private feature */
+/***********************************************************************/
+/***********************************************************************/
+/* public feature */
#define service_adaptor_essential_s_type_length 1
#define service_adaptor_essential_s_type \
"s" /* char * service_name */ \
service_adaptor_file_descriptor_s_type \
")"
-// jwkim async5
#define service_adaptor_start_upload_file_req_s_type_length 5
#define service_adaptor_start_upload_file_req_s_type \
"(" \
"x" /* int64 time_stamp */ \
")"
-///////////////////
-/////////////////// public feature
-///////////////////
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
+/* public feature */
+/***********************************************************************/
+/***********************************************************************/
+/* private feature */
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-///////////////////
-/////////////////// private feature
-///////////////////
/**
* array of structures
#define private_message_inbox_message_list_type "a" private_service_adaptor_inbox_message_s_type
-///////////////////
-/////////////////// private feature
-///////////////////
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
+/* private feature */
+/***********************************************************************/
+
+/***********************************************************************/
+/* public feature */
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-///////////////////
-/////////////////// public feature
-///////////////////
#define plugin_list_type "a" service_adaptor_plugin_s_type
#define storage_file_info_list_type "a" service_adaptor_file_info_s_type
-///////////////////
-/////////////////// public feature
-///////////////////
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
+/* public feature */
+/***********************************************************************/
+
+/***********************************************************************/
+/* common */
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-///////////////////
-/////////////////// common
-///////////////////
/**
* DBus APIs
*/
#define DBUS_SERVICE_ADAPTOR "dbus_00"
-#define DBUS_AUTH_ADAPTOR "dbus_01"
-#define DBUS_CONTACT_ADAPTOR "dbus_02"
-#define DBUS_MESSAGE_ADAPTOR "dbus_03"
-#define DBUS_DISCOVERY_ADAPTOR "dbus_04"
-#define DBUS_SHOP_ADAPTOR "dbus_05"
-#define DBUS_STORAGE_ADAPTOR "dbus_06"
-#define DBUS_PUSH_ADAPTOR "dbus_07"
+#define DBUS_AUTH_ADAPTOR "dbus_01"
+#define DBUS_CONTACT_ADAPTOR "dbus_02"
+#define DBUS_MESSAGE_ADAPTOR "dbus_03"
+#define DBUS_DISCOVERY_ADAPTOR "dbus_04"
+#define DBUS_SHOP_ADAPTOR "dbus_05"
+#define DBUS_STORAGE_ADAPTOR "dbus_06"
+#define DBUS_PUSH_ADAPTOR "dbus_07"
#define DBUS_NAME_LENGTH 7
-///////////////////
-/////////////////// common
-///////////////////
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
+/* common */
+/***********************************************************************/
+
+/***********************************************************************/
+/* private feature */
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-///////////////////
-/////////////////// private feature
-///////////////////
#define PRIVATE_DBUS_CONNECT_SERVICE_ADAPTOR_METHOD DBUS_SERVICE_ADAPTOR "_private""_connect_service_adaptor"
#define PRIVATE_DBUS_SERVICE_ADAPTOR_SIGNAL DBUS_SERVICE_ADAPTOR "_private" "_service_adaptor_signal"
-///////////////////
-/////////////////// private feature
-///////////////////
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
+/* private feature */
+/***********************************************************************/
+
+/***********************************************************************/
+/* public feature */
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-///////////////////
-/////////////////// public feature
-///////////////////
#define DBUS_CONNECT_SERVICE_ADAPTOR_METHOD DBUS_SERVICE_ADAPTOR "_connect_service_adaptor"
#define DBUS_DISCONNECT_SERVICE_ADAPTOR_METHOD DBUS_SERVICE_ADAPTOR "_disconnect_service_adaptor"
#define SERVICE_ADAPTOR_FILE_TRANSFER_STATE_CANCELED 3
#define SERVICE_ADAPTOR_FILE_TRANSFER_STATE_FAILED 4
+/* public feature */
+/***********************************************************************/
-///////////////////
-/////////////////// public feature
-///////////////////
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
-///////////////////
-/////////////////// private feature
-///////////////////
+/***********************************************************************/
+/* private feature */
-typedef enum
-{
+typedef enum {
SERVICE_ADAPTOR_PROTOCOL_RETURN_CODE_NONE = 0,
SERVICE_ADAPTOR_PROTOCOL_RETURN_CODE_COMMON_NO_DATA = 101,
SERVICE_ADAPTOR_PROTOCOL_RETURN_CODE_COMMON_TIMED_OUT = 102,
SERVICE_ADAPTOR_PROTOCOL_RETURN_CODE_MESSAGE_NETWORK = 601,
} service_adaptor_protocol_return_code_e;
-typedef enum
-{
+typedef enum {
SERVICE_ADAPTOR_PROTOCOL_SERVICE_TYPE_AUTH = (0x01 << 0),
SERVICE_ADAPTOR_PROTOCOL_SERVICE_TYPE_STORAGE = (0x01 << 1),
SERVICE_ADAPTOR_PROTOCOL_SERVICE_TYPE_CONTACT = (0x01 << 2),
SERVICE_ADAPTOR_PROTOCOL_SERVICE_TYPE_PUSH = (0x01 << 5),
} service_adaptor_protocol_service_type_e;
-///////////////////
-/////////////////// private feature
-///////////////////
-/////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////
+/* private feature */
+/***********************************************************************/
#endif /* __DBUS_SERVER_H__ */
GDBusMethodInvocation *invocation,
gpointer user_data);
-// private feature
+/* private feature */
service_adaptor_internal_error_code_e private_dbus_storage_file_progress_callback(int32_t fd,
uint64_t progress_size,
uint64_t total_size,
storage_adaptor_error_code_h error_code,
void *server_data);
-// public feature
+/* public feature */
service_adaptor_internal_error_code_e dbus_storage_file_progress_callback(long long int file_uid,
unsigned long long progress_size,
unsigned long long total_size);
#include <glib.h>
#include <gio/gio.h>
-#define __safe_add_string(x) (x==NULL)?"":x
+#define __safe_add_string(x) (x == NULL) ? "" : x
void free_string(gpointer data);
void safe_g_variant_builder_add_string(GVariantBuilder *builder, const char *data);
/* These defines must be located before #include <dlog.h> */
#define TIZEN_ENGINEER_MODE
-// TODO: Investigate why this macro is defined somewhere else
+/* TODO: Investigate why this macro is defined somewhere else */
#ifndef TIZEN_DEBUG_ENABLE
#define TIZEN_DEBUG_ENABLE
#endif
* @param[out] val Value to be returned when expression is true
*/
#define service_adaptor_retv_if(expr, val) do { \
- if(expr) { \
- LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, service_adaptor_gettid()); \
- return (val); \
- } \
- } while (0)
+ if (expr) { \
+ LOGE(FONT_COLOR_PURPLE"[%d]"FONT_COLOR_RESET, service_adaptor_gettid()); \
+ return (val); \
+ } \
+ } while (0)
/**
* @brief Prints debug messages
* @param[in] args Arguments to be displayed
*/
#define service_adaptor_debug(fmt, arg...) do { \
- LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_GREEN"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints info messages
* @param[in] args Arguments to be displayed
*/
#define service_adaptor_info(fmt, arg...) do { \
- LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid() ,##arg); \
- } while (0)
+ LOGI(FONT_COLOR_BLUE"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints warning messages
* @param[in] args Arguments to be displayed
*/
#define service_adaptor_warning(fmt, arg...) do { \
- LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET,service_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGW(FONT_COLOR_YELLOW"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints error messages
* @param[in] args Arguments to be displayed
*/
#define service_adaptor_error(fmt, arg...) do { \
- LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET,service_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGE(FONT_COLOR_RED"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints fatal messages
* @param[in] args Arguments to be displayed
*/
#define service_adaptor_fatal(fmt, arg...) do { \
- LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET,service_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGF(FONT_COLOR_BOLDRED"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints debug message on entry to particular function
* @param[in] args Arguments to be displayed
*/
#define service_adaptor_debug_func(fmt, arg...) do { \
- LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid(), ##arg); \
- } while (0)
+ LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid(), ##arg); \
+ } while (0)
/**
* @brief Prints debug message on entry to particular function
* @param[in] args Arguments to be displayed
*/
#define service_adaptor_debug_secure(fmt, arg...) do { \
- SECURE_LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid(), ##arg); \
- } while (0)
+ SECURE_LOGD(FONT_COLOR_CYAN"[%d]"fmt""FONT_COLOR_RESET, service_adaptor_gettid(), ##arg); \
+ } while (0)
-#define FUNC_START() do{service_adaptor_debug_func("\033[1m\033[32m""Start >>%s>>\n""\033[0m", __FUNCTION__);}while(0)
-#define FUNC_STEP() do{service_adaptor_debug_func("\033[1m\033[32m""Step logging >>%s<<\n""\033[0m", __FUNCTION__);}while(0)
-#define FUNC_END() do{service_adaptor_debug_func("\033[1m\033[36m""End <<%s<<\n""\033[0m", __FUNCTION__);}while(0)
+#define FUNC_START() do {service_adaptor_debug_func("\033[1m\033[32m""Start >>%s>>\n""\033[0m", __FUNCTION__); } while (0)
+#define FUNC_STEP() do {service_adaptor_debug_func("\033[1m\033[32m""Step logging >>%s<<\n""\033[0m", __FUNCTION__); } while (0)
+#define FUNC_END() do {service_adaptor_debug_func("\033[1m\033[36m""End <<%s<<\n""\033[0m", __FUNCTION__); } while (0)
#ifdef __cplusplus
}
#include <tizen.h>
#include "service-adaptor-type.h"
-// TODO It will be re-define another header
+/* TODO It will be re-define another header */
#define SERVICE_ADAPTOR_3RD_PARTY_METADATA_KEY_VERSION "http://tizen.org/service-adaptor/version"
-#define SERVICE_ADAPTOR_3RD_PARTY_METADATA_KEY_AUTH "http://tizen.org/service-adaptor/auth"
+#define SERVICE_ADAPTOR_3RD_PARTY_METADATA_KEY_AUTH "http://tizen.org/service-adaptor/auth"
#define SERVICE_ADAPTOR_3RD_PARTY_METADATA_KEY_STORAGE "http://tizen.org/service-adaptor/storage"
#include "push-adaptor.h"
-typedef struct _push_activate_s
-{
+typedef struct _push_activate_s {
/* service_file_name (unique) */
char *file_name;
#define SERVICE_ADAPTOR_OPERATION_PUSH_NOTI_TO_APPCONTROL "http://tizen.org/serviceadaptor/operation/v1/push"
-typedef struct _service_adaptor_context_info_s
-{
+typedef struct _service_adaptor_context_info_s {
char *user_id;
char *app_id;
unsigned int service_id;
void *property;
} service_adaptor_context_info_s;
-typedef struct _service_adaptor_service_context_s
-{
- char *service_name; // com.serviceadaptor.service1
+typedef struct _service_adaptor_service_context_s {
+ char *service_name; /* com.serviceadaptor.service1 */
char *plugin_uri;
int authenticated;
} service_adaptor_service_context_s;
typedef struct _service_adaptor_service_context_s *service_adaptor_service_context_h;
-typedef struct _service_adaptor_s
-{
+typedef struct _service_adaptor_s {
int started;
GMutex service_adaptor_mutex;
storage_adaptor_listener_h storage_listener;
push_adaptor_listener_h push_listener;
- GList *service_list; // service_adaptor_service_context_h
+ GList *service_list; /* service_adaptor_service_context_h */
} service_adaptor_s;
typedef struct _service_adaptor_s *service_adaptor_h;
-// Gets service adaptor handle
+/* Gets service adaptor handle */
service_adaptor_h service_adaptor_get_handle();
service_adaptor_internal_error_code_e service_adaptor_init();
void service_adaptor_deinit();
-// Gets adaptor context
+/* Gets adaptor context */
service_adaptor_service_context_h service_adaptor_get_service_context(service_adaptor_h service_adaptor,
const char *service_name);
service_adaptor_service_context_h service_src,
service_adaptor_service_context_h service_dst);
-// Create / Destroy adaptors (Internal function)
+/* Create / Destroy adaptors (Internal function) */
service_adaptor_h service_adaptor_create();
void service_adaptor_destroy(service_adaptor_h service_adaptor);
-// Connects / Disconnects adaptors
+/* Connects / Disconnects adaptors */
service_adaptor_internal_error_code_e service_adaptor_connect(service_adaptor_h service_adaptor,
service_adaptor_context_info_s *context_info,
const char *service_name,
void debug_service_context(GList *service_list);
#endif
-typedef enum
-{
+typedef enum {
SA_TIME_CHECK_FLAG_AUTH,
SA_TIME_CHECK_FLAG_STORAGE,
SA_TIME_CHECK_FLAG_CONTACT,
SA_TIME_CHECK_FLAG_MESSAGE,
SA_TIME_CHECK_FLAG_PUSH,
SA_TIME_CHECK_FLAG_SHOP,
-}sa_time_check_flag_e;
+} sa_time_check_flag_e;
void SERVICE_ADAPTOR_API_TIME_CHECK_START();
void SERVICE_ADAPTOR_API_TIME_CHECK_PAUSE();
#include <stdbool.h>
#include <glib.h>
-typedef enum
-{
- SERVICE_ADAPTOR_INTERNAL_ERROR_NONE = 0,
+typedef enum {
+ SERVICE_ADAPTOR_INTERNAL_ERROR_NONE = 0,
SERVICE_ADAPTOR_INTERNAL_ERROR_LAUNCH = 1, /**< 1 ~ 99: internal error*/
SERVICE_ADAPTOR_INTERNAL_ERROR_INIT = 2,
SERVICE_ADAPTOR_INTERNAL_ERROR_DEINIT = 3,
SERVICE_ADAPTOR_INTERNAL_ERROR_CALLBACK_TIME_OUT = 21,
SERVICE_ADAPTOR_INTERNAL_ERROR_INTERNAL_MAX = 99,
SERVICE_ADAPTOR_INTERNAL_ERROR_NO_DATA,
- SERVICE_ADAPTOR_INTERNAL_ERROR_MAX
-
+ SERVICE_ADAPTOR_INTERNAL_ERROR_MAX
} service_adaptor_internal_error_code_e;
-typedef enum
-{
+typedef enum {
SERVICE_ADAPTOR_INTERNAL_RESULT_SUCCEEDED = 0,
SERVICE_ADAPTOR_INTERNAL_RESULT_FAILED = -1,
SERVICE_ADAPTOR_INTERNAL_RESULT_CANCELED = -2,
} service_adaptor_internal_result_e;
-typedef enum
-{
+typedef enum {
SERVICE_ADAPTOR_INTERNAL_SIGNAL_NONE = 0, /**< specifies status as none*/
SERVICE_ADAPTOR_INTERNAL_SIGNAL_INITIALIZED = 1, /**< specifies status as none*/
SERVICE_ADAPTOR_INTERNAL_SIGNAL_NEW_PLUGIN = 2, /**< specifies status as none*/
SERVICE_ADAPTOR_INTERNAL_SIGNAL_ACTIVATE_PLUGIN = 3, /**< specifies status as none*/
- SERVICE_ADAPTOR_INTERNAL_SIGNAL_SHUTDOWN = 4, /**< specifies status as none*/
+ SERVICE_ADAPTOR_INTERNAL_SIGNAL_SHUTDOWN = 4, /**< specifies status as none*/
SERVICE_ADAPTOR_INTERNAL_SIGNAL_OTHER = 99, /**< specifies status as none*/
SERVICE_ADAPTOR_INTERNAL_SIGNAL_UNKNOWN = 999, /**< specifies status as none*/
SERVICE_ADAPTOR_INTERNAL_SIGNAL_MAX,
} service_adaptor_internal_signal_code_e;
-typedef struct service_adaptor_internal_error_s
-{
+typedef struct service_adaptor_internal_error_s {
long long int code;
char *msg;
} service_adaptor_internal_error_t;
typedef struct service_adaptor_internal_error_s *service_adaptor_internal_error_h;
-typedef struct service_adaptor_internal_plugin_s
-{
+typedef struct service_adaptor_internal_plugin_s {
char *name;
bool login;
} service_adaptor_internal_plugin_t;
#ifndef __SERVICE_FILE_MANAGER_H__
#define __SERVICE_FILE_MANAGER_H__
-typedef enum
-{
+typedef enum {
SERVICE_FILE_DIRECTORY_AUTH = (0x01 << 0),
SERVICE_FILE_DIRECTORY_STORAGE = (0x01 << 1),
SERVICE_FILE_DIRECTORY_CONTACT = (0x01 << 2),
SERVICE_FILE_DIRECTORY_PLUGINS = (0x01 << 10) & 0x02,
} service_file_directory_e;
-typedef enum
-{
+typedef enum {
SERVICE_FILE_SECTION_GENERAL = 1,
SERVICE_FILE_SECTION_PUSH = 2,
SERVICE_FILE_SECTION_BUS = 3,