mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-25 20:54:15 +00:00
freetdm: iterators refactoring
add channel iterator
This commit is contained in:
1 parent
e6d6045ba6
commit
bc2638334b
5 files changed
+161
-22
No files matched your search
@@ -619,6 +619,9 @@ FT_DECLARE(ftdm_status_t) ftdm_span_trigger_signals(const ftdm_span_t *span);
|
||||
#define ftdm_log_chan(fchan, level, format, ...) ftdm_log(level, "[s%dc%d][%d:%d] " format, fchan->span_id, fchan->chan_id, fchan->physical_span_id, fchan->physical_chan_id, __VA_ARGS__)
|
||||
#define ftdm_log_chan_msg(fchan, level, msg) ftdm_log(level, "[s%dc%d][%d:%d] " msg, fchan->span_id, fchan->chan_id, fchan->physical_span_id, fchan->physical_chan_id)
|
||||
|
||||
#define ftdm_span_lock(span) ftdm_mutex_lock(span->mutex)
|
||||
#define ftdm_span_unlock(span) ftdm_mutex_unlock(span->mutex)
|
||||
|
||||
FT_DECLARE_DATA extern const char *FTDM_LEVEL_NAMES[9];
|
||||
|
||||
static __inline__ void ftdm_abort(void)
|
||||
|
||||
@@ -366,6 +366,23 @@ typedef ftdm_status_t (*ftdm_span_start_t)(ftdm_span_t *span);
|
||||
typedef ftdm_status_t (*ftdm_span_stop_t)(ftdm_span_t *span);
|
||||
typedef ftdm_status_t (*ftdm_channel_sig_read_t)(ftdm_channel_t *ftdmchan, void *data, ftdm_size_t size);
|
||||
|
||||
typedef enum {
|
||||
FTDM_ITERATOR_VARS = 1,
|
||||
FTDM_ITERATOR_CHANS,
|
||||
} ftdm_iterator_type_t;
|
||||
|
||||
struct ftdm_iterator {
|
||||
ftdm_iterator_type_t type;
|
||||
unsigned int allocated:1;
|
||||
union {
|
||||
struct {
|
||||
int32_t index;
|
||||
const ftdm_span_t *span;
|
||||
} chaniter;
|
||||
ftdm_hash_iterator_t *hashiter;
|
||||
} pvt;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in new issue
Block a user