eloop_none.c File Reference

Event loop - empty template (basic structure, but no OS specific operations). More...

#include "includes.h"
#include "common.h"
#include "eloop.h"
Include dependency graph for eloop_none.c:

Go to the source code of this file.

Data Structures

struct  eloop_sock
struct  eloop_timeout
struct  eloop_signal
struct  eloop_data

Functions

int eloop_init (void *user_data)
 Initialize global event loop data.
int eloop_register_read_sock (int sock, void(*handler)(int sock, void *eloop_ctx, void *sock_ctx), void *eloop_data, void *user_data)
void eloop_unregister_read_sock (int sock)
 Unregister handler for read events.
int eloop_register_timeout (unsigned int secs, unsigned int usecs, void(*handler)(void *eloop_ctx, void *timeout_ctx), void *eloop_data, void *user_data)
int eloop_cancel_timeout (void(*handler)(void *eloop_ctx, void *sock_ctx), void *eloop_data, void *user_data)
int eloop_is_timeout_registered (void(*handler)(void *eloop_ctx, void *timeout_ctx), void *eloop_data, void *user_data)
int eloop_register_signal (int sig, void(*handler)(int sig, void *eloop_ctx, void *signal_ctx), void *user_data)
int eloop_register_signal_terminate (void(*handler)(int sig, void *eloop_ctx, void *signal_ctx), void *user_data)
int eloop_register_signal_reconfig (void(*handler)(int sig, void *eloop_ctx, void *signal_ctx), void *user_data)
void eloop_run (void)
 Start the event loop.
void eloop_terminate (void)
 Terminate event loop.
void eloop_destroy (void)
 Free any resources allocated for the event loop.
int eloop_terminated (void)
 Check whether event loop has been terminated.
void eloop_wait_for_read_sock (int sock)
 Wait for a single reader.
void * eloop_get_user_data (void)
 Get global user data.

Detailed Description

Event loop - empty template (basic structure, but no OS specific operations).

Copyright
Copyright (c) 2002-2005, Jouni Malinen <j@w1.fi>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Alternatively, this software may be distributed under the terms of BSD license.

See README and COPYING for more details.

Definition in file eloop_none.c.


Function Documentation

void eloop_destroy ( void   ) 

Free any resources allocated for the event loop.

After calling eloop_destroy(), other eloop_* functions must not be called before re-running eloop_init().

Definition at line 378 of file eloop_none.c.

void* eloop_get_user_data ( void   ) 

Get global user data.

Returns:
user_data pointer that was registered with eloop_init()

Definition at line 408 of file eloop_none.c.

int eloop_init ( void *  user_data  ) 

Initialize global event loop data.

Parameters:
user_data Pointer to global data passed as eloop_ctx to signal handlers
Returns:
0 on success, -1 on failure

This function must be called before any other eloop_* function. user_data can be used to configure a global (to the process) pointer that will be passed as eloop_ctx parameter to signal handlers.

Definition at line 64 of file eloop_none.c.

void eloop_run ( void   ) 

Start the event loop.

Start the event loop and continue running as long as there are any registered event handlers. This function is run after event loop has been initialized with event_init() and one or more events have been registered.

Definition at line 315 of file eloop_none.c.

Here is the call graph for this function:

void eloop_terminate ( void   ) 

Terminate event loop.

Terminate event loop even if there are registered events. This can be used to request the program to be terminated cleanly.

Definition at line 372 of file eloop_none.c.

int eloop_terminated ( void   ) 

Check whether event loop has been terminated.

Returns:
1 = event loop terminate, 0 = event loop still running

This function can be used to check whether eloop_terminate() has been called to request termination of the event loop. This is normally used to abort operations that may still be queued to be run when eloop_terminate() was called.

Definition at line 393 of file eloop_none.c.

void eloop_unregister_read_sock ( int  sock  ) 

Unregister handler for read events.

Parameters:
sock File descriptor number for the socket

Unregister a read socket notifier that was previously registered with eloop_register_read_sock().

Definition at line 99 of file eloop_none.c.

void eloop_wait_for_read_sock ( int  sock  ) 

Wait for a single reader.

Parameters:
sock File descriptor number for the socket

Do a blocking wait for a single read socket.

Definition at line 399 of file eloop_none.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:23:37 2009 for hostapd by  doxygen 1.6.1