9070 Remove wanboot from gate
[unleashed.git] / usr / src / man / man1 / msgcc.1
blob313d06637d32b225d2bf4a4697e334fd06f8a9f5
1 '\" te
2 .\" Copyright (c) 2000-2007 AT&T Knowledge Ventures
3 .\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
4 .\" Portions Copyright (c) 2007, Sun Microsystems, Inc.
5 .TH MSGCC 1 "Oct 9, 2007"
6 .SH NAME
7 msgcc \- C language message catalog compiler
8 .SH SYNOPSIS
9 .LP
10 .nf
11 \fBmsgcc\fR [\fB-M-\fR\fIoption\fR] [\fBcc-options\fR\fIoption\fR] \fIfile...\fR
12 .fi
14 .SH DESCRIPTION
15 .sp
16 .LP
17 \fBmsgcc\fR is a C language message catalog compiler. It accepts \fBcc\fR style
18 options and arguments.
19 .sp
20 .LP
21 A \fBmsgcpp\fR(1) \fB\&.mso\fR file is generated for each input \fB\&.c\fR
22 file. If the \fB-c\fR option is not specified then a \fBgencat\fR(1)
23 format .\fBmsg\fR file is generated from the input \fB\&.mso\fR and \fB\&.msg\fR
24 files. If \fB-c\fR is not specified then a \fB\&.msg\fR suffix is appended to
25 the \fB-o\fR file if it doesn't already have a suffix. The default output is
26 \fBa.out.msg\fR if \fB-c\fR and \fB-o\fR are not specified.
27 .sp
28 .LP
29 If \fB-M-new\fR is not specified then messages are merged with those in the
30 pre-existing \fB-o\fR file.
31 .SH OPTIONS
32 .sp
33 .LP
34 The following options are supported:
35 .sp
36 .ne 2
37 .na
38 \fB\fIcc-options\fR\fR
39 .ad
40 .RS 14n
41 Specify \fBcc\fR style options and arguments.
42 .RE
44 .sp
45 .ne 2
46 .na
47 \fB\fB-M-\fR\fIoption\fR\fR
48 .ad
49 .RS 14n
50 Set a \fBmsgcc\fR option.
51 .sp
52 Specify option as one of the following:
53 .sp
54 .ne 2
55 .na
56 \fB\fBmkmsgs\fR\fR
57 .ad
58 .RS 18n
59 The \fB-o\fR file is assumed to be in \fBmkmsgs\fR(1) format.
60 .RE
62 .sp
63 .ne 2
64 .na
65 \fB\fBnew\fR\fR
66 .ad
67 .RS 18n
68 Create a new \fB-o\fR file.
69 .RE
71 .sp
72 .ne 2
73 .na
74 \fB\fBpreserve\fR\fR
75 .ad
76 .RS 18n
77 Messages in the \fB-o\fR file that are not in new \fB\&.msg\fR file arguments
78 are preserved. The default is to either reuse the message numbers with new
79 message text that is similar to the old or to delete the message text, leaving
80 an unused message number.
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fB\fBset=\fR\fInumber\fR\fR
87 .ad
88 .RS 18n
89 Set the message set number to \fInumber\fR. The default is \fB1\fR.
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fB\fBsimilar=\fR\fInumber\fR\fR
96 .ad
97 .RS 18n
98 The message text similarity message threshold. The similarity measure between
99 old and new message text is:
101 .in +2
103 100*(2*gzip(\fIold\fR+\fInew\fR)\e
104      /(gzip(\fIold\fR)+gzip(\fInew\fR))-1)
106 .in -2
109 where \fBgzip(\fR\fIx\fR\fB)\fR is the size of text \fIx\fR when compressed by
110 \fBgzip\fR. The default threshold is \fB$__similar__$.A\fR threshold of \fB0\fR
111 turns off message replacement, but unused old messages are still deleted. Use
112 \fB-M-preserve\fR to preserve all old messages.
116 .ne 2
118 \fB\fBverbose\fR\fR
120 .RS 18n
121 Trace similar message replacements on the standard error.
126 .SH OPERANDS
129 The following operands are supported:
131 .ne 2
133 \fB\fIfile\fR\fR
135 .RS 8n
136 Specifies the name of the file on which \fBmsgcc\fR operates.
139 .SH EXIT STATUS
141 .ne 2
143 \fB\fB0\fR\fR
145 .RS 6n
146 Successful completion.
150 .ne 2
152 \fB\fB>0\fR\fR
154 .RS 6n
155 An error occurred.
158 .SH EXAMPLES
160 \fBExample 1 \fRUsing \fBmsgcc\fR
163 The following example uses \fBmsgcc\fR to extract localizable strings from the
164 file \fBhello.c\fR, marked using \fBERROR_dictionary()\fR, writes them to the
165 file \fBhello.mso\fR, and creates a \fBgencat\fR format \fBxxx.msg\fR file:
168 .in +2
170 example% cat hello.c
172 #include <stdio.h>
173 #include <stdlib.h>
176  * dummy macro to avoid including
177  * libast headers
178  */
179 #define ERROR_dictionary(x) x
181 int main(int ac, char *av[])
183         puts( ERROR_dictionary("hello world") );
184         return( EXIT_SUCCESS );
187 example% msgcc -o xxx -D__STDC__ -D__i386 hello.c
189 example% cat hello.mso
190 str "hello world"
192 example% cat xxx.msg
193 $ xxx message catalog
194 $translation msgcc 2007-09-25
195 $set 1
196 $quote "
197 1 "hello world"
199 .in -2
202 .SH AUTHORS
205 Glenn Fowler, \fBgsf@research.att.com\fR
206 .SH ATTRIBUTES
209 See \fBattributes\fR(5) for descriptions of the following attributes:
214 box;
215 c | c
216 l | l .
217 ATTRIBUTE TYPE  ATTRIBUTE VALUE
219 Interface Stability     Volatile
222 .SH SEE ALSO
225 \fBcpp\fR(1), \fBgencat\fR(1), \fBmkmsgs\fR(1), \fBmsggen\fR(1),
226 \fBmsgcpp\fR(1), \fBmsgcvt\fR(1), \fBattributes\fR(5)