From: Bruno Haible Date: Mon, 24 Oct 2005 11:57:34 +0000 (+0000) Subject: Expression evaluation for plural form selection. X-Git-Tag: v0.15~349 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=641a68291b5a87e5db58714d0d8565c53c2ec882;p=thirdparty%2Fgettext.git Expression evaluation for plural form selection. --- diff --git a/gettext-tools/src/plural-eval.h b/gettext-tools/src/plural-eval.h new file mode 100644 index 000000000..d38b666f6 --- /dev/null +++ b/gettext-tools/src/plural-eval.h @@ -0,0 +1,60 @@ +/* Expression evaluation for plural form selection. + Copyright (C) 2005 Free Software Foundation, Inc. + Written by Bruno Haible , 2005. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#ifndef _PLURAL_EVAL_H +#define _PLURAL_EVAL_H + + +/* Definition of 'struct expression', and + declaration of extract_plural_expression() and plural_eval(). */ +#include "plural-exp.h" + + +/* Protection against signals during plural evaluation. */ + +#include + +/* Some platforms don't have the sigjmp_buf type in . */ +#if defined _MSC_VER || defined __MINGW32__ +/* Native Woe32 API. */ +# define sigjmp_buf jmp_buf +# define sigsetjmp(env,savesigs) setjmp (env) +# define siglongjmp longjmp +#endif + +/* We use siginfo to get precise information about the signal. + But siginfo doesn't work on Irix 6.5. */ +#if HAVE_SIGINFO && !defined (__sgi) +# define USE_SIGINFO 1 +#endif + +/* Exit point. Must be set before calling install_sigfpe_handler(). */ +extern sigjmp_buf sigfpe_exit; + +#if USE_SIGINFO +/* Additional information that is set before sigfpe_exit is invoked. */ +extern int sigfpe_code; +#endif + +/* Protect against signals during plural evaluation. Must be called around + calls to plural_eval(). Must be called in pairs. */ +extern void install_sigfpe_handler (void); +extern void uninstall_sigfpe_handler (void); + + +#endif /* _PLURAL_EVAL_H */