DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

insertmsg(CP)


insertmsg -- separate strings from program logic

Syntax

insertmsg -m [message_number] -v [strfile]...

Description

Given a list of C strings contained in input file strfile (which is assumed to be a string list file produced by findstr(CP)), insertmsg(CP) will prepare the identified C source files for message catalogue localization. This is achieved by replacing all string constants (as found in strfile) with calls to the catgets() subroutine, which retrieves localized files from a natural message catalogue at run time. A new version of each C source file is produced with the characters nl_ prepended to the original file names (received from strfile). In addition to calls of catgets(), these new source files will also have the following lines inserted:
   # include <nl_types.h>
   #define  NL_SETN  setnum
   extern   nl_catd  _m_catd;
   extern   char     *catgets();
insertmsg does not perform insertion of message catalogue accessing functions. In addition to creating a new source file, insertmsg writes a message source file on the standard output, which can be used as the input to gencat(CP), or for natural language localizations of the message text. insertmsg does not check string file syntax.

insertmsg recognizes the following options:


-m message_number
Set the first message number to be message_number (the default value is 1 if -m is not present).

-v
Set verbose mode.

strfile is a data file containing lines in the format:

filename pos len "...message text..."


Example

Given an input file, test.c, the command

findstr test.c > strfile.test

will generate a string list for test.c. The command

insertmsg strfile.test

will generate a new file nl_test.c with catgets() subroutines, and output the string list (starting from 1, unless -m is used) used in the catalogue on standard output.

Return values


0
on success

1
on failure

Warnings

Possible truncation of the nl_file base filename.

See also

findstr(CP), gencat(CP)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005