4 * Copyright 2000 Alexandre Julliard
5 * Copyright 2004 Rein Klazes
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library 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 GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
28 /* return -1 on dst buffer overflow */
29 int wine_cpsymbol_mbstowcs_obsolete( const char *src
, int srclen
, WCHAR
*dst
, int dstlen
)
33 if (dstlen
== 0) return srclen
;
34 len
= dstlen
> srclen
? srclen
: dstlen
;
35 for (i
= 0; i
< len
; i
++)
37 unsigned char c
= src
[i
];
38 dst
[i
] = (c
< 0x20) ? c
: c
+ 0xf000;
40 if (srclen
> len
) return -1;
44 /* return -1 on dst buffer overflow, -2 on invalid character */
45 int wine_cpsymbol_wcstombs_obsolete( const WCHAR
*src
, int srclen
, char *dst
, int dstlen
)
49 if (dstlen
== 0) return srclen
;
50 len
= dstlen
> srclen
? srclen
: dstlen
;
51 for (i
= 0; i
< len
; i
++)
55 else if (src
[i
] >= 0xf020 && src
[i
] < 0xf100)
56 dst
[i
] = src
[i
] - 0xf000;
60 if (srclen
> len
) return -1;
64 __ASM_OBSOLETE(wine_cpsymbol_mbstowcs
);
65 __ASM_OBSOLETE(wine_cpsymbol_wcstombs
);
67 #endif /* __ASM_OBSOLETE */