1*946379e7Schristos /* Expression evaluation for plural form selection. 2*946379e7Schristos Copyright (C) 2005-2006 Free Software Foundation, Inc. 3*946379e7Schristos Written by Bruno Haible <bruno@clisp.org>, 2005. 4*946379e7Schristos 5*946379e7Schristos This program is free software; you can redistribute it and/or modify 6*946379e7Schristos it under the terms of the GNU General Public License as published by 7*946379e7Schristos the Free Software Foundation; either version 2, or (at your option) 8*946379e7Schristos any later version. 9*946379e7Schristos 10*946379e7Schristos This program is distributed in the hope that it will be useful, 11*946379e7Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of 12*946379e7Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13*946379e7Schristos GNU General Public License for more details. 14*946379e7Schristos 15*946379e7Schristos You should have received a copy of the GNU General Public License 16*946379e7Schristos along with this program; if not, write to the Free Software Foundation, 17*946379e7Schristos Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 18*946379e7Schristos 19*946379e7Schristos #ifndef _PLURAL_EVAL_H 20*946379e7Schristos #define _PLURAL_EVAL_H 21*946379e7Schristos 22*946379e7Schristos 23*946379e7Schristos /* Definition of 'struct expression', and 24*946379e7Schristos declaration of extract_plural_expression() and plural_eval(). */ 25*946379e7Schristos #include "plural-exp.h" 26*946379e7Schristos 27*946379e7Schristos 28*946379e7Schristos /* Protection against signals during plural evaluation. */ 29*946379e7Schristos 30*946379e7Schristos #include <setjmp.h> 31*946379e7Schristos 32*946379e7Schristos /* Some platforms don't have the sigjmp_buf type in <setjmp.h>. */ 33*946379e7Schristos #if defined _MSC_VER || defined __MINGW32__ 34*946379e7Schristos /* Native Woe32 API. */ 35*946379e7Schristos # define sigjmp_buf jmp_buf 36*946379e7Schristos # define sigsetjmp(env,savesigs) setjmp (env) 37*946379e7Schristos # define siglongjmp longjmp 38*946379e7Schristos #endif 39*946379e7Schristos 40*946379e7Schristos /* We use siginfo to get precise information about the signal. 41*946379e7Schristos But siginfo doesn't work on Irix 6.5 and on Cygwin 2005. */ 42*946379e7Schristos #if HAVE_SIGINFO && !defined (__sgi) && !defined (__CYGWIN__) 43*946379e7Schristos # define USE_SIGINFO 1 44*946379e7Schristos #endif 45*946379e7Schristos 46*946379e7Schristos /* Exit point. Must be set before calling install_sigfpe_handler(). */ 47*946379e7Schristos extern sigjmp_buf sigfpe_exit; 48*946379e7Schristos 49*946379e7Schristos #if USE_SIGINFO 50*946379e7Schristos /* Additional information that is set before sigfpe_exit is invoked. */ 51*946379e7Schristos extern int sigfpe_code; 52*946379e7Schristos #endif 53*946379e7Schristos 54*946379e7Schristos /* Protect against signals during plural evaluation. Must be called around 55*946379e7Schristos calls to plural_eval(). Must be called in pairs. */ 56*946379e7Schristos extern void install_sigfpe_handler (void); 57*946379e7Schristos extern void uninstall_sigfpe_handler (void); 58*946379e7Schristos 59*946379e7Schristos 60*946379e7Schristos #endif /* _PLURAL_EVAL_H */ 61