Navit SVN

/work/compile/navit/src/navit/support/shapefile/shapefil.h

00001 #ifndef SHAPEFILE_H_INCLUDED
00002 #define SHAPEFILE_H_INCLUDED
00003 
00004 /******************************************************************************
00005  * $Id: shapefil.h 15715 2008-11-12 15:15:21Z warmerdam $
00006  *
00007  * Project:  Shapelib
00008  * Purpose:  Primary include file for Shapelib.
00009  * Author:   Frank Warmerdam, warmerdam@pobox.com
00010  *
00011  ******************************************************************************
00012  * Copyright (c) 1999, Frank Warmerdam
00013  *
00014  * This software is available under the following "MIT Style" license,
00015  * or at the option of the licensee under the LGPL (see LICENSE.LGPL).  This
00016  * option is discussed in more detail in shapelib.html.
00017  *
00018  * --
00019  * 
00020  * Permission is hereby granted, free of charge, to any person obtaining a
00021  * copy of this software and associated documentation files (the "Software"),
00022  * to deal in the Software without restriction, including without limitation
00023  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00024  * and/or sell copies of the Software, and to permit persons to whom the
00025  * Software is furnished to do so, subject to the following conditions:
00026  *
00027  * The above copyright notice and this permission notice shall be included
00028  * in all copies or substantial portions of the Software.
00029  *
00030  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00031  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00032  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00033  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00034  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00035  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00036  * DEALINGS IN THE SOFTWARE.
00037  ******************************************************************************
00038  *
00039  * $Log: shapefil.h,v $
00040  * Revision 1.46  2008/11/12 14:28:15  fwarmerdam
00041  * DBFCreateField() now works on files with records
00042  *
00043  * Revision 1.45  2008/11/11 17:47:10  fwarmerdam
00044  * added DBFDeleteField() function
00045  *
00046  * Revision 1.44  2008/01/16 20:05:19  bram
00047  * Add file hooks that accept UTF-8 encoded filenames on some platforms.  Use SASetupUtf8Hooks
00048  *  tosetup the hooks and check SHPAPI_UTF8_HOOKS for its availability.  Currently, this
00049  *  is only available on the Windows platform that decodes the UTF-8 filenames to wide
00050  *  character strings and feeds them to _wfopen and _wremove.
00051  *
00052  * Revision 1.43  2008/01/10 16:35:30  fwarmerdam
00053  * avoid _ prefix on #defined symbols (bug 1840)
00054  *
00055  * Revision 1.42  2007/12/18 18:28:14  bram
00056  * - create hook for client specific atof (bugzilla ticket 1615)
00057  * - check for NULL handle before closing cpCPG file, and close after reading.
00058  *
00059  * Revision 1.41  2007/12/15 20:25:32  bram
00060  * dbfopen.c now reads the Code Page information from the DBF file, and exports
00061  * this information as a string through the DBFGetCodePage function.  This is 
00062  * either the number from the LDID header field ("LDID/<number>") or as the 
00063  * content of an accompanying .CPG file.  When creating a DBF file, the code can
00064  * be set using DBFCreateEx.
00065  *
00066  * Revision 1.40  2007/12/06 07:00:25  fwarmerdam
00067  * dbfopen now using SAHooks for fileio
00068  *
00069  * Revision 1.39  2007/12/04 20:37:56  fwarmerdam
00070  * preliminary implementation of hooks api for io and errors
00071  *
00072  * Revision 1.38  2007/11/21 22:39:56  fwarmerdam
00073  * close shx file in readonly mode (GDAL #1956)
00074  *
00075  * Revision 1.37  2007/10/27 03:31:14  fwarmerdam
00076  * limit default depth of tree to 12 levels (gdal ticket #1594)
00077  *
00078  * Revision 1.36  2007/09/10 23:33:15  fwarmerdam
00079  * Upstreamed support for visibility flag in SHPAPI_CALL for the needs
00080  * of GDAL (gdal ticket #1810).
00081  *
00082  * Revision 1.35  2007/09/03 19:48:10  fwarmerdam
00083  * move DBFReadAttribute() static dDoubleField into dbfinfo
00084  *
00085  * Revision 1.34  2006/06/17 15:33:32  fwarmerdam
00086  * added pszWorkField - bug 1202 (rso)
00087  *
00088  * Revision 1.33  2006/02/15 01:14:30  fwarmerdam
00089  * added DBFAddNativeFieldType
00090  *
00091  * Revision 1.32  2006/01/26 15:07:32  fwarmerdam
00092  * add bMeasureIsUsed flag from Craig Bruce: Bug 1249
00093  *
00094  * Revision 1.31  2006/01/05 01:27:27  fwarmerdam
00095  * added dbf deletion mark/fetch
00096  *
00097  * Revision 1.30  2005/01/03 22:30:13  fwarmerdam
00098  * added support for saved quadtrees
00099  *
00100  * Revision 1.29  2004/09/26 20:09:35  fwarmerdam
00101  * avoid rcsid warnings
00102  *
00103  * Revision 1.28  2003/12/29 06:02:18  fwarmerdam
00104  * added cpl_error.h option
00105  *
00106  * Revision 1.27  2003/04/21 18:30:37  warmerda
00107  * added header write/update public methods
00108  *
00109  * Revision 1.26  2002/09/29 00:00:08  warmerda
00110  * added FTLogical and logical attribute read/write calls
00111  *
00112  * Revision 1.25  2002/05/07 13:46:30  warmerda
00113  * added DBFWriteAttributeDirectly().
00114  *
00115  * Revision 1.24  2002/04/10 16:59:54  warmerda
00116  * added SHPRewindObject
00117  *
00118  * Revision 1.23  2002/01/15 14:36:07  warmerda
00119  * updated email address
00120  *
00121  * Revision 1.22  2002/01/15 14:32:00  warmerda
00122  * try to improve SHPAPI_CALL docs
00123  */
00124 
00125 #include <stdio.h>
00126 
00127 #ifdef USE_DBMALLOC
00128 #include <dbmalloc.h>
00129 #endif
00130 
00131 #ifdef USE_CPL
00132 #include "cpl_error.h"
00133 #include "cpl_vsi.h"
00134 #endif
00135 
00136 #ifdef __cplusplus
00137 extern "C" {
00138 #endif
00139 
00140 /************************************************************************/
00141 /*                        Configuration options.                        */
00142 /************************************************************************/
00143 
00144 /* -------------------------------------------------------------------- */
00145 /*      Should the DBFReadStringAttribute() strip leading and           */
00146 /*      trailing white space?                                           */
00147 /* -------------------------------------------------------------------- */
00148 #define TRIM_DBF_WHITESPACE
00149 
00150 /* -------------------------------------------------------------------- */
00151 /*      Should we write measure values to the Multipatch object?        */
00152 /*      Reportedly ArcView crashes if we do write it, so for now it     */
00153 /*      is disabled.                                                    */
00154 /* -------------------------------------------------------------------- */
00155 #define DISABLE_MULTIPATCH_MEASURE
00156     
00157 /* -------------------------------------------------------------------- */
00158 /*      SHPAPI_CALL                                                     */
00159 /*                                                                      */
00160 /*      The following two macros are present to allow forcing           */
00161 /*      various calling conventions on the Shapelib API.                */
00162 /*                                                                      */
00163 /*      To force __stdcall conventions (needed to call Shapelib         */
00164 /*      from Visual Basic and/or Dephi I believe) the makefile could    */
00165 /*      be modified to define:                                          */
00166 /*                                                                      */
00167 /*        /DSHPAPI_CALL=__stdcall                                       */
00168 /*                                                                      */
00169 /*      If it is desired to force export of the Shapelib API without    */
00170 /*      using the shapelib.def file, use the following definition.      */
00171 /*                                                                      */
00172 /*        /DSHAPELIB_DLLEXPORT                                          */
00173 /*                                                                      */
00174 /*      To get both at once it will be necessary to hack this           */
00175 /*      include file to define:                                         */
00176 /*                                                                      */
00177 /*        #define SHPAPI_CALL __declspec(dllexport) __stdcall           */
00178 /*        #define SHPAPI_CALL1 __declspec(dllexport) * __stdcall        */
00179 /*                                                                      */
00180 /*      The complexity of the situtation is partly caused by the        */
00181 /*      peculiar requirement of Visual C++ that __stdcall appear        */
00182 /*      after any "*"'s in the return value of a function while the     */
00183 /*      __declspec(dllexport) must appear before them.                  */
00184 /* -------------------------------------------------------------------- */
00185 
00186 #ifdef SHAPELIB_DLLEXPORT
00187 #  define SHPAPI_CALL __declspec(dllexport)
00188 #  define SHPAPI_CALL1(x)  __declspec(dllexport) x
00189 #endif
00190 
00191 #ifndef SHPAPI_CALL
00192 #  if defined(USE_GCC_VISIBILITY_FLAG)
00193 #    define SHPAPI_CALL     __attribute__ ((visibility("default")))
00194 #    define SHPAPI_CALL1(x) __attribute__ ((visibility("default")))     x
00195 #  else
00196 #    define SHPAPI_CALL
00197 #  endif
00198 #endif
00199 
00200 #ifndef SHPAPI_CALL1
00201 #  define SHPAPI_CALL1(x)      x SHPAPI_CALL
00202 #endif
00203     
00204 /* -------------------------------------------------------------------- */
00205 /*      Macros for controlling CVSID and ensuring they don't appear     */
00206 /*      as unreferenced variables resulting in lots of warnings.        */
00207 /* -------------------------------------------------------------------- */
00208 #ifndef DISABLE_CVSID
00209 #  define SHP_CVSID(string)     static char cpl_cvsid[] = string; \
00210 static char *cvsid_aw() { return( cvsid_aw() ? ((char *) NULL) : cpl_cvsid ); }
00211 #else
00212 #  define SHP_CVSID(string)
00213 #endif
00214 
00215 /* -------------------------------------------------------------------- */
00216 /*      On some platforms, additional file IO hooks are defined that    */
00217 /*      UTF-8 encoded filenames Unicode filenames                       */
00218 /* -------------------------------------------------------------------- */
00219 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
00220 #       define SHPAPI_WINDOWS
00221 #       define SHPAPI_UTF8_HOOKS
00222 #endif
00223 
00224 /* -------------------------------------------------------------------- */
00225 /*      IO/Error hook functions.                                        */
00226 /* -------------------------------------------------------------------- */
00227 typedef int *SAFile;
00228 
00229 #ifndef SAOffset
00230 typedef unsigned long SAOffset;
00231 #endif
00232 
00233 typedef struct {
00234     SAFile     (*FOpen) ( const char *filename, const char *access);
00235     SAOffset   (*FRead) ( void *p, SAOffset size, SAOffset nmemb, SAFile file);
00236     SAOffset   (*FWrite)( void *p, SAOffset size, SAOffset nmemb, SAFile file);
00237     SAOffset   (*FSeek) ( SAFile file, SAOffset offset, int whence );
00238     SAOffset   (*FTell) ( SAFile file );
00239     int        (*FFlush)( SAFile file );
00240     int        (*FClose)( SAFile file );
00241     int        (*Remove) ( const char *filename );
00242 
00243     void       (*Error) ( const char *message );
00244     double     (*Atof)  ( const char *str );
00245 } SAHooks;
00246 
00247 void SHPAPI_CALL SASetupDefaultHooks( SAHooks *psHooks );
00248 #ifdef SHPAPI_UTF8_HOOKS
00249 void SHPAPI_CALL SASetupUtf8Hooks( SAHooks *psHooks );
00250 #endif
00251 
00252 /************************************************************************/
00253 /*                             SHP Support.                             */
00254 /************************************************************************/
00255 typedef struct
00256 {
00257     SAHooks sHooks;
00258 
00259     SAFile      fpSHP;
00260     SAFile      fpSHX;
00261 
00262     int         nShapeType;                             /* SHPT_* */
00263     
00264     int         nFileSize;                              /* SHP file */
00265 
00266     int         nRecords;
00267     int         nMaxRecords;
00268     int         *panRecOffset;
00269     int         *panRecSize;
00270 
00271     double      adBoundsMin[4];
00272     double      adBoundsMax[4];
00273 
00274     int         bUpdated;
00275 
00276     unsigned char *pabyRec;
00277     int         nBufSize;
00278 } SHPInfo;
00279 
00280 typedef SHPInfo * SHPHandle;
00281 
00282 /* -------------------------------------------------------------------- */
00283 /*      Shape types (nSHPType)                                          */
00284 /* -------------------------------------------------------------------- */
00285 #define SHPT_NULL       0
00286 #define SHPT_POINT      1
00287 #define SHPT_ARC        3
00288 #define SHPT_POLYGON    5
00289 #define SHPT_MULTIPOINT 8
00290 #define SHPT_POINTZ     11
00291 #define SHPT_ARCZ       13
00292 #define SHPT_POLYGONZ   15
00293 #define SHPT_MULTIPOINTZ 18
00294 #define SHPT_POINTM     21
00295 #define SHPT_ARCM       23
00296 #define SHPT_POLYGONM   25
00297 #define SHPT_MULTIPOINTM 28
00298 #define SHPT_MULTIPATCH 31
00299 
00300 
00301 /* -------------------------------------------------------------------- */
00302 /*      Part types - everything but SHPT_MULTIPATCH just uses           */
00303 /*      SHPP_RING.                                                      */
00304 /* -------------------------------------------------------------------- */
00305 
00306 #define SHPP_TRISTRIP   0
00307 #define SHPP_TRIFAN     1
00308 #define SHPP_OUTERRING  2
00309 #define SHPP_INNERRING  3
00310 #define SHPP_FIRSTRING  4
00311 #define SHPP_RING       5
00312 
00313 /* -------------------------------------------------------------------- */
00314 /*      SHPObject - represents on shape (without attributes) read       */
00315 /*      from the .shp file.                                             */
00316 /* -------------------------------------------------------------------- */
00317 typedef struct
00318 {
00319     int         nSHPType;
00320 
00321     int         nShapeId; /* -1 is unknown/unassigned */
00322 
00323     int         nParts;
00324     int         *panPartStart;
00325     int         *panPartType;
00326     
00327     int         nVertices;
00328     double      *padfX;
00329     double      *padfY;
00330     double      *padfZ;
00331     double      *padfM;
00332 
00333     double      dfXMin;
00334     double      dfYMin;
00335     double      dfZMin;
00336     double      dfMMin;
00337 
00338     double      dfXMax;
00339     double      dfYMax;
00340     double      dfZMax;
00341     double      dfMMax;
00342 
00343     int         bMeasureIsUsed;
00344 } SHPObject;
00345 
00346 /* -------------------------------------------------------------------- */
00347 /*      SHP API Prototypes                                              */
00348 /* -------------------------------------------------------------------- */
00349 
00350 /* If pszAccess is read-only, the fpSHX field of the returned structure */
00351 /* will be NULL as it is not necessary to keep the SHX file open */
00352 SHPHandle SHPAPI_CALL
00353       SHPOpen( const char * pszShapeFile, const char * pszAccess );
00354 SHPHandle SHPAPI_CALL
00355       SHPOpenLL( const char *pszShapeFile, const char *pszAccess, 
00356                  SAHooks *psHooks );
00357 SHPHandle SHPAPI_CALL
00358       SHPCreate( const char * pszShapeFile, int nShapeType );
00359 SHPHandle SHPAPI_CALL
00360       SHPCreateLL( const char * pszShapeFile, int nShapeType,
00361                    SAHooks *psHooks );
00362 void SHPAPI_CALL
00363       SHPGetInfo( SHPHandle hSHP, int * pnEntities, int * pnShapeType,
00364                   double * padfMinBound, double * padfMaxBound );
00365 
00366 SHPObject SHPAPI_CALL1(*)
00367       SHPReadObject( SHPHandle hSHP, int iShape );
00368 int SHPAPI_CALL
00369       SHPWriteObject( SHPHandle hSHP, int iShape, SHPObject * psObject );
00370 
00371 void SHPAPI_CALL
00372       SHPDestroyObject( SHPObject * psObject );
00373 void SHPAPI_CALL
00374       SHPComputeExtents( SHPObject * psObject );
00375 SHPObject SHPAPI_CALL1(*)
00376       SHPCreateObject( int nSHPType, int nShapeId, int nParts, 
00377                        const int * panPartStart, const int * panPartType,
00378                        int nVertices, 
00379                        const double * padfX, const double * padfY,
00380                        const double * padfZ, const double * padfM );
00381 SHPObject SHPAPI_CALL1(*)
00382       SHPCreateSimpleObject( int nSHPType, int nVertices,
00383                              const double * padfX, 
00384                              const double * padfY, 
00385                              const double * padfZ );
00386 
00387 int SHPAPI_CALL
00388       SHPRewindObject( SHPHandle hSHP, SHPObject * psObject );
00389 
00390 void SHPAPI_CALL SHPClose( SHPHandle hSHP );
00391 void SHPAPI_CALL SHPWriteHeader( SHPHandle hSHP );
00392 
00393 const char SHPAPI_CALL1(*)
00394       SHPTypeName( int nSHPType );
00395 const char SHPAPI_CALL1(*)
00396       SHPPartTypeName( int nPartType );
00397 
00398 /* -------------------------------------------------------------------- */
00399 /*      Shape quadtree indexing API.                                    */
00400 /* -------------------------------------------------------------------- */
00401 
00402 /* this can be two or four for binary or quad tree */
00403 #define MAX_SUBNODE     4
00404 
00405 /* upper limit of tree levels for automatic estimation */
00406 #define MAX_DEFAULT_TREE_DEPTH 12
00407 
00408 typedef struct shape_tree_node
00409 {
00410     /* region covered by this node */
00411     double      adfBoundsMin[4];
00412     double      adfBoundsMax[4];
00413 
00414     /* list of shapes stored at this node.  The papsShapeObj pointers
00415        or the whole list can be NULL */
00416     int         nShapeCount;
00417     int         *panShapeIds;
00418     SHPObject   **papsShapeObj;
00419 
00420     int         nSubNodes;
00421     struct shape_tree_node *apsSubNode[MAX_SUBNODE];
00422     
00423 } SHPTreeNode;
00424 
00425 typedef struct
00426 {
00427     SHPHandle   hSHP;
00428     
00429     int         nMaxDepth;
00430     int         nDimension;
00431     int         nTotalCount;
00432     
00433     SHPTreeNode *psRoot;
00434 } SHPTree;
00435 
00436 SHPTree SHPAPI_CALL1(*)
00437       SHPCreateTree( SHPHandle hSHP, int nDimension, int nMaxDepth,
00438                      double *padfBoundsMin, double *padfBoundsMax );
00439 void    SHPAPI_CALL
00440       SHPDestroyTree( SHPTree * hTree );
00441 
00442 int     SHPAPI_CALL
00443       SHPWriteTree( SHPTree *hTree, const char * pszFilename );
00444 SHPTree SHPAPI_CALL
00445       SHPReadTree( const char * pszFilename );
00446 
00447 int     SHPAPI_CALL
00448       SHPTreeAddObject( SHPTree * hTree, SHPObject * psObject );
00449 int     SHPAPI_CALL
00450       SHPTreeAddShapeId( SHPTree * hTree, SHPObject * psObject );
00451 int     SHPAPI_CALL
00452       SHPTreeRemoveShapeId( SHPTree * hTree, int nShapeId );
00453 
00454 void    SHPAPI_CALL
00455       SHPTreeTrimExtraNodes( SHPTree * hTree );
00456 
00457 int    SHPAPI_CALL1(*)
00458       SHPTreeFindLikelyShapes( SHPTree * hTree,
00459                                double * padfBoundsMin,
00460                                double * padfBoundsMax,
00461                                int * );
00462 int     SHPAPI_CALL
00463       SHPCheckBoundsOverlap( double *, double *, double *, double *, int );
00464 
00465 int SHPAPI_CALL1(*) 
00466 SHPSearchDiskTree( FILE *fp, 
00467                    double *padfBoundsMin, double *padfBoundsMax,
00468                    int *pnShapeCount );
00469 
00470 /************************************************************************/
00471 /*                             DBF Support.                             */
00472 /************************************************************************/
00473 typedef struct
00474 {
00475     SAHooks sHooks;
00476 
00477     SAFile      fp;
00478 
00479     int         nRecords;
00480 
00481     int         nRecordLength;
00482     int         nHeaderLength;
00483     int         nFields;
00484     int         *panFieldOffset;
00485     int         *panFieldSize;
00486     int         *panFieldDecimals;
00487     char        *pachFieldType;
00488 
00489     char        *pszHeader;
00490 
00491     int         nCurrentRecord;
00492     int         bCurrentRecordModified;
00493     char        *pszCurrentRecord;
00494 
00495     int         nWorkFieldLength;
00496     char        *pszWorkField;
00497     
00498     int         bNoHeader;
00499     int         bUpdated;
00500 
00501     double      dfDoubleField;
00502 
00503     int         iLanguageDriver;
00504     char        *pszCodePage;
00505 } DBFInfo;
00506 
00507 typedef DBFInfo * DBFHandle;
00508 
00509 typedef enum {
00510   FTString,
00511   FTInteger,
00512   FTDouble,
00513   FTLogical,
00514   FTInvalid
00515 } DBFFieldType;
00516 
00517 #define XBASE_FLDHDR_SZ       32
00518 
00519 
00520 DBFHandle SHPAPI_CALL
00521       DBFOpen( const char * pszDBFFile, const char * pszAccess );
00522 DBFHandle SHPAPI_CALL
00523       DBFOpenLL( const char * pszDBFFile, const char * pszAccess,
00524                  SAHooks *psHooks );
00525 DBFHandle SHPAPI_CALL
00526       DBFCreate( const char * pszDBFFile );
00527 DBFHandle SHPAPI_CALL
00528       DBFCreateEx( const char * pszDBFFile, const char * pszCodePage );
00529 DBFHandle SHPAPI_CALL
00530       DBFCreateLL( const char * pszDBFFile, const char * pszCodePage, SAHooks *psHooks );
00531 
00532 int     SHPAPI_CALL
00533       DBFGetFieldCount( DBFHandle psDBF );
00534 int     SHPAPI_CALL
00535       DBFGetRecordCount( DBFHandle psDBF );
00536 int     SHPAPI_CALL
00537       DBFAddField( DBFHandle hDBF, const char * pszFieldName,
00538                    DBFFieldType eType, int nWidth, int nDecimals );
00539 
00540 int     SHPAPI_CALL
00541       DBFAddNativeFieldType( DBFHandle hDBF, const char * pszFieldName,
00542                              char chType, int nWidth, int nDecimals );
00543 
00544 int     SHPAPI_CALL
00545       DBFDeleteField( DBFHandle hDBF, int iField );
00546 
00547 DBFFieldType SHPAPI_CALL
00548       DBFGetFieldInfo( DBFHandle psDBF, int iField, 
00549                        char * pszFieldName, int * pnWidth, int * pnDecimals );
00550 
00551 int SHPAPI_CALL
00552       DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName);
00553 
00554 int     SHPAPI_CALL
00555       DBFReadIntegerAttribute( DBFHandle hDBF, int iShape, int iField );
00556 double  SHPAPI_CALL
00557       DBFReadDoubleAttribute( DBFHandle hDBF, int iShape, int iField );
00558 const char SHPAPI_CALL1(*)
00559       DBFReadStringAttribute( DBFHandle hDBF, int iShape, int iField );
00560 const char SHPAPI_CALL1(*)
00561       DBFReadLogicalAttribute( DBFHandle hDBF, int iShape, int iField );
00562 int     SHPAPI_CALL
00563       DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField );
00564 
00565 int SHPAPI_CALL
00566       DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField, 
00567                                 int nFieldValue );
00568 int SHPAPI_CALL
00569       DBFWriteDoubleAttribute( DBFHandle hDBF, int iShape, int iField,
00570                                double dFieldValue );
00571 int SHPAPI_CALL
00572       DBFWriteStringAttribute( DBFHandle hDBF, int iShape, int iField,
00573                                const char * pszFieldValue );
00574 int SHPAPI_CALL
00575      DBFWriteNULLAttribute( DBFHandle hDBF, int iShape, int iField );
00576 
00577 int SHPAPI_CALL
00578      DBFWriteLogicalAttribute( DBFHandle hDBF, int iShape, int iField,
00579                                const char lFieldValue);
00580 int SHPAPI_CALL
00581      DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField,
00582                                void * pValue );
00583 const char SHPAPI_CALL1(*)
00584       DBFReadTuple(DBFHandle psDBF, int hEntity );
00585 int SHPAPI_CALL
00586       DBFWriteTuple(DBFHandle psDBF, int hEntity, void * pRawTuple );
00587 
00588 int SHPAPI_CALL DBFIsRecordDeleted( DBFHandle psDBF, int iShape );
00589 int SHPAPI_CALL DBFMarkRecordDeleted( DBFHandle psDBF, int iShape, 
00590                                       int bIsDeleted );
00591 
00592 DBFHandle SHPAPI_CALL
00593       DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename );
00594  
00595 void    SHPAPI_CALL
00596       DBFClose( DBFHandle hDBF );
00597 void    SHPAPI_CALL
00598       DBFUpdateHeader( DBFHandle hDBF );
00599 char    SHPAPI_CALL
00600       DBFGetNativeFieldType( DBFHandle hDBF, int iField );
00601 
00602 const char SHPAPI_CALL1(*)
00603       DBFGetCodePage(DBFHandle psDBF );
00604 
00605 #ifdef __cplusplus
00606 }
00607 #endif
00608 
00609 #endif /* ndef SHAPEFILE_H_INCLUDED */