ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/event.c
(Generate patch)

Comparing libev/event.c (file contents):
Revision 1.42 by root, Mon May 10 20:01:45 2010 UTC vs.
Revision 1.44 by root, Sat Oct 16 06:46:55 2010 UTC

1/* 1/*
2 * libevent compatibility layer 2 * libevent compatibility layer
3 * 3 *
4 * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de> 4 * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libev@schmorp.de>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without modifica- 7 * Redistribution and use in source and binary forms, with or without modifica-
8 * tion, are permitted provided that the following conditions are met: 8 * tion, are permitted provided that the following conditions are met:
9 * 9 *
61 int dummy; 61 int dummy;
62}; 62};
63 63
64static struct event_base *ev_x_cur; 64static struct event_base *ev_x_cur;
65 65
66static void
67ev_tv_set (struct timeval *tv, ev_tstamp at)
68{
69 tv->tv_sec = (long)at;
70 tv->tv_usec = (long)((at - (ev_tstamp)tv->tv_sec) * 1e6);
71}
72
73static ev_tstamp 66static ev_tstamp
74ev_tv_get (struct timeval *tv) 67ev_tv_get (struct timeval *tv)
75{ 68{
76 if (tv) 69 if (tv)
77 { 70 {
303 if (ev->ev_events & EV_TIMEOUT || ev_is_active (&ev->to) || ev_is_pending (&ev->to)) 296 if (ev->ev_events & EV_TIMEOUT || ev_is_active (&ev->to) || ev_is_pending (&ev->to))
304 { 297 {
305 revents |= EV_TIMEOUT; 298 revents |= EV_TIMEOUT;
306 299
307 if (tv) 300 if (tv)
308 ev_tv_set (tv, ev_now (EV_A)); /* not sure if this is right :) */ 301 EV_TV_SET (tv, ev_now (EV_A)); /* not sure if this is right :) */
309 } 302 }
310 303
311 return events & revents; 304 return events & revents;
312} 305}
313 306

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines