File:  [ELWIX - Embedded LightWeight unIX -] / libelwix / example / test_tlv.c
Revision 1.1.2.1: download - view: text, annotated - select for diffs - revision graph
Mon Jan 24 16:01:49 2022 UTC (2 years, 5 months ago) by misho
Branches: elwix5_1
adds new UT

    1: #include <stdio.h>
    2: #include <stdlib.h>
    3: #include <string.h>
    4: #include <elwix.h>
    5: 
    6: 
    7: int
    8: main(int argc, char **argv)
    9: {
   10: 	array_t *arr;
   11: 	register int i;
   12: 
   13: 	arr = ait_array2vars((const char**) argv, 42);
   14: 	if (!arr)
   15: 		return 1;
   16: 
   17: 	for (i = 0; i < array_Size(arr); i++) {
   18: 		if (AIT_TYPE(array(arr, i, ait_val_t*)) == string)
   19: 			printf("arr[%d]=%s\n", i, AIT_ADDR(array(arr, i, ait_val_t*)));
   20: 		else
   21: 			printf("arr[%d]#%ld\n", i, AIT_RAW(array(arr, i, ait_val_t*)));
   22: 	}
   23: 
   24: 	ait_freeVars(&arr);
   25: 	return 0;
   26: }

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