paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Data Structures | Macros | Functions
recv.h File Reference

Receiver-related structures and exported symbols of recv_common.c. More...

Data Structures

struct  receiver_node
 Describes one instance of a receiver. More...
 
struct  receiver
 Describes a possible data source for audio streams. More...
 

Macros

#define RECV_CMD(_num)   (lls_cmd(_num, recv_cmd_suite))
 
#define RECV_CMD_OPT_RESULT(_recv, _opt, _lpr)    (lls_opt_result(LSG_RECV_CMD_ ## _recv ## _OPT_ ## _opt, _lpr))
 
#define RECV_CMD_OPT_GIVEN(_recv, _opt, _lpr)    (lls_opt_given(RECV_CMD_OPT_RESULT(_recv, _opt, _lpr)))
 
#define RECV_CMD_OPT_STRING_VAL(_recv, _opt, _lpr)    (lls_string_val(0, RECV_CMD_OPT_RESULT(_recv, _opt, _lpr)))
 
#define RECV_CMD_OPT_UINT32_VAL(_recv, _opt, _lpr)    (lls_uint32_val(0, RECV_CMD_OPT_RESULT(_recv, _opt, _lpr)))
 
#define RECV_CMD_OPT_INT32_VAL(_recv, _opt, _lpr)    (lls_int32_val(0, RECV_CMD_OPT_RESULT(_recv, _opt, _lpr)))
 
#define FOR_EACH_RECEIVER(i)   for (i = 1; lls_cmd(i, recv_cmd_suite); i++)
 Iterate over all available receivers. More...
 

Functions

int check_receiver_arg (const char *ra, struct lls_parse_result **lprp)
 Check if the given string is a valid receiver specifier. More...
 
void print_receiver_helps (bool detailed)
 Print out the help texts to all receivers. More...
 
int generic_recv_pre_monitor (struct sched *s, struct receiver_node *rn)
 Request a minimal timeout in case of buffer tree errors. More...
 

Detailed Description

Receiver-related structures and exported symbols of recv_common.c.

Macro Definition Documentation

◆ RECV_CMD

#define RECV_CMD (   _num)    (lls_cmd(_num, recv_cmd_suite))

◆ RECV_CMD_OPT_RESULT

#define RECV_CMD_OPT_RESULT (   _recv,
  _opt,
  _lpr 
)     (lls_opt_result(LSG_RECV_CMD_ ## _recv ## _OPT_ ## _opt, _lpr))

◆ RECV_CMD_OPT_GIVEN

#define RECV_CMD_OPT_GIVEN (   _recv,
  _opt,
  _lpr 
)     (lls_opt_given(RECV_CMD_OPT_RESULT(_recv, _opt, _lpr)))

◆ RECV_CMD_OPT_STRING_VAL

#define RECV_CMD_OPT_STRING_VAL (   _recv,
  _opt,
  _lpr 
)     (lls_string_val(0, RECV_CMD_OPT_RESULT(_recv, _opt, _lpr)))

◆ RECV_CMD_OPT_UINT32_VAL

#define RECV_CMD_OPT_UINT32_VAL (   _recv,
  _opt,
  _lpr 
)     (lls_uint32_val(0, RECV_CMD_OPT_RESULT(_recv, _opt, _lpr)))

◆ RECV_CMD_OPT_INT32_VAL

#define RECV_CMD_OPT_INT32_VAL (   _recv,
  _opt,
  _lpr 
)     (lls_int32_val(0, RECV_CMD_OPT_RESULT(_recv, _opt, _lpr)))

◆ FOR_EACH_RECEIVER

#define FOR_EACH_RECEIVER (   i)    for (i = 1; lls_cmd(i, recv_cmd_suite); i++)

Iterate over all available receivers.

Function Documentation

◆ check_receiver_arg()

int check_receiver_arg ( const char *  ra,
struct lls_parse_result **  lprp 
)

Check if the given string is a valid receiver specifier.

Parameters
rastring of the form receiver_name [options...]
lprpFilled in on success, undefined else.

This function checks whether ra starts with the name of a receiver, optionally followed by options for that receiver. If a valid receiver name was found the remaining part of ra is passed to the receiver's config parser.

If a NULL pointer or an empty string is passed as the first argument, the hhtp receiver with no options is assumed.

Returns
On success the number of the receiver is returned. On errors, the function calls exit(EXIT_FAILURE).

References alloc(), create_argv(), free_argv(), lls(), PARA_EMERG_LOG, PARA_ERROR_LOG, para_strdup(), para_strerror(), and RECV_CMD.

◆ print_receiver_helps()

void print_receiver_helps ( bool  detailed)

Print out the help texts to all receivers.

Parameters
detailedWhether to print the short or the detailed help.

References FOR_EACH_RECEIVER, and RECV_CMD.

◆ generic_recv_pre_monitor()

int generic_recv_pre_monitor ( struct sched s,
struct receiver_node rn 
)

Request a minimal timeout in case of buffer tree errors.

Parameters
sThe scheduler instance.
rnThe buffer tree node is derived from this.

If the buffer tree node of the given receiver node is in error or EOF state, a minimal I/O timeout is requested from the scheduler. Otherwise, the function does nothing. No file descriptors are asked to be monitored.

Returns
The status of of the receiver node's buffer tree node. That is, the return value of the underlying call to btr_node_status().

References btr_node_status(), BTR_NT_ROOT, receiver_node::btrn, and sched_min_delay().