Browse Prior Art Database

Data Structure Scheme to Support Re-entrant X/Open Catalog Routines System Calls in OS/2

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

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 catalog data structures to support the 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 47% of the total text.

Data Structure Scheme to Support Re-entrant X/Open Catalog Routines
System Calls 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 catalog
data structures to support the X/Open*** catalog functions,
catopen(), catgets() and catclose() in OS/2.

      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.

      As defined in the X/Open manual "System Interface and Headers"
(chapter 5), catalog files contain formatted text messages.  They are
generated by the gencat utility which converts an ASCII message text
file into a formatted catalog file.  Each catalog file can contain
one or more sets of messages.  A set is a group of messages
associated with a component or sub-component in a system.  Messages
can be retreived from a catalog file by specifying the name of the
catalog file, its message set-number and its message-number in the
set.

      This invention provides a data structure scheme that can be
used to design algorithms for very close emulation of the X/Open
catalog messaging system routines in OS/2.  The scheme is based on
the following requirements:

o   A process can have multiple catalog files open at the same time.

o   A catalog file can be opened or closed multiple times by
     maintaining a use-count variable.

o   A catalog file name can be as large as what OS/2 can handle.

o   A catalog descriptor handle to use with the catalog routines.

o   A data structure to store the messages in memory.

The catalog data structures:

      All key catalog data structures have been defined in a header
file called nl_types.h.  This header file is compatible with the UNIX
nl_types.h and should be included in all OS/2 modules that call the
catalog routines.  The header file contains the following
definitions:

   #define MAX_FULL_PATH 260 /* The MAX full-path-name for an OS/2 */
                                /* file */
      #define NL_SETD 1 /* default set-id */

      typedef struct cat_set_t_ {
       char **messages ; /* the messages are stored in this 2-D array
*/
       unsigned short num_messages ; /* number of messages */
     } cat_set_t ;

      The above data type contains a 2-D array to store text messages
belonging to a set.  The first dimension ...