Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Иван Мажукин
mpd
Commits
47a8369d
Commit
47a8369d
authored
Jan 30, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InotifyUpdate: rename struct watch_directory
parent
6805fa2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
InotifyUpdate.cxx
src/InotifyUpdate.cxx
+18
-18
No files found.
src/InotifyUpdate.cxx
View file @
47a8369d
...
...
@@ -47,8 +47,8 @@ enum {
#endif
};
struct
watch_d
irectory
{
struct
watch_d
irectory
*
parent
;
struct
WatchD
irectory
{
WatchD
irectory
*
parent
;
char
*
name
;
...
...
@@ -61,25 +61,25 @@ static InotifySource *inotify_source;
static
InotifyQueue
*
inotify_queue
;
static
unsigned
inotify_max_depth
;
static
struct
watch_d
irectory
inotify_root
;
static
std
::
map
<
int
,
watch_d
irectory
*>
inotify_directories
;
static
WatchD
irectory
inotify_root
;
static
std
::
map
<
int
,
WatchD
irectory
*>
inotify_directories
;
static
void
tree_add_watch_directory
(
struct
watch_d
irectory
*
directory
)
tree_add_watch_directory
(
WatchD
irectory
*
directory
)
{
inotify_directories
.
insert
(
std
::
make_pair
(
directory
->
descriptor
,
directory
));
}
static
void
tree_remove_watch_directory
(
struct
watch_d
irectory
*
directory
)
tree_remove_watch_directory
(
WatchD
irectory
*
directory
)
{
auto
i
=
inotify_directories
.
find
(
directory
->
descriptor
);
assert
(
i
!=
inotify_directories
.
end
());
inotify_directories
.
erase
(
i
);
}
static
struct
watch_d
irectory
*
static
WatchD
irectory
*
tree_find_watch_directory
(
int
wd
)
{
auto
i
=
inotify_directories
.
find
(
wd
);
...
...
@@ -90,7 +90,7 @@ tree_find_watch_directory(int wd)
}
static
void
remove_watch_directory
(
struct
watch_d
irectory
*
directory
)
remove_watch_directory
(
WatchD
irectory
*
directory
)
{
assert
(
directory
!=
NULL
);
...
...
@@ -105,18 +105,18 @@ remove_watch_directory(struct watch_directory *directory)
tree_remove_watch_directory
(
directory
);
while
(
directory
->
children
!=
NULL
)
remove_watch_directory
((
struct
watch_d
irectory
*
)
directory
->
children
->
data
);
remove_watch_directory
((
WatchD
irectory
*
)
directory
->
children
->
data
);
directory
->
parent
->
children
=
g_list_remove
(
directory
->
parent
->
children
,
directory
);
inotify_source
->
Remove
(
directory
->
descriptor
);
g_free
(
directory
->
name
);
g_slice_free
(
struct
watch_d
irectory
,
directory
);
g_slice_free
(
WatchD
irectory
,
directory
);
}
static
char
*
watch_directory_get_uri_fs
(
const
struct
watch_d
irectory
*
directory
)
watch_directory_get_uri_fs
(
const
WatchD
irectory
*
directory
)
{
char
*
parent_uri
,
*
uri
;
...
...
@@ -142,7 +142,7 @@ static bool skip_path(const char *path)
}
static
void
recursive_watch_subdirectories
(
struct
watch_d
irectory
*
directory
,
recursive_watch_subdirectories
(
WatchD
irectory
*
directory
,
const
char
*
path_fs
,
unsigned
depth
)
{
GError
*
error
=
NULL
;
...
...
@@ -169,7 +169,7 @@ recursive_watch_subdirectories(struct watch_directory *directory,
char
*
child_path_fs
;
struct
stat
st
;
int
ret
;
struct
watch_d
irectory
*
child
;
WatchD
irectory
*
child
;
if
(
skip_path
(
ent
->
d_name
))
continue
;
...
...
@@ -205,7 +205,7 @@ recursive_watch_subdirectories(struct watch_directory *directory,
continue
;
}
child
=
g_slice_new
(
struct
watch_d
irectory
);
child
=
g_slice_new
(
WatchD
irectory
);
child
->
parent
=
directory
;
child
->
name
=
g_strdup
(
ent
->
d_name
);
child
->
descriptor
=
ret
;
...
...
@@ -225,7 +225,7 @@ recursive_watch_subdirectories(struct watch_directory *directory,
G_GNUC_PURE
static
unsigned
watch_directory_depth
(
const
struct
watch_d
irectory
*
d
)
watch_directory_depth
(
const
WatchD
irectory
*
d
)
{
assert
(
d
!=
NULL
);
...
...
@@ -240,7 +240,7 @@ static void
mpd_inotify_callback
(
int
wd
,
unsigned
mask
,
G_GNUC_UNUSED
const
char
*
name
,
G_GNUC_UNUSED
void
*
ctx
)
{
struct
watch_d
irectory
*
directory
;
WatchD
irectory
*
directory
;
char
*
uri_fs
;
/*g_debug("wd=%d mask=0x%x name='%s'", wd, mask, name);*/
...
...
@@ -350,13 +350,13 @@ mpd_inotify_finish(void)
delete
inotify_source
;
for
(
auto
i
:
inotify_directories
)
{
watch_d
irectory
*
directory
=
i
.
second
;
WatchD
irectory
*
directory
=
i
.
second
;
g_free
(
directory
->
name
);
g_list_free
(
directory
->
children
);
if
(
directory
!=
&
inotify_root
)
g_slice_free
(
struct
watch_d
irectory
,
directory
);
g_slice_free
(
WatchD
irectory
,
directory
);
}
inotify_directories
.
clear
();
...
...
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