author | zautrix <zautrix> | 2004-11-09 11:57:44 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-11-09 11:57:44 (UTC) |
commit | 21c8ec57e0258815f3d1474c1194d1572f78029e (patch) (unidiff) | |
tree | a9088fc093487b09ed2448b548276db1395bd449 /kmicromail/libetpan | |
parent | 318f9bf1f4bc84af280bd8e090989677ba21d241 (diff) | |
download | kdepimpi-21c8ec57e0258815f3d1474c1194d1572f78029e.zip kdepimpi-21c8ec57e0258815f3d1474c1194d1572f78029e.tar.gz kdepimpi-21c8ec57e0258815f3d1474c1194d1572f78029e.tar.bz2 |
aaded files
-rw-r--r-- | kmicromail/libetpan/tools/charconv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/libetpan/tools/charconv.c b/kmicromail/libetpan/tools/charconv.c index bf3de51..f7a3c89 100644 --- a/kmicromail/libetpan/tools/charconv.c +++ b/kmicromail/libetpan/tools/charconv.c | |||
@@ -16,66 +16,66 @@ | |||
16 | * contributors may be used to endorse or promote products derived | 16 | * contributors may be used to endorse or promote products derived |
17 | * from this software without specific prior written permission. | 17 | * from this software without specific prior written permission. |
18 | * | 18 | * |
19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | 19 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
29 | * SUCH DAMAGE. | 29 | * SUCH DAMAGE. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * $Id$ | 33 | * $Id$ |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #include "charconv.h" | 36 | #include "charconv.h" |
37 | 37 | ||
38 | #include "config.h" | 38 | #include "config.h" |
39 | #ifdef HAVE_ICONV | 39 | #ifdef HAVE_ICONV |
40 | #include <iconv.h> | 40 | #include <iconv.h> |
41 | #endif | 41 | #endif |
42 | #include <stdlib.h> | 42 | #include <stdlib.h> |
43 | #include <string.h> | 43 | #include <string.h> |
44 | #include <stdio.h> | 44 | #include <stdio.h> |
45 | #include <errno.h> | 45 | #include <errno.h> |
46 | 46 | ||
47 | #include "mmapstring.h" | 47 | #include "mmapstring.h" |
48 | |||
49 | #ifdef HAVE_ICONV | 48 | #ifdef HAVE_ICONV |
49 | |||
50 | static size_t mail_iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, | 50 | static size_t mail_iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, |
51 | char **outbuf, size_t *outbytesleft, | 51 | char **outbuf, size_t *outbytesleft, |
52 | char **inrepls, char *outrepl) | 52 | char **inrepls, char *outrepl) |
53 | { | 53 | { |
54 | /* | 54 | /* |
55 | XXX - force conversion of (* inbuf) to (char *) | 55 | XXX - force conversion of (* inbuf) to (char *) |
56 | because prototype of iconv() is the following : | 56 | because prototype of iconv() is the following : |
57 | 57 | ||
58 | size_t iconv(iconv_t cd, char **restrict inbuf, | 58 | size_t iconv(iconv_t cd, char **restrict inbuf, |
59 | size_t *restrict inbytesleft, char **restrict outbuf, | 59 | size_t *restrict inbytesleft, char **restrict outbuf, |
60 | size_t *restrict outbytesleft); | 60 | size_t *restrict outbytesleft); |
61 | */ | 61 | */ |
62 | 62 | ||
63 | size_t ret = 0, ret1; | 63 | size_t ret = 0, ret1; |
64 | char *ib = (char *) *inbuf; | 64 | char *ib = (char *) *inbuf; |
65 | size_t ibl = *inbytesleft; | 65 | size_t ibl = *inbytesleft; |
66 | char *ob = *outbuf; | 66 | char *ob = *outbuf; |
67 | size_t obl = *outbytesleft; | 67 | size_t obl = *outbytesleft; |
68 | 68 | ||
69 | for (;;) | 69 | for (;;) |
70 | { | 70 | { |
71 | ret1 = iconv (cd, &ib, &ibl, &ob, &obl); | 71 | ret1 = iconv (cd, &ib, &ibl, &ob, &obl); |
72 | if (ret1 != (size_t)-1) | 72 | if (ret1 != (size_t)-1) |
73 | ret += ret1; | 73 | ret += ret1; |
74 | if (ibl && obl && errno == EILSEQ) | 74 | if (ibl && obl && errno == EILSEQ) |
75 | { | 75 | { |
76 | if (inrepls) | 76 | if (inrepls) |
77 | { | 77 | { |
78 | /* Try replacing the input */ | 78 | /* Try replacing the input */ |
79 | char **t; | 79 | char **t; |
80 | for (t = inrepls; *t; t++) | 80 | for (t = inrepls; *t; t++) |
81 | { | 81 | { |