1 #include <stdio.h> 2 #include "tpl.h" 3 main()4int main() { 5 int i; 6 char c; 7 tpl_node *tn; 8 9 tn = tpl_map("A(i)c", &i, &c); 10 tpl_load(tn, TPL_FILE, "/tmp/test78.tpl"); 11 12 /* unpack index number 0 (char c) */ 13 tpl_unpack(tn, 0); 14 printf("got %c\n", c); 15 16 /* unpack A(i) (that is, index number 1) til we run out of elements */ 17 while (tpl_unpack(tn, 1) > 0) { 18 printf("got %d\n", i); 19 } 20 tpl_free(tn); 21 return(0); 22 } 23