rewind.c

Go to the documentation of this file.
00001 
00021 #include <grass/Vect.h>
00022 #include <grass/glocale.h>
00023 
00024 /*  Rewind vector data file to cause reads to start at beginning */
00025 /* returns 0 on success, -1 on error */
00026 static int rew_dummy()
00027 {
00028     return -1;
00029 }
00030 
00031 
00032 #ifndef HAVE_OGR
00033 static int format()
00034 {
00035     G_fatal_error(_("Requested format is not compiled in this version"));
00036     return 0;
00037 }
00038 #endif
00039 
00040 
00041 static int (*Rewind_array[][3]) () = {
00042     {
00043     rew_dummy, V1_rewind_nat, V2_rewind_nat}
00044 #ifdef HAVE_OGR
00045     , {
00046     rew_dummy, V1_rewind_ogr, V2_rewind_ogr}
00047 #else
00048     , {
00049     rew_dummy, format, format}
00050 #endif
00051 };
00052 
00053 
00062 int Vect_rewind(struct Map_info *Map)
00063 {
00064     if (!VECT_OPEN(Map))
00065         return -1;
00066 
00067     G_debug(1, "Vect_Rewind(): name = %s", Map->name);
00068 
00069     return (*Rewind_array[Map->format][Map->level]) (Map);
00070 }
Generated on Tue Apr 6 13:28:10 2010 for GRASS Programmer's Manual by  doxygen 1.6.3