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 2004 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
30 #pragma ident "%Z%%M% %I% %E% SMI"
42 #include <sys/types.h>
48 #include "gnu_errmsg.h"
55 #define _ENCODING_ALIAS_PATH "/usr/lib/iconv/alias"
56 #define DEST_CHARSET "UTF-8"
57 #define CHARSET_STR "charset="
59 #define NPLURALS_STR "nplurals="
60 #define NPLURALS_LEN 9
67 #define cur_po (po_names[cur_po_index])
70 off_t off
; /* offset to the string */
71 size_t len
; /* length of the string including null-termination */
72 unsigned int num
; /* line number */
76 int no
; /* # of plural forms */
77 unsigned int num
; /* line number */
78 char *str
; /* string */
79 size_t len
; /* length of the string including null-termination */
84 char *id
; /* msgid + (msgid_plural) */
85 char *str
; /* msgstr + (msgstr[n]) */
86 size_t id_len
; /* length of id */
87 size_t str_len
; /* length of str */
88 unsigned int hash
; /* hash value of msgid */
89 unsigned int num
; /* line number */
90 int po
; /* po index */
93 #define DEF_MSG_NUM 100
96 int header
; /* 1: header found, 0: header missing */
97 char *fname
; /* mo filename */
98 struct messages
*msg
; /* ptr to the messages struct array */
99 unsigned int nmsg
; /* # of messages */
100 unsigned int msg_size
; /* message_size */
101 unsigned int fnum
; /* # of fuzzy translations */
102 unsigned int unum
; /* # of untranslated msgs */
103 unsigned int hash_size
; /* hash table size */
104 unsigned int nplurals
; /* # of plural forms */
106 unsigned int thash_size
;
107 struct catalog
*next
; /* next catalog */
115 extern int yyparse(void);
116 extern int yylex(void);
117 extern void yyerror(const char *);
118 extern void handle_domain(char *);
119 extern void handle_comment(char *);
120 extern void handle_message(struct entry
*, struct entry
*);
121 extern void clear_state(void);
122 extern void po_init(const char *);
123 extern void po_fini(void);
124 extern void catalog_init(const char *);
126 extern struct messages
*search_msg(struct catalog
*,
127 const char *, unsigned int);
128 extern unsigned int hashpjw(const char *);
129 extern unsigned int find_prime(unsigned int);
130 extern void output_all_gnu_mo_files(void);
131 extern unsigned int get_hash_index(unsigned int *,
132 unsigned int, unsigned int);
133 extern void check_format(struct entry
*, struct entry
*, int);
135 extern char **po_names
;
136 extern int cur_po_index
;
138 extern char *inputdir
;
139 extern char *outfile
;
141 extern int fuzzy_flag
;
142 extern int verbose_flag
;
143 extern int strict_flag
;
144 extern struct catalog
*catalog_head
;
152 #endif /* _GNU_MSGFMT_H */