1
/* Value distribution of plural form expressions.
2
Copyright (C) 2001-2008 Free Software Foundation, Inc.
3
Written by Bruno Haible <bruno@clisp.org>, 2001-2005.
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 3 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
#ifndef _PLURAL_DISTRIB_H
19
#define _PLURAL_DISTRIB_H
22
/* Definition of 'struct expression'. */
23
#include "plural-exp.h"
31
/* The value distribution of a plural formula. */
32
struct plural_distribution
34
/* The plural formula as a parsed expression. */
35
const struct expression *expr;
37
/* OFTEN is either NULL or an array of nplurals elements,
38
OFTEN[j] being true if the value j appears to be assumed infinitely often
39
by the plural formula. */
40
const unsigned char *often;
42
/* The length of the OFTEN array. */
43
unsigned long often_length;
45
/* A function which evaluates the plural formula for min <= n <= max
46
and returns the estimated number of times the value j was assumed. */
47
unsigned int (*histogram) (const struct plural_distribution *self,
48
int min, int max, unsigned long j);
57
#endif /* _PLURAL_DISTRIB_H */