Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/klib/blob/master/test/klist_test.c # klib [Ported from github.com/attractivechaos/klib] added block arena Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `klib / test / klist_test.c` 19 lines ยท 353 bytes Raw Blame History 1 #include 2 #include "klist.h" 3 4 #define __int_free(x) 5 KLIST_INIT(32, int, __int_free) 6 7 int main() 8 { 9 klist_t(32) *kl; 10 kliter_t(32) *p; 11 kl = kl_init(32); 12 *kl_pushp(32, kl) = 1; 13 *kl_pushp(32, kl) = 10; 14 kl_shift(32, kl, 0); 15 for (p = kl_begin(kl); p != kl_end(kl); p = kl_next(p)) 16 printf("%d\n", kl_val(p)); 17 kl_destroy(32, kl); 18 return 0; 19 }