UM C API 6.17.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

lbmht.h
Go to the documentation of this file.
1
75 #ifndef LBMHT_H
76 #define LBMHT_H
77
78 #if defined(__cplusplus)
79 extern "C" {
80 #endif /* __cplusplus */
81
82 #include "lbm/lbm.h"
83
84 #define LBM_HT_BASE_MATCH_LEVEL 0
85 #define LBM_HT_TOKEN_GLOBNAME 0
86 #define LBM_HT_TOKEN_GLOBPATH 1
87 #define LBM_HT_TOKEN_NAME 2
88
89 #define LBM_HT_INIT_BRANCH_SZ 16
90
91 #define LBM_HT_CBVEC_SZ 16
92
95 typedef struct lbm_hypertopic_rcv_stct lbm_hypertopic_rcv_t;
96
120 typedef int (*lbm_hypertopic_rcv_cb_proc)(lbm_hypertopic_rcv_t *hrcv, lbm_msg_t *msg, void *clientd);
121
138 typedef void (*lbm_delete_cb_proc)(int dispatch_thrd, void *clientd);
139
140 #define LBM_HT_CBVEC_FLAG_ACTIVE 1
141 #define LBM_HT_CBVEC_FLAG_DELETED 2
142
143
144 #ifdef LBM_HT_INTERNAL
145 struct htcbvec {
146 union {
147 lbm_hypertopic_rcv_cb_proc rcvproc;
148 lbm_delete_cb_proc delproc;
149 } u;
150 void *clientd;
151 int flags;
152 };
153
154 struct htcbvlist
155 {
156 struct htcbvlist *next;
157 struct htcbvlist *nextactv;
158 int idx;
159 struct htcbvec cbvec[LBM_HT_CBVEC_SZ];
160 };
161
162 struct lbm_hypertopic_rcv_stct
163 {
164 mul_mutex_t lock;
165 lbm_wildcard_rcv_t *wrcv;
166 lbm_event_queue_t *evq;
167 lbm_context_t *ctx;
168 struct htbranch *root;
169 size_t prelen;
170 struct htcbvlist *activecbs;
171 };
172
173 struct htcbnode
174 {
175 lbm_hypertopic_rcv_cb_proc rcvproc;
176 void *clientd;
177 struct htcbnode *next;
178 };
179
180 struct htnode
181 {
182 char *cname;
183 int refcnt;
184 struct htcbnode *cblist;
185 struct htbranch *next;
186 };
187
188 struct htbranch
189 {
190 int nnodes;
191 int size;
192 int idx[LBM_HT_TOKEN_NAME+1];
193 struct htnode htnodes[1];
194 };
195 #endif
196
199 typedef struct lbm_delete_cb_info_t_stct {
201 lbm_delete_cb_proc cbproc;
203 void *clientd;
204 } lbm_delete_cb_info_t;
205
214 LBMExpDLL int lbm_hypertopic_rcv_init(lbm_hypertopic_rcv_t **hrcvp, lbm_context_t *ctx, const char *prefix, lbm_event_queue_t *evq);
215
223 LBMExpDLL int lbm_hypertopic_rcv_add(lbm_hypertopic_rcv_t *hrcv, const char *pattern, lbm_hypertopic_rcv_cb_proc proc, void *clientd);
224
233 LBMExpDLL int lbm_hypertopic_rcv_delete(lbm_hypertopic_rcv_t *hrcv, const char *pattern, lbm_hypertopic_rcv_cb_proc proc, void *clientd, lbm_delete_cb_info_t *cbinfo);
234
239 LBMExpDLL int lbm_hypertopic_rcv_destroy(lbm_hypertopic_rcv_t *hrcv);
240
241 #if defined(__cplusplus)
242 }
243 #endif /* __cplusplus */
244
245 #endif
lbm_hypertopic_rcv_delete
LBMExpDLL int lbm_hypertopic_rcv_delete(lbm_hypertopic_rcv_t *hrcv, const char *pattern, lbm_hypertopic_rcv_cb_proc proc, void *clientd, lbm_delete_cb_info_t *cbinfo)
Delete a previously added topic from a HyperTopic receiver topic set.
lbm_delete_cb_info_t_stct::cbproc
lbm_delete_cb_proc cbproc
Definition: lbmht.h:201
lbm_delete_cb_info_t
struct lbm_delete_cb_info_t_stct lbm_delete_cb_info_t
Structure passed to the lbm_hypertopic_rcv_delete() function so that a deletion callback may be calle...
lbm_hypertopic_rcv_init
LBMExpDLL int lbm_hypertopic_rcv_init(lbm_hypertopic_rcv_t **hrcvp, lbm_context_t *ctx, const char *prefix, lbm_event_queue_t *evq)
Initialize a HyperTopic receiver.
lbm_delete_cb_info_t_stct
Structure passed to the lbm_hypertopic_rcv_delete() function so that a deletion callback may be calle...
Definition: lbmht.h:199
lbm_msg_t_stct
Information structure for receive events delivered to receiver callback lbm_rcv_cb_proc.
Definition: lbm.h:3967
lbm_event_queue_t
struct lbm_event_queue_t_stct lbm_event_queue_t
Opaque structure that designates a UM event queue object. See Event Queue Object. ...
Definition: lbm.h:2293
lbm_wildcard_rcv_t
struct lbm_wildcard_rcv_t_stct lbm_wildcard_rcv_t
Opaque structure that designates a UM wildcard receiver object. See UM Wildcard Receivers.
Definition: lbm.h:3839
lbm_hypertopic_rcv_t
struct lbm_hypertopic_rcv_stct lbm_hypertopic_rcv_t
HyperTopic receiver object (opaque)
Definition: lbmht.h:95
lbm_hypertopic_rcv_cb_proc
int(* lbm_hypertopic_rcv_cb_proc)(lbm_hypertopic_rcv_t *hrcv, lbm_msg_t *msg, void *clientd)
Application callback for messages delivered to HyperTopic receivers.
Definition: lbmht.h:120
lbm_delete_cb_proc
void(* lbm_delete_cb_proc)(int dispatch_thrd, void *clientd)
Application callback for lbm_hypertopic_rcv_delete().
Definition: lbmht.h:138
lbm_hypertopic_rcv_add
LBMExpDLL int lbm_hypertopic_rcv_add(lbm_hypertopic_rcv_t *hrcv, const char *pattern, lbm_hypertopic_rcv_cb_proc proc, void *clientd)
Add a topic pattern to the set of topics being received by a HyperTopic receiver. ...
lbm_hypertopic_rcv_destroy
LBMExpDLL int lbm_hypertopic_rcv_destroy(lbm_hypertopic_rcv_t *hrcv)
Clean-up HyperTopic receiver previously created by lbm_hypertopic_rcv_init()
lbm_context_t
struct lbm_context_t_stct lbm_context_t
Context object (opaque) for UM. See Context Object.
Definition: lbm.h:1771
lbm_delete_cb_info_t_stct::clientd
void * clientd
Definition: lbmht.h:203