2 Unix SMB/CIFS implementation.
3 Samba module with developer tools
4 Copyright (C) Andrew Tridgell 2001
5 Copyright (C) Jelmer Vernooij 2002
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "charset_proto.h"
46 size_t weird_pull(void *cd
, const char **inbuf
, size_t *inbytesleft
,
47 char **outbuf
, size_t *outbytesleft
)
49 while (*inbytesleft
>= 1 && *outbytesleft
>= 2) {
52 for (i
=0;weird_table
[i
].from
;i
++) {
55 weird_table
[i
].len
) == 0) {
56 if (*inbytesleft
< weird_table
[i
].len
) {
60 (*outbuf
)[0] = weird_table
[i
].from
;
62 (*inbytesleft
) -= weird_table
[i
].len
;
64 (*inbuf
) += weird_table
[i
].len
;
71 (*outbuf
)[0] = (*inbuf
)[0];
79 if (*inbytesleft
> 0) {
87 size_t weird_push(void *cd
, const char **inbuf
, size_t *inbytesleft
,
88 char **outbuf
, size_t *outbytesleft
)
92 while (*inbytesleft
>= 2 && *outbytesleft
>= 1) {
95 for (i
=0;weird_table
[i
].from
;i
++) {
96 if ((*inbuf
)[0] == weird_table
[i
].from
&&
98 if (*outbytesleft
< weird_table
[i
].len
) {
105 (*outbytesleft
) -= weird_table
[i
].len
;
107 (*outbuf
) += weird_table
[i
].len
;
114 (*outbuf
)[0] = (*inbuf
)[0];
115 if ((*inbuf
)[1]) ir_count
++;
117 (*outbytesleft
) -= 1;
122 if (*inbytesleft
== 1) {
127 if (*inbytesleft
> 1) {
136 void charset_weird_dummy(void);
137 void charset_weird_dummy(void)