From b50461629ddb1287f2bd5662dba9a6e2fdf88b5a Mon Sep 17 00:00:00 2001 From: Jiwoong Im Date: Tue, 3 Mar 2015 15:11:05 +0900 Subject: [PATCH] change service_cb to app_control_cb JIRA ticket : TC-2314 Change-Id: I0e8b468fca78a8206c01589c89ef1840c541b17e Signed-off-by: Jiwoong Im --- include/appcore-agent.h | 8 ++++---- include/service_app.h | 12 ++++++------ src/appcore-agent.c | 12 ++++++------ src/service_app_main.c | 14 +++++++------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/appcore-agent.h b/include/appcore-agent.h index 59c1ce0..0a40349 100755 --- a/include/appcore-agent.h +++ b/include/appcore-agent.h @@ -28,7 +28,7 @@ #include #include -#include "app_service.h" +#include "app_control.h" #ifdef __cplusplus @@ -38,9 +38,9 @@ extern "C" { struct agentcore_ops { void *data; /**< Callback data */ - int (*create) (void *); - int (*terminate) (void *); - int (*service) (service_h, void *); + int (*create) (void *); /**< This callback function is called at the start of the application. */ + int (*terminate) (void *); /**< This callback function is called once after the main loop of application exits. */ + int (*app_control) (app_control_h, void *); /**< This callback function is called when other application send the launch request to the application. */ void *reserved[6]; /**< Reserved */ diff --git a/include/service_app.h b/include/service_app.h index 7e2a829..631a2c7 100755 --- a/include/service_app.h +++ b/include/service_app.h @@ -19,7 +19,7 @@ #define __TIZEN_APPFW_SERVICE_APP_H__ #include -#include +#include #include @@ -72,13 +72,13 @@ typedef void (*service_app_terminate_cb) (void *user_data); /** * @brief Called when other application send the launch request to the agent application. * - * @param[in] service The handle to the service + * @param[in] app_control The handle to the app_control * @param[in] user_data The user data passed from the callback registration function * @see service_app_main() * @see #service_app_event_callback_s * @see @ref CAPI_SERVICE_MODULE API */ -typedef void (*service_app_service_cb) (service_h service, void *user_data); +typedef void (*service_app_control_cb) (app_control_h app_control, void *user_data); /** @@ -108,13 +108,13 @@ typedef void (*service_app_low_battery_cb) (void *user_data); * @see service_app_main() * @see service_app_create_cb() * @see service_app_terminate_cb() - * @see service_app_service_cb() + * @see service_app_control_cb() */ typedef struct { service_app_create_cb create; /**< This callback function is called at the start of the application. */ service_app_terminate_cb terminate; /**< This callback function is called once after the main loop of the application exits. */ - service_app_service_cb service; /**< This callback function is called when another application sends the launch request to the application. */ + service_app_control_cb app_control; /**< This callback function is called when another application sends the launch request to the application. */ } service_app_lifecycle_callback_s; @@ -169,7 +169,7 @@ int service_app_remove_event_handler(app_event_handler_h event_handler); * * @see service_app_create_cb() * @see service_app_terminate_cb() - * @see service_app_service_cb() + * @see service_app_control_cb() * @see service_app_exit() * @see #service_app_lifecycle_callback_s */ diff --git a/src/appcore-agent.c b/src/appcore-agent.c index e787d14..87f6f7a 100755 --- a/src/appcore-agent.c +++ b/src/appcore-agent.c @@ -32,6 +32,7 @@ #include #include "aul.h" #include "appcore-agent.h" +#include #include #include @@ -174,7 +175,6 @@ struct agent_appcore { static struct agent_appcore core; -extern int service_create_request(bundle *data, service_h *service); static int __sys_lowmem_post(void *data, void *evt); static int __sys_lowmem(void *data, void *evt); static int __sys_lowbatt(void *data, void *evt); @@ -204,7 +204,7 @@ static void __do_app(enum agent_event event, void *data, bundle * b) { int r = 0; struct agent_priv *svc = data; - service_h service = NULL; + app_control_h app_control = NULL; _ret_if(svc == NULL); @@ -216,15 +216,15 @@ static void __do_app(enum agent_event event, void *data, bundle * b) _ret_if(svc->ops == NULL); - if (service_create_event(b, &service) != 0) + if (app_control_create_event(b, &app_control) != 0) { return; } switch (event) { case AGE_REQUEST: - if (svc->ops->service) - r = svc->ops->service(service, svc->ops->data); + if (svc->ops->app_control) + r = svc->ops->app_control(app_control, svc->ops->data); svc->state = AGS_RUNNING; break; /* case AGE_STOP: @@ -238,7 +238,7 @@ static void __do_app(enum agent_event event, void *data, bundle * b) /* do nothing */ break; } - service_destroy(service); + app_control_destroy(app_control); } static struct agent_ops s_ops = { diff --git a/src/service_app_main.c b/src/service_app_main.c index 34ea510..3da99da 100755 --- a/src/service_app_main.c +++ b/src/service_app_main.c @@ -68,7 +68,7 @@ typedef service_app_context_s *service_app_context_h; static int service_app_create(void *data); static int service_app_terminate(void *data); -static int service_app_reset(service_h service, void *data); +static int service_app_reset(app_control_h app_control, void *data); static int service_app_low_memory(void *event_info, void *data); static int service_app_low_battery(void *event_info, void *data); @@ -103,7 +103,7 @@ EXPORT_API int service_app_main(int argc, char **argv, service_app_lifecycle_cal .data = &service_app_context, .create = service_app_create, .terminate = service_app_terminate, - .service = service_app_reset, + .app_control = service_app_reset, }; if (argc <= 0 || argv == NULL || callback == NULL) @@ -249,21 +249,21 @@ int service_app_terminate(void *data) } -int service_app_reset(service_h service, void *data) +int service_app_reset(app_control_h app_control, void *data) { service_app_context_h service_app_context = data; - service_app_service_cb service_cb; + service_app_control_cb app_control_cb; if (service_app_context == NULL) { return service_app_error(SERVICE_APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL); } - service_cb = service_app_context->callback->service; + app_control_cb = service_app_context->callback->app_control; - if (service_cb != NULL) + if (app_control_cb != NULL) { - service_cb(service, service_app_context->data); + app_control_cb(app_control, service_app_context->data); } return SERVICE_APP_ERROR_NONE; -- 2.7.4