Browse Prior Art Database

Method for Handling Messages when Porting Code from UNIX to OS/2

IP.com Disclosure Number: IPCOM000112041D
Original Publication Date: 1994-Apr-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 2 page(s) / 71K

Publishing Venue

IBM

Related People

Feigel, RA: AUTHOR [+2]

Abstract

Disclosed is a method for handling error messages and associated help text when porting code from UNIX* to OS/2**. A major goal of porting code across environments is to avoid making major logic changes to the code. OS/2 and UNIX have different methods for building and displaying messages and helps. If the above goal is to be met, it is desirable to continue to use the UNIX message-handling routines. This is satisfactory for the display of runtime messages, but does not address the display of associated help text. In order to preserve consistency within the OS/2 environment, the OS/2 help system needs to be utilized.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Method for Handling Messages when Porting Code from UNIX to OS/2

      Disclosed is a method for handling error messages and
associated help text when porting code from UNIX* to OS/2**.  A major
goal of porting code across environments is to avoid making major
logic changes to the code.  OS/2 and UNIX have different methods for
building and displaying messages and helps.  If the above goal is to
be met, it is desirable to continue to use the UNIX message-handling
routines.  This is satisfactory for the display of runtime messages,
but does not address the display of associated help text.  In order
to preserve consistency within the OS/2 environment, the OS/2 help
system needs to be utilized.

      Both systems use a message file with a different format to
build the respective message and help text binaries.  This leads to
the need for a message file for the OS/2 help system that contains
the same message information included in the UNIX source file, as
well as help text.  When changes are made or messages are added,
modification of two files is required.  This is always undesirable as
it leads to errors.

      The solution is to design a single source file that contains
both the message and help text and that satisfies the format
requirements of both systems such that binaries can be generated for
UNIX runtime support and OS/2 help support.  This is accomplished by
properly combining the two files.

      The GENCAT tool is used in the UNIX environment to generate
message binary from a message source file.  GENCAT inputs this file
and generates the binary that UNIX programs can access to display
messages.  Lines beginning with a "$" character, followed by a blank,
are considered comments to GENCAT, and are ignored.  Lines beginning
with numeric characters are taken as a message number followed by the
message text to be displayed.  An example of such a file follows:

     $set 1

     $ This is a comment

     1 Internal ...