Skip to content

Commit

Permalink
move uv_poll_* position
Browse files Browse the repository at this point in the history
  • Loading branch information
typester committed Mar 29, 2013
1 parent c655c06 commit a871c7b
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions src/UV.xs
Original file line number Diff line number Diff line change
Expand Up @@ -1429,42 +1429,6 @@ CODE:
XSRETURN(2);
}

void
uv_poll_init(int fd)
CODE:
{
uv_poll_t* poll;
int r;

Newx(poll, 1, uv_poll_t);

r = uv_poll_init(uv_default_loop(), poll, fd);
if (r) {
croak("cannot initialize poll handle");
}

ST(0) = sv_handle_wrap_init((uv_handle_t*)poll, UV_POLL);
XSRETURN(1);
}

int
uv_poll_start(uv_poll_t* handle, int events, SV* cb)
CODE:
{
p5uv_poll_t* p5poll = (p5uv_poll_t*)handle->data;

if (p5poll->cb)
SvREFCNT_dec(p5poll->cb);
p5poll->cb = SvREFCNT_inc(cb);

RETVAL = uv_poll_start(handle, events, poll_cb);
}
OUTPUT:
RETVAL

int
uv_poll_stop(uv_poll_t* handle)

int
uv_guess_handle(int fd)

Expand Down Expand Up @@ -1508,6 +1472,42 @@ CODE:
uv_pipe_connect(req, pipe, name, connect_cb);
}

void
uv_poll_init(int fd)
CODE:
{
uv_poll_t* poll;
int r;

Newx(poll, 1, uv_poll_t);

r = uv_poll_init(uv_default_loop(), poll, fd);
if (r) {
croak("cannot initialize poll handle");
}

ST(0) = sv_handle_wrap_init((uv_handle_t*)poll, UV_POLL);
XSRETURN(1);
}

int
uv_poll_start(uv_poll_t* handle, int events, SV* cb)
CODE:
{
p5uv_poll_t* p5poll = (p5uv_poll_t*)handle->data;

if (p5poll->cb)
SvREFCNT_dec(p5poll->cb);
p5poll->cb = SvREFCNT_inc(cb);

RETVAL = uv_poll_start(handle, events, poll_cb);
}
OUTPUT:
RETVAL

int
uv_poll_stop(uv_poll_t* handle)

void
uv_prepare_init()
CODE:
Expand Down

0 comments on commit a871c7b

Please sign in to comment.