Forráskód Böngészése

reverted indentation of external library

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32582 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 17 éve
szülő
commit
506f780651

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 878 - 833
lib/external/shapelib/dbfopen.c


+ 82 - 83
lib/external/shapelib/safileio.c

@@ -1,4 +1,3 @@
-
 /******************************************************************************
  * $Id: safileio.c,v 1.4 2008/01/16 20:05:14 bram Exp $
  *
@@ -79,110 +78,112 @@ SHP_CVSID("$Id: safileio.c,v 1.4 2008/01/16 20:05:14 bram Exp $");
 
 /************************************************************************/
 /*                              SADFOpen()                              */
-
 /************************************************************************/
 
-SAFile SADFOpen(const char *pszFilename, const char *pszAccess)
+SAFile SADFOpen( const char *pszFilename, const char *pszAccess )
+
 {
-    return (SAFile) fopen(pszFilename, pszAccess);
+    return (SAFile) fopen( pszFilename, pszAccess );
 }
 
 /************************************************************************/
 /*                              SADFRead()                              */
-
 /************************************************************************/
 
-SAOffset SADFRead(void *p, SAOffset size, SAOffset nmemb, SAFile file)
+SAOffset SADFRead( void *p, SAOffset size, SAOffset nmemb, SAFile file )
+
 {
-    return (SAOffset) fread(p, (size_t) size, (size_t) nmemb, (FILE *) file);
+    return (SAOffset) fread( p, (size_t) size, (size_t) nmemb, 
+                             (FILE *) file );
 }
 
 /************************************************************************/
 /*                             SADFWrite()                              */
-
 /************************************************************************/
 
-SAOffset SADFWrite(void *p, SAOffset size, SAOffset nmemb, SAFile file)
+SAOffset SADFWrite( void *p, SAOffset size, SAOffset nmemb, SAFile file )
+
 {
-    return (SAOffset) fwrite(p, (size_t) size, (size_t) nmemb, (FILE *) file);
+    return (SAOffset) fwrite( p, (size_t) size, (size_t) nmemb, 
+                              (FILE *) file );
 }
 
 /************************************************************************/
 /*                              SADFSeek()                              */
-
 /************************************************************************/
 
-SAOffset SADFSeek(SAFile file, SAOffset offset, int whence)
+SAOffset SADFSeek( SAFile file, SAOffset offset, int whence )
+
 {
-    return (SAOffset) fseek((FILE *) file, (long)offset, whence);
+    return (SAOffset) fseek( (FILE *) file, (long) offset, whence );
 }
 
 /************************************************************************/
 /*                              SADFTell()                              */
-
 /************************************************************************/
 
-SAOffset SADFTell(SAFile file)
+SAOffset SADFTell( SAFile file )
+
 {
-    return (SAOffset) ftell((FILE *) file);
+    return (SAOffset) ftell( (FILE *) file );
 }
 
 /************************************************************************/
 /*                             SADFFlush()                              */
-
 /************************************************************************/
 
-int SADFFlush(SAFile file)
+int SADFFlush( SAFile file )
+
 {
-    return fflush((FILE *) file);
+    return fflush( (FILE *) file );
 }
 
 /************************************************************************/
 /*                             SADFClose()                              */
-
 /************************************************************************/
 
-int SADFClose(SAFile file)
+int SADFClose( SAFile file )
+
 {
-    return fclose((FILE *) file);
+    return fclose( (FILE *) file );
 }
 
 /************************************************************************/
 /*                             SADFClose()                              */
-
 /************************************************************************/
 
-int SADRemove(const char *filename)
+int SADRemove( const char *filename )
+
 {
-    return remove(filename);
+    return remove( filename );
 }
 
 /************************************************************************/
 /*                              SADError()                              */
-
 /************************************************************************/
 
-void SADError(const char *message)
+void SADError( const char *message )
+
 {
-    fprintf(stderr, "%s\n", message);
+    fprintf( stderr, "%s\n", message );
 }
 
 /************************************************************************/
 /*                        SASetupDefaultHooks()                         */
-
 /************************************************************************/
 
-void SASetupDefaultHooks(SAHooks * psHooks)
+void SASetupDefaultHooks( SAHooks *psHooks )
+
 {
-    psHooks->FOpen = SADFOpen;
-    psHooks->FRead = SADFRead;
-    psHooks->FWrite = SADFWrite;
-    psHooks->FSeek = SADFSeek;
-    psHooks->FTell = SADFTell;
-    psHooks->FFlush = SADFFlush;
-    psHooks->FClose = SADFClose;
-
-    psHooks->Error = SADError;
+    psHooks->FOpen   = SADFOpen;
+    psHooks->FRead   = SADFRead;
+    psHooks->FWrite  = SADFWrite;
+    psHooks->FSeek   = SADFSeek;
+    psHooks->FTell   = SADFTell;
+    psHooks->FFlush  = SADFFlush;
+    psHooks->FClose  = SADFClose;
+
+    psHooks->Error   = SADError;
 }
 
 
@@ -192,65 +193,64 @@ void SASetupDefaultHooks(SAHooks * psHooks)
 
 /************************************************************************/
 /*                          Utf8ToWideChar                              */
-
 /************************************************************************/
 
-const wchar_t *Utf8ToWideChar(const char *pszFilename)
+const wchar_t* Utf8ToWideChar( const char *pszFilename )
 {
     int nMulti, nWide;
     wchar_t *pwszFileName;
-
+    
     nMulti = strlen(pszFilename) + 1;
-    nWide = MultiByteToWideChar(CP_UTF8, 0, pszFilename, nMulti, 0, 0);
-    if (nWide == 0) {
-	return NULL;
+    nWide = MultiByteToWideChar( CP_UTF8, 0, pszFilename, nMulti, 0, 0);
+    if( nWide == 0 )
+    {
+        return NULL;
     }
-    pwszFileName = (wchar_t *) malloc(nWide * sizeof(wchar_t));
-    if (pwszFileName == NULL) {
-	return NULL;
+    pwszFileName = (wchar_t*) malloc(nWide * sizeof(wchar_t));
+    if ( pwszFileName == NULL )
+    {
+        return NULL;
     }
-    if (MultiByteToWideChar
-	(CP_UTF8, 0, pszFilename, nMulti, pwszFileName, nWide) == 0) {
-	free(pwszFileName);
-	return NULL;
+    if( MultiByteToWideChar( CP_UTF8, 0, pszFilename, nMulti, pwszFileName, nWide ) == 0 )
+    {
+        free( pwszFileName );
+        return NULL;
     }
     return pwszFileName;
 }
 
 /************************************************************************/
 /*                           SAUtf8WFOpen                               */
-
 /************************************************************************/
 
-SAFile SAUtf8WFOpen(const char *pszFilename, const char *pszAccess)
+SAFile SAUtf8WFOpen( const char *pszFilename, const char *pszAccess )
 {
     SAFile file = NULL;
     const wchar_t *pwszFileName, *pwszAccess;
-
-    pwszFileName = Utf8ToWideChar(pszFilename);
-    pwszAccess = Utf8ToWideChar(pszAccess);
-    if (pwszFileName != NULL && pwszFileName != NULL) {
-	file = (SAFile) _wfopen(pwszFileName, pwszAccess);
+    pwszFileName = Utf8ToWideChar( pszFilename );
+    pwszAccess = Utf8ToWideChar( pszAccess );
+    if( pwszFileName != NULL && pwszFileName != NULL)
+    {
+        file = (SAFile) _wfopen( pwszFileName, pwszAccess );
     }
-    free((wchar_t *) pwszFileName);
-    free((wchar_t *) pwszAccess);
+    free ((wchar_t*) pwszFileName);
+    free ((wchar_t*) pwszAccess);
     return file;
 }
 
 /************************************************************************/
 /*                             SAUtf8WRemove()                          */
-
 /************************************************************************/
 
-int SAUtf8WRemove(const char *pszFilename)
+int SAUtf8WRemove( const char *pszFilename )
 {
-    const wchar_t *pwszFileName = Utf8ToWideChar(pszFilename);
-    int rc = -1;
-
-    if (pwszFileName != NULL) {
-	rc = _wremove(pwszFileName);
+    const wchar_t *pwszFileName = Utf8ToWideChar( pszFilename );
+    int rc = -1; 
+    if( pwszFileName != NULL )
+    {
+        rc = _wremove( pwszFileName );
     }
-    free((wchar_t *) pwszFileName);
+    free ((wchar_t*) pwszFileName);
     return rc;
 }
 
@@ -260,26 +260,25 @@ int SAUtf8WRemove(const char *pszFilename)
 
 /************************************************************************/
 /*                          SASetupUtf8Hooks()                          */
-
 /************************************************************************/
 
-void SASetupUtf8Hooks(SAHooks * psHooks)
+void SASetupUtf8Hooks( SAHooks *psHooks )
 {
-#ifdef SHPAPI_WINDOWS
-    psHooks->FOpen = SAUtf8WFOpen;
-    psHooks->Remove = SAUtf8WRemove;
+#ifdef SHPAPI_WINDOWS    
+    psHooks->FOpen   = SAUtf8WFOpen;
+    psHooks->Remove  = SAUtf8WRemove;
 #else
 #   error "no implementations of UTF-8 hooks available for this platform"
 #endif
-    psHooks->FRead = SADFRead;
-    psHooks->FWrite = SADFWrite;
-    psHooks->FSeek = SADFSeek;
-    psHooks->FTell = SADFTell;
-    psHooks->FFlush = SADFFlush;
-    psHooks->FClose = SADFClose;
-
-    psHooks->Error = SADError;
-    psHooks->Atof = atof;
+    psHooks->FRead   = SADFRead;
+    psHooks->FWrite  = SADFWrite;
+    psHooks->FSeek   = SADFSeek;
+    psHooks->FTell   = SADFTell;
+    psHooks->FFlush  = SADFFlush;
+    psHooks->FClose  = SADFClose;
+
+    psHooks->Error   = SADError;
+    psHooks->Atof    = atof;
 }
 
 #endif

+ 350 - 344
lib/external/shapelib/shapefil.h

@@ -108,56 +108,54 @@
 #endif
 
 #ifdef __cplusplus
-extern "C"
-{
+extern "C" {
 #endif
 
 /************************************************************************/
-    /*                        Configuration options.                        */
-
+/*                        Configuration options.                        */
 /************************************************************************/
 
-    /* -------------------------------------------------------------------- */
-    /*      Should the DBFReadStringAttribute() strip leading and           */
-    /*      trailing white space?                                           */
-    /* -------------------------------------------------------------------- */
+/* -------------------------------------------------------------------- */
+/*      Should the DBFReadStringAttribute() strip leading and           */
+/*      trailing white space?                                           */
+/* -------------------------------------------------------------------- */
 #define TRIM_DBF_WHITESPACE
 
-    /* -------------------------------------------------------------------- */
-    /*      Should we write measure values to the Multipatch object?        */
-    /*      Reportedly ArcView crashes if we do write it, so for now it     */
-    /*      is disabled.                                                    */
-    /* -------------------------------------------------------------------- */
+/* -------------------------------------------------------------------- */
+/*      Should we write measure values to the Multipatch object?        */
+/*      Reportedly ArcView crashes if we do write it, so for now it     */
+/*      is disabled.                                                    */
+/* -------------------------------------------------------------------- */
 #define DISABLE_MULTIPATCH_MEASURE
-
-    /* -------------------------------------------------------------------- */
-    /*      SHPAPI_CALL                                                     */
-    /*                                                                      */
-    /*      The following two macros are present to allow forcing           */
-    /*      various calling conventions on the Shapelib API.                */
-    /*                                                                      */
-    /*      To force __stdcall conventions (needed to call Shapelib         */
-    /*      from Visual Basic and/or Dephi I believe) the makefile could    */
-    /*      be modified to define:                                          */
-    /*                                                                      */
-    /*        /DSHPAPI_CALL=__stdcall                                       */
-    /*                                                                      */
-    /*      If it is desired to force export of the Shapelib API without    */
-    /*      using the shapelib.def file, use the following definition.      */
-    /*                                                                      */
-    /*        /DSHAPELIB_DLLEXPORT                                          */
-    /*                                                                      */
-    /*      To get both at once it will be necessary to hack this           */
-    /*      include file to define:                                         */
-    /*                                                                      */
-    /*        #define SHPAPI_CALL __declspec(dllexport) __stdcall           */
-    /*        #define SHPAPI_CALL1 __declspec(dllexport) * __stdcall        */
-    /*                                                                      */
-    /*      The complexity of the situtation 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.                  */
-    /* -------------------------------------------------------------------- */
+    
+/* -------------------------------------------------------------------- */
+/*      SHPAPI_CALL                                                     */
+/*                                                                      */
+/*      The following two macros are present to allow forcing           */
+/*      various calling conventions on the Shapelib API.                */
+/*                                                                      */
+/*      To force __stdcall conventions (needed to call Shapelib         */
+/*      from Visual Basic and/or Dephi I believe) the makefile could    */
+/*      be modified to define:                                          */
+/*                                                                      */
+/*        /DSHPAPI_CALL=__stdcall                                       */
+/*                                                                      */
+/*      If it is desired to force export of the Shapelib API without    */
+/*      using the shapelib.def file, use the following definition.      */
+/*                                                                      */
+/*        /DSHAPELIB_DLLEXPORT                                          */
+/*                                                                      */
+/*      To get both at once it will be necessary to hack this           */
+/*      include file to define:                                         */
+/*                                                                      */
+/*        #define SHPAPI_CALL __declspec(dllexport) __stdcall           */
+/*        #define SHPAPI_CALL1 __declspec(dllexport) * __stdcall        */
+/*                                                                      */
+/*      The complexity of the situtation 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.                  */
+/* -------------------------------------------------------------------- */
 
 #ifdef SHAPELIB_DLLEXPORT
 #  define SHPAPI_CALL __declspec(dllexport)
@@ -176,78 +174,74 @@ 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.        */
-    /* -------------------------------------------------------------------- */
+    
+/* -------------------------------------------------------------------- */
+/*      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 ); }
 #else
 #  define SHP_CVSID(string)
 #endif
-
-    /* -------------------------------------------------------------------- */
-    /*      IO/Error hook functions.                                        */
-    /* -------------------------------------------------------------------- */
-    typedef int *SAFile;
+    
+/* -------------------------------------------------------------------- */
+/*      IO/Error hook functions.                                        */
+/* -------------------------------------------------------------------- */
+typedef int *SAFile;
 
 #ifndef SAOffset
-    typedef unsigned long SAOffset;
+typedef unsigned long SAOffset;
 #endif
 
-    typedef struct
-    {
-	SAFile(*FOpen) (const char *filename, const char *path);
-	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);
+typedef struct {
+    SAFile     (*FOpen) ( const char *filename, const char *path);
+    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 );
 
-	void (*Error) (const char *message);
-    } SAHooks;
+    void       (*Error) ( const char *message );
+} SAHooks;
 
-    void SHPAPI_CALL SASetupDefaultHooks(SAHooks * psHooks);
+void SHPAPI_CALL SASetupDefaultHooks( SAHooks *psHooks );
 
 /************************************************************************/
-    /*                             SHP Support.                             */
-
+/*                             SHP Support.                             */
 /************************************************************************/
-    typedef struct
-    {
-	SAHooks sHooks;
-
-	SAFile fpSHP;
-	SAFile fpSHX;
+typedef	struct
+{
+    SAHooks sHooks;
 
-	int nShapeType;		/* SHPT_* */
+    SAFile      fpSHP;
+    SAFile 	fpSHX;
 
-	int nFileSize;		/* SHP file */
+    int		nShapeType;				/* SHPT_* */
+    
+    int		nFileSize;				/* SHP file */
 
-	int nRecords;
-	int nMaxRecords;
-	int *panRecOffset;
-	int *panRecSize;
+    int         nRecords;
+    int		nMaxRecords;
+    int		*panRecOffset;
+    int		*panRecSize;
 
-	double adBoundsMin[4];
-	double adBoundsMax[4];
+    double	adBoundsMin[4];
+    double	adBoundsMax[4];
 
-	int bUpdated;
+    int		bUpdated;
 
-	unsigned char *pabyRec;
-	int nBufSize;
-    } SHPInfo;
+    unsigned char *pabyRec;
+    int         nBufSize;
+} SHPInfo;
 
-    typedef SHPInfo *SHPHandle;
+typedef SHPInfo * SHPHandle;
 
-    /* -------------------------------------------------------------------- */
-    /*      Shape types (nSHPType)                                          */
-    /* -------------------------------------------------------------------- */
+/* -------------------------------------------------------------------- */
+/*      Shape types (nSHPType)                                          */
+/* -------------------------------------------------------------------- */
 #define SHPT_NULL	0
 #define SHPT_POINT	1
 #define SHPT_ARC	3
@@ -264,10 +258,10 @@ static char *cvsid_aw() { return( cvsid_aw() ? ((char *) NULL) : cpl_cvsid ); }
 #define SHPT_MULTIPATCH 31
 
 
-    /* -------------------------------------------------------------------- */
-    /*      Part types - everything but SHPT_MULTIPATCH just uses           */
-    /*      SHPP_RING.                                                      */
-    /* -------------------------------------------------------------------- */
+/* -------------------------------------------------------------------- */
+/*      Part types - everything but SHPT_MULTIPATCH just uses           */
+/*      SHPP_RING.                                                      */
+/* -------------------------------------------------------------------- */
 
 #define SHPP_TRISTRIP	0
 #define SHPP_TRIFAN	1
@@ -276,277 +270,289 @@ static char *cvsid_aw() { return( cvsid_aw() ? ((char *) NULL) : cpl_cvsid ); }
 #define SHPP_FIRSTRING	4
 #define SHPP_RING	5
 
-    /* -------------------------------------------------------------------- */
-    /*      SHPObject - represents on shape (without attributes) read       */
-    /*      from the .shp file.                                             */
-    /* -------------------------------------------------------------------- */
-    typedef struct
-    {
-	int nSHPType;
-
-	int nShapeId;		/* -1 is unknown/unassigned */
-
-	int nParts;
-	int *panPartStart;
-	int *panPartType;
-
-	int nVertices;
-	double *padfX;
-	double *padfY;
-	double *padfZ;
-	double *padfM;
-
-	double dfXMin;
-	double dfYMin;
-	double dfZMin;
-	double dfMMin;
-
-	double dfXMax;
-	double dfYMax;
-	double dfZMax;
-	double dfMMax;
-
-	int bMeasureIsUsed;
-    } SHPObject;
-
-    /* -------------------------------------------------------------------- */
-    /*      SHP API Prototypes                                              */
-    /* -------------------------------------------------------------------- */
-
-    /* If pszAccess is read-only, the fpSHX field of the returned structure */
-    /* will be NULL as it is not necessary to keep the SHX file open */
-    SHPHandle SHPAPI_CALL
-	SHPOpen(const char *pszShapeFile, const char *pszAccess);
-    SHPHandle SHPAPI_CALL
-	SHPOpenLL(const char *pszShapeFile, const char *pszAccess,
-		  SAHooks * psHooks);
-    SHPHandle SHPAPI_CALL SHPCreate(const char *pszShapeFile, int nShapeType);
-    SHPHandle SHPAPI_CALL
-	SHPCreateLL(const char *pszShapeFile, int nShapeType,
-		    SAHooks * psHooks);
-    void SHPAPI_CALL
-	SHPGetInfo(SHPHandle hSHP, int *pnEntities, int *pnShapeType,
-		   double *padfMinBound, double *padfMaxBound);
-
-    SHPObject SHPAPI_CALL1(*)
-      SHPReadObject(SHPHandle hSHP, int iShape);
-    int SHPAPI_CALL
-	SHPWriteObject(SHPHandle hSHP, int iShape, SHPObject * psObject);
-
-    void SHPAPI_CALL SHPDestroyObject(SHPObject * psObject);
-    void SHPAPI_CALL SHPComputeExtents(SHPObject * psObject);
-    SHPObject SHPAPI_CALL1(*)
-     
-	SHPCreateObject(int nSHPType, int nShapeId, int nParts,
-			const int *panPartStart, const int *panPartType,
-			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 *padfZ);
-
-    int SHPAPI_CALL SHPRewindObject(SHPHandle hSHP, SHPObject * psObject);
-
-    void SHPAPI_CALL SHPClose(SHPHandle hSHP);
-    void SHPAPI_CALL SHPWriteHeader(SHPHandle hSHP);
-
-    const char SHPAPI_CALL1(*)
-      SHPTypeName(int nSHPType);
-    const char SHPAPI_CALL1(*)
-      SHPPartTypeName(int nPartType);
-
-    /* -------------------------------------------------------------------- */
-    /*      Shape quadtree indexing API.                                    */
-    /* -------------------------------------------------------------------- */
-
-    /* this can be two or four for binary or quad tree */
+/* -------------------------------------------------------------------- */
+/*      SHPObject - represents on shape (without attributes) read       */
+/*      from the .shp file.                                             */
+/* -------------------------------------------------------------------- */
+typedef struct
+{
+    int		nSHPType;
+
+    int		nShapeId; /* -1 is unknown/unassigned */
+
+    int		nParts;
+    int		*panPartStart;
+    int		*panPartType;
+    
+    int		nVertices;
+    double	*padfX;
+    double	*padfY;
+    double	*padfZ;
+    double	*padfM;
+
+    double	dfXMin;
+    double	dfYMin;
+    double	dfZMin;
+    double	dfMMin;
+
+    double	dfXMax;
+    double	dfYMax;
+    double	dfZMax;
+    double	dfMMax;
+
+    int		bMeasureIsUsed;
+} SHPObject;
+
+/* -------------------------------------------------------------------- */
+/*      SHP API Prototypes                                              */
+/* -------------------------------------------------------------------- */
+
+/* If pszAccess is read-only, the fpSHX field of the returned structure */
+/* will be NULL as it is not necessary to keep the SHX file open */
+SHPHandle SHPAPI_CALL
+      SHPOpen( const char * pszShapeFile, const char * pszAccess );
+SHPHandle SHPAPI_CALL
+      SHPOpenLL( const char *pszShapeFile, const char *pszAccess, 
+                 SAHooks *psHooks );
+SHPHandle SHPAPI_CALL
+      SHPCreate( const char * pszShapeFile, int nShapeType );
+SHPHandle SHPAPI_CALL
+      SHPCreateLL( const char * pszShapeFile, int nShapeType,
+                   SAHooks *psHooks );
+void SHPAPI_CALL
+      SHPGetInfo( SHPHandle hSHP, int * pnEntities, int * pnShapeType,
+                  double * padfMinBound, double * padfMaxBound );
+
+SHPObject SHPAPI_CALL1(*)
+      SHPReadObject( SHPHandle hSHP, int iShape );
+int SHPAPI_CALL
+      SHPWriteObject( SHPHandle hSHP, int iShape, SHPObject * psObject );
+
+void SHPAPI_CALL
+      SHPDestroyObject( SHPObject * psObject );
+void SHPAPI_CALL
+      SHPComputeExtents( SHPObject * psObject );
+SHPObject SHPAPI_CALL1(*)
+      SHPCreateObject( int nSHPType, int nShapeId, int nParts, 
+                       const int * panPartStart, const int * panPartType,
+                       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 * padfZ );
+
+int SHPAPI_CALL
+      SHPRewindObject( SHPHandle hSHP, SHPObject * psObject );
+
+void SHPAPI_CALL SHPClose( SHPHandle hSHP );
+void SHPAPI_CALL SHPWriteHeader( SHPHandle hSHP );
+
+const char SHPAPI_CALL1(*)
+      SHPTypeName( int nSHPType );
+const char SHPAPI_CALL1(*)
+      SHPPartTypeName( int nPartType );
+
+/* -------------------------------------------------------------------- */
+/*      Shape quadtree indexing API.                                    */
+/* -------------------------------------------------------------------- */
+
+/* this can be two or four for binary or quad tree */
 #define MAX_SUBNODE	4
 
-    /* upper limit of tree levels for automatic estimation */
+/* upper limit of tree levels for automatic estimation */
 #define MAX_DEFAULT_TREE_DEPTH 12
 
-    typedef struct shape_tree_node
-    {
-	/* region covered by this node */
-	double adfBoundsMin[4];
-	double adfBoundsMax[4];
-
-	/* list of shapes stored at this node.  The papsShapeObj pointers
-	   or the whole list can be NULL */
-	int nShapeCount;
-	int *panShapeIds;
-	SHPObject **papsShapeObj;
-
-	int nSubNodes;
-	struct shape_tree_node *apsSubNode[MAX_SUBNODE];
-
-    } SHPTreeNode;
-
-    typedef struct
-    {
-	SHPHandle hSHP;
-
-	int nMaxDepth;
-	int nDimension;
-	int nTotalCount;
-
-	SHPTreeNode *psRoot;
-    } SHPTree;
-
-    SHPTree SHPAPI_CALL1(*)
-     
-	SHPCreateTree(SHPHandle hSHP, int nDimension, int nMaxDepth,
-		      double *padfBoundsMin, double *padfBoundsMax);
-    void SHPAPI_CALL SHPDestroyTree(SHPTree * hTree);
-
-    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);
-
-    void SHPAPI_CALL SHPTreeTrimExtraNodes(SHPTree * hTree);
-
-    int SHPAPI_CALL1(*)
-     
-	SHPTreeFindLikelyShapes(SHPTree * hTree,
-				double *padfBoundsMin,
-				double *padfBoundsMax, int *);
-    int SHPAPI_CALL
-	SHPCheckBoundsOverlap(double *, double *, double *, double *, int);
-
-    int SHPAPI_CALL1(*)
-     
-	SHPSearchDiskTree(FILE * fp,
-			  double *padfBoundsMin, double *padfBoundsMax,
-			  int *pnShapeCount);
+typedef struct shape_tree_node
+{
+    /* region covered by this node */
+    double	adfBoundsMin[4];
+    double	adfBoundsMax[4];
+
+    /* list of shapes stored at this node.  The papsShapeObj pointers
+       or the whole list can be NULL */
+    int		nShapeCount;
+    int		*panShapeIds;
+    SHPObject   **papsShapeObj;
+
+    int		nSubNodes;
+    struct shape_tree_node *apsSubNode[MAX_SUBNODE];
+    
+} SHPTreeNode;
+
+typedef struct
+{
+    SHPHandle   hSHP;
+    
+    int		nMaxDepth;
+    int		nDimension;
+    int         nTotalCount;
+    
+    SHPTreeNode	*psRoot;
+} SHPTree;
+
+SHPTree SHPAPI_CALL1(*)
+      SHPCreateTree( SHPHandle hSHP, int nDimension, int nMaxDepth,
+                     double *padfBoundsMin, double *padfBoundsMax );
+void    SHPAPI_CALL
+      SHPDestroyTree( SHPTree * hTree );
+
+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 );
+
+void 	SHPAPI_CALL
+      SHPTreeTrimExtraNodes( SHPTree * hTree );
+
+int    SHPAPI_CALL1(*)
+      SHPTreeFindLikelyShapes( SHPTree * hTree,
+                               double * padfBoundsMin,
+                               double * padfBoundsMax,
+                               int * );
+int     SHPAPI_CALL
+      SHPCheckBoundsOverlap( double *, double *, double *, double *, int );
+
+int SHPAPI_CALL1(*) 
+SHPSearchDiskTree( FILE *fp, 
+                   double *padfBoundsMin, double *padfBoundsMax,
+                   int *pnShapeCount );
 
 /************************************************************************/
-    /*                             DBF Support.                             */
-
+/*                             DBF Support.                             */
 /************************************************************************/
-    typedef struct
-    {
-	SAHooks sHooks;
-
-	SAFile fp;
+typedef	struct
+{
+    SAHooks sHooks;
 
-	int nRecords;
+    SAFile	fp;
 
-	int nRecordLength;
-	int nHeaderLength;
-	int nFields;
-	int *panFieldOffset;
-	int *panFieldSize;
-	int *panFieldDecimals;
-	char *pachFieldType;
+    int         nRecords;
 
-	char *pszHeader;
+    int		nRecordLength;
+    int		nHeaderLength;
+    int		nFields;
+    int		*panFieldOffset;
+    int		*panFieldSize;
+    int		*panFieldDecimals;
+    char	*pachFieldType;
 
-	int nCurrentRecord;
-	int bCurrentRecordModified;
-	char *pszCurrentRecord;
+    char	*pszHeader;
 
-	int nWorkFieldLength;
-	char *pszWorkField;
+    int		nCurrentRecord;
+    int		bCurrentRecordModified;
+    char	*pszCurrentRecord;
 
-	int bNoHeader;
-	int bUpdated;
+    int         nWorkFieldLength;
+    char        *pszWorkField;
+    
+    int		bNoHeader;
+    int		bUpdated;
 
-	double dfDoubleField;
-    } DBFInfo;
+    double      dfDoubleField;
+} DBFInfo;
 
-    typedef DBFInfo *DBFHandle;
+typedef DBFInfo * DBFHandle;
 
-    typedef enum
-    {
-	FTString,
-	FTInteger,
-	FTDouble,
-	FTLogical,
-	FTInvalid
-    } DBFFieldType;
+typedef enum {
+  FTString,
+  FTInteger,
+  FTDouble,
+  FTLogical,
+  FTInvalid
+} DBFFieldType;
 
 #define XBASE_FLDHDR_SZ       32
 
 
-    DBFHandle SHPAPI_CALL
-	DBFOpen(const char *pszDBFFile, const char *pszAccess);
-    DBFHandle SHPAPI_CALL
-	DBFOpenLL(const char *pszDBFFile, const char *pszAccess,
-		  SAHooks * psHooks);
-    DBFHandle SHPAPI_CALL DBFCreate(const char *pszDBFFile);
-    DBFHandle SHPAPI_CALL
-	DBFCreateLL(const char *pszDBFFile, SAHooks * psHooks);
-
-    int SHPAPI_CALL DBFGetFieldCount(DBFHandle psDBF);
-    int SHPAPI_CALL DBFGetRecordCount(DBFHandle psDBF);
-    int SHPAPI_CALL
-	DBFAddField(DBFHandle hDBF, const char *pszFieldName,
-		    DBFFieldType eType, int nWidth, int nDecimals);
-
-    int SHPAPI_CALL
-	DBFAddNativeFieldType(DBFHandle hDBF, const char *pszFieldName,
-			      char chType, int nWidth, int nDecimals);
-
-    DBFFieldType SHPAPI_CALL
-	DBFGetFieldInfo(DBFHandle psDBF, int iField,
-			char *pszFieldName, int *pnWidth, int *pnDecimals);
-
-    int SHPAPI_CALL
-	DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName);
-
-    int SHPAPI_CALL
-	DBFReadIntegerAttribute(DBFHandle hDBF, int iShape, int iField);
-    double SHPAPI_CALL
-	DBFReadDoubleAttribute(DBFHandle hDBF, int iShape, int iField);
-    const char SHPAPI_CALL1(*)
-      DBFReadStringAttribute(DBFHandle hDBF, int iShape, int iField);
-    const char SHPAPI_CALL1(*)
-      DBFReadLogicalAttribute(DBFHandle hDBF, int iShape, int iField);
-    int SHPAPI_CALL
-	DBFIsAttributeNULL(DBFHandle hDBF, int iShape, int iField);
-
-    int SHPAPI_CALL
-	DBFWriteIntegerAttribute(DBFHandle hDBF, int iShape, int iField,
-				 int nFieldValue);
-    int SHPAPI_CALL
-	DBFWriteDoubleAttribute(DBFHandle hDBF, int iShape, int iField,
-				double dFieldValue);
-    int SHPAPI_CALL
-	DBFWriteStringAttribute(DBFHandle hDBF, int iShape, int iField,
-				const char *pszFieldValue);
-    int SHPAPI_CALL
-	DBFWriteNULLAttribute(DBFHandle hDBF, int iShape, int iField);
-
-    int SHPAPI_CALL
-	DBFWriteLogicalAttribute(DBFHandle hDBF, int iShape, int iField,
-				 const char lFieldValue);
-    int SHPAPI_CALL
-	DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField,
-				  void *pValue);
-    const char SHPAPI_CALL1(*)
-      DBFReadTuple(DBFHandle psDBF, int hEntity);
-    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 bIsDeleted);
-
-    DBFHandle SHPAPI_CALL
-	DBFCloneEmpty(DBFHandle psDBF, const char *pszFilename);
-
-    void SHPAPI_CALL DBFClose(DBFHandle hDBF);
-    void SHPAPI_CALL DBFUpdateHeader(DBFHandle hDBF);
-    char SHPAPI_CALL DBFGetNativeFieldType(DBFHandle hDBF, int iField);
+DBFHandle SHPAPI_CALL
+      DBFOpen( const char * pszDBFFile, const char * pszAccess );
+DBFHandle SHPAPI_CALL
+      DBFOpenLL( const char * pszDBFFile, const char * pszAccess,
+                 SAHooks *psHooks );
+DBFHandle SHPAPI_CALL
+      DBFCreate( const char * pszDBFFile );
+DBFHandle SHPAPI_CALL
+      DBFCreateLL( const char * pszDBFFile, SAHooks *psHooks );
+
+int	SHPAPI_CALL
+      DBFGetFieldCount( DBFHandle psDBF );
+int	SHPAPI_CALL
+      DBFGetRecordCount( DBFHandle psDBF );
+int	SHPAPI_CALL
+      DBFAddField( DBFHandle hDBF, const char * pszFieldName,
+                   DBFFieldType eType, int nWidth, int nDecimals );
+
+int	SHPAPI_CALL
+      DBFAddNativeFieldType( DBFHandle hDBF, const char * pszFieldName,
+                             char chType, int nWidth, int nDecimals );
+
+DBFFieldType SHPAPI_CALL
+      DBFGetFieldInfo( DBFHandle psDBF, int iField, 
+                       char * pszFieldName, int * pnWidth, int * pnDecimals );
+
+int SHPAPI_CALL
+      DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName);
+
+int 	SHPAPI_CALL
+      DBFReadIntegerAttribute( DBFHandle hDBF, int iShape, int iField );
+double 	SHPAPI_CALL
+      DBFReadDoubleAttribute( DBFHandle hDBF, int iShape, int iField );
+const char SHPAPI_CALL1(*)
+      DBFReadStringAttribute( DBFHandle hDBF, int iShape, int iField );
+const char SHPAPI_CALL1(*)
+      DBFReadLogicalAttribute( DBFHandle hDBF, int iShape, int iField );
+int     SHPAPI_CALL
+      DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField );
+
+int SHPAPI_CALL
+      DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField, 
+                                int nFieldValue );
+int SHPAPI_CALL
+      DBFWriteDoubleAttribute( DBFHandle hDBF, int iShape, int iField,
+                               double dFieldValue );
+int SHPAPI_CALL
+      DBFWriteStringAttribute( DBFHandle hDBF, int iShape, int iField,
+                               const char * pszFieldValue );
+int SHPAPI_CALL
+     DBFWriteNULLAttribute( DBFHandle hDBF, int iShape, int iField );
+
+int SHPAPI_CALL
+     DBFWriteLogicalAttribute( DBFHandle hDBF, int iShape, int iField,
+			       const char lFieldValue);
+int SHPAPI_CALL
+     DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField,
+                               void * pValue );
+const char SHPAPI_CALL1(*)
+      DBFReadTuple(DBFHandle psDBF, int hEntity );
+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 bIsDeleted );
+
+DBFHandle SHPAPI_CALL
+      DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename );
+ 
+void	SHPAPI_CALL
+      DBFClose( DBFHandle hDBF );
+void    SHPAPI_CALL
+      DBFUpdateHeader( DBFHandle hDBF );
+char    SHPAPI_CALL
+      DBFGetNativeFieldType( DBFHandle hDBF, int iField );
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif				/* ndef _SHAPEFILE_H_INCLUDED */
+#endif /* ndef _SHAPEFILE_H_INCLUDED */

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1624 - 1625
lib/external/shapelib/shpopen.c