GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vector/Vlib/type.c
Go to the documentation of this file.
1 
20 #include <grass/gis.h>
21 #include <grass/Vect.h>
22 
31 int Vect_option_to_types(struct Option *type_opt)
32 {
33  int i = 0;
34  int type = 0;
35 
36  while (type_opt->answers[i]) {
37  switch (type_opt->answers[i][0]) {
38  case 'p':
39  type |= GV_POINT;
40  break;
41  case 'l':
42  type |= GV_LINE;
43  break;
44  case 'b':
45  type |= GV_BOUNDARY;
46  break;
47  case 'c':
48  type |= GV_CENTROID;
49  break;
50  case 'f':
51  type |= GV_FACE;
52  break;
53  case 'k':
54  type |= GV_KERNEL;
55  break;
56  case 'a':
57  type |= GV_AREA;
58  break;
59  case 'v':
60  type |= GV_VOLUME;
61  break;
62  }
63  i++;
64  }
65 
66  return type;
67 }
int Vect_option_to_types(struct Option *type_opt)
Get types from options.