1: #include <stdio.h>
2: #include <stdlib.h>
3: #include <string.h>
4: #include <sys/types.h>
5: #include <limits.h>
6: #include <aitmqtt.h>
7:
8:
9: int
10: main(int argc, char **argv)
11: {
12: mqtt_subscr_t *v, *p;
13: u_char qoses[] = { 1, 0, 2, 6, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 };
14: register int i = 0;
15:
16: v = mqtt_strs2subs((const char**) argv, 0, qoses);
17: for (p = v; p->sub_topic.msg_base; p++)
18: printf("size=%hd %s qos=%d\n", p->sub_topic.msg_len, (char*) p->sub_topic.msg_base, p->sub_qos);
19: mqtt_subFree(&v);
20:
21: v = mqtt_subAlloc(10);
22: for (p = v; p->sub_topic.msg_base; p++)
23: printf("i=%d\n", i++);
24: mqtt_subFree(&v);
25:
26: return 0;
27: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>