INSERTMSG(1) — HP-UX
NAME
insertmsg − use findstr(1) output to insert calls to getmsg(3C)
SYNOPSIS
insertmsg stringlist
DESCRIPTION
Insertmsg examines the file stringlist, which is assumed to be the output of findstr minus the strings which do not need to be localized and have been removed by editing. Insertmsg first places the line
#include <msgbuf.h>
at the beginning of each file named in stringlist. Then for each line in stringlist, it surrounds the string with an expression of the form
(*getmsg(nl_fd, nl_set_num, nl_msg_num, nl_msg_buf, NL_MBUFLN)
== ’\0’ ? "saved string" : nl_msg_buf)
which evaluates to the original string if the translation cannot be retrieved. The string buffer and other "nl_" variables and constants are defined in <msgbuf.h>. Insertmsg places the modified source on a file nl_xx.c where the original file name was xx.c. The user must then hand edit the file to insert a call
nl_catopen("/*appropriate message catalog*/");
and assign the proper value to nl_set_num.
Insertmsg also places on the standard output a file which can be used as input to gencat. Again, hand editing is required to define the $set number to match nl_set_num. Messages will automatically be numbered from 1 upward in the order that they appear in stringlist. The same number will also be placed in the call to getmsg(3C), as the parameter msg_num.
DIAGNOSTICS
If insertmsg does not find the opening or closing double quote where it expects it in the strings file, it prints "insertmsg exiting : lost in strings file" and dies. If this happens, check the strings file to make sure that the lines that have been kept there have not been altered.
SEE ALSO
findstr(1), gencat(1), getmsg(3C).
BUGS
Inserts a pointer to a static area which is overwritten on each call.
INTERNATIONAL SUPPORT
8- and 16-bit data, 8-bit filenames.
Hewlett-Packard Company — Version B.1, May 11, 2021