1.\" $OpenBSD: gencat.1,v 1.17 2010/09/03 11:09:28 jmc Exp $ 2.\" 3.\" Copyright (c) 1997 Ken Stailey 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 3. The name of the author may not be used to endorse or promote products 14.\" derived from this software without specific prior written permission 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26.\" 27.\" $Id: gencat.1,v 1.17 2010/09/03 11:09:28 jmc Exp $ 28.\" 29.Dd $Mdocdate: September 3 2010 $ 30.Dt GENCAT 1 31.Os 32.Sh NAME 33.Nm gencat 34.Nd NLS catalog compiler 35.Sh SYNOPSIS 36.Nm gencat 37.Ar catfile msgfile ... 38.Sh DESCRIPTION 39The 40.Nm 41utility merges the text NLS (National Language Support) in 42.Ar msgfile 43into a formatted message catalog file 44.Ar catfile . 45The file 46.Ar catfile 47will be created if it does not already exist. 48If 49.Ar catfile 50does exist, its messages will be included in the new 51.Ar catfile . 52If set and message numbers collide, the new message text defined in 53.Ar msgfile 54will replace the old message text currently contained in 55.Ar catfile . 56.Sh INPUT FILES 57The format of a message text source file is defined below. 58Note that the fields of a message text source line are separated by a 59single space character; any other space characters are considered to be 60part of the field contents. 61.Pp 62.Bl -tag -width Ds 63.It Li $set Ar n comment 64This line specifies the set identifier of the following messages until 65the next 66.Li $set 67or end-of-file appears. 68The argument 69.Ar n 70is the set identifier which is defined as a number in the range 71.Bo 1 , 72.Dv NL_SETMAX Bc . 73Set identifiers must occur in ascending order within 74a single source file, but need not be contiguous. 75Any string following 76a space following the set identifier is treated as a comment. 77If no 78.Li $set 79directive is specified in a given source file, all messages will 80be located in the default message set 81.Dv NL_SETD . 82.It Li $del Ar n comment 83This line deletes messages from set 84.Ar n 85from a message catalog. 86The 87.Ar n 88specifies a set number. 89Any string following a space following the set 90number is treated as a comment. 91.It Li $ Ar comment 92A line beginning with 93.Li $ 94followed by a space is treated as a comment. 95.It Ar m message-text 96A message line consists of a message identifier 97.Ar m 98in the range 99.Bo 1 , 100.Dv NL_MSGMAX Bc . 101The 102.Ar message-text 103is stored in the message catalog with the set identifier specified by 104the last 105.Li $set 106directive, and the message identifier 107.Ar m . 108If the 109.Ar message-text 110is empty, and there is a space character following the message identifier, 111an empty string is stored in the message catalog. 112If the 113.Ar message-text 114is empty, and if there is no space character following the message 115identifier, then the existing message in the current set with the 116specified message identifier is deleted from the catalog. 117Message identifiers must be in ascending order within a single set, but 118need not be contiguous. 119The 120.Ar message-text 121length must be in the range 122.Bo 0 , 123.Dv NL_TEXTMAX Bc . 124.It Li $quote Ar c 125This line specifies an optional quote character 126.Ar c 127which can be used to surround 128.Ar message-text 129so that trailing space or empty messages are visible in message 130source files. 131By default, or if an empty 132.Li $quote 133directive is specified, no quoting of 134.Ar message-text 135will be recognized. 136.El 137.Pp 138Empty lines in message source files are ignored. 139The effect of lines beginning with any character other than those 140described above is undefined. 141.Pp 142Text strings can contain the following special characters and escape 143sequences. 144In addition, if a quote character is defined, it may be 145escaped as well to embed a literal quote character. 146.Pp 147.Bl -tag -width Ds -offset indent -compact 148.It Li \en 149line feed 150.It Li \et 151horizontal tab 152.It Li \ev 153vertical tab 154.It Li \eb 155backspace 156.It Li \er 157carriage return 158.It Li \ef 159form feed 160.It Li \e\e 161backslash 162.It Li \eooo 163octal number in the range [000, 377] 164.El 165.Pp 166A backslash character immediately before the end of the line in a file 167is used to continue the line onto the next line, e.g., 168.Pp 169.Dl 1 This line is continued \e 170.Dl on this line. 171.Pp 172If the character following the backslash is not one of those specified, 173the backslash is ignored. 174.Sh EXIT STATUS 175.Ex -std gencat 176.Sh SEE ALSO 177.Xr catclose 3 , 178.Xr catgets 3 , 179.Xr catopen 3 180.Sh STANDARDS 181The 182.Nm 183utility is compliant with the 184.St -p1003.1-2008 185specification. 186.Sh AUTHORS 187.An -nosplit 188This manual page by 189.An Ken Stailey 190updated and revised by 191.An Terry Lambert . 192.Sh BUGS 193A message catalog file created from a blank input file can not be revised; 194it must be deleted and recreated. 195