strmerge.1int
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1INT 代码 · 共 205 行
1INT
205 行
.TH strmerge 1int.SH Namestrmerge \- batch string replacement.SH Syntax.B strmerge[.B \-m.I prefix] [.B \-p.I patternfile] [ .B \-s .I string].I source-program....SH Description.NXR "strmerge utility"The .PN strmergecommand reads the strings specified in the message file produced by.PN strextractand replaces those strings with calls to the message file in the source program to create a new source program. The new version of source program has the same name as the input source program, with the prefix nl_. For example, if the input source program is named .PN prog.c , the output source program is named .PN \&nl_prog.c . You use this command to replace hard-coded messages (text strings identified by the.PN strextractcommand) with calls to the .PN catgets function and to create a source message catalog file. The source message catalog contains the text for each message extracted from your input sourceprogram. The .PN strmergecommand names the file by appending .msf to the name of the input source program. For example, the source message catalog for the .PN prog.c program is named.PN prog.msf .You can use the source message catalog as input to the .PN gencatcommand..PPAt run time, the program reads the message text from the message catalog. By storing messages in a message catalog, instead of your program, you allow the text of messages to be translated to a new language or modified without the source program being changed..PPIn the .I source-programargument, you name one or more source programs for which you want stringsreplaced. The .PN strmergecommand does not replace messages for source programs included using the .PN #includedirective. Therefore, you might want a source program and all the sourceprograms it includes on a single.PN strmerge command line..PPYou can create a patterns file (as specified by .I patternfile) to control how the .PN strmerge command replaces text. The patterns file is divided into several sections,each of which is identified by a keyword. The keyword must start at thebeginning of a new line, and its first character must be a dollar sign ($).Following the identifier, you specify a number of patterns. Each patternbegins on a new line and follows the regular expression syntax you use inthe .PN ed editor. For more information on the patterns file, see the.MS patterns 5intreference page..SH Options.IP \fB\-m\fR 5Add.I prefixto message numbers in the output source program and source message catalog.You can use this prefix as a mnemonic. You must process source message catalogs that contain number prefixes using the .PN gencat \-hoption. Message numbers will be in the form:.EX<prefix><msg_num>.EE.IPSet numbers will be in the form:.EXS_<prefix><set_num>.EE .IP If you process your input source program with this option, the resulting source program and source message catalog may not be portable. For more information, see the \fIGuide to Developing International Software\fP..IP \fB-p\fP 5Use .I patternfileto match strings in the input source program. By default, the command searches for the pattern filein the current directory, your home directory and finally.PN /usr/lib/intln ..IPIf you omit the.PN \-poption, the .PN strmergecommand uses a default patterns file that is stored in.PN /usr/lib/intln/patterns ..IP \fB\-s\fR 5Write .I string at the top of the source message catalog. If you omit the.PN \-s option, .PN strmergeuses the string specified in the .PN $CATHEADsection of the patterns file..SH RestrictionsYou can specify only one rewrite string for all classes of pattern matches..PPThe .PN strmergecommand does not verify if the message text filematches the source file being rewritten..PPThe .PN strmergecommand does not replace strings to files included with.PN #includedirective. You must run the.PN strmergecommand on these files separately..SH ExamplesThe following produces a message file.PN prog.catfor a program called.PN prog.c ..EX% strextract \-p c_patterns prog.c prog2.c% vi prog.msg% strmerge \-p c_patterns prog.c prog2.c% gencat prog.cat prog.msf% vi nl_prog.c% vi nl_prog2.c% cc nl_prog.c nl_prog2.c \-li.EE.PPIn this example, the.PN strextract command uses the .PN c_patterns file to determine which strings to match. The input source programs are named.PN prog.cand.PN prog2.c ..PPIf you need to remove any of the messages or extract one of the created strings, edit the resulting message file, .PN prog.msg .Under no conditions should you add to this file. Doing so could result in unpredictable behavior..PPYou issue the .PN strmergecommand to replace the extracted strings with calls to the message catalog.In response to this command, .PN strmerge creates the source message catalogs,.PN prog.msfand .PN prog2.msf ,and the output source programs,.PN nl_prog.cand .PN nl_prog2.c ..PPBefore compiling the source programs, you must edit .PN nl_prog.cand.PN nl_prog2.cto include the appropriate .PN catopenand .PN catclosefunction calls..PPThe .PN gencatcommand creates a message catalog and the .PN cccommand creates an executable program..SH See Alsointro(3int), extract(1int), gencat(1int), strextract(1int), trans(1int),regex(3), catopen(3int), catgets(3int), patterns(5int).br\fIGuide to Developing International Software\fP
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?