Webcom C SDK
webcom-msg.h
Go to the documentation of this file.
1 /*
2  * Webcom C SDK
3  *
4  * Copyright 2017 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 WEBCOM_MSG_H_
24 #define WEBCOM_MSG_H_
25 
26 #include <stdint.h>
27 
33 typedef enum {
38 
39 typedef enum {
50 
51 typedef enum {
57 
58 typedef struct {
59  char *path;
60  char *data;
61  char *hash;
63 
64 typedef struct {
65  char *path;
66  char *data;
68 
69 typedef struct {
70  char *path;
71  void *query_ids;
73 
74 typedef struct {
75  char *path;
77 
78 typedef struct {
79  char *cred;
81 
82 typedef void *wc_action_unauth_t;
83 
84 typedef struct {
85  char *path;
86  char *data;
88 
89 typedef struct {
90  char *path;
91  char *data;
93 
94 typedef struct {
95  char *path;
97 
98 typedef struct {
100  int64_t r;
101  union {
111  } u;
112 } wc_action_t;
113 
114 typedef struct {
115  int64_t r;
116  char *status;
117  char *data;
118 } wc_response_t;
119 
120 typedef struct {
121  char *status;
122  char *reason;
124 
125 typedef struct {
126  char *path;
128 
129 typedef struct {
130  char *path;
131  char *data;
133 
134 typedef struct {
135  char *path;
136  char *data;
138 
139 typedef struct {
141  char *status;
142  union {
147  } u;
148 } wc_push_t;
149 
150 typedef struct {
152  union {
156  } u;
157 } wc_data_msg_t;
158 
159 /* Control message data types */
160 
161 typedef enum {
165 
166 typedef struct {
167  int64_t ts;
168  char *server;
169  char *version;
171 
172 typedef struct {
174  union {
177  } u;
178 } wc_ctrl_msg_t;
179 
180 /* Level 1 data types */
181 
182 typedef enum {
185 } wc_msg_type_t;
186 
187 typedef struct {
189  union {
192  } u;
193 } wc_msg_t;
194 
200 void wc_datasync_msg_init(wc_msg_t *msg);
201 
212 void wc_datasync_msg_free(wc_msg_t *msg);
213 
214 
224 
229 #endif /* WEBCOM_MSG_H_ */
wc_push_auth_revoked_t auth_revoked
Definition: webcom-msg.h:143
char * path
Definition: webcom-msg.h:85
wc_data_msg_type_t
Definition: webcom-msg.h:33
wc_action_auth_t auth
Definition: webcom-msg.h:106
wc_data_msg_type_t type
Definition: webcom-msg.h:151
char * version
Definition: webcom-msg.h:169
char * path
Definition: webcom-msg.h:90
char * data
Definition: webcom-msg.h:60
wc_push_listen_revoked_t listen_revoked
Definition: webcom-msg.h:144
wc_push_data_update_merge_t update_merge
Definition: webcom-msg.h:146
Definition: webcom-msg.h:41
char * status
Definition: webcom-msg.h:116
Definition: webcom-msg.h:36
wc_push_type_t type
Definition: webcom-msg.h:140
Definition: webcom-msg.h:58
Definition: webcom-msg.h:139
Definition: webcom-msg.h:40
char * reason
Definition: webcom-msg.h:122
Definition: webcom-msg.h:94
Definition: webcom-msg.h:52
Definition: webcom-msg.h:187
wc_msg_type_t
Definition: webcom-msg.h:182
Definition: webcom-msg.h:35
wc_data_msg_t data
Definition: webcom-msg.h:191
wc_action_t action
Definition: webcom-msg.h:153
Definition: webcom-msg.h:98
Definition: webcom-msg.h:34
wc_action_unauth_t unauth
Definition: webcom-msg.h:107
char * data
Definition: webcom-msg.h:91
Definition: webcom-msg.h:69
char * path
Definition: webcom-msg.h:75
Definition: webcom-msg.h:114
wc_push_t push
Definition: webcom-msg.h:155
Definition: webcom-msg.h:163
int64_t ts
Definition: webcom-msg.h:167
Definition: webcom-msg.h:172
Definition: webcom-msg.h:162
Definition: webcom-msg.h:74
char * hash
Definition: webcom-msg.h:61
char * path
Definition: webcom-msg.h:95
Definition: webcom-msg.h:89
Definition: webcom-msg.h:47
wc_action_on_disc_cancel_t on_disc_cancel
Definition: webcom-msg.h:110
wc_action_type_t type
Definition: webcom-msg.h:99
char * path
Definition: webcom-msg.h:70
Definition: webcom-msg.h:150
Definition: webcom-msg.h:44
void wc_datasync_msg_init(wc_msg_t *msg)
wc_action_put_t put
Definition: webcom-msg.h:102
Definition: webcom-msg.h:125
char * data
Definition: webcom-msg.h:131
wc_action_merge_t merge
Definition: webcom-msg.h:103
wc_push_data_update_put_t update_put
Definition: webcom-msg.h:145
void wc_datasync_msg_free(wc_msg_t *msg)
Definition: webcom-msg.h:46
wc_action_type_t
Definition: webcom-msg.h:39
char * server
Definition: webcom-msg.h:168
wc_ctrl_msg_t ctrl
Definition: webcom-msg.h:190
Definition: webcom-msg.h:45
wc_msg_type_t type
Definition: webcom-msg.h:188
char * status
Definition: webcom-msg.h:121
wc_action_on_disc_merge_t on_disc_merge
Definition: webcom-msg.h:109
char * path
Definition: webcom-msg.h:126
wc_ctrl_msg_type_t type
Definition: webcom-msg.h:173
wc_handshake_t handshake
Definition: webcom-msg.h:175
wc_push_type_t
Definition: webcom-msg.h:51
Definition: webcom-msg.h:134
Definition: webcom-msg.h:183
Definition: webcom-msg.h:184
char * wc_datasync_msg_to_json_str(wc_msg_t *msg)
Definition: webcom-msg.h:53
void * query_ids
Definition: webcom-msg.h:71
char * path
Definition: webcom-msg.h:130
Definition: webcom-msg.h:78
wc_action_unlisten_t unlisten
Definition: webcom-msg.h:105
char * path
Definition: webcom-msg.h:135
Definition: webcom-msg.h:48
int64_t r
Definition: webcom-msg.h:100
Definition: webcom-msg.h:166
char * status
Definition: webcom-msg.h:141
void * wc_action_unauth_t
Definition: webcom-msg.h:82
char * path
Definition: webcom-msg.h:59
Definition: webcom-msg.h:120
char * data
Definition: webcom-msg.h:86
wc_action_listen_t listen
Definition: webcom-msg.h:104
wc_ctrl_msg_type_t
Definition: webcom-msg.h:161
char * data
Definition: webcom-msg.h:117
Definition: webcom-msg.h:129
Definition: webcom-msg.h:84
char * path
Definition: webcom-msg.h:65
char * shutdown_reason
Definition: webcom-msg.h:176
wc_action_on_disc_put_t on_disc_put
Definition: webcom-msg.h:108
char * data
Definition: webcom-msg.h:136
int64_t r
Definition: webcom-msg.h:115
char * data
Definition: webcom-msg.h:66
wc_response_t response
Definition: webcom-msg.h:154
Definition: webcom-msg.h:54
char * cred
Definition: webcom-msg.h:79
Definition: webcom-msg.h:43
Definition: webcom-msg.h:42
Definition: webcom-msg.h:55
Definition: webcom-msg.h:64