Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
18699623
Commit
18699623
authored
Feb 18, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libwine: Move the CP_SYMBOL conversion functions to libwine_port.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2087f38e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
40 deletions
+61
-40
Makefile.in
libs/port/Makefile.in
+1
-0
cpsymbol.c
libs/port/cpsymbol.c
+58
-0
mbtowc.c
libs/wine/mbtowc.c
+0
-19
port.c
libs/wine/port.c
+2
-0
wctomb.c
libs/wine/wctomb.c
+0
-21
No files found.
libs/port/Makefile.in
View file @
18699623
...
...
@@ -73,6 +73,7 @@ C_SRCS = \
c_936.c
\
c_949.c
\
c_950.c
\
cpsymbol.c
\
cptable.c
\
digitmap.c
\
ffs.c
\
...
...
libs/port/cpsymbol.c
0 → 100644
View file @
18699623
/*
* CP_SYMBOL support
*
* Copyright 2000 Alexandre Julliard
* Copyright 2004 Rein Klazes
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "wine/unicode.h"
/* return -1 on dst buffer overflow */
int
wine_cpsymbol_mbstowcs
(
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
)
{
int
len
,
i
;
if
(
dstlen
==
0
)
return
srclen
;
len
=
dstlen
>
srclen
?
srclen
:
dstlen
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
unsigned
char
c
=
src
[
i
];
dst
[
i
]
=
(
c
<
0x20
)
?
c
:
c
+
0xf000
;
}
if
(
srclen
>
len
)
return
-
1
;
return
len
;
}
/* return -1 on dst buffer overflow, -2 on invalid character */
int
wine_cpsymbol_wcstombs
(
const
WCHAR
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
)
{
int
len
,
i
;
if
(
dstlen
==
0
)
return
srclen
;
len
=
dstlen
>
srclen
?
srclen
:
dstlen
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
src
[
i
]
<
0x20
)
dst
[
i
]
=
src
[
i
];
else
if
(
src
[
i
]
>=
0xf020
&&
src
[
i
]
<
0xf100
)
dst
[
i
]
=
src
[
i
]
-
0xf000
;
else
return
-
2
;
}
if
(
srclen
>
len
)
return
-
1
;
return
len
;
}
libs/wine/mbtowc.c
View file @
18699623
...
...
@@ -291,22 +291,3 @@ int wine_cp_mbstowcs( const union cptable *table, int flags,
return
mbstowcs_dbcs_decompose
(
&
table
->
dbcs
,
src
,
srclen
,
dst
,
dstlen
);
}
}
/* CP_SYMBOL implementation */
/* return -1 on dst buffer overflow */
int
wine_cpsymbol_mbstowcs
(
const
char
*
src
,
int
srclen
,
WCHAR
*
dst
,
int
dstlen
)
{
int
len
,
i
;
if
(
dstlen
==
0
)
return
srclen
;
len
=
dstlen
>
srclen
?
srclen
:
dstlen
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
unsigned
char
c
=
src
[
i
];
if
(
c
<
0x20
)
dst
[
i
]
=
c
;
else
dst
[
i
]
=
c
+
0xf000
;
}
if
(
srclen
>
len
)
return
-
1
;
return
len
;
}
libs/wine/port.c
View file @
18699623
...
...
@@ -33,6 +33,8 @@ const void *libwine_port_functions[] =
{
wine_cp_enum_table
,
wine_cp_get_table
,
wine_cpsymbol_mbstowcs
,
wine_cpsymbol_wcstombs
,
wine_fold_string
};
...
...
libs/wine/wctomb.c
View file @
18699623
...
...
@@ -470,24 +470,3 @@ int wine_cp_wcstombs( const union cptable *table, int flags,
return
wcstombs_dbcs
(
&
table
->
dbcs
,
src
,
srclen
,
dst
,
dstlen
);
}
}
/* CP_SYMBOL implementation */
/* return -1 on dst buffer overflow, -2 on invalid character */
int
wine_cpsymbol_wcstombs
(
const
WCHAR
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
)
{
int
len
,
i
;
if
(
dstlen
==
0
)
return
srclen
;
len
=
dstlen
>
srclen
?
srclen
:
dstlen
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
WCHAR
w
=
src
[
i
];
if
(
w
<
0x20
)
dst
[
i
]
=
w
;
else
if
(
w
>=
0xf020
&&
w
<
0xf100
)
dst
[
i
]
=
w
-
0xf000
;
else
return
-
2
;
}
if
(
srclen
>
len
)
return
-
1
;
return
len
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment