freetdm: - Extend ftdm interrupt object to notify which IO events are ready in the device

- Add definition of FTDM_MAX_SIG_PARAMETERS to have a standard limit for signaling module parameters
This commit is contained in:
Moises Silva
2011-12-25 20:49:10 -05:00
parent 06eee95da8
commit de98034145
8 changed files with 70 additions and 29 deletions

View File

@@ -62,6 +62,9 @@
/*! \brief Max number of groups */
#define FTDM_MAX_GROUPS_INTERFACE FTDM_MAX_SPANS_INTERFACE
/*! \brief Max number of key=value pairs to be sent as signaling stack parameters */
#define FTDM_MAX_SIG_PARAMETERS 30
#define FTDM_INVALID_INT_PARM 0xFF
/*! \brief Thread/Mutex OS abstraction API. */
@@ -621,14 +624,6 @@ typedef enum {
FTDM_CRASH_ON_ASSERT
} ftdm_crash_policy_t;
/*! \brief I/O waiting flags */
typedef enum {
FTDM_NO_FLAGS = 0,
FTDM_READ = (1 << 0),
FTDM_WRITE = (1 << 1),
FTDM_EVENTS = (1 << 2)
} ftdm_wait_flag_t;
/*! \brief Signaling configuration parameter for the stacks (variable=value pair) */
typedef struct ftdm_conf_parameter {
const char *var;

View File

@@ -203,6 +203,14 @@ typedef enum {
FTDM_TRUE
} ftdm_bool_t;
/*! \brief I/O waiting flags */
typedef enum {
FTDM_NO_FLAGS = 0,
FTDM_READ = (1 << 0),
FTDM_WRITE = (1 << 1),
FTDM_EVENTS = (1 << 2)
} ftdm_wait_flag_t;
/*!
* \brief FreeTDM channel.
* This is the basic data structure used to place calls and I/O operations

View File

@@ -52,11 +52,12 @@ FT_DECLARE(ftdm_status_t) _ftdm_mutex_trylock(const char *file, int line, const
#define ftdm_mutex_unlock(_x) _ftdm_mutex_unlock(__FILE__, __LINE__, __FUNCTION__, _x)
FT_DECLARE(ftdm_status_t) _ftdm_mutex_unlock(const char *file, int line, const char *func, ftdm_mutex_t *mutex);
FT_DECLARE(ftdm_status_t) ftdm_interrupt_create(ftdm_interrupt_t **cond, ftdm_socket_t device);
FT_DECLARE(ftdm_status_t) ftdm_interrupt_create(ftdm_interrupt_t **cond, ftdm_socket_t device, ftdm_wait_flag_t device_flags);
FT_DECLARE(ftdm_status_t) ftdm_interrupt_destroy(ftdm_interrupt_t **cond);
FT_DECLARE(ftdm_status_t) ftdm_interrupt_signal(ftdm_interrupt_t *cond);
FT_DECLARE(ftdm_status_t) ftdm_interrupt_wait(ftdm_interrupt_t *cond, int ms);
FT_DECLARE(ftdm_status_t) ftdm_interrupt_multiple_wait(ftdm_interrupt_t *interrupts[], ftdm_size_t size, int ms);
FT_DECLARE(ftdm_wait_flag_t) ftdm_interrupt_device_ready(ftdm_interrupt_t *interrupt);
#ifdef __cplusplus
}