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 |
*/ |
*/ |
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; |
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 |
|
|