summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/msgcc.1
blob: 313d06637d32b225d2bf4a4697e334fd06f8a9f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
'\" te
.\" Copyright (c) 2000-2007 AT&T Knowledge Ventures
.\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
.\" Portions Copyright (c) 2007, Sun Microsystems, Inc.
.TH MSGCC 1 "Oct 9, 2007"
.SH NAME
msgcc \- C language message catalog compiler
.SH SYNOPSIS
.LP
.nf
\fBmsgcc\fR [\fB-M-\fR\fIoption\fR] [\fBcc-options\fR\fIoption\fR] \fIfile...\fR
.fi

.SH DESCRIPTION
.sp
.LP
\fBmsgcc\fR is a C language message catalog compiler. It accepts \fBcc\fR style
options and arguments.
.sp
.LP
A \fBmsgcpp\fR(1) \fB\&.mso\fR file is generated for each input \fB\&.c\fR
file. If the \fB-c\fR option is not specified then a \fBgencat\fR(1)
format .\fBmsg\fR file is generated from the input \fB\&.mso\fR and \fB\&.msg\fR
files. If \fB-c\fR is not specified then a \fB\&.msg\fR suffix is appended to
the \fB-o\fR file if it doesn't already have a suffix. The default output is
\fBa.out.msg\fR if \fB-c\fR and \fB-o\fR are not specified.
.sp
.LP
If \fB-M-new\fR is not specified then messages are merged with those in the
pre-existing \fB-o\fR file.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fIcc-options\fR\fR
.ad
.RS 14n
Specify \fBcc\fR style options and arguments.
.RE

.sp
.ne 2
.na
\fB\fB-M-\fR\fIoption\fR\fR
.ad
.RS 14n
Set a \fBmsgcc\fR option.
.sp
Specify option as one of the following:
.sp
.ne 2
.na
\fB\fBmkmsgs\fR\fR
.ad
.RS 18n
The \fB-o\fR file is assumed to be in \fBmkmsgs\fR(1) format.
.RE

.sp
.ne 2
.na
\fB\fBnew\fR\fR
.ad
.RS 18n
Create a new \fB-o\fR file.
.RE

.sp
.ne 2
.na
\fB\fBpreserve\fR\fR
.ad
.RS 18n
Messages in the \fB-o\fR file that are not in new \fB\&.msg\fR file arguments
are preserved. The default is to either reuse the message numbers with new
message text that is similar to the old or to delete the message text, leaving
an unused message number.
.RE

.sp
.ne 2
.na
\fB\fBset=\fR\fInumber\fR\fR
.ad
.RS 18n
Set the message set number to \fInumber\fR. The default is \fB1\fR.
.RE

.sp
.ne 2
.na
\fB\fBsimilar=\fR\fInumber\fR\fR
.ad
.RS 18n
The message text similarity message threshold. The similarity measure between
old and new message text is:
.sp
.in +2
.nf
100*(2*gzip(\fIold\fR+\fInew\fR)\e
     /(gzip(\fIold\fR)+gzip(\fInew\fR))-1)
.fi
.in -2
.sp

where \fBgzip(\fR\fIx\fR\fB)\fR is the size of text \fIx\fR when compressed by
\fBgzip\fR. The default threshold is \fB$__similar__$.A\fR threshold of \fB0\fR
turns off message replacement, but unused old messages are still deleted. Use
\fB-M-preserve\fR to preserve all old messages.
.RE

.sp
.ne 2
.na
\fB\fBverbose\fR\fR
.ad
.RS 18n
Trace similar message replacements on the standard error.
.RE

.RE

.SH OPERANDS
.sp
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIfile\fR\fR
.ad
.RS 8n
Specifies the name of the file on which \fBmsgcc\fR operates.
.RE

.SH EXIT STATUS
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
An error occurred.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRUsing \fBmsgcc\fR
.sp
.LP
The following example uses \fBmsgcc\fR to extract localizable strings from the
file \fBhello.c\fR, marked using \fBERROR_dictionary()\fR, writes them to the
file \fBhello.mso\fR, and creates a \fBgencat\fR format \fBxxx.msg\fR file:

.sp
.in +2
.nf
example% cat hello.c

#include <stdio.h>
#include <stdlib.h>

/*
 * dummy macro to avoid including
 * libast headers
 */
#define ERROR_dictionary(x) x

int main(int ac, char *av[])
{
        puts( ERROR_dictionary("hello world") );
        return( EXIT_SUCCESS );
}

example% msgcc -o xxx -D__STDC__ -D__i386 hello.c

example% cat hello.mso
str "hello world"

example% cat xxx.msg
$ xxx message catalog
$translation msgcc 2007-09-25
$set 1
$quote "
1 "hello world"
.fi
.in -2
.sp

.SH AUTHORS
.sp
.LP
Glenn Fowler, \fBgsf@research.att.com\fR
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Volatile
.TE

.SH SEE ALSO
.sp
.LP
\fBcpp\fR(1), \fBgencat\fR(1), \fBmkmsgs\fR(1), \fBmsggen\fR(1),
\fBmsgcpp\fR(1), \fBmsgcvt\fR(1), \fBattributes\fR(5)