modified: src1/input.c
[GalaxyCodeBases.git] / c_cpp / lib / klib / test / kgraph_test.c
blob3da1cd71b155e7258a6f42ca4e140b62665dd029
1 #include <stdio.h>
2 #include "kgraph.h"
4 KHASH_INIT2(e32, extern, uint32_t, int, 1, kh_int_hash_func, kh_int_hash_equal)
6 typedef struct {
7 int i;
8 khash_t(e32) *_arc;
9 } vertex_t;
11 KGRAPH_INIT(g, extern, vertex_t, int, e32)
12 KGRAPH_PRINT(g, extern)
14 int main()
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;