GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vector/Vlib/rewind.c
Go to the documentation of this file.
1 
21 #include <grass/Vect.h>
22 #include <grass/glocale.h>
23 
24 /* Rewind vector data file to cause reads to start at beginning */
25 /* returns 0 on success, -1 on error */
26 static int rew_dummy()
27 {
28  return -1;
29 }
30 
31 
32 #ifndef HAVE_OGR
33 static int format()
34 {
35  G_fatal_error(_("Requested format is not compiled in this version"));
36  return 0;
37 }
38 #endif
39 
40 
41 static int (*Rewind_array[][3]) () = {
42  {
43  rew_dummy, V1_rewind_nat, V2_rewind_nat}
44 #ifdef HAVE_OGR
45  , {
46  rew_dummy, V1_rewind_ogr, V2_rewind_ogr}
47 #else
48  , {
49  rew_dummy, format, format}
50 #endif
51 };
52 
53 
62 int Vect_rewind(struct Map_info *Map)
63 {
64  if (!VECT_OPEN(Map))
65  return -1;
66 
67  G_debug(1, "Vect_Rewind(): name = %s", Map->name);
68 
69  return (*Rewind_array[Map->format][Map->level]) (Map);
70 }
int V1_rewind_nat(struct Map_info *Map)
Definition: rewind_nat.c:24
int V2_rewind_ogr(struct Map_info *Map)
Definition: rewind_ogr.c:39
int V1_rewind_ogr(struct Map_info *Map)
Definition: rewind_ogr.c:27
int
Definition: g3dcolor.c:48
int V2_rewind_nat(struct Map_info *Map)
Definition: rewind_nat.c:29
tuple Map
Definition: render.py:1310
int G_debug(int level, const char *msg,...)
Print debugging message.
Definition: gis/debug.c:51
int G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
int Vect_rewind(struct Map_info *Map)
Rewind vector data file to cause reads to start at beginning.