/[thuban]/branches/WIP-pyshapelib-bramz/libraries/pyshapelib/dbflibmodule.c
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/libraries/pyshapelib/dbflibmodule.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1917 by bh, Mon Nov 3 17:31:11 2003 UTC revision 2212 by bh, Mon May 17 15:47:57 2004 UTC
# Line 345  DBFInfo_write_record(DBFHandle handle, i Line 345  DBFInfo_write_record(DBFHandle handle, i
345  %}  %}
346    
347    
348    /* The commit method implementation
349     *
350     * The method relies on the DBFUpdateHeader method which is not
351     * available in shapelib <= 1.2.10.  setup.py defines
352     * HAVE_UPDATE_HEADER's value depending on whether the function is
353     * available in the shapelib version the code is compiled with.
354     */
355    %{
356    static
357    void
358    DBFInfo_commit(DBFHandle handle)
359    {
360    #if HAVE_UPDATE_HEADER
361        DBFUpdateHeader(handle);
362    #endif
363    }
364    %}
365    
366    
367  /*  /*
368   * The SWIG Interface definition.   * The SWIG Interface definition.
369   */   */
# Line 502  typedef        struct Line 521  typedef        struct
521                                          dict_or_sequence);                                          dict_or_sequence);
522          }          }
523    
524          int commit() {          void commit() {
525              return DBFCommit(self->handle);              DBFInfo_commit(self->handle);
526          }          }
527            /* Delete the commit method from the class if it doesn't have a
528             * real implementation.
529             */
530            %pragma(python) addtomethod="__class__:if not dbflibc._have_commit: del commit"
531    
532      }      }
533  } DBFFile;  } DBFFile;
# Line 550  typedef enum { Line 573  typedef enum {
573    FTDouble,    FTDouble,
574    FTInvalid    FTInvalid
575  } DBFFieldType;  } DBFFieldType;
576    
577    
578    /* Put the value of the HAVE_UPDATE_HEADER preprocessor macro into the
579     * wrapper so that the __class__ pragma above knows when to remove the
580     * commit method
581     */
582    const int _have_commit = HAVE_UPDATE_HEADER;
583    

Legend:
Removed from v.1917  
changed lines
  Added in v.2212

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26