Annotation of mqtt/example/test.c, revision 1.1.2.6
1.1.2.1 misho 1: #include <stdio.h>
2: #include <stdlib.h>
3: #include <string.h>
4: #include <sys/types.h>
5: #include "aitmqtt.h"
6:
7:
8: int
9: main(int argc, char **argv)
10: {
1.1.2.2 misho 11: mqtt_subscr_t *v, *p;
12: u_char qoses[] = { 1, 0, 2, 6, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 };
1.1.2.4 misho 13: register int i;
1.1.2.1 misho 14:
15: if (argc < 2)
16: return 1;
17:
1.1.2.2 misho 18: v = mqtt_str2sub((const char**) argv, 0, qoses);
1.1.2.6 ! misho 19: for (p = v; p->sub_topic._base; p++)
! 20: printf("size=%hd %s qos=%d\n", p->sub_topic._size, p->sub_topic._base, p->sub_ret);
1.1.2.5 misho 21: mqtt_subFree(&v);
1.1.2.4 misho 22:
23: v = mqtt_subAlloc(10);
1.1.2.6 ! misho 24: for (p = v; p->sub_topic._base; p++)
1.1.2.4 misho 25: printf("i=%d\n", i++);
1.1.2.5 misho 26: mqtt_subFree(&v);
1.1.2.1 misho 27:
28: return 0;
29: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>