michael@0: /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #ifndef __UMAP__ michael@0: #define __UMAP__ michael@0: michael@0: #define NOMAPPING 0xfffd michael@0: michael@0: enum { michael@0: uFormat0Tag = 0, michael@0: uFormat1Tag, michael@0: uFormat2Tag, michael@0: uNumFormatTag michael@0: }; michael@0: michael@0: typedef struct { michael@0: uint16_t srcBegin; /* 2 byte */ michael@0: uint16_t srcEnd; /* 2 byte */ michael@0: uint16_t destBegin; /* 2 byte */ michael@0: } uFormat0; michael@0: michael@0: typedef struct { michael@0: uint16_t srcBegin; /* 2 byte */ michael@0: uint16_t srcEnd; /* 2 byte */ michael@0: uint16_t mappingOffset; /* 2 byte */ michael@0: } uFormat1; michael@0: michael@0: typedef struct { michael@0: uint16_t srcBegin; /* 2 byte */ michael@0: uint16_t srcEnd; /* 2 byte -waste */ michael@0: uint16_t destBegin; /* 2 byte */ michael@0: } uFormat2; michael@0: michael@0: typedef struct { michael@0: union { michael@0: uFormat0 format0; michael@0: uFormat1 format1; michael@0: uFormat2 format2; michael@0: } fmt; michael@0: } uMapCell; michael@0: michael@0: #define UMAPCELL_SIZE (3*sizeof(uint16_t)) michael@0: michael@0: typedef struct { michael@0: uint16_t itemOfList; michael@0: uint16_t offsetToFormatArray; michael@0: uint16_t offsetToMapCellArray; michael@0: uint16_t offsetToMappingTable; michael@0: uint16_t data[1]; michael@0: } uTable; michael@0: michael@0: #endif