citrus_mapper_std_local.h revision 219019
1254885Sdumbbell/* $FreeBSD: head/lib/libiconv_modules/mapper_std/citrus_mapper_std_local.h 219019 2011-02-25 00:04:39Z gabor $ */
2254885Sdumbbell/*	$NetBSD: citrus_mapper_std_local.h,v 1.3 2006/09/09 14:35:17 tnozaki Exp $	*/
3254885Sdumbbell
4254885Sdumbbell/*-
5254885Sdumbbell * Copyright (c)2003, 2006 Citrus Project,
6254885Sdumbbell * All rights reserved.
7254885Sdumbbell *
8254885Sdumbbell * Redistribution and use in source and binary forms, with or without
9254885Sdumbbell * modification, are permitted provided that the following conditions
10254885Sdumbbell * are met:
11254885Sdumbbell * 1. Redistributions of source code must retain the above copyright
12254885Sdumbbell *    notice, this list of conditions and the following disclaimer.
13254885Sdumbbell * 2. Redistributions in binary form must reproduce the above copyright
14254885Sdumbbell *    notice, this list of conditions and the following disclaimer in the
15254885Sdumbbell *    documentation and/or other materials provided with the distribution.
16254885Sdumbbell *
17254885Sdumbbell * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18254885Sdumbbell * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19254885Sdumbbell * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20254885Sdumbbell * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21254885Sdumbbell * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22254885Sdumbbell * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23254885Sdumbbell * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24254885Sdumbbell * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25254885Sdumbbell * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26254885Sdumbbell * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27254885Sdumbbell * SUCH DAMAGE.
28254885Sdumbbell */
29254885Sdumbbell
30254885Sdumbbell#ifndef _CITRUS_MAPPER_STD_LOCAL_H_
31254885Sdumbbell#define _CITRUS_MAPPER_STD_LOCAL_H_
32254885Sdumbbell
33254885Sdumbbelltypedef uint32_t (*_citrus_mapper_std_getvalfunc_t)(const void *, uint32_t);
34254885Sdumbbell
35254885Sdumbbellstruct _citrus_mapper_std_linear_zone {
36254885Sdumbbell	_citrus_index_t		begin;
37254885Sdumbbell	_citrus_index_t		end;
38254885Sdumbbell	_citrus_index_t		width;
39254885Sdumbbell};
40254885Sdumbbellstruct _citrus_mapper_std_rowcol {
41254885Sdumbbell	struct _citrus_region	rc_table;
42254885Sdumbbell	size_t			rc_src_rowcol_len;
43254885Sdumbbell	struct _citrus_mapper_std_linear_zone
44254885Sdumbbell				*rc_src_rowcol;
45254885Sdumbbell	_citrus_index_t		rc_src_rowcol_bits;
46254885Sdumbbell	_citrus_index_t		rc_src_rowcol_mask;
47254885Sdumbbell	_citrus_index_t		rc_dst_invalid;
48254885Sdumbbell	_citrus_index_t		rc_dst_unit_bits;
49254885Sdumbbell	int			rc_oob_mode;
50254885Sdumbbell	_citrus_index_t		rc_dst_ilseq;
51254885Sdumbbell};
52254885Sdumbbell
53254885Sdumbbellstruct _citrus_mapper_std;
54254885Sdumbbell
55254885Sdumbbelltypedef int (*_citrus_mapper_std_convert_t)(
56254885Sdumbbell	struct _citrus_mapper_std *__restrict,
57254885Sdumbbell	_index_t *__restrict, _index_t, void *__restrict);
58254885Sdumbbelltypedef void (*_citrus_mapper_std_uninit_t)(struct _citrus_mapper_std *);
59254885Sdumbbell
60254885Sdumbbellstruct _citrus_mapper_std {
61254885Sdumbbell	struct _citrus_region		ms_file;
62254885Sdumbbell	struct _citrus_db		*ms_db;
63254885Sdumbbell	_citrus_mapper_std_convert_t	ms_convert;
64254885Sdumbbell	_citrus_mapper_std_uninit_t	ms_uninit;
65254885Sdumbbell	union {
66254885Sdumbbell		struct _citrus_mapper_std_rowcol	rowcol;
67254885Sdumbbell	} u;
68254885Sdumbbell#define ms_rowcol	u.rowcol
69254885Sdumbbell};
70254885Sdumbbell
71254885Sdumbbell#endif
72254885Sdumbbell