Webcom C SDK
include
webcom-c
webcom-on.h
Go to the documentation of this file.
1
/*
2
* webcom-sdk-c
3
*
4
* Copyright 2018 Orange
5
* <camille.oudot@orange.com>
6
*
7
* This library is free software; you can redistribute it and/or modify it
8
* under the terms of the GNU Lesser General Public License as published by the
9
* Free Software Foundation; either version 2.1 of the License, or (at your
10
* option) any later version.
11
*
12
* This library is distributed in the hope that it will be useful, but WITHOUT
13
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15
* for more details.
16
*
17
* You should have received a copy of the GNU Lesser General Public License
18
* along with this library; if not, write to the Free Software Foundation,
19
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
*
21
*/
22
23
#ifndef INCLUDE_WEBCOM_C_WEBCOM_ON_H_
24
#define INCLUDE_WEBCOM_C_WEBCOM_ON_H_
25
26
#include "
webcom-base.h
"
27
46
typedef
void
*
on_handle_t
;
47
62
typedef
int (*
on_callback_f
)(
wc_context_t
*ctx,
on_handle_t
handle,
char
* data,
char
*current_key,
char
*previous_key);
63
64
enum
on_event_type
{
65
ON_CHILD_ADDED
,
66
ON_CHILD_REMOVED
,
67
ON_CHILD_CHANGED
,
68
ON_VALUE
,
69
/* update the ON_EVENT_TYPE_COUNT macro if you add new events */
70
};
71
82
on_handle_t
wc_datasync_on_value
(
wc_context_t
*ctx,
char
*path,
on_callback_f
callback);
83
95
on_handle_t
wc_datasync_on_child_added
(
wc_context_t
*ctx,
char
*path,
on_callback_f
callback);
96
107
on_handle_t
wc_datasync_on_child_changed
(
wc_context_t
*ctx,
char
*path,
on_callback_f
callback);
108
119
on_handle_t
wc_datasync_on_child_removed
(
wc_context_t
*ctx,
char
*path,
on_callback_f
callback);
120
126
char
*
wc_datasync_on_handle_get_path
(
on_handle_t
h);
127
133
wc_context_t
*
wc_datasync_on_handle_get_ctx
(
on_handle_t
h);
134
142
void
wc_datasync_off
(
on_handle_t
h);
143
151
void
wc_datasync_off_path
(
wc_context_t
*ctx,
char
*path);
152
161
void
wc_datasync_off_path_type
(
wc_context_t
*ctx,
char
*path,
enum
on_event_type
type);
162
167
#endif
/* INCLUDE_WEBCOM_C_WEBCOM_ON_H_ */
wc_context_t
struct wc_context wc_context_t
Definition:
webcom-base.h:27
wc_datasync_on_value
on_handle_t wc_datasync_on_value(wc_context_t *ctx, char *path, on_callback_f callback)
ON_CHILD_REMOVED
Definition:
webcom-on.h:66
ON_CHILD_ADDED
Definition:
webcom-on.h:65
ON_CHILD_CHANGED
Definition:
webcom-on.h:67
wc_datasync_on_child_added
on_handle_t wc_datasync_on_child_added(wc_context_t *ctx, char *path, on_callback_f callback)
webcom-base.h
wc_datasync_off
void wc_datasync_off(on_handle_t h)
on_handle_t
void * on_handle_t
Definition:
webcom-on.h:46
on_callback_f
int(* on_callback_f)(wc_context_t *ctx, on_handle_t handle, char *data, char *current_key, char *previous_key)
Definition:
webcom-on.h:62
wc_datasync_on_child_removed
on_handle_t wc_datasync_on_child_removed(wc_context_t *ctx, char *path, on_callback_f callback)
on_event_type
on_event_type
Definition:
webcom-on.h:64
wc_datasync_off_path
void wc_datasync_off_path(wc_context_t *ctx, char *path)
wc_datasync_on_handle_get_ctx
wc_context_t * wc_datasync_on_handle_get_ctx(on_handle_t h)
ON_VALUE
Definition:
webcom-on.h:68
wc_datasync_on_child_changed
on_handle_t wc_datasync_on_child_changed(wc_context_t *ctx, char *path, on_callback_f callback)
wc_datasync_off_path_type
void wc_datasync_off_path_type(wc_context_t *ctx, char *path, enum on_event_type type)
wc_datasync_on_handle_get_path
char * wc_datasync_on_handle_get_path(on_handle_t h)
Generated on Thu Oct 18 2018 09:31:46 for Webcom C SDK by
1.8.13