overview.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
MS OS/2 Naming Conventions (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
 
                      MS OS/2 Naming Conventions (1.2)
 
In this data base, all parameter, variable, structure, field, and constant
names conform to MS OS/2 naming conventions. MS OS/2 naming conventions are
rules that define how to create names that indicate both the purpose and
data type of an item used with MS OS/2 system functions. These naming
conventions are used in this data base to help you readily identify the
purpose and type of the function parameters, structure fields, and
variables. These conventions are also used in most MS OS/2 sample program
sources to make the sources more readable and informative.
 
The following list briefly describes the MS OS/2 naming conventions:
 
Item           Convention
────────────────────────────────────────────────────────────────────────────
Variable, parameter, field
               All variable, parameter, and field names consist of up to
               three elements: a prefix, a base type, and a qualifier. The
               names always consist of at least a base type or a qualifier.
               In most cases, the name also includes a prefix. The base type
               identifies the data type of the item; the prefix specifies
               additional information, such as whether the item is a
               pointer, an array, or a count of bytes. The qualifier
               specifies the purpose of the item. All letters in the prefix
               and base type are lowercase. The letters in the qualifier are
               mixed-case (both uppercase and lowercase). When naming
               variables, the prefix and base type are optional for common
               integer types such as SHORT and USHORT.
 
Structure      All structure names consist of a word or phrase that
               specifies the purpose of the structure. All letters in the
               structure name are uppercase.
 
Constant       All constant names consist of a prefix (derived from the name
               of the function associated with the constant) and a word or
               phrase that specifies the meaning of the constant in terms of
               a value, action, color, or condition. All letters in the
               constant name are uppercase and an underscore (_) separates
               the prefix from the rest of the name.
 
Function name  All function names consist of a three-letter system prefix
               and a word or phrase that describes the action of the
               function. Each word in the function name starts with an
               uppercase letter. Verb and noun combinations, such as
               DosGetDateTime, are recommended.
 
The following examples show some of the standard prefix and base types you
will see in this data base:
 
/* Base Types */
 
BOOL fSuccess;      /* f    Boolean flag. TRUE if successful.    */
CHAR chChar;        /* ch   8-bit character.                     */
SHORT sRate;        /* s    16-bit signed integer.               */
LONG lDistance;     /* l    32-bit signed integer.               */
UCHAR uchScan;      /* uch  8-bit unsigned character.            */
USHORT usHeight;    /* us   16-bit unsigned integer.             */
ULONG ulWidth;      /* ul   32-bit unsigned integer.             */
BYTE bAttribute;    /* b    8-bit unsigned integer.              */
CHAR szName[];      /* sz   Zero-terminated array of characters. */
BYTE fbMask;        /* fb   Array of flags in a byte.            */
USHORT fsMask;      /* fs   Array of flags in a short.           */
ULONG flMask;       /* fl   Array of flags in a long.            */
SEL selSegment;     /* sel  16-bit segment selector.             */
 
/* Prefixes */
 
PCH pchBuffer;      /* p    32-bit far pointer to a given type.  */
NPCH npchBuffer;    /* np   16-bit near pointer to a given type. */
CHAR achData[1];    /* a    Array of a given type.               */
USHORT ichIndex;    /* i    Index to an array of a given type.   */
USHORT cb;          /* c    Count of items of a given type.      */
HFILE hf;           /* hf   Handle identifying a given object.   */
USHORT offSeg;      /* off  Offset.                              */
USHORT idSession;   /* id   Identifier of a given object.        */
 
                                      ♦