Salome HOME
2a9a96a0aba44a433c3bb6cc56f95ae5c42e1c73
[modules/hydro.git] / src / shapelib / shapefil.h
1 #ifndef SHAPEFILE_H_INCLUDED
2 #define SHAPEFILE_H_INCLUDED
3
4 /******************************************************************************
5  * $Id: shapefil.h,v 1.52 2011-12-11 22:26:46 fwarmerdam Exp $
6  *
7  * Project:  Shapelib
8  * Purpose:  Primary include file for Shapelib.
9  * Author:   Frank Warmerdam, warmerdam@pobox.com
10  *
11  ******************************************************************************
12  * Copyright (c) 1999, Frank Warmerdam
13  *
14  * This software is available under the following "MIT Style" license,
15  * or at the option of the licensee under the LGPL (see LICENSE.LGPL).  This
16  * option is discussed in more detail in shapelib.html.
17  *
18  * --
19  * 
20  * Permission is hereby granted, free of charge, to any person obtaining a
21  * copy of this software and associated documentation files (the "Software"),
22  * to deal in the Software without restriction, including without limitation
23  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
24  * and/or sell copies of the Software, and to permit persons to whom the
25  * Software is furnished to do so, subject to the following conditions:
26  *
27  * The above copyright notice and this permission notice shall be included
28  * in all copies or substantial portions of the Software.
29  *
30  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
31  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
33  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
35  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
36  * DEALINGS IN THE SOFTWARE.
37  ******************************************************************************
38  *
39  * $Log: shapefil.h,v $
40  * Revision 1.52  2011-12-11 22:26:46  fwarmerdam
41  * upgrade .qix access code to use SAHooks (gdal #3365)
42  *
43  * Revision 1.51  2011-07-24 05:59:25  fwarmerdam
44  * minimize use of CPLError in favor of SAHooks.Error()
45  *
46  * Revision 1.50  2011-05-13 17:35:17  fwarmerdam
47  * added DBFReorderFields() and DBFAlterFields() functions (from Even)
48  *
49  * Revision 1.49  2011-04-16 14:38:21  fwarmerdam
50  * avoid warnings with gcc on SHP_CVSID
51  *
52  * Revision 1.48  2010-08-27 23:42:52  fwarmerdam
53  * add SHPAPI_CALL attribute in code
54  *
55  * Revision 1.47  2010-01-28 11:34:34  fwarmerdam
56  * handle the shape file length limits more gracefully (#3236)
57  *
58  * Revision 1.46  2008-11-12 14:28:15  fwarmerdam
59  * DBFCreateField() now works on files with records
60  *
61  * Revision 1.45  2008/11/11 17:47:10  fwarmerdam
62  * added DBFDeleteField() function
63  *
64  * Revision 1.44  2008/01/16 20:05:19  bram
65  * Add file hooks that accept UTF-8 encoded filenames on some platforms.  Use SASetupUtf8Hooks
66  *  tosetup the hooks and check SHPAPI_UTF8_HOOKS for its availability.  Currently, this
67  *  is only available on the Windows platform that decodes the UTF-8 filenames to wide
68  *  character strings and feeds them to _wfopen and _wremove.
69  *
70  * Revision 1.43  2008/01/10 16:35:30  fwarmerdam
71  * avoid _ prefix on #defined symbols (bug 1840)
72  *
73  * Revision 1.42  2007/12/18 18:28:14  bram
74  * - create hook for client specific atof (bugzilla ticket 1615)
75  * - check for NULL handle before closing cpCPG file, and close after reading.
76  *
77  * Revision 1.41  2007/12/15 20:25:32  bram
78  * dbfopen.c now reads the Code Page information from the DBF file, and exports
79  * this information as a string through the DBFGetCodePage function.  This is 
80  * either the number from the LDID header field ("LDID/<number>") or as the 
81  * content of an accompanying .CPG file.  When creating a DBF file, the code can
82  * be set using DBFCreateEx.
83  *
84  * Revision 1.40  2007/12/06 07:00:25  fwarmerdam
85  * dbfopen now using SAHooks for fileio
86  *
87  * Revision 1.39  2007/12/04 20:37:56  fwarmerdam
88  * preliminary implementation of hooks api for io and errors
89  *
90  * Revision 1.38  2007/11/21 22:39:56  fwarmerdam
91  * close shx file in readonly mode (GDAL #1956)
92  *
93  * Revision 1.37  2007/10/27 03:31:14  fwarmerdam
94  * limit default depth of tree to 12 levels (gdal ticket #1594)
95  *
96  * Revision 1.36  2007/09/10 23:33:15  fwarmerdam
97  * Upstreamed support for visibility flag in SHPAPI_CALL for the needs
98  * of GDAL (gdal ticket #1810).
99  *
100  * Revision 1.35  2007/09/03 19:48:10  fwarmerdam
101  * move DBFReadAttribute() static dDoubleField into dbfinfo
102  *
103  * Revision 1.34  2006/06/17 15:33:32  fwarmerdam
104  * added pszWorkField - bug 1202 (rso)
105  *
106  * Revision 1.33  2006/02/15 01:14:30  fwarmerdam
107  * added DBFAddNativeFieldType
108  *
109  * Revision 1.32  2006/01/26 15:07:32  fwarmerdam
110  * add bMeasureIsUsed flag from Craig Bruce: Bug 1249
111  *
112  * Revision 1.31  2006/01/05 01:27:27  fwarmerdam
113  * added dbf deletion mark/fetch
114  *
115  * Revision 1.30  2005/01/03 22:30:13  fwarmerdam
116  * added support for saved quadtrees
117  *
118  * Revision 1.29  2004/09/26 20:09:35  fwarmerdam
119  * avoid rcsid warnings
120  *
121  * Revision 1.28  2003/12/29 06:02:18  fwarmerdam
122  * added cpl_error.h option
123  *
124  * Revision 1.27  2003/04/21 18:30:37  warmerda
125  * added header write/update public methods
126  *
127  * Revision 1.26  2002/09/29 00:00:08  warmerda
128  * added FTLogical and logical attribute read/write calls
129  *
130  * Revision 1.25  2002/05/07 13:46:30  warmerda
131  * added DBFWriteAttributeDirectly().
132  *
133  * Revision 1.24  2002/04/10 16:59:54  warmerda
134  * added SHPRewindObject
135  *
136  * Revision 1.23  2002/01/15 14:36:07  warmerda
137  * updated email address
138  *
139  * Revision 1.22  2002/01/15 14:32:00  warmerda
140  * try to improve SHPAPI_CALL docs
141  */
142
143 #include <stdio.h>
144
145 #ifdef USE_DBMALLOC
146 #include <dbmalloc.h>
147 #endif
148
149 #ifdef __cplusplus
150 extern "C" {
151 #endif
152
153 /************************************************************************/
154 /*                        Configuration options.                        */
155 /************************************************************************/
156
157 /* -------------------------------------------------------------------- */
158 /*      Should the DBFReadStringAttribute() strip leading and           */
159 /*      trailing white space?                                           */
160 /* -------------------------------------------------------------------- */
161 #define TRIM_DBF_WHITESPACE
162
163 /* -------------------------------------------------------------------- */
164 /*      Should we write measure values to the Multipatch object?        */
165 /*      Reportedly ArcView crashes if we do write it, so for now it     */
166 /*      is disabled.                                                    */
167 /* -------------------------------------------------------------------- */
168 #define DISABLE_MULTIPATCH_MEASURE
169     
170 /* -------------------------------------------------------------------- */
171 /*      SHPAPI_CALL                                                     */
172 /*                                                                      */
173 /*      The following two macros are present to allow forcing           */
174 /*      various calling conventions on the Shapelib API.                */
175 /*                                                                      */
176 /*      To force __stdcall conventions (needed to call Shapelib         */
177 /*      from Visual Basic and/or Dephi I believe) the makefile could    */
178 /*      be modified to define:                                          */
179 /*                                                                      */
180 /*        /DSHPAPI_CALL=__stdcall                                       */
181 /*                                                                      */
182 /*      If it is desired to force export of the Shapelib API without    */
183 /*      using the shapelib.def file, use the following definition.      */
184 /*                                                                      */
185 /*        /DSHAPELIB_DLLEXPORT                                          */
186 /*                                                                      */
187 /*      To get both at once it will be necessary to hack this           */
188 /*      include file to define:                                         */
189 /*                                                                      */
190 /*        #define SHPAPI_CALL __declspec(dllexport) __stdcall           */
191 /*        #define SHPAPI_CALL1 __declspec(dllexport) * __stdcall        */
192 /*                                                                      */
193 /*      The complexity of the situtation is partly caused by the        */
194 /*      peculiar requirement of Visual C++ that __stdcall appear        */
195 /*      after any "*"'s in the return value of a function while the     */
196 /*      __declspec(dllexport) must appear before them.                  */
197 /* -------------------------------------------------------------------- */
198
199 #ifdef WIN32
200   #define SHAPELIB_DLLEXPORT 1
201 #endif
202
203 #ifdef SHAPELIB_DLLEXPORT
204 #  define SHPAPI_CALL __declspec(dllexport)
205 #  define SHPAPI_CALL1(x)  __declspec(dllexport) x
206 #else
207 #  define SHPAPI_CALL __declspec(dllimport)
208 #  define SHPAPI_CALL1(x)  __declspec(dllimport) x
209 #endif
210
211 #ifndef SHPAPI_CALL
212 #  if defined(USE_GCC_VISIBILITY_FLAG)
213 #    define SHPAPI_CALL     __attribute__ ((visibility("default")))
214 #    define SHPAPI_CALL1(x) __attribute__ ((visibility("default")))     x
215 #  else
216 #    define SHPAPI_CALL
217 #  endif
218 #endif
219
220 #ifndef SHPAPI_CALL1
221 #  define SHPAPI_CALL1(x)      x SHPAPI_CALL
222 #endif
223     
224 /* -------------------------------------------------------------------- */
225 /*      Macros for controlling CVSID and ensuring they don't appear     */
226 /*      as unreferenced variables resulting in lots of warnings.        */
227 /* -------------------------------------------------------------------- */
228 #ifndef DISABLE_CVSID
229 #  if defined(__GNUC__) && __GNUC__ >= 4
230 #    define SHP_CVSID(string)     static char cpl_cvsid[] __attribute__((used)) = string;
231 #  else
232 #    define SHP_CVSID(string)     static char cpl_cvsid[] = string; \
233 static char *cvsid_aw() { return( cvsid_aw() ? ((char *) NULL) : cpl_cvsid ); }
234 #  endif
235 #else
236 #  define SHP_CVSID(string)
237 #endif
238
239 /* -------------------------------------------------------------------- */
240 /*      On some platforms, additional file IO hooks are defined that    */
241 /*      UTF-8 encoded filenames Unicode filenames                       */
242 /* -------------------------------------------------------------------- */
243 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
244 #       define SHPAPI_WINDOWS
245 #       define SHPAPI_UTF8_HOOKS
246 #endif
247
248 /* -------------------------------------------------------------------- */
249 /*      IO/Error hook functions.                                        */
250 /* -------------------------------------------------------------------- */
251 typedef int *SAFile;
252
253 #ifndef SAOffset
254 typedef unsigned long SAOffset;
255 #endif
256
257 typedef struct {
258     SAFile     (*FOpen) ( const char *filename, const char *access);
259     SAOffset   (*FRead) ( void *p, SAOffset size, SAOffset nmemb, SAFile file);
260     SAOffset   (*FWrite)( void *p, SAOffset size, SAOffset nmemb, SAFile file);
261     SAOffset   (*FSeek) ( SAFile file, SAOffset offset, int whence );
262     SAOffset   (*FTell) ( SAFile file );
263     int        (*FFlush)( SAFile file );
264     int        (*FClose)( SAFile file );
265     int        (*Remove) ( const char *filename );
266
267     void       (*Error) ( const char *message );
268     double     (*Atof)  ( const char *str );
269 } SAHooks;
270
271 void SHPAPI_CALL SASetupDefaultHooks( SAHooks *psHooks );
272 #ifdef SHPAPI_UTF8_HOOKS
273 void SHPAPI_CALL SASetupUtf8Hooks( SAHooks *psHooks );
274 #endif
275
276 /************************************************************************/
277 /*                             SHP Support.                             */
278 /************************************************************************/
279 typedef struct
280 {
281     SAHooks sHooks;
282
283     SAFile      fpSHP;
284     SAFile      fpSHX;
285
286     int         nShapeType;                             /* SHPT_* */
287     
288     unsigned int        nFileSize;                              /* SHP file */
289
290     int         nRecords;
291     int         nMaxRecords;
292     unsigned int                *panRecOffset;
293     unsigned int                *panRecSize;
294
295     double      adBoundsMin[4];
296     double      adBoundsMax[4];
297
298     int         bUpdated;
299
300     unsigned char *pabyRec;
301     int         nBufSize;
302 } SHPInfo;
303
304 typedef SHPInfo * SHPHandle;
305
306 /* -------------------------------------------------------------------- */
307 /*      Shape types (nSHPType)                                          */
308 /* -------------------------------------------------------------------- */
309 #define SHPT_NULL       0
310 #define SHPT_POINT      1
311 #define SHPT_ARC        3
312 #define SHPT_POLYGON    5
313 #define SHPT_MULTIPOINT 8
314 #define SHPT_POINTZ     11
315 #define SHPT_ARCZ       13
316 #define SHPT_POLYGONZ   15
317 #define SHPT_MULTIPOINTZ 18
318 #define SHPT_POINTM     21
319 #define SHPT_ARCM       23
320 #define SHPT_POLYGONM   25
321 #define SHPT_MULTIPOINTM 28
322 #define SHPT_MULTIPATCH 31
323
324
325 /* -------------------------------------------------------------------- */
326 /*      Part types - everything but SHPT_MULTIPATCH just uses           */
327 /*      SHPP_RING.                                                      */
328 /* -------------------------------------------------------------------- */
329
330 #define SHPP_TRISTRIP   0
331 #define SHPP_TRIFAN     1
332 #define SHPP_OUTERRING  2
333 #define SHPP_INNERRING  3
334 #define SHPP_FIRSTRING  4
335 #define SHPP_RING       5
336
337 /* -------------------------------------------------------------------- */
338 /*      SHPObject - represents on shape (without attributes) read       */
339 /*      from the .shp file.                                             */
340 /* -------------------------------------------------------------------- */
341 typedef struct
342 {
343     int         nSHPType;
344
345     int         nShapeId; /* -1 is unknown/unassigned */
346
347     int         nParts;
348     int         *panPartStart;
349     int         *panPartType;
350     
351     int         nVertices;
352     double      *padfX;
353     double      *padfY;
354     double      *padfZ;
355     double      *padfM;
356
357     double      dfXMin;
358     double      dfYMin;
359     double      dfZMin;
360     double      dfMMin;
361
362     double      dfXMax;
363     double      dfYMax;
364     double      dfZMax;
365     double      dfMMax;
366
367     int         bMeasureIsUsed;
368 } SHPObject;
369
370 /* -------------------------------------------------------------------- */
371 /*      SHP API Prototypes                                              */
372 /* -------------------------------------------------------------------- */
373
374 /* If pszAccess is read-only, the fpSHX field of the returned structure */
375 /* will be NULL as it is not necessary to keep the SHX file open */
376 SHPHandle SHPAPI_CALL
377       SHPOpen( const char * pszShapeFile, const char * pszAccess );
378 SHPHandle SHPAPI_CALL
379       SHPOpenLL( const char *pszShapeFile, const char *pszAccess, 
380                  SAHooks *psHooks );
381 SHPHandle SHPAPI_CALL
382       SHPCreate( const char * pszShapeFile, int nShapeType );
383 SHPHandle SHPAPI_CALL
384       SHPCreateLL( const char * pszShapeFile, int nShapeType,
385                    SAHooks *psHooks );
386 void SHPAPI_CALL
387       SHPGetInfo( SHPHandle hSHP, int * pnEntities, int * pnShapeType,
388                   double * padfMinBound, double * padfMaxBound );
389
390 SHPObject SHPAPI_CALL1(*)
391       SHPReadObject( SHPHandle hSHP, int iShape );
392 int SHPAPI_CALL
393       SHPWriteObject( SHPHandle hSHP, int iShape, SHPObject * psObject );
394
395 void SHPAPI_CALL
396       SHPDestroyObject( SHPObject * psObject );
397 void SHPAPI_CALL
398       SHPComputeExtents( SHPObject * psObject );
399 SHPObject SHPAPI_CALL1(*)
400       SHPCreateObject( int nSHPType, int nShapeId, int nParts, 
401                        const int * panPartStart, const int * panPartType,
402                        int nVertices, 
403                        const double * padfX, const double * padfY,
404                        const double * padfZ, const double * padfM );
405 SHPObject SHPAPI_CALL1(*)
406       SHPCreateSimpleObject( int nSHPType, int nVertices,
407                              const double * padfX, 
408                              const double * padfY, 
409                              const double * padfZ );
410
411 int SHPAPI_CALL
412       SHPRewindObject( SHPHandle hSHP, SHPObject * psObject );
413
414 void SHPAPI_CALL SHPClose( SHPHandle hSHP );
415 void SHPAPI_CALL SHPWriteHeader( SHPHandle hSHP );
416
417 const char SHPAPI_CALL1(*)
418       SHPTypeName( int nSHPType );
419 const char SHPAPI_CALL1(*)
420       SHPPartTypeName( int nPartType );
421
422 /* -------------------------------------------------------------------- */
423 /*      Shape quadtree indexing API.                                    */
424 /* -------------------------------------------------------------------- */
425
426 /* this can be two or four for binary or quad tree */
427 #define MAX_SUBNODE     4
428
429 /* upper limit of tree levels for automatic estimation */
430 #define MAX_DEFAULT_TREE_DEPTH 12
431
432 typedef struct shape_tree_node
433 {
434     /* region covered by this node */
435     double      adfBoundsMin[4];
436     double      adfBoundsMax[4];
437
438     /* list of shapes stored at this node.  The papsShapeObj pointers
439        or the whole list can be NULL */
440     int         nShapeCount;
441     int         *panShapeIds;
442     SHPObject   **papsShapeObj;
443
444     int         nSubNodes;
445     struct shape_tree_node *apsSubNode[MAX_SUBNODE];
446     
447 } SHPTreeNode;
448
449 typedef struct
450 {
451     SHPHandle   hSHP;
452     
453     int         nMaxDepth;
454     int         nDimension;
455     int         nTotalCount;
456     
457     SHPTreeNode *psRoot;
458 } SHPTree;
459
460 SHPTree SHPAPI_CALL1(*)
461       SHPCreateTree( SHPHandle hSHP, int nDimension, int nMaxDepth,
462                      double *padfBoundsMin, double *padfBoundsMax );
463 void    SHPAPI_CALL
464       SHPDestroyTree( SHPTree * hTree );
465
466 int     SHPAPI_CALL
467       SHPWriteTree( SHPTree *hTree, const char * pszFilename );
468
469 int     SHPAPI_CALL
470       SHPTreeAddShapeId( SHPTree * hTree, SHPObject * psObject );
471 int     SHPAPI_CALL
472       SHPTreeRemoveShapeId( SHPTree * hTree, int nShapeId );
473
474 void    SHPAPI_CALL
475       SHPTreeTrimExtraNodes( SHPTree * hTree );
476
477 int    SHPAPI_CALL1(*)
478       SHPTreeFindLikelyShapes( SHPTree * hTree,
479                                double * padfBoundsMin,
480                                double * padfBoundsMax,
481                                int * );
482 int     SHPAPI_CALL
483       SHPCheckBoundsOverlap( double *, double *, double *, double *, int );
484
485 int SHPAPI_CALL1(*) 
486 SHPSearchDiskTree( FILE *fp, 
487                    double *padfBoundsMin, double *padfBoundsMax,
488                    int *pnShapeCount );
489
490
491 typedef struct SHPDiskTreeInfo* SHPTreeDiskHandle;
492
493 SHPTreeDiskHandle SHPAPI_CALL
494     SHPOpenDiskTree( const char* pszQIXFilename,
495                      SAHooks *psHooks );
496
497 void SHPAPI_CALL
498     SHPCloseDiskTree( SHPTreeDiskHandle hDiskTree );
499
500 int SHPAPI_CALL1(*) 
501 SHPSearchDiskTreeEx( SHPTreeDiskHandle hDiskTree, 
502                    double *padfBoundsMin, double *padfBoundsMax,
503                    int *pnShapeCount );
504
505 int SHPAPI_CALL
506     SHPWriteTreeLL(SHPTree *hTree, const char *pszFilename, SAHooks *psHooks );
507
508 /************************************************************************/
509 /*                             DBF Support.                             */
510 /************************************************************************/
511 typedef struct
512 {
513     SAHooks sHooks;
514
515     SAFile      fp;
516
517     int         nRecords;
518
519     int         nRecordLength;
520     int         nHeaderLength;
521     int         nFields;
522     int         *panFieldOffset;
523     int         *panFieldSize;
524     int         *panFieldDecimals;
525     char        *pachFieldType;
526
527     char        *pszHeader;
528
529     int         nCurrentRecord;
530     int         bCurrentRecordModified;
531     char        *pszCurrentRecord;
532
533     int         nWorkFieldLength;
534     char        *pszWorkField;
535     
536     int         bNoHeader;
537     int         bUpdated;
538
539     double      dfDoubleField;
540
541     int         iLanguageDriver;
542     char        *pszCodePage;
543 } DBFInfo;
544
545 typedef DBFInfo * DBFHandle;
546
547 typedef enum {
548   FTString,
549   FTInteger,
550   FTDouble,
551   FTLogical,
552   FTInvalid
553 } DBFFieldType;
554
555 #define XBASE_FLDHDR_SZ       32
556
557
558 DBFHandle SHPAPI_CALL
559       DBFOpen( const char * pszDBFFile, const char * pszAccess );
560 DBFHandle SHPAPI_CALL
561       DBFOpenLL( const char * pszDBFFile, const char * pszAccess,
562                  SAHooks *psHooks );
563 DBFHandle SHPAPI_CALL
564       DBFCreate( const char * pszDBFFile );
565 DBFHandle SHPAPI_CALL
566       DBFCreateEx( const char * pszDBFFile, const char * pszCodePage );
567 DBFHandle SHPAPI_CALL
568       DBFCreateLL( const char * pszDBFFile, const char * pszCodePage, SAHooks *psHooks );
569
570 int     SHPAPI_CALL
571       DBFGetFieldCount( DBFHandle psDBF );
572 int     SHPAPI_CALL
573       DBFGetRecordCount( DBFHandle psDBF );
574 int     SHPAPI_CALL
575       DBFAddField( DBFHandle hDBF, const char * pszFieldName,
576                    DBFFieldType eType, int nWidth, int nDecimals );
577
578 int     SHPAPI_CALL
579       DBFAddNativeFieldType( DBFHandle hDBF, const char * pszFieldName,
580                              char chType, int nWidth, int nDecimals );
581
582 int     SHPAPI_CALL
583       DBFDeleteField( DBFHandle hDBF, int iField );
584
585 int SHPAPI_CALL
586       DBFReorderFields( DBFHandle psDBF, int* panMap );
587
588 int SHPAPI_CALL
589       DBFAlterFieldDefn( DBFHandle psDBF, int iField, const char * pszFieldName,
590                          char chType, int nWidth, int nDecimals );
591
592 DBFFieldType SHPAPI_CALL
593       DBFGetFieldInfo( DBFHandle psDBF, int iField, 
594                        char * pszFieldName, int * pnWidth, int * pnDecimals );
595
596 int SHPAPI_CALL
597       DBFGetFieldIndex(DBFHandle psDBF, const char *pszFieldName);
598
599 int     SHPAPI_CALL
600       DBFReadIntegerAttribute( DBFHandle hDBF, int iShape, int iField );
601 double  SHPAPI_CALL
602       DBFReadDoubleAttribute( DBFHandle hDBF, int iShape, int iField );
603 const char SHPAPI_CALL1(*)
604       DBFReadStringAttribute( DBFHandle hDBF, int iShape, int iField );
605 const char SHPAPI_CALL1(*)
606       DBFReadLogicalAttribute( DBFHandle hDBF, int iShape, int iField );
607 int     SHPAPI_CALL
608       DBFIsAttributeNULL( DBFHandle hDBF, int iShape, int iField );
609
610 int SHPAPI_CALL
611       DBFWriteIntegerAttribute( DBFHandle hDBF, int iShape, int iField, 
612                                 int nFieldValue );
613 int SHPAPI_CALL
614       DBFWriteDoubleAttribute( DBFHandle hDBF, int iShape, int iField,
615                                double dFieldValue );
616 int SHPAPI_CALL
617       DBFWriteStringAttribute( DBFHandle hDBF, int iShape, int iField,
618                                const char * pszFieldValue );
619 int SHPAPI_CALL
620      DBFWriteNULLAttribute( DBFHandle hDBF, int iShape, int iField );
621
622 int SHPAPI_CALL
623      DBFWriteLogicalAttribute( DBFHandle hDBF, int iShape, int iField,
624                                const char lFieldValue);
625 int SHPAPI_CALL
626      DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField,
627                                void * pValue );
628 const char SHPAPI_CALL1(*)
629       DBFReadTuple(DBFHandle psDBF, int hEntity );
630 int SHPAPI_CALL
631       DBFWriteTuple(DBFHandle psDBF, int hEntity, void * pRawTuple );
632
633 int SHPAPI_CALL DBFIsRecordDeleted( DBFHandle psDBF, int iShape );
634 int SHPAPI_CALL DBFMarkRecordDeleted( DBFHandle psDBF, int iShape, 
635                                       int bIsDeleted );
636
637 DBFHandle SHPAPI_CALL
638       DBFCloneEmpty(DBFHandle psDBF, const char * pszFilename );
639  
640 void    SHPAPI_CALL
641       DBFClose( DBFHandle hDBF );
642 void    SHPAPI_CALL
643       DBFUpdateHeader( DBFHandle hDBF );
644 char    SHPAPI_CALL
645       DBFGetNativeFieldType( DBFHandle hDBF, int iField );
646
647 const char SHPAPI_CALL1(*)
648       DBFGetCodePage(DBFHandle psDBF );
649
650 #ifdef __cplusplus
651 }
652 #endif
653
654 #endif /* ndef SHAPEFILE_H_INCLUDED */