Annotation of libaitmqtt/example/test.c, revision 1.2

1.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: {
                     11:        mqtt_subscr_t *v, *p;
                     12:        u_char qoses[] = { 1, 0, 2, 6, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 };
                     13:        register int i;
                     14: 
1.2     ! misho      15:        v = mqtt_str2subs((const char**) argv, 0, qoses);
1.1       misho      16:        for (p = v; p->sub_topic.msg_base; p++)
                     17:                printf("size=%hd %s qos=%d\n", p->sub_topic.msg_len, (char*) p->sub_topic.msg_base, p->sub_ret);
                     18:        mqtt_subFree(&v);
                     19: 
                     20:        v = mqtt_subAlloc(10);
                     21:        for (p = v; p->sub_topic.msg_base; p++)
                     22:                printf("i=%d\n", i++);
                     23:        mqtt_subFree(&v);
                     24: 
                     25:        return 0;
                     26: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>