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
721cd6e6
Commit
721cd6e6
authored
Jul 07, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Move some functions to avoid forward declarations.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0cb350f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
51 deletions
+51
-51
registry.c
server/registry.c
+51
-51
No files found.
server/registry.c
View file @
721cd6e6
...
@@ -279,6 +279,57 @@ static void dump_value( const struct key_value *value, FILE *f )
...
@@ -279,6 +279,57 @@ static void dump_value( const struct key_value *value, FILE *f )
fputc
(
'\n'
,
f
);
fputc
(
'\n'
,
f
);
}
}
/* find the named child of a given key and return its index */
static
struct
key
*
find_subkey
(
const
struct
key
*
key
,
const
struct
unicode_str
*
name
,
int
*
index
)
{
int
i
,
min
,
max
,
res
;
data_size_t
len
;
min
=
0
;
max
=
key
->
last_subkey
;
while
(
min
<=
max
)
{
i
=
(
min
+
max
)
/
2
;
len
=
min
(
key
->
subkeys
[
i
]
->
obj
.
name
->
len
,
name
->
len
);
res
=
memicmp_strW
(
key
->
subkeys
[
i
]
->
obj
.
name
->
name
,
name
->
str
,
len
);
if
(
!
res
)
res
=
key
->
subkeys
[
i
]
->
obj
.
name
->
len
-
name
->
len
;
if
(
!
res
)
{
*
index
=
i
;
return
key
->
subkeys
[
i
];
}
if
(
res
>
0
)
max
=
i
-
1
;
else
min
=
i
+
1
;
}
*
index
=
min
;
/* this is where we should insert it */
return
NULL
;
}
/* try to grow the array of subkeys; return 1 if OK, 0 on error */
static
int
grow_subkeys
(
struct
key
*
key
)
{
struct
key
**
new_subkeys
;
int
nb_subkeys
;
if
(
key
->
nb_subkeys
)
{
nb_subkeys
=
key
->
nb_subkeys
+
(
key
->
nb_subkeys
/
2
);
/* grow by 50% */
if
(
!
(
new_subkeys
=
realloc
(
key
->
subkeys
,
nb_subkeys
*
sizeof
(
*
new_subkeys
)
)))
{
set_error
(
STATUS_NO_MEMORY
);
return
0
;
}
}
else
{
nb_subkeys
=
MIN_SUBKEYS
;
if
(
!
(
new_subkeys
=
mem_alloc
(
nb_subkeys
*
sizeof
(
*
new_subkeys
)
)))
return
0
;
}
key
->
subkeys
=
new_subkeys
;
key
->
nb_subkeys
=
nb_subkeys
;
return
1
;
}
/* save a registry and all its subkeys to a text file */
/* save a registry and all its subkeys to a text file */
static
void
save_subkeys
(
const
struct
key
*
key
,
const
struct
key
*
base
,
FILE
*
f
)
static
void
save_subkeys
(
const
struct
key
*
key
,
const
struct
key
*
base
,
FILE
*
f
)
{
{
...
@@ -624,31 +675,6 @@ static void touch_key( struct key *key, unsigned int change )
...
@@ -624,31 +675,6 @@ static void touch_key( struct key *key, unsigned int change )
for
(
key
=
get_parent
(
key
);
key
;
key
=
get_parent
(
key
))
check_notify
(
key
,
change
,
0
);
for
(
key
=
get_parent
(
key
);
key
;
key
=
get_parent
(
key
))
check_notify
(
key
,
change
,
0
);
}
}
/* try to grow the array of subkeys; return 1 if OK, 0 on error */
static
int
grow_subkeys
(
struct
key
*
key
)
{
struct
key
**
new_subkeys
;
int
nb_subkeys
;
if
(
key
->
nb_subkeys
)
{
nb_subkeys
=
key
->
nb_subkeys
+
(
key
->
nb_subkeys
/
2
);
/* grow by 50% */
if
(
!
(
new_subkeys
=
realloc
(
key
->
subkeys
,
nb_subkeys
*
sizeof
(
*
new_subkeys
)
)))
{
set_error
(
STATUS_NO_MEMORY
);
return
0
;
}
}
else
{
nb_subkeys
=
MIN_SUBKEYS
;
if
(
!
(
new_subkeys
=
mem_alloc
(
nb_subkeys
*
sizeof
(
*
new_subkeys
)
)))
return
0
;
}
key
->
subkeys
=
new_subkeys
;
key
->
nb_subkeys
=
nb_subkeys
;
return
1
;
}
/* allocate a subkey for a given key, and return its index */
/* allocate a subkey for a given key, and return its index */
static
struct
key
*
alloc_subkey
(
struct
key
*
parent
,
const
struct
unicode_str
*
name
,
static
struct
key
*
alloc_subkey
(
struct
key
*
parent
,
const
struct
unicode_str
*
name
,
int
index
,
timeout_t
modif
)
int
index
,
timeout_t
modif
)
...
@@ -679,32 +705,6 @@ static struct key *alloc_subkey( struct key *parent, const struct unicode_str *n
...
@@ -679,32 +705,6 @@ static struct key *alloc_subkey( struct key *parent, const struct unicode_str *n
return
key
;
return
key
;
}
}
/* find the named child of a given key and return its index */
static
struct
key
*
find_subkey
(
const
struct
key
*
key
,
const
struct
unicode_str
*
name
,
int
*
index
)
{
int
i
,
min
,
max
,
res
;
data_size_t
len
;
min
=
0
;
max
=
key
->
last_subkey
;
while
(
min
<=
max
)
{
i
=
(
min
+
max
)
/
2
;
len
=
min
(
key
->
subkeys
[
i
]
->
obj
.
name
->
len
,
name
->
len
);
res
=
memicmp_strW
(
key
->
subkeys
[
i
]
->
obj
.
name
->
name
,
name
->
str
,
len
);
if
(
!
res
)
res
=
key
->
subkeys
[
i
]
->
obj
.
name
->
len
-
name
->
len
;
if
(
!
res
)
{
*
index
=
i
;
return
key
->
subkeys
[
i
];
}
if
(
res
>
0
)
max
=
i
-
1
;
else
min
=
i
+
1
;
}
*
index
=
min
;
/* this is where we should insert it */
return
NULL
;
}
/* return the wow64 variant of the key, or the key itself if none */
/* return the wow64 variant of the key, or the key itself if none */
static
struct
key
*
find_wow64_subkey
(
struct
key
*
key
,
const
struct
unicode_str
*
name
)
static
struct
key
*
find_wow64_subkey
(
struct
key
*
key
,
const
struct
unicode_str
*
name
)
{
{
...
...
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