Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
329cd301
Commit
329cd301
authored
Apr 07, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use custom struct for stat watcher.
parent
022a063d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
4 deletions
+36
-4
src/gevent/libuv/_corecffi_cdef.c
src/gevent/libuv/_corecffi_cdef.c
+8
-1
src/gevent/libuv/_corecffi_source.c
src/gevent/libuv/_corecffi_source.c
+28
-3
No files found.
src/gevent/libuv/_corecffi_cdef.c
View file @
329cd301
...
...
@@ -289,4 +289,11 @@ static void _gevent_generic_callback0(uv_handle_t* handle); // no extra args
static
void
_gevent_generic_callback1
(
uv_handle_t
*
handle
,
int
arg
);
// one extra args. Everything will funnel through this
static
void
_gevent_poll_callback2
(
uv_handle_t
*
handle
,
int
status
,
int
events
);
static
void
_gevent_fs_event_callback3
(
uv_handle_t
*
handle
,
const
char
*
filename
,
int
events
,
int
status
);
static
void
_gevent_fs_poll_callback3
(
uv_handle_t
*
handle
,
int
status
,
const
uv_stat_t
*
prev
,
const
uv_stat_t
*
curr
);
typedef
struct
_gevent_fs_poll_s
{
uv_fs_poll_t
handle
;
uv_stat_t
curr
;
uv_stat_t
prev
;
}
gevent_fs_poll_t
;
static
void
_gevent_fs_poll_callback3
(
void
*
handle
,
int
status
,
const
uv_stat_t
*
prev
,
const
uv_stat_t
*
curr
);
src/gevent/libuv/_corecffi_source.c
View file @
329cd301
...
...
@@ -44,10 +44,35 @@ static void _gevent_fs_event_callback3(uv_handle_t* handle, const char* filename
{
_gevent_generic_callback1
(
handle
,
status
<
0
?
status
:
events
);
}
/*
typedef struct {
uv_fs_poll_t handle;
uv_stat_t curr;
uv_stat_t prev;
} gevent_fs_poll_t;
*/
static
void
_gevent_fs_poll_callback3
(
uv_handle_t
*
handle
,
int
status
,
const
uv_stat_t
*
prev
,
const
uv_stat_t
*
curr
)
typedef
struct
_gevent_fs_poll_s
{
uv_fs_poll_t
handle
;
uv_stat_t
curr
;
uv_stat_t
prev
;
}
gevent_fs_poll_t
;
static
void
_gevent_fs_poll_callback3
(
void
*
handlep
,
int
status
,
const
uv_stat_t
*
prev
,
const
uv_stat_t
*
curr
)
{
// stat pointers are valid for this callback only.
// Will need a custom callback for this or somehow be able to pass
// copied data up.
// if given, copy them into our structure, where they can be reached
// from python, just like libev's watcher does, before calling
// the callback.
if
(
status
<
0
)
{
return
;
}
gevent_fs_poll_t
*
handle
=
(
gevent_fs_poll_t
*
)
handlep
;
assert
(
status
==
0
);
handle
->
curr
=
*
curr
;
handle
->
prev
=
*
prev
;
_gevent_generic_callback1
((
uv_handle_t
*
)
handle
,
0
);
}
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