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 "Vect.h"
00019 
00020 /*  Rewind vector data file to cause reads to start at beginning */
00021 /* returns 0 on success, -1 on error */
00022 
00023 static int
00024 rew_dummy ()
00025 {
00026       return -1;
00027 }
00028 static int format () { G_fatal_error ("Requested format is not compiled in this version"); return 0; } 
00029 
00030 static int (*Rewind_array[][3]) () =
00031 {
00032     { rew_dummy, V1_rewind_nat, V2_rewind_nat }
00033 #ifdef HAVE_OGR
00034    ,{ rew_dummy, V1_rewind_ogr, V2_rewind_ogr }
00035 #else
00036    ,{ rew_dummy, format, format }
00037 #endif
00038 };
00039 
00046 int 
00047 Vect_rewind (struct Map_info *Map)
00048 {
00049     if (!VECT_OPEN (Map))
00050         return -1;
00051 
00052     G_debug (1, "Vect_Rewind(): name = %s", Map->name);
00053     return (*Rewind_array[Map->format][Map->level]) (Map);
00054 }
00055 

Generated on Wed Aug 23 17:49:01 2006 for GRASS by  doxygen 1.4.7