/****************************************************************************/
/*                                                                          */
/*                       IBM/Microsoft Confidential                         */
/*                                                                          */
/*                 Copyright (c) IBM Corporation  1987, 1990                */
/*                 Copyright (c) Microsoft Corp.  1987, 1990                */
/*                           All Rights Reserved                            */
/*                                                                          */
/****************************************************************************/

/*
 * loadmsgs.h - include file for loading the loader message file.
 */

#define RESIDENT_MSG      0
#define DISCARDABLE_MSG   1

#define MAXRESIDENTPAGES  2
#define MAXDISCARDPAGES   2

#define INVALID_MSG      -1

/* ASM


Def_Message_Table MACRO   tablename
                  public      tablename,_&tablename
tablename           label   word
_&tablename         label   word
                    ?lastmsg = 0
                  ENDM


Def_Msg_Table_Entry MACRO msgno
                      if (?lastmsg NE 0)
                        .errnz (msgno LE ?lastmsg)
                      endif
                      dw msgno
                      dw 0       ;Null pointer to start with
                      ?lastmsg = msgno
                    ENDM


Def_Load_Message_Table MACRO
                       public      _Load_Message_Table
_Load_Message_Table      label word
                         ?lastmsg = 0
                       ENDM


Def_Load_Msg MACRO msgno,type
               if (?lastmsg NE 0)
                 .errnz (msgno LE ?lastmsg)
               endif
               dw msgno
               ifidni <type>,<Resident>
                 db RESIDENT_MSG
               else
                 db DISCARDABLE_MSG
               endif
               ?lastmsg = msgno
             ENDM

*/

typedef struct LoadMsgEntry
{
    unsigned short  MsgNumber;              // Message number
    unsigned char   MsgType;                // Message type (res, disc)
};

typedef struct MsgEntry
{
    unsigned short  MsgNo;                  // Message number
    char            *pMsg;                  // pointer to message
};

// message file header
typedef struct file_head
{
    char      signature_h[8];       // signature mark
    char      component_id[3];      // component id
    unsigned  msg_count;            // number of messages
    unsigned  base_mid;             // base message number
    char      offset_type;          // double(0) or single word (1)
    unsigned  version;
    unsigned  header_length;
    char      cp_type;              // SBCS code page (0) or DBCS (1)
    int       code_page;            // code page number
    char      reserved[8];
} head_t;
