xref: /titanic_50/usr/src/cmd/msgfmt/gnu_prime.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2001-2002 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_GNU_PRIME_H
28*7c478bd9Sstevel@tonic-gate #define	_GNU_PRIME_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
33*7c478bd9Sstevel@tonic-gate extern "C" {
34*7c478bd9Sstevel@tonic-gate #endif
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate static const unsigned int	prime[] = {
37*7c478bd9Sstevel@tonic-gate 	2,	3,	5,	7,	11,	/* 0 - 4 */
38*7c478bd9Sstevel@tonic-gate 	13,	17,	19,	23,	29,	/* 5 - 9 */
39*7c478bd9Sstevel@tonic-gate 	31,	37,	41,	43,	47,	/* 10 - 14 */
40*7c478bd9Sstevel@tonic-gate 	53,	59,	61,	67,	71,	/* 15 - 19 */
41*7c478bd9Sstevel@tonic-gate 	73,	79,	83,	89,	97,	/* 20 - 24 */
42*7c478bd9Sstevel@tonic-gate 	101,	103,	107,	109,	113,	/* 25 - 29 */
43*7c478bd9Sstevel@tonic-gate 	127,	131,	137,	139,	149,	/* 30 - 34 */
44*7c478bd9Sstevel@tonic-gate 	151,	157,	163,	167,	173,	/* 35 - 39 */
45*7c478bd9Sstevel@tonic-gate 	179,	181,	191,	193,	197,	/* 40 - 44 */
46*7c478bd9Sstevel@tonic-gate 	199,	211,	223,	227,	229,	/* 45 - 49 */
47*7c478bd9Sstevel@tonic-gate 	233,	239,	241,	251,	257,	/* 50 - 54 */
48*7c478bd9Sstevel@tonic-gate 	263,	269,	271,	277,	281,	/* 55 - 59 */
49*7c478bd9Sstevel@tonic-gate 	283,	293,	307,	311,	313,	/* 60 - 64 */
50*7c478bd9Sstevel@tonic-gate 	317,	331,	337,	347,	349,	/* 65 - 69 */
51*7c478bd9Sstevel@tonic-gate 	353,	359,	367,	373,	379,	/* 70 - 74 */
52*7c478bd9Sstevel@tonic-gate 	383,	389,	397,	401,	409,	/* 75 - 79 */
53*7c478bd9Sstevel@tonic-gate 	419,	421,	431,	433,	439,	/* 80 - 84 */
54*7c478bd9Sstevel@tonic-gate 	443,	449,	457,	461,	463,	/* 85 - 89 */
55*7c478bd9Sstevel@tonic-gate 	467,	479,	487,	491,	499,	/* 90 - 94 */
56*7c478bd9Sstevel@tonic-gate 	503,	509,	521,	523,	541,	/* 95 - 99 */
57*7c478bd9Sstevel@tonic-gate 	547,	557,	563,	569,	571,	/* 100 - 104 */
58*7c478bd9Sstevel@tonic-gate 	577,	587,	593,	599,	601,	/* 105 - 109 */
59*7c478bd9Sstevel@tonic-gate 	607,	613,	617,	619,	631,	/* 110 - 114 */
60*7c478bd9Sstevel@tonic-gate 	641,	643,	647,	653,	659,	/* 115 - 119 */
61*7c478bd9Sstevel@tonic-gate 	661,	673,	677,	683,	691,	/* 120 - 124 */
62*7c478bd9Sstevel@tonic-gate 	701,	709,	719,	727,	733,	/* 125 - 129 */
63*7c478bd9Sstevel@tonic-gate 	739,	743,	751,	757,	761,	/* 130 - 134 */
64*7c478bd9Sstevel@tonic-gate 	769,	773,	787,	797,	809,	/* 135 - 139 */
65*7c478bd9Sstevel@tonic-gate 	811,	821,	823,	827,	829,	/* 140 - 144 */
66*7c478bd9Sstevel@tonic-gate 	839,	853,	857,	859,	863,	/* 145 - 149 */
67*7c478bd9Sstevel@tonic-gate 	877,	881,	883,	887,	907,	/* 150 - 154 */
68*7c478bd9Sstevel@tonic-gate 	911,	919,	929,	937,	941,	/* 155 - 159 */
69*7c478bd9Sstevel@tonic-gate 	947,	953,	967,	971,	977,	/* 160 - 164 */
70*7c478bd9Sstevel@tonic-gate 	983,	991,	997,	1009,	1013,	/* 165 - 169 */
71*7c478bd9Sstevel@tonic-gate 	1019,	1021,	1031,	1033,	1039,	/* 170 - 174 */
72*7c478bd9Sstevel@tonic-gate 	1049,	1051,	1061,	1063,	1069,	/* 175 - 179 */
73*7c478bd9Sstevel@tonic-gate 	1087,	1091,	1093,	1097,	1103	/* 180 - 184 */
74*7c478bd9Sstevel@tonic-gate };
75*7c478bd9Sstevel@tonic-gate 
76*7c478bd9Sstevel@tonic-gate static const int	index[] = {
77*7c478bd9Sstevel@tonic-gate 	1,	/*    0:   3 */
78*7c478bd9Sstevel@tonic-gate 	24,	/*  100:  97 */
79*7c478bd9Sstevel@tonic-gate 	45,	/*  200: 199 */
80*7c478bd9Sstevel@tonic-gate 	61,	/*  300: 293 */
81*7c478bd9Sstevel@tonic-gate 	77,	/*  400: 397 */
82*7c478bd9Sstevel@tonic-gate 	94,	/*  500: 499 */
83*7c478bd9Sstevel@tonic-gate 	108,	/*  600: 599 */
84*7c478bd9Sstevel@tonic-gate 	124,	/*  700: 691 */
85*7c478bd9Sstevel@tonic-gate 	138,	/*  800: 797 */
86*7c478bd9Sstevel@tonic-gate 	153,	/*  900: 887 */
87*7c478bd9Sstevel@tonic-gate 	167	/* 1000: 997 */
88*7c478bd9Sstevel@tonic-gate };
89*7c478bd9Sstevel@tonic-gate 
90*7c478bd9Sstevel@tonic-gate #define	MAX_INDEX_INDEX	10
91*7c478bd9Sstevel@tonic-gate #define	MAX_PRIME_INDEX	184
92*7c478bd9Sstevel@tonic-gate #define	START_SEARCH_INDEX	10	/* 31:  31 * 31 = 961 */
93*7c478bd9Sstevel@tonic-gate 
94*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
95*7c478bd9Sstevel@tonic-gate }
96*7c478bd9Sstevel@tonic-gate #endif
97*7c478bd9Sstevel@tonic-gate 
98*7c478bd9Sstevel@tonic-gate #endif /* _GNU_PRIME_H */
99