# dmxsigio.c File Reference

`#include "inputstr.h"`
`#include "dmxinputinit.h"`
`#include "dmxsigio.h"`
`#include "dmxevents.h"`
`#include <signal.h>`
`#include <unistd.h>`
`#include <fcntl.h>`

## Defines

#define | O_ASYNC 0
#define | O_NONBLOCK FNONBLK

## Functions

static void | dmxSigioHandler (int sig)
void | dmxSigioBlock (void)
void | dmxSigioUnblock (void)
static void | dmxSigioHook (void)
static void | dmxSigioUnhook (void)
static void | dmxSigioAdd (DMXInputInfo *dmxInput)
static void | dmxSigioRemove (DMXInputInfo *dmxInput)
void | dmxSigioEnableInput (void)
void | dmxSigioDisableInput (void)
void | dmxSigioRegister (DMXInputInfo *dmxInput, int fd)
void | dmxSigioUnregister (DMXInputInfo *dmxInput)

## Variables

static int | dmxFdCount = 0
static Bool | dmxInputEnabled = TRUE

## Detailed Description

Provides an interface for handling SIGIO signals for input devices.

## Define Documentation

#define O_ASYNC 0

Referenced by dmxSigioAdd(), and dmxSigioRemove().

#define O_NONBLOCK FNONBLK

Referenced by kbdLinuxOpenVT(), msLinuxInit(), ps2LinuxInit(), and usbInit().

## Function Documentation

static void dmxSigioAdd | ( | DMXInputInfo * | dmxInput | ) | `[static]`

References DMX_ACTIVESIGIO, DMX_NOSIGIO, DMX_USESIGIO, dmxFdCount, dmxSigioHook(), O_ASYNC, _DMXInputInfo::sigioAdded, _DMXInputInfo::sigioFd, _DMXInputInfo::sigioFdCount, and _DMXInputInfo::sigioState.

Referenced by dmxSigioEnableInput(), and dmxSigioRegister().

void dmxSigioBlock | ( | void |  | ) |

Block SIGIO handling.

Referenced by dmxCoreMotion(), dmxExtMotion(), and dmxTranslateAndEnqueueExtEvent().

void dmxSigioDisableInput | ( | void |  | ) |

Disable SIGIO handling. This removes the hanlder from the OS.

References dmxInputEnabled, dmxInputs, dmxNumInputs, and dmxSigioRemove().

Referenced by dmxWakeupHandler().

void dmxSigioEnableInput | ( | void |  | ) |

Enable SIGIO handling. This instantiates the handler with the OS.

References dmxInputEnabled, dmxInputs, dmxNumInputs, and dmxSigioAdd().

Referenced by dmxSwitchReturn().

static void dmxSigioHandler | ( | int | sig | ) | `[static]`

References _DMXLocalInputInfo::collect_events, _DMXInputInfo::devs, DMX_ACTIVESIGIO, DMX_NO_BLOCK, dmxCheckSpecialKeys(), dmxEnqueue(), dmxInputs, dmxMotion(), dmxNumInputs, _DMXInputInfo::numDevs, _DMXLocalInputInfo::pDevice, and _DMXInputInfo::sigioState.

static void dmxSigioHook | ( | void |  | ) | `[static]`

Referenced by dmxSigioAdd().

void dmxSigioRegister | ( | DMXInputInfo * | dmxInput,
|  | int | fd |
| ) |  |  |

Make a note that the input device described in dmxInput will be using the file descriptor fd for SIGIO signals. Calls AddEnabledDevice ifi SIGIO handling has been enabled with dmxSigioEnableInput().

References DMX_MAX_SIGIO_FDS, dmxFatal, dmxInputEnabled, dmxLog(), dmxSigioAdd(), _DMXInputInfo::sigioFd, _DMXInputInfo::sigioFdCount, and _DMXInputInfo::sigioState.

Referenced by dmxDeviceOnOff().

static void dmxSigioRemove | ( | DMXInputInfo * | dmxInput | ) | `[static]`

References DMX_ACTIVESIGIO, DMX_NOSIGIO, DMX_USESIGIO, dmxFdCount, dmxSigioUnhook(), O_ASYNC, _DMXInputInfo::sigioAdded, _DMXInputInfo::sigioFd, _DMXInputInfo::sigioFdCount, and _DMXInputInfo::sigioState.

Referenced by dmxSigioDisableInput(), and dmxSigioUnregister().

void dmxSigioUnblock | ( | void |  | ) |

Unblock SIGIO handling.

Referenced by dmxCoreMotion(), dmxExtMotion(), and dmxTranslateAndEnqueueExtEvent().

static void dmxSigioUnhook | ( | void |  | ) | `[static]`

Referenced by dmxSigioRemove().

void dmxSigioUnregister | ( | DMXInputInfo * | dmxInput | ) |

Remove the notes that dmxInput is using any file descriptors for SIGIO signals. Calls RemoveEnabledDevice.

References DMX_NOSIGIO, dmxSigioRemove(), _DMXInputInfo::sigioFdCount, and _DMXInputInfo::sigioState.

Referenced by dmxDeviceOnOff().

## Variable Documentation

int dmxFdCount = 0`[static]`

Referenced by dmxSigioAdd(), and dmxSigioRemove().

Bool dmxInputEnabled = TRUE`[static]`

Referenced by dmxSigioDisableInput(), dmxSigioEnableInput(), and dmxSigioRegister().

Generated June 29, 2004 for Distributed Multihead X by doxygen 1.3.4. </addres>