~ubuntu-branches/ubuntu/natty/pymca/natty

« back to all changes in this revision

Viewing changes to PyMca/specfile/src/sflabel.c

  • Committer: Bazaar Package Importer
  • Author(s): Angel Abad
  • Date: 2010-11-18 22:28:16 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20101118222816-b8g5f3bmjp97cckq
Tags: 4.4.0-2ubuntu1
* Merge from debian unstable (LP: #677221). Remaining changes:
  - rm -f the data files from the pymca package instead of rm. fix FTBFS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#/*##########################################################################
2
 
# Copyright (C) 2004-2006 European Synchrotron Radiation Facility
 
2
# Copyright (C) 2004-2010 European Synchrotron Radiation Facility
3
3
#
4
4
# This file is part of the PyMCA X-ray Fluorescence Toolkit developed at
5
5
# the ESRF by the Beamline Instrumentation Software Support (BLISS) group.
22
22
# and cannot be used as a free plugin for a non-free program. 
23
23
#
24
24
# Please contact the ESRF industrial unit (industry@esrf.fr) if this license 
25
 
# is a problem to you.
 
25
# is a problem for you.
26
26
#############################################################################*/
27
27
/*char RcsId[] = "$Header: /segfs/bliss/source/python/specfile/specfile-3.1/src/RCS/sflabel.c,v 1.3 2003/02/03 13:15:35 rey Exp $"; */
28
28
/************************************************************************
67
67
 */
68
68
#include <SpecFile.h>
69
69
#include <SpecFileP.h>
 
70
#include <locale_management.h>
 
71
#ifndef _GNU_SOURCE
 
72
#ifdef PYMCA_POSIX
 
73
#include <locale.h>
 
74
#endif
 
75
#endif
70
76
 
71
77
/*
72
78
 * Declarations
475
481
     long      motct = 0;
476
482
     long      no_lines;
477
483
     short     i,j;
478
 
     
 
484
 
 
485
#ifndef _GNU_SOURCE
 
486
#ifdef PYMCA_POSIX
 
487
        char *currentLocaleBuffer;
 
488
        char localeBuffer[21];
 
489
#endif
 
490
#endif
 
491
 
479
492
     if (sfSetCurrent(sf,index,error) == -1) {
480
493
         *retpos = (double *) NULL;
481
494
          return(0);
504
517
     }
505
518
 
506
519
     motct = 0;
507
 
 
 
520
#ifndef _GNU_SOURCE
 
521
#ifdef PYMCA_POSIX
 
522
        currentLocaleBuffer = setlocale(LC_NUMERIC, NULL);
 
523
        strcpy(localeBuffer, currentLocaleBuffer);
 
524
        setlocale(LC_NUMERIC, "C\0");
 
525
#endif
 
526
#endif
508
527
     for (j=0;j<no_lines;j++) {
509
528
         thisline = lines[j] + 4;
510
529
         endline  = thisline + strlen(thisline);
513
532
            if (*ptr==' ') { 
514
533
               posstr[i] = '\0';
515
534
 
516
 
               pos[motct]  = atof(posstr);
 
535
               pos[motct]  = PyMcaAtof(posstr);
517
536
 
518
537
               motct++; 
519
538
               i=-1; 
527
546
            i++;
528
547
         }
529
548
         posstr[i]   = '\0';
530
 
         pos[motct]  = atof(posstr);
 
549
         pos[motct]  = PyMcaAtof(posstr);
531
550
 
532
551
         motct++; 
533
552
 
534
 
       }
 
553
         }
 
554
 
 
555
#ifndef _GNU_SOURCE
 
556
#ifdef PYMCA_POSIX
 
557
        setlocale(LC_NUMERIC, localeBuffer);
 
558
#endif
 
559
#endif
535
560
 
536
561
     /*
537
562
      * Save in specfile structure