Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ insertmsg(1) — HP-UX 5.50

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] [−nnumber] stringlist

DESCRIPTION

Insertmsg examines the file stringlist, which is assumed to be the output of findstr 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 1
#include <nl_types.h>
#endif NLS

If the set number of the message(s) associated with the string(s) is other than 1, the definition of NL_SETN should be edited to correspond.  Then for each line in stringlist, insertmsg surrounds the string with an expression of the form:

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

where 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 messages are numbered consecutively, starting with the number defined in the −n option.  The default starting message number is 1.  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 catalogue",0);

where nl_catd is defined in <nl_types.h> and nlmsg_fd is a parameter to catgets, inserted for each string from stringlist.

Insertmsg also places on the standard output a file that can be used as input to gencat(1). Again, manual editing is required to define the $set number to match the NL_SETN definition. 

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 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 will output default string if the message retrieval was unsuccessful for any reason, whereas catgets will revert to default string only in the case of an unsuccessful attempt to open the message catalogue.  Any other failed attempt to retrieve the message will result in the output of a null string. 

Nl_catd is a data type defined in <nl_types.h>, which defines the message catalogue file descriptor.  The user may need to manually add to the file created by insertmsg the following statement:

#include <nl_types.h>

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

HARDWARE DEPENDENCIES

Series 200, 300, 500
The −h and −n options are not supported. 

Insertmg places the following lines at the beginning of each files named in stringlist:

#ifndef NLS
#define nl_msg(i, s) (s)
#else NLS
#define NL_SETN 1/* set number */
#include <msgbuf.h>
#endif NLS

For each line in stringlist, insertmsg surrounds the string with an expression of the form:

((nl_msg(1, "saved string"))

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_name.c where the original file name was name.c. The user must manually edit the file nl_name.c to insert the following statement:

nl_catopen("/*appropriate message catalogue*/");

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. 

Hewlett-Packard Company  —  Version B.1,  May 11, 2021

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