Annotation of libaitmqtt/example/test_enclen.c, revision 1.1.1.1.16.1
1.1 misho 1: #include <stdio.h>
2: #include <stdlib.h>
3: #include <netinet/in.h>
1.1.1.1.16.1! misho 4: #include <limits.h>
! 5: #include <aitmqtt.h>
1.1 misho 6:
7: int
8: main(int argc, char **argv)
9: {
10: unsigned int x;
11: unsigned char *p = (unsigned char*) &x;
12:
13: if (argc < 2)
14: return 1;
15: else
16: x = strtol(argv[1], NULL, 0);
17:
18: x = mqtt_encodeLen(x);
19: printf("encode:: %u (wire)-> %02x %02x %02x %02x\n", x, p[0], p[1], p[2], p[3]);
20:
21: printf("sizeof len=%d\n", mqtt_sizeLen(x));
22:
23: return 0;
24: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>