stc(1) - Linux man page

Name

stc - String table compiler

Synopsis

stc [<options>] <inputfile> <outputdirectory>

Description

The program converts a string table source file (*.str) into multiple binary string table files (*.stt) which can be used by the dkstt module in the libdkc library.

The output files are placed in the outputdirectory, the program creates a directory structure using languages and encoding (if available) for the subdirectory names.

Options

-p

writes plain (uncompressed) output files.

Return Value

The program returns an exit status 0 on success, all other status codes indicate errors.

Examples

Input file example

# This is an example string table file.
$version 1.0

"msg-hello"
de = "Guten Tag."
en = "Hello."
en_US = "Hi."

"msg-goodbye"
de = "Auf Wiedersehen."
en = "Goodbye."

Files

INPUT FILE SYNTAX

The input file consists of an optional file header and a list of sections.

The file header consists of a version string, it contains the ''$version'' keyword and a string table version number major.minor.

Each section consists of a section keyword (this keyword is used by the application to search for a matching string) in double quotes. The remainder of the section is a list of key/value pairs, key and value are separated by ''=''. The key is a language, language/region, language/encoding, or language/region/encoding combination. The structure of the key is the same as for the LANG environment variable, i.e. ''de'' or ''de_DE'' or ''de_DE.UTF-8''. The value is the string to return for the key.

OUTPUT FILE STRUCTURE

The output is a set of binary files, the files can be compressed using the zlib or bzip2 library.

Integer variables are stored in network byte order in the data stream.

The data stream consists of the following components:

File identifier, 7 bytes
The file identifier is the string '' STRT-2 '' followed by a 0x00 byte.
Major version number (major), 2 byte unsigned integer.
Minor version number (minor), 2 byte unsigned integer.
Number of entries (ne) , 2 byte unsigned integer.
Reserved (co), 2 byte unsigned integer.
This value is 0.
Keys array (ne times):
String length (sl), 2 byte unsigned integer.

The final 0x00 byte is included in the calculation.

String (sl bytes).

The final 0x00 byte is included in the data stream.

Values array (ne times):
String length (sl), 2 byte unsigned integer.

The final 0x00 byte is included in the calculation.

String (sl bytes).

The final 0x00 byte is included in the data stream.

All remaining contents of the data stream is ignored.

Author

Dirk Krause

Copyright And License

Copyright © 2010, Dirk Krause All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above
  copyright notice, this list of conditions and the
  following disclaimer.

* Redistributions in binary form must reproduce the above
  copyright notice, this list of conditions and the following
  disclaimer in the documentation and/or other materials
  provided with the distribution.

* Neither the name of the Dirk Krause nor the names of
  contributors may be used to endorse or promote products
  derived from this software without specific prior written
  permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF USE , DATA , OR PROFITS ; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE , EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE .

See Also

dkapp(3), dkstt(3), http://dktools.sourceforge.net/stc.html

Referenced By

dklibs(3)