| ![[BACK]](/icons/cvsweb/back.gif) Return to test.c CVS log ![[TXT]](/icons/cvsweb/text.gif) | ![[DIR]](/icons/cvsweb/dir.gif) Up to  [ELWIX - Embedded LightWeight unIX -] / libaitmqtt / example | 
| version 1.2, 2012/06/20 15:02:23 | version 1.2.14.3, 2022/09/15 16:46:56 | 
|---|---|
| Line 2 | Line 2 | 
| #include <stdlib.h> | #include <stdlib.h> | 
| #include <string.h> | #include <string.h> | 
| #include <sys/types.h> | #include <sys/types.h> | 
| #include "aitmqtt.h" | #include <limits.h> | 
| #include <aitmqtt.h> | |
| int | int | 
| Line 10 main(int argc, char **argv) | Line 11 main(int argc, char **argv) | 
| { | { | 
| mqtt_subscr_t *v, *p; | mqtt_subscr_t *v, *p; | 
| u_char qoses[] = { 1, 0, 2, 6, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 }; | u_char qoses[] = { 1, 0, 2, 6, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 }; | 
| register int i; | register int i = 0; | 
| v = mqtt_str2subs((const char**) argv, 0, qoses); | v = mqtt_strs2subs((const char**) argv, 0, qoses); | 
| for (p = v; p->sub_topic.msg_base; p++) | for (p = v; p->sub_topic.msg_base; p++) | 
| printf("size=%hd %s qos=%d\n", p->sub_topic.msg_len, (char*) p->sub_topic.msg_base, p->sub_ret); | printf("size=%hd %s qos=%d\n", p->sub_topic.msg_len, (char*) p->sub_topic.msg_base, p->sub_qos); | 
| mqtt_subFree(&v); | mqtt_subFree(&v); | 
| v = mqtt_subAlloc(10); | v = mqtt_subAlloc(10); |