25 #include <grass/linkm.h>
27 static int link_chunk_size = 100;
28 static int link_exit_flag = 0;
32 link_chunk_size =
size;
37 link_exit_flag =
flag;
43 struct link_head *Head;
45 if (
NULL == (Head = (
struct link_head *)
malloc(
sizeof(
struct link_head))))
56 Head->alloced = PTR_CNT;
58 Head->chunk_size = link_chunk_size;
59 Head->exit_flag = link_exit_flag;
71 if (Head->ptr_array) {
72 for (i = 0; i < Head->max_ptr; i++)
73 if (Head->ptr_array[i] !=
NULL)
74 free(Head->ptr_array[i]);
75 free(Head->ptr_array);
struct link_head * link_init(int size)
void link_cleanup(struct link_head *Head)
void link_set_chunk_size(int size)
void link_exit_on_error(int flag)