4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
30 #pragma ident "%Z%%M% %I% %E% SMI"
39 int decode(long, long *);
45 #define U (BYTE*sizeof (unsigned))
46 #define L (BYTE*sizeof (long))
59 y
|= (long)table
[tp
++] << empty
;
62 y
|= table
[tp
]>>i
-empty
;
64 (((unsigned long)1 << (BYTE
* sizeof (y
) - 1)) - 1), &w1
);
76 main(int argc
, char **argv
)
82 /* Set locale environment variables local definitions */
83 (void) setlocale(LC_ALL
, "");
84 #if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
85 #define TEXT_DOMAIN "SYS_TEST" /* Use this only if it wasn't */
87 (void) textdomain(TEXT_DOMAIN
);
90 (void) fread((char *)hindex
, sizeof (*hindex
), NI
, stdin
);
91 table
= (unsigned *)malloc(hindex
[NI
-1]*sizeof (*table
));
92 (void) fread((char *)table
, sizeof (*table
), hindex
[NI
-1], stdin
);
93 for (i
= 0; i
< NI
-1; i
++) {
95 v
= (long)i
<<(HASHWIDTH
-INDEXWIDTH
);
96 for (wp
= hindex
[i
]; wp
< hindex
[i
+1]; ) {
97 if (wp
== hindex
[i
] && bp
== U
)
104 if (wp
> hindex
[i
+1] ||
105 wp
== hindex
[i
+1] && bp
< U
)
108 (void) printf("%.9lo\n", v
);