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/kgraph_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 / kgraph_test.c` 26 lines ยท 489 bytes Raw Blame History 1 #include 2 #include "kgraph.h" 3 4 KHASH_INIT2(e32, extern, uint32_t, int, 1, kh_int_hash_func, kh_int_hash_equal) 5 6 typedef struct { 7 int i; 8 khash_t(e32) *_arc; 9 } vertex_t; 10 11 KGRAPH_INIT(g, extern, vertex_t, int, e32) 12 KGRAPH_PRINT(g, extern) 13 14 int main() 15 { 16 int *pb, *pe; 17 kgraph_t(g) *g; 18 g = kg_init_g(); 19 kg_put_a_g(g, 10, 20, 0, &pb, &pe); 20 kg_put_a_g(g, 20, 30, 0, &pb, &pe); 21 kg_put_a_g(g, 30, 10, 1, &pb, &pe); 22 kg_del_v_g(g, 20); 23 kg_print_g(g); 24 kg_destroy_g(g); 25 return 0; 26 }