rewind.c

Go to the documentation of this file.
00001 /*
00002 ****************************************************************************
00003 *
00004 * MODULE:       Vector library 
00005 *               
00006 * AUTHOR(S):    Original author CERL, probably Dave Gerdes or Mike Higgins.
00007 *               Update to GRASS 5.7 Radim Blazek and David D. Gray.
00008 *
00009 * PURPOSE:      Higher level functions for reading/writing/manipulating vectors.
00010 *
00011 * COPYRIGHT:    (C) 2001 by the GRASS Development Team
00012 *
00013 *               This program is free software under the GNU General Public
00014 *               License (>=v2). Read the file COPYING that comes with GRASS
00015 *               for details.
00016 *
00017 *****************************************************************************/
00018 #include <grass/Vect.h>
00019 
00020 
00021 /*  Rewind vector data file to cause reads to start at beginning */
00022 /* returns 0 on success, -1 on error */
00023 static int
00024 rew_dummy ()
00025 {
00026       return -1;
00027 }
00028 
00029 
00030 #ifndef HAVE_OGR
00031 static int format () { G_fatal_error ("Requested format is not compiled in this version"); return 0; } 
00032 #endif
00033 
00034 
00035 static int (*Rewind_array[][3]) () =
00036 {
00037     { rew_dummy, V1_rewind_nat, V2_rewind_nat }
00038 #ifdef HAVE_OGR
00039    ,{ rew_dummy, V1_rewind_ogr, V2_rewind_ogr }
00040 #else
00041    ,{ rew_dummy, format, format }
00042 #endif
00043 };
00044 
00045 
00052 int 
00053 Vect_rewind (struct Map_info *Map)
00054 {
00055     if (!VECT_OPEN (Map))
00056         return -1;
00057 
00058     G_debug (1, "Vect_Rewind(): name = %s", Map->name);
00059 
00060     return (*Rewind_array[Map->format][Map->level]) (Map);
00061 }

Generated on Sun Apr 6 17:32:44 2008 for GRASS by  doxygen 1.5.5