File:  [ELWIX - Embedded LightWeight unIX -] / libaitmqtt / example / test.c
Revision 1.2.14.3: download - view: text, annotated - select for diffs - revision graph
Thu Sep 15 16:46:56 2022 UTC (21 months, 2 weeks ago) by misho
Branches: mqtt1_8
Diff to: branchpoint 1.2: preferred, unified
upd UT

    1: #include <stdio.h>
    2: #include <stdlib.h>
    3: #include <string.h>
    4: #include <sys/types.h>
    5: #include <limits.h>
    6: #include <aitmqtt.h>
    7: 
    8: 
    9: int
   10: main(int argc, char **argv)
   11: {
   12: 	mqtt_subscr_t *v, *p;
   13: 	u_char qoses[] = { 1, 0, 2, 6, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 };
   14: 	register int i = 0;
   15: 
   16: 	v = mqtt_strs2subs((const char**) argv, 0, qoses);
   17: 	for (p = v; p->sub_topic.msg_base; p++)
   18: 		printf("size=%hd %s qos=%d\n", p->sub_topic.msg_len, (char*) p->sub_topic.msg_base, p->sub_qos);
   19: 	mqtt_subFree(&v);
   20: 
   21: 	v = mqtt_subAlloc(10);
   22: 	for (p = v; p->sub_topic.msg_base; p++)
   23: 		printf("i=%d\n", i++);
   24: 	mqtt_subFree(&v);
   25: 
   26: 	return 0;
   27: }

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