1 .\" ident "%Z%%M% %I% %E% SMI"
2 .\" Copyright 2005 Sun Microsystems, Inc. All rights reserved.
3 .\" Use is subject to license terms.
4 .\"
5 .\" CDDL HEADER START
6 .\"
7 .\" The contents of this file are subject to the terms of the
8 .\" Common Development and Distribution License, Version 1.0 only
9 .\" (the "License"). You may not use this file except in compliance
10 .\" with the License.
11 .\"
12 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
13 .\" or http://www.opensolaris.org/os/licensing.
14 .\" See the License for the specific language governing permissions
15 .\" and limitations under the License.
16 .\"
17 .\" When distributing Covered Code, include this CDDL HEADER in each
18 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
19 .\" If applicable, add the following below this CDDL HEADER, with the
20 .\" fields enclosed by brackets "[]" replaced with your own identifying
21 .\" information: Portions Copyright [yyyy] [name of copyright owner]
22 .\"
23 .\" CDDL HEADER END
24 .\"
25 .if n .tr \--
26 .TH sgsmsg 1l "2 Jun 1999"
27 .SH NAME
28 sgsmsg \- generate message strings for SGS subsystem.
29 .SH SYNOPSIS
30 .B sgsmsg
31 [
32 .B \-cl
33 ] [
34 .BI \-d\0 "data"
35 ] [
36 .BI \-h\0 "defs"
37 ] [
38 .BI \-i\0 "ident"
39 ]
40 .if n .ti +5n
41 [
42 .BI \-m\0 "messages"
43 ] [
44 .BI \-n\0 "name"
45 ]
46 .I file \.\.\.
52 of collecting character strings within a code group such as an executable or
53 shared object. All character strings are captured into a single data array
54 within the \f2data\f1 file.
55 The data array is similar to that produced by
56 .BR xstr (1)),
57 and helps reduce the relocation overhead incurred by string pointers.
58 .LP
59 Indexes into the data array are generated as
60 definitions within the \f2defs\f1 file. The code group can reference each
61 character string via predefined macros.
62 .LP
63 The character strings may also be translated into an internationalized
64 format and captured in the
65 \f2messages\f1 file. By default these message strings are suitable for
66 .BR gettext (3I)
67 manipulation. The \f3\-c\f1 option provides for these message strings to be
68 translated into a form suitable for
69 .BR catgets (3C)
70 manipulation.
71 .SH OPERANDS
72 .LP
73 One of more input \f2file\f1s contains a definition for each character
74 string used by a particular code group. The interpretation of a
75 definition is determined by the first character of each line within
76 the input \f2file\f1:
77 .LP
78 .PD 0
79 .RS +4
80 .IP \(bu 3
81 Entries that begin with a \f3#\fI, \f3$\f1 or a newline are treated as
82 comments and are copied (as is) to the \f2messages\f1 file.
83 .IP \(bu 3
84 Entries that begin with a \f3@\f1 are translated and will be written to
85 one or more of the output files. Two translations are possible dependent upon
86 whether one or more tokens follow the \f3@\f1 character.
87 .RE
88 .PD
89 .sp
90 .LP
91 An \f4@\f1 character followed by a single token is interpreted as one of
92 two reserved message output
212 MSG_ID_LD 1 SUNW_OST_SGS
213 MSG_ID_LIBLD 2 SUNW_OST_SGS
214 MSG_ID_LIBLDDBG 3 SUNW_OST_SGS
215
216 .fi
217 .RE
218 .if t .bp
219 .LP
220 The following string definition \f2file\f1 defines a small number of
221 strings used by
222 .BR libld.so.2 :
223 .ta 2.2i
224 .RS
225 .nf
226 .ft 3
227
228 % cat libld.msg
229 .ft 1
230 .if t .sp 0.35
231 .if n .sp
232 # ident "%Z%%M% %I% %E% SMI"
233 .if t .sp 0.35
234 .if n .sp
235 @ _START_
236 .if t .sp 0.35
237 .if n .sp
238 # Message file for cmd/sgs/libld.
239 .if t .sp 0.35
240 .if n .sp
241 @ MSG_ID_LIBLD
242
243 # System call messages
244 .if t .sp 0.35
245 .if n .sp
246 @ MSG_SYS_OPEN "file %s: cannot open file: %s"
247 @ MSG_SYS_MMAP "file %s: cannot mmap file: %s"
248
249 # Symbol processing errors
250 .if t .sp 0.35
251 .if n .sp
252 @ MSG_SYM_DIFFTYPE "symbol `%s' has differing types:"
253 @ MSG_SYM_DIFFATTR "symbol `%s' has differing %s:\\n\\
254 \ \\t(file %s value=0x%x; file %s value=0x%x);"
400 .RS
401 .nf
402 .ft 3
403
404 #include <locale.h>
405
406 int
407 main(int argc, char ** argv)
408 {
409 \&\.\.\.\.\.\.
410 (void) setlocale(LC_MESSAGES, MSG_ORIG(MSG_STR_EMPTY));
411 (void) textdomain(MSG_ORIG(MSG_SUNW_OST_SGS));
412 \&\.\.\.\.\.\.
413 }
414
415 const char *
416 _ld_msg(int mid)
417 {
418 return (gettext(MSG_ORIG(mid)));
419 }
420 .sp
421 .SH "EXIT STATUS"
422 A non-zero error return indicates a processing error.
423 .RE
424 .PD
425 .SH "SEE ALSO"
426 .BR gencat (1),
427 .BR ld (1),
428 .BR msgfmt (1),
429 .BR catgets (3C),
430 .BR gettext (3I).
431 .br
432 .TZ LLM
433 .if n .tr \-\-
|
1 .\" Copyright 2005 Sun Microsystems, Inc. All rights reserved.
2 .\" Use is subject to license terms.
3 .\"
4 .\" CDDL HEADER START
5 .\"
6 .\" The contents of this file are subject to the terms of the
7 .\" Common Development and Distribution License, Version 1.0 only
8 .\" (the "License"). You may not use this file except in compliance
9 .\" with the License.
10 .\"
11 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
12 .\" or http://www.opensolaris.org/os/licensing.
13 .\" See the License for the specific language governing permissions
14 .\" and limitations under the License.
15 .\"
16 .\" When distributing Covered Code, include this CDDL HEADER in each
17 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
18 .\" If applicable, add the following below this CDDL HEADER, with the
19 .\" fields enclosed by brackets "[]" replaced with your own identifying
20 .\" information: Portions Copyright [yyyy] [name of copyright owner]
21 .\"
22 .\" CDDL HEADER END
23 .\"
24 .if n .tr \--
25 .TH sgsmsg 1ONBLD "Jun 2, 1999"
26 .SH NAME
27 sgsmsg \- generate message strings for SGS subsystem.
28 .SH SYNOPSIS
29 .B sgsmsg
30 [
31 .B \-cl
32 ] [
33 .BI \-d\0 "data"
34 ] [
35 .BI \-h\0 "defs"
36 ] [
37 .BI \-i\0 "ident"
38 ]
39 .if n .ti +5n
40 [
41 .BI \-m\0 "messages"
42 ] [
43 .BI \-n\0 "name"
44 ]
45 .I file \.\.\.
51 of collecting character strings within a code group such as an executable or
52 shared object. All character strings are captured into a single data array
53 within the \f2data\f1 file.
54 The data array is similar to that produced by
55 .BR xstr (1)),
56 and helps reduce the relocation overhead incurred by string pointers.
57 .LP
58 Indexes into the data array are generated as
59 definitions within the \f2defs\f1 file. The code group can reference each
60 character string via predefined macros.
61 .LP
62 The character strings may also be translated into an internationalized
63 format and captured in the
64 \f2messages\f1 file. By default these message strings are suitable for
65 .BR gettext (3I)
66 manipulation. The \f3\-c\f1 option provides for these message strings to be
67 translated into a form suitable for
68 .BR catgets (3C)
69 manipulation.
70 .SH OPERANDS
71 One of more input \f2file\f1s contains a definition for each character
72 string used by a particular code group. The interpretation of a
73 definition is determined by the first character of each line within
74 the input \f2file\f1:
75 .LP
76 .PD 0
77 .RS +4
78 .IP \(bu 3
79 Entries that begin with a \f3#\fI, \f3$\f1 or a newline are treated as
80 comments and are copied (as is) to the \f2messages\f1 file.
81 .IP \(bu 3
82 Entries that begin with a \f3@\f1 are translated and will be written to
83 one or more of the output files. Two translations are possible dependent upon
84 whether one or more tokens follow the \f3@\f1 character.
85 .RE
86 .PD
87 .sp
88 .LP
89 An \f4@\f1 character followed by a single token is interpreted as one of
90 two reserved message output
210 MSG_ID_LD 1 SUNW_OST_SGS
211 MSG_ID_LIBLD 2 SUNW_OST_SGS
212 MSG_ID_LIBLDDBG 3 SUNW_OST_SGS
213
214 .fi
215 .RE
216 .if t .bp
217 .LP
218 The following string definition \f2file\f1 defines a small number of
219 strings used by
220 .BR libld.so.2 :
221 .ta 2.2i
222 .RS
223 .nf
224 .ft 3
225
226 % cat libld.msg
227 .ft 1
228 .if t .sp 0.35
229 .if n .sp
230 @ _START_
231 .if t .sp 0.35
232 .if n .sp
233 # Message file for cmd/sgs/libld.
234 .if t .sp 0.35
235 .if n .sp
236 @ MSG_ID_LIBLD
237
238 # System call messages
239 .if t .sp 0.35
240 .if n .sp
241 @ MSG_SYS_OPEN "file %s: cannot open file: %s"
242 @ MSG_SYS_MMAP "file %s: cannot mmap file: %s"
243
244 # Symbol processing errors
245 .if t .sp 0.35
246 .if n .sp
247 @ MSG_SYM_DIFFTYPE "symbol `%s' has differing types:"
248 @ MSG_SYM_DIFFATTR "symbol `%s' has differing %s:\\n\\
249 \ \\t(file %s value=0x%x; file %s value=0x%x);"
395 .RS
396 .nf
397 .ft 3
398
399 #include <locale.h>
400
401 int
402 main(int argc, char ** argv)
403 {
404 \&\.\.\.\.\.\.
405 (void) setlocale(LC_MESSAGES, MSG_ORIG(MSG_STR_EMPTY));
406 (void) textdomain(MSG_ORIG(MSG_SUNW_OST_SGS));
407 \&\.\.\.\.\.\.
408 }
409
410 const char *
411 _ld_msg(int mid)
412 {
413 return (gettext(MSG_ORIG(mid)));
414 }
415 .RE
416 .sp
417 .SH "EXIT STATUS"
418 A non-zero error return indicates a processing error.
419 .PD
420 .SH "SEE ALSO"
421 .BR gencat (1),
422 .BR ld (1),
423 .BR msgfmt (1),
424 .BR catgets (3C),
425 .BR gettext (3C).
426 .if n .tr \-\-
|