intl/uconv/util/umap.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/intl/uconv/util/umap.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     1.4 +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +#ifndef __UMAP__
     1.9 +#define __UMAP__
    1.10 +
    1.11 +#define NOMAPPING 0xfffd
    1.12 +
    1.13 +enum {
    1.14 +	uFormat0Tag = 0,
    1.15 +	uFormat1Tag,
    1.16 +	uFormat2Tag,
    1.17 +	uNumFormatTag
    1.18 +};
    1.19 +
    1.20 +typedef struct {
    1.21 +		uint16_t srcBegin;		/* 2 byte	*/
    1.22 +		uint16_t srcEnd;			/* 2 byte	*/
    1.23 +		uint16_t destBegin;		/* 2 byte	*/
    1.24 +} uFormat0;
    1.25 +
    1.26 +typedef struct {
    1.27 +		uint16_t srcBegin;		/* 2 byte	*/
    1.28 +		uint16_t srcEnd;			/* 2 byte	*/
    1.29 +		uint16_t	mappingOffset;	/* 2 byte	*/
    1.30 +} uFormat1;
    1.31 +
    1.32 +typedef struct {
    1.33 +		uint16_t srcBegin;		/* 2 byte	*/
    1.34 +		uint16_t srcEnd;			/* 2 byte	-waste	*/
    1.35 +		uint16_t destBegin;		/* 2 byte	*/
    1.36 +} uFormat2;
    1.37 +
    1.38 +typedef struct  {
    1.39 +	union {
    1.40 +		uFormat0	format0;
    1.41 +		uFormat1	format1;
    1.42 +		uFormat2	format2;
    1.43 +	} fmt;
    1.44 +} uMapCell;
    1.45 +
    1.46 +#define UMAPCELL_SIZE (3*sizeof(uint16_t))
    1.47 +
    1.48 +typedef struct  {
    1.49 +	uint16_t 		itemOfList;
    1.50 +	uint16_t		offsetToFormatArray;
    1.51 +	uint16_t		offsetToMapCellArray;
    1.52 +	uint16_t		offsetToMappingTable;
    1.53 +	uint16_t		data[1];
    1.54 +} uTable;
    1.55 +
    1.56 +#endif

mercurial