Ignore:
Timestamp:
Apr 22, 2006, 9:46:43 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • Allow the caca_event_t *ev argument for caca_get_event() to be NULL.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/event.c

    r811 r849  
    5151 *  function to wait indefinitely until a matching event is received.
    5252 *
     53 *  If not null, \c ev will be filled with information about the event
     54 *  received. If null, the function will return but no information about
     55 *  the event will be sent.
     56 *
    5357 *  \param dp The libcaca graphical context.
    5458 *  \param event_mask Bitmask of requested events.
    5559 *  \param timeout A timeout value in microseconds
    56  *  \param ev A pointer to a caca_event structure.
    57  *  \return The next matching event in the queue, or 0 if no event is pending.
     60 *  \param ev A pointer to a caca_event structure, or NULL.
     61 *  \return 1 if a matching event was received, or 0 if the wait timeouted.
    5862 */
    5963int caca_get_event(caca_display_t *dp, unsigned int event_mask,
    6064                   caca_event_t *ev, int timeout)
    6165{
     66    caca_event_t dummy_event;
    6267    caca_timer_t timer;
    6368    int usec = 0;
     
    6873    if(timeout > 0)
    6974        _caca_getticks(&timer);
     75
     76    if(ev == NULL)
     77        ev = &dummy_event;
    7078
    7179    for( ; ; )
Note: See TracChangeset for help on using the changeset viewer.