1 #include <stdio.h> 2 #include <stdlib.h> 3 #include "tpl.h" 4 main()5int main() { 6 tpl_node *tn; 7 char *s,*t; 8 void *addr; 9 int sz; 10 11 tn = tpl_map("s",&s); 12 s = "hello, world!"; 13 tpl_pack(tn,0); 14 tpl_dump(tn,TPL_MEM,&addr,&sz); 15 tpl_free(tn); 16 17 tn = tpl_map("s",&t); 18 tpl_load(tn,TPL_MEM,addr,sz); 19 tpl_unpack(tn,0); 20 printf("t is %s\n", t); 21 free(t); 22 tpl_free(tn); 23 free(addr); 24 return(0); 25 } 26