/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Copyright (c) 2003-2004, Jouni Malinen <jkmaline@cc.hut.fi>
* Sun elects to license this software under the BSD license.
* See README for more details.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <poll.h>
#include "eloop.h"
/*
* Initialize global event loop data - must be called before any other eloop_*
* function. user_data is a pointer to global data structure and will be passed
* as eloop_ctx to signal handlers.
*/
void
{
}
/*
* Register handler for read event
*/
int
{
return (-1);
return (0);
}
void
{
int i;
return;
for (i = 0; i < eloop.reader_count; i++) {
break;
}
if (i == eloop.reader_count)
return;
sizeof (struct eloop_sock));
}
}
/*
* Register timeout routines
*/
int
void *eloop_data, void *user_data)
{
return (-1);
}
return (0);
}
break;
}
} else {
}
return (0);
}
/*
* Cancel timeouts matching <handler,eloop_data,user_data>.
* ELOOP_ALL_CTX can be used as a wildcard for cancelling all timeouts
* regardless of eloop_data/user_data.
*/
void
void *eloop_data, void *user_data)
{
eloop_data == ELOOP_ALL_CTX) &&
user_data == ELOOP_ALL_CTX)) {
else
} else
}
}
{
int i;
for (i = 0; i < eloop.signal_count; i++) {
break;
}
}
}
static void eloop_process_pending_signals(void)
{
int i;
return;
for (i = 0; i < eloop.signal_count; i++) {
}
}
}
/*
* Register handler for signal.
* Note: signals are 'global' events and there is no local eloop_data pointer
* like with other handlers. The (global) pointer given to eloop_init() will be
* used as eloop_ctx for signal handlers.
*/
int
void *user_data)
{
tmp = (struct eloop_signal *)
sizeof (struct eloop_signal));
return (-1);
return (0);
}
/*
* Start event loop and continue running as long as there are any registered
* event handlers.
*/
void
eloop_run(void)
{
int i, res;
int default_t, t;
else
}
for (i = 0; i < eloop.reader_count; i++) {
}
return;
/* check if some registered timeouts have occurred */
}
}
if (res <= 0)
continue;
for (i = 0; i < eloop.reader_count; i++) {
}
}
}
}
/*
* Terminate event loop even if there are registered events.
*/
void
eloop_terminate(void)
{
}
/*
* Free any reserved resources. After calling eloop_destoy(), other eloop_*
* functions must not be called before re-running eloop_init().
*/
void
eloop_destroy(void)
{
}
}