Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <stdlib.h>
00019 #include <grass/gis.h>
00020 #include <grass/Vect.h>
00021
00022
00023 int dig_init_list(struct ilist *list)
00024 {
00025 list->value = NULL;
00026 list->n_values = 0;
00027 list->alloc_values = 0;
00028
00029 return 1;
00030 }
00031
00032
00033 int dig_list_add(struct ilist *list, int val)
00034 {
00035 void *p;
00036 int size;
00037
00038 if (list->n_values == list->alloc_values) {
00039 size = (list->n_values + 1000) * sizeof(int);
00040 p = G_realloc((void *)list->value, size);
00041 if (p == NULL)
00042 return 0;
00043 list->value = (int *)p;
00044 list->alloc_values = list->n_values + 1000;
00045 }
00046
00047 list->value[list->n_values] = val;
00048 list->n_values++;
00049
00050 return 1;
00051 }