locale.h and gnuplot

Andreas Beyer beyer at imb-jena.de
Mon Feb 21 09:40:40 CET 2005


Jakson Aquino schrieb:
> StatistX macro solved the problem with gnuplot. I
> always called the macros inside the condition #ifndef
> NO_GETTEXT. I deleted the following lines from the
> macro, but only because they seems to be written in
> Objective C and I don't know how to translate them.
> 
> if (SX_saved_locale == NULL) { \
>  [NSException raise: NSMallocException \
>    format: @"set locale: Not enough memory."]; \
> } \
> 
When you store the current locale information, the program could 
potentially run out of memory. You have to check that, which StatistX 
does by testing the condition
   SX_saved_locale == NULL
If this condition is true, the program has no memory left (or something 
else went wrong). statist should perform the same test at the same place 
and handle the problem in some way. E.g. the following is a possible way 
to deal with it:

if (saved_locale == NULL) {
    /* Run out of memory. Fatal, stop the program. */
    out_err(FAT, ERR_FILE, ERR_LINE,
          _("set locale: Not enough memory."));
}


Look at "statist.h" for details about out_err(). If possible, one could 
also use mymalloc() from memory_handling.h.

	Andreas




More information about the Statist-list mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)