File src/dinoex_kqueue.c

* by Dirk Meyer (dinoex) * Copyright (C) 2011-2011 Dirk Meyer * * By using this file, you agree to the terms and conditions set * forth in the GNU General Public License. More information is * available in the LICENSE file. * * If you received this file without documentation, it can be * downloaded from http://iroffer.dinoex.net/ * * $Id: dinoex_kqueue.c,v 1.8 2012/03/16 20:49:37 cvs Exp $ *


Included Files

include the headers


Preprocessor definitions

#define _LONGLONG 1

#define NOTE_EOF 0


Local Variables

ir_kqueue_fd
static int ir_kqueue_fd
Used in: ir_kqueue_init()  
  ir_kqueue_select()  

ir_kqueue_change_size
static int ir_kqueue_change_size

Used in: ir_kqueue_init()  
  ir_kqueue_select()  
  ir_kqueue_set_buffer()  
  ir_kqueue_update()  

ir_kqueue_event_max
static int ir_kqueue_event_max

Used in: ir_kqueue_init()  
  ir_kqueue_select()  
  ir_kqueue_set_buffer()  
  ir_kqueue_update()  

ir_kqueue_change_buffer
static struct kevent* ir_kqueue_change_buffer

Used in: ir_kqueue_exit()  
  ir_kqueue_select()  
  ir_kqueue_set_buffer()  
  ir_kqueue_update()  

ir_kqueue_event_buffer
static struct kevent* ir_kqueue_event_buffer

Used in: ir_kqueue_exit()  
  ir_kqueue_select()  
  ir_kqueue_set_buffer()  

ir_kqueue_readset
emulate select

static fd_set ir_kqueue_readset

Used in: ir_kqueue_close()  
  ir_kqueue_init()  
  ir_kqueue_update()  

ir_kqueue_writeset
static fd_set ir_kqueue_writeset

Used in: ir_kqueue_close()  
  ir_kqueue_init()  
  ir_kqueue_update()  

Global Function event_close()

close and drop events

void event_close ( int handle )

Prototyped in: src/dinoex_kqueue.h
Calls: ir_kqueue_close() src/dinoex_kqueue.c
  close()
Called by: cancel_md5_hash() src/dinoex_jobs.c
  complete_md5_hash() src/dinoex_jobs.c
  connectirc() src/iroffer_misc.c
  connectirc2() src/dinoex_irc.c
  gobackground() src/iroffer_misc.c
  h_close_listen() src/dinoex_http.c
  irc_resolved() src/dinoex_irc.c
  l_closeconn() src/iroffer_upload.c
  l_setup_accept() src/dinoex_upload.c
  mainloop() src/iroffer_main.c
  setupdccchataccept() src/iroffer_dccchat.c
  shutdown_close() src/dinoex_kqueue.c
  t_closeconn() src/iroffer_transfer.c
  t_establishcon() src/iroffer_transfer.c
  telnet_close_listen() src/dinoex_telnet.c
References Variables: gdata src/dinoex_main.c

Global Function ir_kqueue_exit()

release buffers for kqueue

void ir_kqueue_exit ( void )

Prototyped in: src/dinoex_kqueue.h
Calls: free()
Called by: exit_iroffer() src/dinoex_main.c
References Variables: ir_kqueue_change_buffer src/dinoex_kqueue.c
  ir_kqueue_event_buffer src/dinoex_kqueue.c

Global Function ir_kqueue_init()

setup buffers for kqueue

void ir_kqueue_init ( void )

Prototyped in: src/dinoex_kqueue.h
Calls: ir_kqueue_set_buffer() src/dinoex_kqueue.c
  fcntl(), fprintf(), kqueue()
Called by: main() src/iroffer_main.c
References Variables: ir_kqueue_change_size src/dinoex_kqueue.c
  ir_kqueue_event_max src/dinoex_kqueue.c
  ir_kqueue_fd src/dinoex_kqueue.c
  ir_kqueue_readset src/dinoex_kqueue.c
  ir_kqueue_writeset src/dinoex_kqueue.c

Global Function ir_kqueue_select()

poll kqueue status

int ir_kqueue_select ( int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds )

Prototyped in: src/dinoex_kqueue.h
Calls: ioutput() src/iroffer_utilities.c
  ir_kqueue_set_buffer() src/dinoex_kqueue.c
  ir_kqueue_update() src/dinoex_kqueue.c
  outerror() src/iroffer_utilities.c
  __error(), kevent(), strerror()
Called by: mainloop() src/iroffer_main.c
References Variables: gdata src/dinoex_main.c
  ir_kqueue_change_buffer src/dinoex_kqueue.c
  ir_kqueue_change_size src/dinoex_kqueue.c
  ir_kqueue_event_buffer src/dinoex_kqueue.c
  ir_kqueue_event_max src/dinoex_kqueue.c
  ir_kqueue_fd src/dinoex_kqueue.c

Global Function shutdown_close()

close an TCP connection safely

void shutdown_close ( int handle )

Prototyped in: src/dinoex_kqueue.h
Calls: event_close() src/dinoex_kqueue.c
  shutdown()
Called by: close_server() src/dinoex_ssl.c
  h_closeconn() src/dinoex_http.c
  l_closeconn() src/iroffer_upload.c
  l_istimeout() src/iroffer_upload.c
  open_listen() src/dinoex_irc.c
  shutdowndccchat() src/iroffer_dccchat.c
  t_closeconn() src/iroffer_transfer.c
  t_flushed() src/iroffer_transfer.c
  telnet_accept() src/dinoex_telnet.c

Local Function ir_kqueue_close()

static void ir_kqueue_close ( int fd )
Called by: event_close() src/dinoex_kqueue.c
References Variables: ir_kqueue_readset src/dinoex_kqueue.c
  ir_kqueue_writeset src/dinoex_kqueue.c

Local Function ir_kqueue_set_buffer()

static void ir_kqueue_set_buffer ( void )
Calls: free(), malloc(), realloc()
Called by: ir_kqueue_init() src/dinoex_kqueue.c
  ir_kqueue_select() src/dinoex_kqueue.c
  ir_kqueue_update() src/dinoex_kqueue.c
References Variables: ir_kqueue_change_buffer src/dinoex_kqueue.c
  ir_kqueue_change_size src/dinoex_kqueue.c
  ir_kqueue_event_buffer src/dinoex_kqueue.c
  ir_kqueue_event_max src/dinoex_kqueue.c

Local Function ir_kqueue_update()

static void ir_kqueue_update ( int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds )
Calls: ioutput() src/iroffer_utilities.c
  ir_kqueue_set_buffer() src/dinoex_kqueue.c
Called by: ir_kqueue_select() src/dinoex_kqueue.c
References Variables: gdata src/dinoex_main.c
  ir_kqueue_change_buffer src/dinoex_kqueue.c
  ir_kqueue_change_size src/dinoex_kqueue.c
  ir_kqueue_event_max src/dinoex_kqueue.c
  ir_kqueue_readset src/dinoex_kqueue.c
  ir_kqueue_writeset src/dinoex_kqueue.c