/src/dcmtk/oficonv/libsrc/citrus_mapper.h
Line | Count | Source |
1 | | /*- |
2 | | * Copyright (c)2003 Citrus Project, |
3 | | * All rights reserved. |
4 | | * |
5 | | * Redistribution and use in source and binary forms, with or without |
6 | | * modification, are permitted provided that the following conditions |
7 | | * are met: |
8 | | * 1. Redistributions of source code must retain the above copyright |
9 | | * notice, this list of conditions and the following disclaimer. |
10 | | * 2. Redistributions in binary form must reproduce the above copyright |
11 | | * notice, this list of conditions and the following disclaimer in the |
12 | | * documentation and/or other materials provided with the distribution. |
13 | | * |
14 | | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
15 | | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
16 | | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
17 | | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
18 | | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
19 | | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
20 | | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
21 | | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
22 | | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
23 | | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
24 | | * SUCH DAMAGE. |
25 | | */ |
26 | | |
27 | | #ifndef _CITRUS_MAPPER_H_ |
28 | | #define _CITRUS_MAPPER_H_ |
29 | | |
30 | | #include "dcmtk/config/osconfig.h" |
31 | | #include "citrus_bcs.h" |
32 | | |
33 | | struct _citrus_mapper_area; |
34 | | struct _citrus_csmapper; |
35 | | struct _citrus_mapper_ops; |
36 | | struct _citrus_mapper_traits; |
37 | | |
38 | | BEGIN_EXTERN_C |
39 | | int _citrus_mapper_create_area( |
40 | | struct _citrus_mapper_area * *, |
41 | | const char *); |
42 | | void _citrus_mapper_delete_area(struct _citrus_mapper_area * *); |
43 | | int _citrus_mapper_open(struct _citrus_mapper_area *, |
44 | | struct _citrus_csmapper * *, |
45 | | const char *); |
46 | | int _citrus_mapper_open_direct( |
47 | | struct _citrus_mapper_area *, |
48 | | struct _citrus_csmapper * *, |
49 | | const char *, const char *); |
50 | | void _citrus_csmapper_close(struct _citrus_csmapper *); |
51 | | void _citrus_mapper_close_nohash(struct _citrus_csmapper *); |
52 | | void _citrus_mapper_set_persistent(struct _citrus_csmapper * ); |
53 | | END_EXTERN_C |
54 | | |
55 | | #include "citrus_mapper_local.h" |
56 | | |
57 | | /* return values of _citrus_csmapper_convert */ |
58 | 0 | #define _CITRUS_MAPPER_CONVERT_SUCCESS (0) |
59 | 0 | #define _CITRUS_MAPPER_CONVERT_NONIDENTICAL (1) |
60 | 0 | #define _CITRUS_MAPPER_CONVERT_SRC_MORE (2) |
61 | 0 | #define _CITRUS_MAPPER_CONVERT_DST_MORE (3) |
62 | 0 | #define _CITRUS_MAPPER_CONVERT_ILSEQ (4) |
63 | 0 | #define _CITRUS_MAPPER_CONVERT_FATAL (5) |
64 | | |
65 | | /* |
66 | | * _citrus_csmapper_convert: |
67 | | * convert an index. |
68 | | * - if the converter supports M:1 converter, the function may return |
69 | | * _CITRUS_MAPPER_CONVERT_SRC_MORE and the storage pointed by dst |
70 | | * may be unchanged in this case, although the internal status of |
71 | | * the mapper is affected. |
72 | | * - if the converter supports 1:N converter, the function may return |
73 | | * _CITRUS_MAPPER_CONVERT_DST_MORE. In this case, the contiguous |
74 | | * call of this function ignores src and changes the storage pointed |
75 | | * by dst. |
76 | | * - if the converter supports M:N converter, the function may behave |
77 | | * the combination of the above. |
78 | | * |
79 | | */ |
80 | | static __inline int |
81 | | _citrus_csmapper_convert(struct _citrus_csmapper * cm, |
82 | | _citrus_index_t * dst, _citrus_index_t src, |
83 | | void * ps) |
84 | 0 | { |
85 | |
|
86 | 0 | return ((*cm->cm_ops->mo_convert)(cm, dst, src, ps)); |
87 | 0 | } Unexecuted instantiation: citrus_csmapper.c:_citrus_csmapper_convert Unexecuted instantiation: citrus_mapper.c:_citrus_csmapper_convert Unexecuted instantiation: citrus_iconv_std.c:_citrus_csmapper_convert Unexecuted instantiation: citrus_mapper_646.c:_citrus_csmapper_convert Unexecuted instantiation: citrus_mapper_none.c:_citrus_csmapper_convert Unexecuted instantiation: citrus_mapper_serial.c:_citrus_csmapper_convert Unexecuted instantiation: citrus_mapper_std.c:_citrus_csmapper_convert Unexecuted instantiation: citrus_mapper_zone.c:_citrus_csmapper_convert |
88 | | |
89 | | /* |
90 | | * _citrus_csmapper_init_state: |
91 | | * initialize the state. |
92 | | */ |
93 | | static __inline void |
94 | | _citrus_csmapper_init_state(struct _citrus_csmapper * cm) |
95 | 0 | { |
96 | 0 |
|
97 | 0 | (*cm->cm_ops->mo_init_state)(); |
98 | 0 | } Unexecuted instantiation: citrus_csmapper.c:_citrus_csmapper_init_state Unexecuted instantiation: citrus_mapper.c:_citrus_csmapper_init_state Unexecuted instantiation: citrus_iconv_std.c:_citrus_csmapper_init_state Unexecuted instantiation: citrus_mapper_646.c:_citrus_csmapper_init_state Unexecuted instantiation: citrus_mapper_none.c:_citrus_csmapper_init_state Unexecuted instantiation: citrus_mapper_serial.c:_citrus_csmapper_init_state Unexecuted instantiation: citrus_mapper_std.c:_citrus_csmapper_init_state Unexecuted instantiation: citrus_mapper_zone.c:_citrus_csmapper_init_state |
99 | | |
100 | | /* |
101 | | * _citrus_csmapper_get_state_size: |
102 | | * get the size of state storage. |
103 | | */ |
104 | | static __inline size_t |
105 | | _citrus_csmapper_get_state_size(struct _citrus_csmapper * cm) |
106 | 0 | { |
107 | |
|
108 | 0 | return (cm->cm_traits->mt_state_size); |
109 | 0 | } Unexecuted instantiation: citrus_csmapper.c:_citrus_csmapper_get_state_size Unexecuted instantiation: citrus_mapper.c:_citrus_csmapper_get_state_size Unexecuted instantiation: citrus_iconv_std.c:_citrus_csmapper_get_state_size Unexecuted instantiation: citrus_mapper_646.c:_citrus_csmapper_get_state_size Unexecuted instantiation: citrus_mapper_none.c:_citrus_csmapper_get_state_size Unexecuted instantiation: citrus_mapper_serial.c:_citrus_csmapper_get_state_size Unexecuted instantiation: citrus_mapper_std.c:_citrus_csmapper_get_state_size Unexecuted instantiation: citrus_mapper_zone.c:_citrus_csmapper_get_state_size |
110 | | |
111 | | /* |
112 | | * _citrus_csmapper_get_src_max: |
113 | | * get the maximum number of suspended sources. |
114 | | */ |
115 | | static __inline size_t |
116 | | _citrus_csmapper_get_src_max(struct _citrus_csmapper * cm) |
117 | 0 | { |
118 | |
|
119 | 0 | return (cm->cm_traits->mt_src_max); |
120 | 0 | } Unexecuted instantiation: citrus_csmapper.c:_citrus_csmapper_get_src_max Unexecuted instantiation: citrus_mapper.c:_citrus_csmapper_get_src_max Unexecuted instantiation: citrus_iconv_std.c:_citrus_csmapper_get_src_max Unexecuted instantiation: citrus_mapper_646.c:_citrus_csmapper_get_src_max Unexecuted instantiation: citrus_mapper_none.c:_citrus_csmapper_get_src_max Unexecuted instantiation: citrus_mapper_serial.c:_citrus_csmapper_get_src_max Unexecuted instantiation: citrus_mapper_std.c:_citrus_csmapper_get_src_max Unexecuted instantiation: citrus_mapper_zone.c:_citrus_csmapper_get_src_max |
121 | | |
122 | | /* |
123 | | * _citrus_csmapper_get_dst_max: |
124 | | * get the maximum number of suspended destinations. |
125 | | */ |
126 | | static __inline size_t |
127 | | _citrus_csmapper_get_dst_max(struct _citrus_csmapper * cm) |
128 | 0 | { |
129 | |
|
130 | 0 | return (cm->cm_traits->mt_dst_max); |
131 | 0 | } Unexecuted instantiation: citrus_csmapper.c:_citrus_csmapper_get_dst_max Unexecuted instantiation: citrus_mapper.c:_citrus_csmapper_get_dst_max Unexecuted instantiation: citrus_iconv_std.c:_citrus_csmapper_get_dst_max Unexecuted instantiation: citrus_mapper_646.c:_citrus_csmapper_get_dst_max Unexecuted instantiation: citrus_mapper_none.c:_citrus_csmapper_get_dst_max Unexecuted instantiation: citrus_mapper_serial.c:_citrus_csmapper_get_dst_max Unexecuted instantiation: citrus_mapper_std.c:_citrus_csmapper_get_dst_max Unexecuted instantiation: citrus_mapper_zone.c:_citrus_csmapper_get_dst_max |
132 | | |
133 | | #endif |