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

Diff of /branches/WIP-pyshapelib-bramz/libraries/shapelib/dbfopen.c

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

revision 2702 by bh, Mon May 17 15:47:57 2004 UTC revision 2703 by bernhard, Sun Sep 24 18:51:39 2006 UTC
# Line 255  static int     nStringFieldLen = 0; Line 255  static int     nStringFieldLen = 0;
255  static char * pszStringField = NULL;  static char * pszStringField = NULL;
256    
257  /************************************************************************/  /************************************************************************/
258    /*                             DBFSet_atof_function()                   */
259    /*                                                                      */
260    /* This makes it possible to initialise a different atof() function     */
261    /* which might be necessary because the standard atof() might be        */
262    /* sensitive to locale settings.                                        */
263    /*                                                                      */
264    /* If the calling application uses a locale with different decimal_point*/
265    /* it should better also give us a locale agnostic atof() function.     */
266    /*                                                                      */
267    /* As far as I can see from Python PEP331 and GNU libc documentation    */
268    /* there is no standard for such a function yet.                        */
269    /*                                                                      */
270    /* [email protected] 20060924                               */
271    /************************************************************************/
272    
273    static double (* atof_function)(const char *nptr)  = &atof;
274    
275    void SHPAPI_CALL
276            DBFSetatof_function(  double (* new_atof_function)(const char *nptr))
277    {
278            atof_function = new_atof_function;
279    }
280    
281    /************************************************************************/
282  /*                             SfRealloc()                              */  /*                             SfRealloc()                              */
283  /*                                                                      */  /*                                                                      */
284  /*      A realloc cover function that will access a NULL pointer as     */  /*      A realloc cover function that will access a NULL pointer as     */
# Line 826  static void *DBFReadAttribute(DBFHandle Line 850  static void *DBFReadAttribute(DBFHandle
850  /* -------------------------------------------------------------------- */  /* -------------------------------------------------------------------- */
851      if( chReqType == 'N' )      if( chReqType == 'N' )
852      {      {
853          dDoubleField = atof(pszStringField);          dDoubleField = (*atof_function)(pszStringField);
854    
855          pReturnField = &dDoubleField;          pReturnField = &dDoubleField;
856      }      }

Legend:
Removed from v.2702  
changed lines
  Added in v.2703

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26