Sha256: b90182e1da18af23da4f5ca3992cf0c308ee45dcc6eca552535c0e644222f60a

Contents?: true

Size: 1.78 KB

Versions: 18

Compression:

Stored size: 1.78 KB

Contents

/*
 * Trema event handler library.
 *
 * Copyright (C) 2011 axsh Ltd.
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */


#ifndef EVENT_HANDLER_H
#define EVENT_HANDLER_H


#include <sys/types.h>
#include "bool.h"


typedef void ( *event_fd_callback )( int, void *data );
typedef void ( *external_callback_t )( void );

extern void ( *init_event_handler )();
extern void ( *finalize_event_handler )();

extern bool ( *start_event_handler )();
extern void ( *stop_event_handler )();

extern bool ( *run_event_handler_once )( int timeout_usec );

extern void ( *set_fd_handler )( int fd, event_fd_callback read_callback, void *read_data, event_fd_callback write_callback, void *write_data );
extern void ( *delete_fd_handler )( int fd );

extern void ( *set_readable )( int fd, bool state );
extern void ( *set_writable )( int fd, bool state );

extern bool ( *readable )( int fd );
extern bool ( *writable )( int fd );

// Optional functions for event handlers to implement, must be signal
// safe. Leave as NULL if not supported.
extern bool ( *set_external_callback )( external_callback_t callback );


#endif // EVENT_HANDLER_H


/*
 * Local variables:
 * c-basic-offset: 2
 * indent-tabs-mode: nil
 * End:
 */

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
trema-0.4.5 src/lib/event_handler.h
trema-0.4.4 src/lib/event_handler.h
trema-0.4.3 src/lib/event_handler.h
trema-0.4.2 src/lib/event_handler.h
trema-0.4.1 src/lib/event_handler.h
trema-0.4.0 src/lib/event_handler.h
trema-0.3.21 src/lib/event_handler.h
trema-0.3.20 src/lib/event_handler.h
trema-0.3.19 src/lib/event_handler.h
trema-0.3.18 src/lib/event_handler.h
trema-0.3.17 src/lib/event_handler.h
trema-0.3.16 src/lib/event_handler.h
trema-0.3.15 src/lib/event_handler.h
trema-0.3.14 src/lib/event_handler.h
trema-0.3.13 src/lib/event_handler.h
trema-0.3.12 src/lib/event_handler.h
trema-0.3.11 src/lib/event_handler.h
trema-0.3.10 src/lib/event_handler.h