]> arthur.barton.de Git - netatalk.git/blob - libatalk/unicode/charsets/mac_cyrillic.c
Remove all Appletalk stuff
[netatalk.git] / libatalk / unicode / charsets / mac_cyrillic.c
1 /* 
2    Unix SMB/CIFS implementation.
3    minimal iconv implementation
4    Copyright (C) Andrew Tridgell 2001
5    Copyright (C) Jelmer Vernooij 2002,2003
6    
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 2 of the License, or
10    (at your option) any later version.
11    
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.
16    
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20    
21    From samba 3.0 beta and GNU libiconv-1.8
22    It's bad but most of the time we can't use libc iconv service:
23    - it doesn't round trip for most encoding
24    - it doesn't know about Apple extension
25 */
26
27 #ifdef HAVE_CONFIG_H
28 #include "config.h"
29 #endif /* HAVE_CONFIG_H */
30 #include <stdlib.h> /* for size_t */
31 #include <arpa/inet.h>
32
33 #include <atalk/unicode.h>
34
35 #include "mac_cyrillic.h"
36 #include "generic_mb.h"
37
38 static size_t   mac_cyrillic_pull(void *,char **, size_t *, char **, size_t *);
39 static size_t   mac_cyrillic_push(void *,char **, size_t *, char **, size_t *);
40
41 struct charset_functions charset_mac_cyrillic =
42 {
43         "MAC_CYRILLIC",
44         7,
45         mac_cyrillic_pull,
46         mac_cyrillic_push,
47         CHARSET_CLIENT | CHARSET_MULTIBYTE,
48         NULL,
49         NULL, NULL
50 };
51
52
53 /* ------------------------ */
54
55 static size_t mac_cyrillic_push( void *cd, char **inbuf, size_t *inbytesleft,
56                          char **outbuf, size_t *outbytesleft)
57 {
58       return (size_t) mb_generic_push( char_ucs2_to_mac_cyrillic, cd, inbuf, inbytesleft, outbuf, outbytesleft);
59 }
60
61 /* ------------------------ */
62
63 static size_t mac_cyrillic_pull ( void *cd, char **inbuf, size_t *inbytesleft,
64                          char **outbuf, size_t *outbytesleft)
65 {
66       return (size_t) mb_generic_pull( char_mac_cyrillic_to_ucs2, cd, inbuf, inbytesleft, outbuf, outbytesleft);
67 }