mirror of
https://github.com/troydhanson/tpl.git
synced 2024-12-27 08:05:39 +08:00
24 lines
393 B
C
24 lines
393 B
C
#include "tpl.h"
|
|
|
|
int main() {
|
|
int i;
|
|
char c;
|
|
tpl_node *tn;
|
|
|
|
tn = tpl_map("A(i)c", &i, &c);
|
|
|
|
/* pack index number 0 (char c) */
|
|
c = 'a';
|
|
tpl_pack(tn, 0);
|
|
|
|
/* pack A(i) (that is, index number 1) a few times */
|
|
i = 3;
|
|
tpl_pack(tn, 1);
|
|
i = 4;
|
|
tpl_pack(tn, 1);
|
|
|
|
tpl_dump(tn, TPL_FILE, "/tmp/test78.tpl");
|
|
tpl_free(tn);
|
|
return(0);
|
|
}
|