Browse Prior Art Database

Implementation of the X/OPEN Message Catalog Functions in OS/2

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

Publishing Venue

IBM

Related People

Cuan, V: AUTHOR [+5]

Abstract

In the process of porting source code written for the UNIX* platform to the OS/2** platform, many Unix system calls will have to be emulated to avoid major design changes to the original source. The differences in the tasking model (processes vs threads) between the two operating systems make the emulation of the Unix catalog function calls quite challenging. This invention provides algorithms to implement the Unix X/Open*** catalog functions catopen, catgets and catclose in OS/2.

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

Implementation of the X/OPEN Message Catalog Functions in OS/2

      In the process of porting source code written for the UNIX*
platform to the OS/2** platform, many Unix system calls will have to
be emulated to avoid major design changes to the original source.
The differences in the tasking model (processes vs threads) between
the two operating systems make the emulation of the Unix catalog
function calls quite challenging.  This invention provides algorithms
to implement the Unix X/Open*** catalog functions catopen, catgets
and catclose in OS/2.

The X/Open catalog facility consists of three main components:

o   gencat - a utility that generates formatted catalog files from
    ASCII text files.

o   The catalog file data structures.

o   A library of catalog functions to open, read and close the
    catalog files.

      The gencat utility as defined in the X/Open "XSI Commands and
Utilities" guide is a tool which merges a message text source file
into a formatted catalog file.  Please refer to the above document
for information on gencat and also refer the "XSI System Interface
and Headers" guide for information on the catalog file format.  The
catalog data structures are defined in the article "A data structure
scheme to support re-entrant X/Open catalog routines".  These
structures are required for the implementation of the X/Open message
catalog routines described in the following sections.  The OS/2
operating system has its own messaging facility and associated APIs
to store and display messages.  Since there is no direct
correspondence between the formats of the two messaging systems, the
original Unix program code would have required major design changes
if we choose to use the OS/2 facility.  Hence, a decision was made to
port the required catalog messaging functions to OS/2.

      This invention provides a set of catalog routines, catopen(),
catgets() and catclose(), which can be used to operate on any catalog
file generated by the OS/2 gencat utility.  The original catalog
routines have been enhanced to do the following:

o   A process can have one or more catalog files open at any instant.

o   A catalog file can contain one or more message sets.

o   Multiple threads can open and use one or many catalog files.

o   The routines are re-entrant when multiple threads use the same
    file.

o   The files are not "really" closed till all threads have closed a
    file.

      An initial version of the gencat utility provided no support
for multiple message sets in a catalog file.  The utility was
enhanced to store multiple message sets in a catalog file.  The first
two bytes in the formatted catalog file stores the maximum number of
sets in the file.  Each message in a catalog file is then uniquely
identified by a set-number and a message-number.

The catalog messaging routines

To understand the algorithm used in each of the routines, it is
important to remember the following assump...