File:  [ELWIX - Embedded LightWeight unIX -] / libaitmqtt / example / test_declen.c
Revision 1.1.1.1.16.1: download - view: text, annotated - select for diffs - revision graph
Wed Sep 14 16:16:55 2016 UTC (7 years, 10 months ago) by misho
Branches: mqtt1_8
Diff to: branchpoint 1.1.1.1: preferred, unified
adds linux makefile

    1: #include <stdio.h>
    2: #include <stdlib.h>
    3: #include <netinet/in.h>
    4: #include <limits.h>
    5: #include <aitmqtt.h>
    6: 
    7: int
    8: main(int argc, char **argv)
    9: {
   10: 	unsigned int x;
   11: 	unsigned char *p = (unsigned char*) &x;
   12: 	int s;
   13: 
   14: 	if (argc < 2)
   15: 		return 1;
   16: 	else
   17: 		x = strtol(argv[1], NULL, 0);
   18: 
   19: 	printf("decode:: (wire)-> %02x %02x %02x %02x ", p[0], p[1], p[2], p[3]);
   20: 	x = mqtt_decodeLen(&x, &s);
   21: 	printf("length is x=%u sizeof=%d\n", x, s);
   22: 
   23: 	return 0;
   24: }

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