.fo off
#define DCR361 TRUE
#define BYTE char
#define WORD unsigned short
#define DWORD unsigned long
#define ReadNum(a,b) MyRead( a, (char *)&b, sizeof( b ) );
#define WriteNum(a,b) MyWrite( a, (char *)&b, sizeof( b ) );
#define ReadStr(a,b) MyRead( a, (char *)b, sizeof( b ) );
#define WriteStr(a,b) MyWrite( a, (char *)b, sizeof( b ) );
#define ByteCount(a) written += sizeof(a);
#define Addsizeof(a,b) a += sizeof(b);
#define SeekStart    0
#define SeekCurrent  1
#define SeekEnd      2
#define FNAMELEN 261
#define Step(a,b) printf("Step %5d:\n",a,b);
#define DIR(a) sprintf( Wrkline, "dir %s ", a );system( Wrkline );

struct fhext {
   WORD Length;               /* File Header Extension Length */
   WORD nFiles;                 /* Number File Definition Records */
   WORD pExt;                 /* Pointer to next definition */
};
struct LanguageType {
   BYTE CPTipe;
   WORD Country;
   WORD Family;                  /* Language Family ID */
   WORD Version;                 /* Language Version ID */
};
struct codepagetype {
   WORD Count;                   /* Code Page Count */
   WORD ID[16];                     /* Code Page ID pointer */
};
struct mkmsgf {
   BYTE Signature[8];
   BYTE Component[3];
   WORD MsgCount;
   WORD BaseMid;
   BYTE Indicator;
   WORD Version;
   WORD HeaderLen;
   WORD CPData;
   DWORD ExtHeader;
   BYTE Reserved[5];
};
typedef struct LanguageType  LangType   ;
typedef struct codepagetype CPType     ;
typedef struct msgfiledef    MsgDefType ;
typedef struct fhext ExtHeadType;
typedef struct mkmsgf MsgFormat;
struct msgfiledef {
   MsgDefType *pNext;
   MsgDefType *pNextDef;
   ExtHeadType Extended;
   LangType Language;
   CPType CodePage;
   char filename[FNAMELEN];
};
typedef struct msgfiledef MsgFileType ;

MsgFileType *wMsgFileTbl;
ExtHeadType ExtHeader;
long MsgSegLoc32;
char Wrkline[FNAMELEN+20];
char WrkExeName[FNAMELEN];                        /* @@6 */

void ReadCPData(MsgFileType *);
void ReadFileDef(MsgFileType *);
void CalcMsgSegSiz();
.fo on
