0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * CDDL HEADER START
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * The contents of this file are subject to the terms of the
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * Common Development and Distribution License, Version 1.0 only
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * (the "License"). You may not use this file except in compliance
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * with the License.
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * See the License for the specific language governing permissions
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * and limitations under the License.
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * When distributing Covered Code, include this CDDL HEADER in each
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * If applicable, add the following below this CDDL HEADER, with the
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * fields enclosed by brackets "[]" replaced with your own identifying
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * information: Portions Copyright [yyyy] [name of copyright owner]
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * CDDL HEADER END
44ed9dbbfa620821ecf59a131462082f628dd0f3Stephen Hanson * Copyright 2001, 2002 Sun Microsystems, Inc. All rights reserved.
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulow * Use is subject to license terms.
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi#pragma ident "%Z%%M% %I% %E% SMI"
0eb822a1c0c2bea495647510b75f77f0e57633ebcindisearch_msg(struct catalog *p, const char *id, unsigned int hash_val)
940d71d237794874e18a0eb72f6564821a823517eschrock return (&m[i - 1]);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi size_t id_len, str_len, id_off, str_off, ids_top, strs_top;
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi while (p) {
908f1e1388f616898b4e515d343c0414f2a6472esd if (p->nmsg == 0) {
908f1e1388f616898b4e515d343c0414f2a6472esd * no message in this file
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * skip generating a mo
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * Sort the message array
9dd0f810214fdc8e1af881a9a5c4b6927629ff9ecindi (int (*)(const void *, const void *))msg_cmp);
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth sizeof (unsigned int));
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi /* Setting Header info */
eae2e508a8e70b1ec407b10bd068c080651bbe5ckrishnae header.off_msgstr_tbl = sizeof (struct gnu_msg_info) +
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim for (i = 0; i < p->nmsg; i++) {
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim id_tbl = (struct msgtbl *)Xmalloc(sizeof (struct msgtbl) *
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim str_tbl = (struct msgtbl *)Xmalloc(sizeof (struct msgtbl) *
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim sizeof (unsigned int) * hash_size;
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim for (i = 0; i < p->nmsg; i++) {
e58a33b62cd4c9a6815fd752ce58b5f389289da1Stephen Hanson * Set the hash table
e58a33b62cd4c9a6815fd752ce58b5f389289da1Stephen Hanson idx = get_hash_index(hash_tbl, m[i].hash, hash_size);
e58a33b62cd4c9a6815fd752ce58b5f389289da1Stephen Hanson * rearrange msgid and msgstr
e58a33b62cd4c9a6815fd752ce58b5f389289da1Stephen Hanson (void) memcpy(ids + id_off, m[i].id, m[i].id_len);
e58a33b62cd4c9a6815fd752ce58b5f389289da1Stephen Hanson (void) memcpy(strs + str_off, m[i].str, m[i].str_len);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi /* NOTREACHED */
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi /* writing header */
skip:
free(p);
p = op;
if (verbose_flag) {