Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ insertmsg(1) — HP-UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

findstr(1)

gencat(1)

catgets(3C)

catopen(3C)

INSERTMSG(1)  —  HP-UX

NAME

insertmsg − use findstr(1) output to insert calls to catgets(3C)

SYNOPSIS

insertmsg [ −h ] [ −n number ] [ −i amount ] [ −s number ] stringlist

DESCRIPTION

Insertmsg examines the file stringlist, which is assumed to be the output of findstr(1) less any strings that do not need to be localized and have been removed by editing. If the −h option is specified, insertmsg places the following lines at the beginning of each file named in stringlist:

#ifndef NLS
#define catgets(i,sn,mn,s) (s)
#else NLS
#define NL_SETN number
#include <nl_types.h>
#endif NLS

The number is a set number defined by the -s option; the default is 1.  For each string in stringlist, insertmsg surrounds the string in the corresponding file with an expression of the form:

(catgets(nlmsg_fd,NL_SETN,msg_num,"default string"))

The default string is the original string referenced by the line in stringlist, and msg_num is replaced by the message number assigned to that string.  The assigned message numbers begin with the number defined in the −n option and are incremented by the amount defined in the −i option.  The default is 1 for both the starting message number and the increment.  If name.c is the file to be modified, as specified within the stringlist file, insertmsg places the modified source in nl_name.c.  The user must then manually edit the file nl_name.c to insert the following statements:

nl_catd nlmsg_fd;
nlmsg_fd = catopen("appropriate message catalog",0);

The data type nl_catd is defined in <nl_types.h> and nlmsg_fd is a parameter to the calls to catgets, which are inserted for each string from stringlist.

Insertmsg also sends to the standard output a file that can be used as input to gencat(1).

DIAGNOSTICS

If insertmsg does not find opening or closing double quotes where required in the strings file, it prints "insertmsg exiting : lost in strings file" and dies.  If this happens, check the strings file to ensure that the lines that have been kept there have not been altered. 

WARNINGS

Previous implementations of insertmsg inserted a call to nl_msg rather than catgets. Nl_msg outputs default string if the message retrieval is unsuccessful for any reason, whereas catgets reverts to default string only when it is unable to open the message catalog.  Any other failed attempt to retrieve the message results in the output of a null string. 

If the −h hoption is not used, the user may need to manually add the following statement to the file created by insertmsg:

#include <nl_types.h>

Insertmsg inserts a pointer to a static area that is overwritten on each call. 

AUTHOR

Insertmsg was developed by HP. 

SEE ALSO

findstr(1), gencat(1), catgets(3C), catopen(3C). 

INTERNATIONAL SUPPORT

8- and 16-bit data; 8-bit file names, messages. 

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026