insertmsg(CP) 6 January 1993 insertmsg(CP) Name insertmsg - separate strings from program logic Syntax insertmsg -m [messagenumber] -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 locali- zation. This is achieved by replacing all string constants (as found in strfile) with calls to the catgets() subroutine, which retrieves local- ized 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 func- tions. 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 messagenumber Set the first message number to be messagenumber (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 catalo- gue on standard output. Return values 0 on success 1 on failure Warnings Possible truncation of the nlfile base filename. See also findstr(CP), gencat(CP)