Annotation of mqtt/example/test.c, revision 1.1.2.5

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);
                     19:        for (p = v; p->sub_data; p++)
                     20:                printf("msb=%hhd lsb=%hhd val=%hd %s qos=%d\n", 
                     21:                                p->sub_sb.sb.m, p->sub_sb.sb.l, p->sub_sb.val, p->sub_data, p->sub_qos);
1.1.2.5 ! misho      22:        mqtt_subFree(&v);
1.1.2.4   misho      23: 
                     24:        v = mqtt_subAlloc(10);
                     25:        for (p = v; p->sub_data; p++)
                     26:                printf("i=%d\n", i++);
1.1.2.5 ! misho      27:        mqtt_subFree(&v);
1.1.2.1   misho      28: 
                     29:        return 0;
                     30: }

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