Annotation of libaitmqtt/example/test.c, revision 1.2.14.3
1.1 misho 1: #include <stdio.h>
2: #include <stdlib.h>
3: #include <string.h>
4: #include <sys/types.h>
1.2.14.1 misho 5: #include <limits.h>
6: #include <aitmqtt.h>
1.1 misho 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 };
1.2.14.2 misho 14: register int i = 0;
1.1 misho 15:
1.2.14.3! misho 16: v = mqtt_strs2subs((const char**) argv, 0, qoses);
1.1 misho 17: for (p = v; p->sub_topic.msg_base; p++)
1.2.14.3! misho 18: printf("size=%hd %s qos=%d\n", p->sub_topic.msg_len, (char*) p->sub_topic.msg_base, p->sub_qos);
1.1 misho 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>