Przeglądaj źródła

shapelib/DBF driver: re-sync to GDAL/OGR (https://trac.osgeo.org/grass/ticket/3079)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@69890 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 8 lat temu
rodzic
commit
8e2dc707a2

+ 118 - 4
lib/external/shapelib/README

@@ -3,17 +3,131 @@ Update history of SHAPELIB copy:
 * files shpopen.c,shapefil.h,dbfopen.c:
    from ogr/ogrsf_frmts/shape/
 * file safileio.c
-   from SHAPELIB itself (http://shapelib.maptools.org/)
+   from SHAPELIB itself (http://download.osgeo.org/shapelib/)
 
 Last update
+* taken from GDAL 2.1.2 and SHAPELIB 1.3.0 (Thu Nov 24 10:45:41 CET 2016)
 * taken from GDAL 1.5.1-SVN (Sun Mar 30 11:20:43 CEST 2008)
 * taken from GDAL 1.5.0-CVS (Wed Sep  5 13:48:48 CEST 2007)
 * taken from GDAL 1.3.2-CVS (Sat Jun 17 22:08:04 CEST 2006)
 
 Additional fixes:
-* dbfopen.c (around line 1013)
-   GDAL bug #809 (http://trac.osgeo.org/gdal/ticket/809)
+* dbfopen.c
+   around line 1270: GDAL bug #809 (http://trac.osgeo.org/gdal/ticket/809)
+   define CPLsnprintf
+   define CPL_IGNORE_RET_VAL_INT
+
+* shpopen.c
+  define CPL_UNUSED
+
+* safileio.c
+  SHP_CVSID: ISO C does not allow extra ‘;’ outside of a function
 
 * Use <grass/shapefil.h> etc rather than "shapefil.h"
-   in both shpopen.c and dbfopen.c
+   in shpopen.c, dbfopen.c, and safileio.c
+
+
+full fix for dbf_open.c
+-->
+diff -up shapelib_gdal/dbfopen.c shapelib/dbfopen.c 
+--- shapelib_gdal/dbfopen.c	2016-10-24 13:00:32.000000000 +0200
++++ shapelib/dbfopen.c	2016-11-24 10:25:24.423021915 +0100
+@@ -157,7 +157,7 @@
+  * Treat all blank numeric fields as null too.
+  */
+ 
+-#include "shapefil.h"
++#include <grass/shapefil.h>
+ 
+ #include <math.h>
+ #include <stdlib.h>
+@@ -168,6 +168,12 @@
+ #include "cpl_string.h"
+ #else
+ #define CPLsprintf sprintf
++#if defined(WIN32) || defined(_WIN32)
++#  ifndef snprintf
++#     define snprintf _snprintf
++#  endif
++#endif
++#define CPLsnprintf snprintf
+ #endif
+ 
+ SHP_CVSID("$Id$")
+@@ -177,7 +183,11 @@ SHP_CVSID("$Id: dbfopen.c,v 1.89 2011-07
+ #  define TRUE		1
+ #endif
+ 
++#ifdef USE_CPL
+ CPL_INLINE static void CPL_IGNORE_RET_VAL_INT(CPL_UNUSED int unused) {}
++#else
++#define CPL_IGNORE_RET_VAL_INT(ret_val_int)	return
++#endif
+ 
+ /************************************************************************/
+ /*                             SfRealloc()                              */
+@@ -1273,8 +1283,8 @@ DBFGetFieldInfo( DBFHandle psDBF, int iF
+     else if( psDBF->pachFieldType[iField] == 'N'
+              || psDBF->pachFieldType[iField] == 'F' )
+     {
+-	if( psDBF->panFieldDecimals[iField] > 0
+-            || psDBF->panFieldSize[iField] >= 10 )
++	if( psDBF->panFieldDecimals[iField] > 0 )
++/*            || psDBF->panFieldSize[iField] >= 10 ) */ /* GDAL bug #809 */
+ 	    return( FTDouble );
+ 	else
+ 	    return( FTInteger );
+<--
+
+full fix for shpopen.c
+-->
+diff -up shapelib_gdal/shpopen.c shapelib/shpopen.c 
+--- shapelib_gdal/shpopen.c	2016-10-24 13:00:32.000000000 +0200
++++ shapelib/shpopen.c	2016-11-24 10:25:58.460964573 +0100
+@@ -265,7 +265,7 @@
+  *
+  */
+ 
+-#include "shapefil.h"
++#include <grass/shapefil.h>
+ 
+ #include <math.h>
+ #include <limits.h>
+@@ -276,6 +276,10 @@
+ 
+ SHP_CVSID("$Id$")
+ 
++#ifndef CPL_UNUSED
++#define CPL_UNUSED
++#endif
++
+ typedef unsigned char uchar;
+ 
+ #if UINT_MAX == 65535
+<--
+
+full fix for safileio.c
+-->
+diff -up shapelib_gdal/safileio.c shapelib/safileio.c 
+--- shapelib_gdal/safileio.c	2008-01-16 21:05:14.000000000 +0100
++++ shapelib/safileio.c	2016-11-24 10:25:42.734991066 +0100
+@@ -56,7 +56,7 @@
+  *
+  */
+ 
+-#include "shapefil.h"
++#include <grass/shapefil.h>
+ 
+ #include <math.h>
+ #include <limits.h>
+@@ -65,7 +65,7 @@
+ #include <string.h>
+ #include <stdio.h>
+ 
+-SHP_CVSID("$Id$");
++SHP_CVSID("$Id$")
+ 
+ #ifdef SHPAPI_UTF8_HOOKS
+ #   ifdef SHPAPI_WINDOWS
+<--
 

Plik diff jest za duży
+ 878 - 188
lib/external/shapelib/dbfopen.c


+ 6 - 4
lib/external/shapelib/safileio.c

@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id: safileio.c,v 1.4 2008/01/16 20:05:14 bram Exp $
+ * $Id: safileio.c,v 1.4 2008-01-16 20:05:14 bram Exp $
  *
  * Project:  Shapelib
  * Purpose:  Default implementation of file io based on stdio.
@@ -34,7 +34,7 @@
  ******************************************************************************
  *
  * $Log: safileio.c,v $
- * Revision 1.4  2008/01/16 20:05:14  bram
+ * Revision 1.4  2008-01-16 20:05:14  bram
  * Add file hooks that accept UTF-8 encoded filenames on some platforms.  Use SASetupUtf8Hooks
  *  tosetup the hooks and check SHPAPI_UTF8_HOOKS for its availability.  Currently, this
  *  is only available on the Windows platform that decodes the UTF-8 filenames to wide
@@ -56,7 +56,7 @@
  *
  */
 
-#include "shapefil.h"
+#include <grass/shapefil.h>
 
 #include <math.h>
 #include <limits.h>
@@ -65,7 +65,7 @@
 #include <string.h>
 #include <stdio.h>
 
-SHP_CVSID("$Id: safileio.c,v 1.4 2008/01/16 20:05:14 bram Exp $");
+SHP_CVSID("$Id: safileio.c,v 1.4 2008-01-16 20:05:14 bram Exp $");
 
 #ifdef SHPAPI_UTF8_HOOKS
 #   ifdef SHPAPI_WINDOWS
@@ -182,8 +182,10 @@ void SASetupDefaultHooks( SAHooks *psHooks )
     psHooks->FTell   = SADFTell;
     psHooks->FFlush  = SADFFlush;
     psHooks->FClose  = SADFClose;
+    psHooks->Remove  = SADRemove;
 
     psHooks->Error   = SADError;
+    psHooks->Atof    = atof;
 }
 
 

+ 195 - 42
lib/external/shapelib/shapefil.h

@@ -1,5 +1,5 @@
-#ifndef _SHAPEFILE_H_INCLUDED
-#define _SHAPEFILE_H_INCLUDED
+#ifndef SHAPEFILE_H_INCLUDED
+#define SHAPEFILE_H_INCLUDED
 
 /******************************************************************************
  * $Id$
@@ -10,13 +10,14 @@
  *
  ******************************************************************************
  * Copyright (c) 1999, Frank Warmerdam
+ * Copyright (c) 2012-2013, Even Rouault <even dot rouault at mines-paris dot org>
  *
  * This software is available under the following "MIT Style" license,
  * or at the option of the licensee under the LGPL (see LICENSE.LGPL).  This
  * option is discussed in more detail in shapelib.html.
  *
  * --
- * 
+ *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  * to deal in the Software without restriction, including without limitation
@@ -37,6 +38,50 @@
  ******************************************************************************
  *
  * $Log: shapefil.h,v $
+ * Revision 1.52  2011-12-11 22:26:46  fwarmerdam
+ * upgrade .qix access code to use SAHooks (gdal #3365)
+ *
+ * Revision 1.51  2011-07-24 05:59:25  fwarmerdam
+ * minimize use of CPLError in favor of SAHooks.Error()
+ *
+ * Revision 1.50  2011-05-13 17:35:17  fwarmerdam
+ * added DBFReorderFields() and DBFAlterFields() functions (from Even)
+ *
+ * Revision 1.49  2011-04-16 14:38:21  fwarmerdam
+ * avoid warnings with gcc on SHP_CVSID
+ *
+ * Revision 1.48  2010-08-27 23:42:52  fwarmerdam
+ * add SHPAPI_CALL attribute in code
+ *
+ * Revision 1.47  2010-01-28 11:34:34  fwarmerdam
+ * handle the shape file length limits more gracefully (#3236)
+ *
+ * Revision 1.46  2008-11-12 14:28:15  fwarmerdam
+ * DBFCreateField() now works on files with records
+ *
+ * Revision 1.45  2008/11/11 17:47:10  fwarmerdam
+ * added DBFDeleteField() function
+ *
+ * Revision 1.44  2008/01/16 20:05:19  bram
+ * Add file hooks that accept UTF-8 encoded filenames on some platforms.  Use SASetupUtf8Hooks
+ *  tosetup the hooks and check SHPAPI_UTF8_HOOKS for its availability.  Currently, this
+ *  is only available on the Windows platform that decodes the UTF-8 filenames to wide
+ *  character strings and feeds them to _wfopen and _wremove.
+ *
+ * Revision 1.43  2008/01/10 16:35:30  fwarmerdam
+ * avoid _ prefix on #defined symbols (bug 1840)
+ *
+ * Revision 1.42  2007/12/18 18:28:14  bram
+ * - create hook for client specific atof (bugzilla ticket 1615)
+ * - check for NULL handle before closing cpCPG file, and close after reading.
+ *
+ * Revision 1.41  2007/12/15 20:25:32  bram
+ * dbfopen.c now reads the Code Page information from the DBF file, and exports
+ * this information as a string through the DBFGetCodePage function.  This is
+ * either the number from the LDID header field ("LDID/<number>") or as the
+ * content of an accompanying .CPG file.  When creating a DBF file, the code can
+ * be set using DBFCreateEx.
+ *
  * Revision 1.40  2007/12/06 07:00:25  fwarmerdam
  * dbfopen now using SAHooks for fileio
  *
@@ -103,8 +148,7 @@
 #endif
 
 #ifdef USE_CPL
-#include "cpl_error.h"
-#include "cpl_vsi.h"
+#include "cpl_conv.h"
 #endif
 
 #ifdef __cplusplus
@@ -127,7 +171,7 @@ extern "C" {
 /*      is disabled.                                                    */
 /* -------------------------------------------------------------------- */
 #define DISABLE_MULTIPATCH_MEASURE
-    
+
 /* -------------------------------------------------------------------- */
 /*      SHPAPI_CALL                                                     */
 /*                                                                      */
@@ -151,7 +195,7 @@ extern "C" {
 /*        #define SHPAPI_CALL __declspec(dllexport) __stdcall           */
 /*        #define SHPAPI_CALL1 __declspec(dllexport) * __stdcall        */
 /*                                                                      */
-/*      The complexity of the situtation is partly caused by the        */
+/*      The complexity of the situation is partly caused by the        */
 /*      peculiar requirement of Visual C++ that __stdcall appear        */
 /*      after any "*"'s in the return value of a function while the     */
 /*      __declspec(dllexport) must appear before them.                  */
@@ -174,18 +218,31 @@ extern "C" {
 #ifndef SHPAPI_CALL1
 #  define SHPAPI_CALL1(x)      x SHPAPI_CALL
 #endif
-    
+
 /* -------------------------------------------------------------------- */
 /*      Macros for controlling CVSID and ensuring they don't appear     */
 /*      as unreferenced variables resulting in lots of warnings.        */
 /* -------------------------------------------------------------------- */
 #ifndef DISABLE_CVSID
-#  define SHP_CVSID(string)     static char cpl_cvsid[] = string; \
-static char *cvsid_aw() { return( cvsid_aw() ? ((char *) NULL) : cpl_cvsid ); }
+#  if defined(__GNUC__) && __GNUC__ >= 4
+#    define SHP_CVSID(string)     static const char cpl_cvsid[] __attribute__((used)) = string;
+#  else
+#    define SHP_CVSID(string)     static const char cpl_cvsid[] = string; \
+static const char *cvsid_aw() { return( cvsid_aw() ? NULL : cpl_cvsid ); }
+#  endif
 #else
 #  define SHP_CVSID(string)
 #endif
-    
+
+/* -------------------------------------------------------------------- */
+/*      On some platforms, additional file IO hooks are defined that    */
+/*      UTF-8 encoded filenames Unicode filenames                       */
+/* -------------------------------------------------------------------- */
+#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
+#	define SHPAPI_WINDOWS
+#	define SHPAPI_UTF8_HOOKS
+#endif
+
 /* -------------------------------------------------------------------- */
 /*      IO/Error hook functions.                                        */
 /* -------------------------------------------------------------------- */
@@ -196,23 +253,30 @@ typedef unsigned long SAOffset;
 #endif
 
 typedef struct {
-    SAFile     (*FOpen) ( const char *filename, const char *path);
+    SAFile     (*FOpen) ( const char *filename, const char *access);
     SAOffset   (*FRead) ( void *p, SAOffset size, SAOffset nmemb, SAFile file);
     SAOffset   (*FWrite)( void *p, SAOffset size, SAOffset nmemb, SAFile file);
     SAOffset   (*FSeek) ( SAFile file, SAOffset offset, int whence );
     SAOffset   (*FTell) ( SAFile file );
     int        (*FFlush)( SAFile file );
     int        (*FClose)( SAFile file );
+    int        (*Remove) ( const char *filename );
 
     void       (*Error) ( const char *message );
+    double     (*Atof)  ( const char *str );
 } SAHooks;
 
 void SHPAPI_CALL SASetupDefaultHooks( SAHooks *psHooks );
+#ifdef SHPAPI_UTF8_HOOKS
+void SHPAPI_CALL SASetupUtf8Hooks( SAHooks *psHooks );
+#endif
 
 /************************************************************************/
 /*                             SHP Support.                             */
 /************************************************************************/
-typedef	struct
+typedef struct tagSHPObject SHPObject;
+
+typedef struct
 {
     SAHooks sHooks;
 
@@ -220,13 +284,13 @@ typedef	struct
     SAFile 	fpSHX;
 
     int		nShapeType;				/* SHPT_* */
-    
-    int		nFileSize;				/* SHP file */
+
+    unsigned int 	nFileSize;				/* SHP file */
 
     int         nRecords;
     int		nMaxRecords;
-    int		*panRecOffset;
-    int		*panRecSize;
+    unsigned int		*panRecOffset;
+    unsigned int		*panRecSize;
 
     double	adBoundsMin[4];
     double	adBoundsMax[4];
@@ -235,6 +299,11 @@ typedef	struct
 
     unsigned char *pabyRec;
     int         nBufSize;
+
+    int            bFastModeReadObject;
+    unsigned char *pabyObjectBuf;
+    int            nObjectBufSize;
+    SHPObject*     psCachedObject;
 } SHPInfo;
 
 typedef SHPInfo * SHPHandle;
@@ -274,7 +343,7 @@ typedef SHPInfo * SHPHandle;
 /*      SHPObject - represents on shape (without attributes) read       */
 /*      from the .shp file.                                             */
 /* -------------------------------------------------------------------- */
-typedef struct
+struct tagSHPObject
 {
     int		nSHPType;
 
@@ -283,7 +352,7 @@ typedef struct
     int		nParts;
     int		*panPartStart;
     int		*panPartType;
-    
+
     int		nVertices;
     double	*padfX;
     double	*padfY;
@@ -301,7 +370,8 @@ typedef struct
     double	dfMMax;
 
     int		bMeasureIsUsed;
-} SHPObject;
+    int     bFastModeReadObject;
+};
 
 /* -------------------------------------------------------------------- */
 /*      SHP API Prototypes                                              */
@@ -312,9 +382,23 @@ typedef struct
 SHPHandle SHPAPI_CALL
       SHPOpen( const char * pszShapeFile, const char * pszAccess );
 SHPHandle SHPAPI_CALL
-      SHPOpenLL( const char *pszShapeFile, const char *pszAccess, 
+      SHPOpenLL( const char *pszShapeFile, const char *pszAccess,
                  SAHooks *psHooks );
 SHPHandle SHPAPI_CALL
+      SHPOpenLLEx( const char *pszShapeFile, const char *pszAccess,
+                  SAHooks *psHooks, int bRestoreSHX );
+
+int       SHPAPI_CALL
+      SHPRestoreSHX( const char *pszShapeFile, const char *pszAccess,
+                  SAHooks *psHooks );
+
+/* If setting bFastMode = TRUE, the content of SHPReadObject() is owned by the SHPHandle. */
+/* So you cannot have 2 valid instances of SHPReadObject() simultaneously. */
+/* The SHPObject padfZ and padfM members may be NULL depending on the geometry */
+/* type. It is illegal to free at hand any of the pointer members of the SHPObject structure */
+void SHPAPI_CALL SHPSetFastModeReadObject( SHPHandle hSHP, int bFastMode );
+
+SHPHandle SHPAPI_CALL
       SHPCreate( const char * pszShapeFile, int nShapeType );
 SHPHandle SHPAPI_CALL
       SHPCreateLL( const char * pszShapeFile, int nShapeType,
@@ -333,15 +417,15 @@ void SHPAPI_CALL
 void SHPAPI_CALL
       SHPComputeExtents( SHPObject * psObject );
 SHPObject SHPAPI_CALL1(*)
-      SHPCreateObject( int nSHPType, int nShapeId, int nParts, 
+      SHPCreateObject( int nSHPType, int nShapeId, int nParts,
                        const int * panPartStart, const int * panPartType,
-                       int nVertices, 
+                       int nVertices,
                        const double * padfX, const double * padfY,
                        const double * padfZ, const double * padfM );
 SHPObject SHPAPI_CALL1(*)
       SHPCreateSimpleObject( int nSHPType, int nVertices,
-                             const double * padfX, 
-                             const double * padfY, 
+                             const double * padfX,
+                             const double * padfY,
                              const double * padfZ );
 
 int SHPAPI_CALL
@@ -379,17 +463,17 @@ typedef struct shape_tree_node
 
     int		nSubNodes;
     struct shape_tree_node *apsSubNode[MAX_SUBNODE];
-    
+
 } SHPTreeNode;
 
 typedef struct
 {
     SHPHandle   hSHP;
-    
+
     int		nMaxDepth;
     int		nDimension;
     int         nTotalCount;
-    
+
     SHPTreeNode	*psRoot;
 } SHPTree;
 
@@ -401,12 +485,8 @@ void    SHPAPI_CALL
 
 int	SHPAPI_CALL
       SHPWriteTree( SHPTree *hTree, const char * pszFilename );
-SHPTree SHPAPI_CALL
-      SHPReadTree( const char * pszFilename );
 
 int	SHPAPI_CALL
-      SHPTreeAddObject( SHPTree * hTree, SHPObject * psObject );
-int	SHPAPI_CALL
       SHPTreeAddShapeId( SHPTree * hTree, SHPObject * psObject );
 int	SHPAPI_CALL
       SHPTreeRemoveShapeId( SHPTree * hTree, int nShapeId );
@@ -422,11 +502,55 @@ int    SHPAPI_CALL1(*)
 int     SHPAPI_CALL
       SHPCheckBoundsOverlap( double *, double *, double *, double *, int );
 
-int SHPAPI_CALL1(*) 
-SHPSearchDiskTree( FILE *fp, 
+int SHPAPI_CALL1(*)
+SHPSearchDiskTree( FILE *fp,
                    double *padfBoundsMin, double *padfBoundsMax,
                    int *pnShapeCount );
 
+
+typedef struct SHPDiskTreeInfo* SHPTreeDiskHandle;
+
+SHPTreeDiskHandle SHPAPI_CALL
+    SHPOpenDiskTree( const char* pszQIXFilename,
+                     SAHooks *psHooks );
+
+void SHPAPI_CALL
+    SHPCloseDiskTree( SHPTreeDiskHandle hDiskTree );
+
+int SHPAPI_CALL1(*)
+SHPSearchDiskTreeEx( SHPTreeDiskHandle hDiskTree,
+                   double *padfBoundsMin, double *padfBoundsMax,
+                   int *pnShapeCount );
+
+int SHPAPI_CALL
+    SHPWriteTreeLL(SHPTree *hTree, const char *pszFilename, SAHooks *psHooks );
+
+
+/* -------------------------------------------------------------------- */
+/*      SBN Search API                                                  */
+/* -------------------------------------------------------------------- */
+
+typedef struct SBNSearchInfo* SBNSearchHandle;
+
+SBNSearchHandle SHPAPI_CALL
+    SBNOpenDiskTree( const char* pszSBNFilename,
+                 SAHooks *psHooks );
+
+void SHPAPI_CALL
+    SBNCloseDiskTree( SBNSearchHandle hSBN );
+
+int SHPAPI_CALL1(*)
+SBNSearchDiskTree( SBNSearchHandle hSBN,
+                   double *padfBoundsMin, double *padfBoundsMax,
+                   int *pnShapeCount );
+
+int SHPAPI_CALL1(*)
+SBNSearchDiskTreeInteger( SBNSearchHandle hSBN,
+                          int bMinX, int bMinY, int bMaxX, int bMaxY,
+                          int *pnShapeCount );
+
+void SHPAPI_CALL SBNSearchFreeIds( int* panShapeId );
+
 /************************************************************************/
 /*                             DBF Support.                             */
 /************************************************************************/
@@ -454,11 +578,22 @@ typedef	struct
 
     int         nWorkFieldLength;
     char        *pszWorkField;
-    
+
     int		bNoHeader;
     int		bUpdated;
 
-    double      dfDoubleField;
+    union
+    {
+        double      dfDoubleField;
+        int         nIntField;
+    } fieldValue;
+
+    int         iLanguageDriver;
+    char        *pszCodePage;
+
+    int         nUpdateYearSince1900; /* 0-255 */
+    int         nUpdateMonth; /* 1-12 */
+    int         nUpdateDay; /* 1-31 */
 } DBFInfo;
 
 typedef DBFInfo * DBFHandle;
@@ -482,7 +617,9 @@ DBFHandle SHPAPI_CALL
 DBFHandle SHPAPI_CALL
       DBFCreate( const char * pszDBFFile );
 DBFHandle SHPAPI_CALL
-      DBFCreateLL( const char * pszDBFFile, SAHooks *psHooks );
+      DBFCreateEx( const char * pszDBFFile, const char * pszCodePage );
+DBFHandle SHPAPI_CALL
+      DBFCreateLL( const char * pszDBFFile, const char * pszCodePage, SAHooks *psHooks );
 
 int	SHPAPI_CALL
       DBFGetFieldCount( DBFHandle psDBF );
@@ -496,8 +633,18 @@ int	SHPAPI_CALL
       DBFAddNativeFieldType( DBFHandle hDBF, const char * pszFieldName,
                              char chType, int nWidth, int nDecimals );
 
+int	SHPAPI_CALL
+      DBFDeleteField( DBFHandle hDBF, int iField );
+
+int SHPAPI_CALL
+      DBFReorderFields( DBFHandle psDBF, int* panMap );
+
+int SHPAPI_CALL
+      DBFAlterFieldDefn( DBFHandle psDBF, int iField, const char * pszFieldName,
+                         char chType, int nWidth, int nDecimals );
+
 DBFFieldType SHPAPI_CALL
-      DBFGetFieldInfo( DBFHandle psDBF, int iField, 
+      DBFGetFieldInfo( DBFHandle psDBF, int iField,
                        char * pszFieldName, int * pnWidth, int * pnDecimals );
 
 int SHPAPI_CALL
@@ -515,7 +662,7 @@ int     SHPAPI_CALL
       DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField );
 
 int SHPAPI_CALL
-      DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField, 
+      DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField,
                                 int nFieldValue );
 int SHPAPI_CALL
       DBFWriteDoubleAttribute( DBFHandle hDBF, int iShape, int iField,
@@ -538,12 +685,12 @@ int SHPAPI_CALL
       DBFWriteTuple(DBFHandle psDBF, int hEntity, void * pRawTuple );
 
 int SHPAPI_CALL DBFIsRecordDeleted( DBFHandle psDBF, int iShape );
-int SHPAPI_CALL DBFMarkRecordDeleted( DBFHandle psDBF, int iShape, 
+int SHPAPI_CALL DBFMarkRecordDeleted( DBFHandle psDBF, int iShape,
                                       int bIsDeleted );
 
 DBFHandle SHPAPI_CALL
       DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename );
- 
+
 void	SHPAPI_CALL
       DBFClose( DBFHandle hDBF );
 void    SHPAPI_CALL
@@ -551,8 +698,14 @@ void    SHPAPI_CALL
 char    SHPAPI_CALL
       DBFGetNativeFieldType( DBFHandle hDBF, int iField );
 
+const char SHPAPI_CALL1(*)
+      DBFGetCodePage(DBFHandle psDBF );
+
+void SHPAPI_CALL
+    DBFSetLastModifiedDate( DBFHandle psDBF, int nYYSince1900, int nMM, int nDD );
+
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* ndef _SHAPEFILE_H_INCLUDED */
+#endif /* ndef SHAPEFILE_H_INCLUDED */

Plik diff jest za duży
+ 1099 - 422
lib/external/shapelib/shpopen.c