/src/dcmtk/oficonv/libsrc/citrus_mapper_none.c
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 | | #include "dcmtk/config/osconfig.h" |
28 | | #include "citrus_mapper_none.h" |
29 | | |
30 | | #ifdef HAVE_SYS_QUEUE_H |
31 | | #include <sys/queue.h> |
32 | | #else |
33 | | #include "dcmtk/oficonv/queue.h" |
34 | | #endif |
35 | | |
36 | | #include <errno.h> |
37 | | #include <stdlib.h> |
38 | | #include <string.h> |
39 | | |
40 | | #include "citrus_bcs.h" |
41 | | #include "citrus_types.h" |
42 | | #include "citrus_module.h" |
43 | | #include "citrus_hash.h" |
44 | | #include "citrus_mapper.h" |
45 | | |
46 | | /* ---------------------------------------------------------------------- */ |
47 | | |
48 | | _CITRUS_MAPPER_DECLS(mapper_none); |
49 | | _CITRUS_MAPPER_DEF_OPS(mapper_none); |
50 | | |
51 | | |
52 | | /* ---------------------------------------------------------------------- */ |
53 | | |
54 | | int |
55 | | _citrus_mapper_none_mapper_getops(struct _citrus_mapper_ops *ops) |
56 | 0 | { |
57 | |
|
58 | 0 | memcpy(ops, &_citrus_mapper_none_mapper_ops, |
59 | 0 | sizeof(_citrus_mapper_none_mapper_ops)); |
60 | |
|
61 | 0 | return (0); |
62 | 0 | } |
63 | | |
64 | | static int |
65 | | /*ARGSUSED*/ |
66 | | _citrus_mapper_none_mapper_init(struct _citrus_mapper_area * ma , |
67 | | struct _citrus_csmapper * cm, const char * dir , |
68 | | const void * var , size_t lenvar , |
69 | | struct _citrus_mapper_traits * mt, size_t lenmt) |
70 | 0 | { |
71 | 0 | (void) ma; |
72 | 0 | (void) dir; |
73 | 0 | (void) var; |
74 | 0 | (void) lenvar; |
75 | |
|
76 | 0 | if (lenmt < sizeof(*mt)) |
77 | 0 | return (EINVAL); |
78 | | |
79 | 0 | cm->cm_closure = NULL; |
80 | 0 | mt->mt_src_max = mt->mt_dst_max = 1; /* 1:1 converter */ |
81 | 0 | mt->mt_state_size = 0; /* stateless */ |
82 | |
|
83 | 0 | return (0); |
84 | 0 | } |
85 | | |
86 | | static void |
87 | | /*ARGSUSED*/ |
88 | | _citrus_mapper_none_mapper_uninit(struct _citrus_csmapper *cm ) |
89 | 0 | { |
90 | 0 | (void) cm; |
91 | 0 | } |
92 | | |
93 | | static int |
94 | | /*ARGSUSED*/ |
95 | | _citrus_mapper_none_mapper_convert(struct _citrus_csmapper * cm , |
96 | | _citrus_index_t * dst, _citrus_index_t src, |
97 | | void * ps ) |
98 | 0 | { |
99 | 0 | (void) cm; |
100 | 0 | (void) ps; |
101 | |
|
102 | 0 | *dst = src; |
103 | 0 | return (_CITRUS_MAPPER_CONVERT_SUCCESS); |
104 | 0 | } |
105 | | |
106 | | static void |
107 | | /*ARGSUSED*/ |
108 | | _citrus_mapper_none_mapper_init_state(void) |
109 | 0 | { |
110 | |
|
111 | 0 | } |