GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vector/diglib/list.c
Go to the documentation of this file.
1 /*
2  ****************************************************************************
3  *
4  * MODULE: Vector library
5  *
6  * AUTHOR(S): Original author CERL, probably Dave Gerdes.
7  * Update to GRASS 5.7 Radim Blazek.
8  *
9  * PURPOSE: Lower level functions for reading/writing/manipulating vectors.
10  *
11  * COPYRIGHT: (C) 2001 by the GRASS Development Team
12  *
13  * This program is free software under the GNU General Public
14  * License (>=v2). Read the file COPYING that comes with GRASS
15  * for details.
16  *
17  *****************************************************************************/
18 #include <stdlib.h>
19 #include <grass/gis.h>
20 #include <grass/Vect.h>
21 
22 /* Init int_list */
23 int dig_init_list(struct ilist *list)
24 {
25  list->value = NULL;
26  list->n_values = 0;
27  list->alloc_values = 0;
28 
29  return 1;
30 }
31 
32 /* Init add item to list */
33 int dig_list_add(struct ilist *list, int val)
34 {
35  void *p;
36  int size;
37 
38  if (list->n_values == list->alloc_values) {
39  size = (list->n_values + 1000) * sizeof(int);
40  p = G_realloc((void *)list->value, size);
41  if (p == NULL)
42  return 0;
43  list->value = (int *)p;
44  list->alloc_values = list->n_values + 1000;
45  }
46 
47  list->value[list->n_values] = val;
48  list->n_values++;
49 
50  return 1;
51 }
int dig_init_list(struct ilist *list)
int dig_list_add(struct ilist *list, int val)
tuple size
value.Bind(wx.EVT_TEXT, self.OnVolumeIsosurfMap)
Definition: tools.py:2334
return NULL
Definition: dbfopen.c:1394