intl/uconv/util/umap.h

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

michael@0 1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5 #ifndef __UMAP__
michael@0 6 #define __UMAP__
michael@0 7
michael@0 8 #define NOMAPPING 0xfffd
michael@0 9
michael@0 10 enum {
michael@0 11 uFormat0Tag = 0,
michael@0 12 uFormat1Tag,
michael@0 13 uFormat2Tag,
michael@0 14 uNumFormatTag
michael@0 15 };
michael@0 16
michael@0 17 typedef struct {
michael@0 18 uint16_t srcBegin; /* 2 byte */
michael@0 19 uint16_t srcEnd; /* 2 byte */
michael@0 20 uint16_t destBegin; /* 2 byte */
michael@0 21 } uFormat0;
michael@0 22
michael@0 23 typedef struct {
michael@0 24 uint16_t srcBegin; /* 2 byte */
michael@0 25 uint16_t srcEnd; /* 2 byte */
michael@0 26 uint16_t mappingOffset; /* 2 byte */
michael@0 27 } uFormat1;
michael@0 28
michael@0 29 typedef struct {
michael@0 30 uint16_t srcBegin; /* 2 byte */
michael@0 31 uint16_t srcEnd; /* 2 byte -waste */
michael@0 32 uint16_t destBegin; /* 2 byte */
michael@0 33 } uFormat2;
michael@0 34
michael@0 35 typedef struct {
michael@0 36 union {
michael@0 37 uFormat0 format0;
michael@0 38 uFormat1 format1;
michael@0 39 uFormat2 format2;
michael@0 40 } fmt;
michael@0 41 } uMapCell;
michael@0 42
michael@0 43 #define UMAPCELL_SIZE (3*sizeof(uint16_t))
michael@0 44
michael@0 45 typedef struct {
michael@0 46 uint16_t itemOfList;
michael@0 47 uint16_t offsetToFormatArray;
michael@0 48 uint16_t offsetToMapCellArray;
michael@0 49 uint16_t offsetToMappingTable;
michael@0 50 uint16_t data[1];
michael@0 51 } uTable;
michael@0 52
michael@0 53 #endif

mercurial