From 677438a8a3322234d7bc4ad8aeae3db8df366ccd Mon Sep 17 00:00:00 2001 From: Joo-Chul Kevin Lee Date: Mon, 19 Sep 2022 20:45:30 +0900 Subject: [PATCH] rename data type: - oc_pushd_rsc_rep => oc_pushd_resource_rep - oc_pushd_rsc_rep_t => oc_pushd_resource_rep_t --- api/oc_push.c | 28 +++++++++++----------- apps/docs/push.md | 10 ++++---- apps/push_configurator_multithread_linux.c | 2 +- apps/push_originserver_multithread_linux.c | 2 +- apps/push_targetserver_multithread_linux.c | 2 +- include/oc_push.h | 10 ++++---- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/api/oc_push.c b/api/oc_push.c index 23fa9f9fd8..e2c790c625 100644 --- a/api/oc_push.c +++ b/api/oc_push.c @@ -152,7 +152,7 @@ OC_MEMB(rep_instance_memb, oc_rep_t, 1); * @brief memory block definition for storing pushed resource representation * list */ -OC_MEMB(pushd_rsc_rep_instance_memb, oc_pushd_rsc_rep_t, 1); +OC_MEMB(pushd_rsc_rep_instance_memb, oc_pushd_resource_rep_t, 1); /* * @brief `pushed_rsc_list` keeps Resource representation of Pushed Resources @@ -189,7 +189,7 @@ enum { * if this callback function is provided by user, it will called whenever new * push is arrived... */ -static void (*oc_push_arrived)(oc_pushd_rsc_rep_t *) = NULL; +static void (*oc_push_arrived)(oc_pushd_resource_rep_t *) = NULL; #define pp_statestr(i) (pp_state_strs[(i)]) @@ -1031,13 +1031,13 @@ _build_rep_payload(CborEncoder *parent, oc_rep_t *rep) * * @param uri uri for pushed Resource * @param device_index device index which pushed Resource belongs to - * @return `oc_pushd_rsc_rep_t` instance + * @return `oc_pushd_resource_rep_t` instance */ -static oc_pushd_rsc_rep_t * +static oc_pushd_resource_rep_t * _find_pushd_rsc_rep_by_uri(oc_string_t *uri, size_t device_index) { - oc_pushd_rsc_rep_t *pushd_rsc_rep = - (oc_pushd_rsc_rep_t *)(oc_list_head(pushd_rsc_rep_list)); + oc_pushd_resource_rep_t *pushd_rsc_rep = + (oc_pushd_resource_rep_t *)(oc_list_head(pushd_rsc_rep_list)); while (pushd_rsc_rep) { if (!strcmp(oc_string(pushd_rsc_rep->resource->uri), oc_string(*uri)) && @@ -1065,7 +1065,7 @@ get_pushd_rsc(oc_request_t *request, oc_interface_mask_t iface_mask, (void)user_data; int result = OC_STATUS_OK; - oc_pushd_rsc_rep_t *pushd_rsc_rep = _find_pushd_rsc_rep_by_uri( + oc_pushd_resource_rep_t *pushd_rsc_rep = _find_pushd_rsc_rep_by_uri( &request->resource->uri, request->resource->device); if (!pushd_rsc_rep) { @@ -1468,7 +1468,7 @@ post_pushd_rsc(oc_request_t *request, oc_interface_mask_t iface_mask, int result = OC_STATUS_CHANGED; oc_rep_t *rep = request->request_payload; oc_rep_t *common_property; - oc_pushd_rsc_rep_t *pushd_rsc_rep; + oc_pushd_resource_rep_t *pushd_rsc_rep; oc_recvs_t *recvs_instance; oc_recv_t *recv_obj; @@ -1673,7 +1673,7 @@ get_pushrecv(oc_request_t *request, oc_interface_mask_t iface_mask, /* * @brief purge app resource (`oc_resource_t`) and resource representation - * instance (`oc_pushd_rsc_rep_t`) accessed through `uri` in device whose + * instance (`oc_pushd_resource_rep_t`) accessed through `uri` in device whose * index is `device_index` * * @param uri URI of app resource to be purged @@ -1684,7 +1684,7 @@ _purge_pushd_rsc(oc_string_t *uri, size_t device_index) { oc_resource_t *pushd_rsc = oc_ri_get_app_resource_by_uri( oc_string(*uri), oc_string_len(*uri), device_index); - oc_pushd_rsc_rep_t *pushd_rsc_rep = + oc_pushd_resource_rep_t *pushd_rsc_rep = _find_pushd_rsc_rep_by_uri(uri, device_index); if (pushd_rsc_rep) { @@ -1714,7 +1714,7 @@ _purge_pushd_rsc(oc_string_t *uri, size_t device_index) /* * @brief create app Resource (`oc_resource_t`) and Resource representation - * (`oc_pushd_rsc_rep_t`) instance for the pushed Resource + * (`oc_pushd_resource_rep_t`) instance for the pushed Resource * * @param recv_obj receiver object that points pushed resource * @param resource Push Receiver resource @@ -1756,8 +1756,8 @@ _create_pushd_rsc(oc_recv_t *recv_obj, const oc_resource_t *resource) result = false; /* create resource representation container for this resource */ - oc_pushd_rsc_rep_t *pushd_rsc_rep_instance = - (oc_pushd_rsc_rep_t *)oc_memb_alloc(&pushd_rsc_rep_instance_memb); + oc_pushd_resource_rep_t *pushd_rsc_rep_instance = + (oc_pushd_resource_rep_t *)oc_memb_alloc(&pushd_rsc_rep_instance_memb); if (pushd_rsc_rep_instance) { pushd_rsc_rep_instance->resource = pushd_rsc; pushd_rsc_rep_instance->rep = NULL; @@ -1813,7 +1813,7 @@ static void _update_recv_obj(oc_recv_t *recv_obj, const oc_recvs_t *recvs_instance, oc_rep_t *rep) { - oc_pushd_rsc_rep_t *pushd_rsc_rep; + oc_pushd_resource_rep_t *pushd_rsc_rep; while (rep) { switch (rep->type) { diff --git a/apps/docs/push.md b/apps/docs/push.md index d24dfb0d49..f157da91fd 100644 --- a/apps/docs/push.md +++ b/apps/docs/push.md @@ -165,18 +165,18 @@ OCF Push Notification is composed of 3 players: **Origin Server**, **Target Serv * @brief object used to store Resource pushed to * "oic.r.pshreceiver:receivers[i].receiveruri" */ - typedef struct oc_pushd_rsc_rep + typedef struct oc_pushd_resource_rep { - struct oc_pushd_rsc_rep *next; + struct oc_pushd_resource_rep *next; oc_resource_t *resource; ///< used to point any pushed Resource managed by iotivity-lite oc_rep_t *rep; ///< payload of pushed Resource - } oc_pushd_rsc_rep_t; + } oc_pushd_resource_rep_t; /** * @brief callback function called whenever new push arrives */ - typedef void (*oc_on_push_arrived_t)(oc_pushd_rsc_rep_t *); + typedef void (*oc_on_push_arrived_t)(oc_pushd_resource_rep_t *); /** * @brief set callback function called whenever new push arrives @@ -190,7 +190,7 @@ OCF Push Notification is composed of 3 players: **Origin Server**, **Target Serv - Example: ```c /* callback function example */ - void push_arrived(oc_pushd_rsc_rep_t *push_payload) + void push_arrived(oc_pushd_resource_rep_t *push_payload) { printf("new push arrives (path: %s, rt: ", oc_string(push_payload->resource->uri)); for (size_t i=0; iresource->types); i++) diff --git a/apps/push_configurator_multithread_linux.c b/apps/push_configurator_multithread_linux.c index c687b2d5f7..2c8192f3dc 100644 --- a/apps/push_configurator_multithread_linux.c +++ b/apps/push_configurator_multithread_linux.c @@ -65,7 +65,7 @@ typedef struct } custom_func_s; void -push_arrived(oc_pushd_rsc_rep_t *push_payload) +push_arrived(oc_pushd_resource_rep_t *push_payload) { PRINT("new push arrives (path: %s, rt: ", oc_string(push_payload->resource->uri)); diff --git a/apps/push_originserver_multithread_linux.c b/apps/push_originserver_multithread_linux.c index af25f572f6..118d7f5be2 100644 --- a/apps/push_originserver_multithread_linux.c +++ b/apps/push_originserver_multithread_linux.c @@ -67,7 +67,7 @@ static int brightness2; * callback function to be called whenever new PUSH arrives */ void -push_arrived(oc_pushd_rsc_rep_t *push_payload) +push_arrived(oc_pushd_resource_rep_t *push_payload) { printf("new push arrives (path: %s, rt: ", oc_string(push_payload->resource->uri)); diff --git a/apps/push_targetserver_multithread_linux.c b/apps/push_targetserver_multithread_linux.c index 30a95e5cde..314ff39107 100644 --- a/apps/push_targetserver_multithread_linux.c +++ b/apps/push_targetserver_multithread_linux.c @@ -44,7 +44,7 @@ pthread_mutex_t app_mutex; int quit = 0; void -push_arrived(oc_pushd_rsc_rep_t *push_payload) +push_arrived(oc_pushd_resource_rep_t *push_payload) { printf("new push arrives (path: %s, rt: ", oc_string(push_payload->resource->uri)); diff --git a/include/oc_push.h b/include/oc_push.h index 91bb3a8a00..261a0fbe0d 100644 --- a/include/oc_push.h +++ b/include/oc_push.h @@ -48,20 +48,20 @@ extern "C" { /** * @brief object used to store Resource pushed to - * "oic.r.pshreceiver:receivers[i].receiveruri" + * "oic.r.pushreceiver:receivers[i].receiveruri" */ -typedef struct oc_pushd_rsc_rep +typedef struct oc_pushd_resource_rep { - struct oc_pushd_rsc_rep *next; + struct oc_pushd_resource_rep *next; oc_resource_t *resource; ///< used to point any pushed Resource managed by iotivity-lite oc_rep_t *rep; ///< payload of pushed Resource -} oc_pushd_rsc_rep_t; +} oc_pushd_resource_rep_t; /** * @brief callback function called whenever new push arrives */ -typedef void (*oc_on_push_arrived_t)(oc_pushd_rsc_rep_t *); +typedef void (*oc_on_push_arrived_t)(oc_pushd_resource_rep_t *); /** * @brief print payload of Resource in user friendly format