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
5fdc57ef
Commit
5fdc57ef
authored
Feb 07, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added memchrW and memrchrW to the exported Unicode functions.
parent
31f32215
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
19 deletions
+17
-19
profile.c
dlls/kernel/profile.c
+3
-19
unicode.h
include/wine/unicode.h
+14
-0
No files found.
dlls/kernel/profile.c
View file @
5fdc57ef
...
...
@@ -246,22 +246,6 @@ static void PROFILE_Free( PROFILESECTION *section )
}
}
/* look for the requested character up to the specified memory location,
* returning NULL if not found */
static
inline
const
WCHAR
*
PROFILE_memchrW
(
const
WCHAR
*
mem_start
,
const
WCHAR
*
mem_end
,
WCHAR
ch
)
{
for
(
;
mem_start
<
mem_end
;
mem_start
++
)
if
(
*
mem_start
==
ch
)
return
mem_start
;
return
NULL
;
}
/* look for the requested character from the specified end memory location,
* down to another memory location, returning NULL if not found */
static
inline
const
WCHAR
*
PROFILE_memrchrW
(
const
WCHAR
*
mem_start
,
const
WCHAR
*
mem_end
,
WCHAR
ch
)
{
for
(
;
mem_end
>=
mem_start
;
mem_end
--
)
if
(
*
mem_end
==
ch
)
return
mem_end
;
return
NULL
;
}
/* returns 1 if a character white space else 0 */
static
inline
int
PROFILE_isspaceW
(
WCHAR
c
)
{
...
...
@@ -298,7 +282,7 @@ static inline ENCODING PROFILE_DetectTextEncoding(const void * buffer, int * len
static
const
WCHAR
*
PROFILE_GetLine
(
const
WCHAR
*
szStart
,
const
WCHAR
*
szEnd
)
{
return
PROFILE_memchrW
(
szStart
,
szEnd
,
'\n'
);
return
memchrW
(
szStart
,
'\n'
,
szEnd
-
szStart
);
}
/***********************************************************************
...
...
@@ -417,7 +401,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding)
if
(
*
szLineStart
==
'['
)
/* section start */
{
const
WCHAR
*
szSectionEnd
;
if
(
!
(
szSectionEnd
=
PROFILE_memrchrW
(
szLineStart
,
szLineEnd
,
']'
)))
if
(
!
(
szSectionEnd
=
memrchrW
(
szLineStart
,
']'
,
szLineEnd
-
szLineStart
)))
{
WARN
(
"Invalid section header at line %d: %s
\n
"
,
line
,
debugstr_wn
(
szLineStart
,
(
int
)(
szLineEnd
-
szLineStart
))
);
...
...
@@ -453,7 +437,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding)
/* get rid of white space after the name and before the start
* of the value */
if
((
szNameEnd
=
szValueStart
=
PROFILE_memchrW
(
szLineStart
,
szLineEnd
,
'='
))
!=
NULL
)
if
((
szNameEnd
=
szValueStart
=
memchrW
(
szLineStart
,
'='
,
szLineEnd
-
szLineStart
))
!=
NULL
)
{
szNameEnd
=
szValueStart
-
1
;
while
((
szNameEnd
>
szLineStart
)
&&
PROFILE_isspaceW
(
*
szNameEnd
))
szNameEnd
--
;
...
...
include/wine/unicode.h
View file @
5fdc57ef
...
...
@@ -287,6 +287,20 @@ static inline WCHAR *struprW( WCHAR *str )
return
ret
;
}
static
inline
WCHAR
*
memchrW
(
const
WCHAR
*
ptr
,
WCHAR
ch
,
size_t
n
)
{
const
WCHAR
*
end
;
for
(
end
=
ptr
+
n
;
ptr
<
end
;
ptr
++
)
if
(
*
ptr
==
ch
)
return
(
WCHAR
*
)
ptr
;
return
NULL
;
}
static
inline
WCHAR
*
memrchrW
(
const
WCHAR
*
ptr
,
WCHAR
ch
,
size_t
n
)
{
const
WCHAR
*
end
,
*
ret
=
NULL
;
for
(
end
=
ptr
+
n
;
ptr
<
end
;
ptr
++
)
if
(
*
ptr
==
ch
)
ret
=
ptr
;
return
(
WCHAR
*
)
ret
;
}
static
inline
long
int
atolW
(
const
WCHAR
*
str
)
{
return
strtolW
(
str
,
(
WCHAR
**
)
0
,
10
);
...
...
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