The previous patch removed the ->init() method of the afh receiver.
Since the afh receiver was the only receiver that defined an init
method, the method can now be removed from struct receiver.
As a consequence, recv_init(), which calls each receiver's init method
has become a no-op and can also be removed.
return ret;
}
-/** See \ref recv_init(). */
const struct receiver lsg_recv_cmd_com_afh_user_data = {
.open = afh_recv_open,
.close = afh_recv_close,
parse_config_or_die();
crypt_init();
daemon_set_priority(OPT_UINT32_VAL(PRIORITY));
- recv_init();
if (daemon_init_colors_or_die(OPT_UINT32_VAL(COLOR), COLOR_AUTO,
COLOR_NO, OPT_GIVEN(LOGFILE))) {
for (i = 0; i < OPT_GIVEN(LOG_COLOR); i++)
return ret;
}
-/** See \ref recv_init(). */
const struct receiver lsg_recv_cmd_com_dccp_user_data = {
.open = dccp_recv_open,
.close = dccp_recv_close,
return 1;
}
-/** See \ref recv_init(). */
const struct receiver lsg_recv_cmd_com_http_user_data = {
.open = http_recv_open,
.close = http_recv_close,
int ret;
unsigned num_inputs;
- /* needed this early to make help work */
- recv_init();
-
sched.default_timeout.tv_sec = 5;
parse_config_or_die(argc, argv);
session_open();
loglevel = OPT_UINT32_VAL(LOGLEVEL, lpr);
version_handle_flag("recv", OPT_GIVEN(VERSION, lpr));
handle_help_flag(lpr);
- recv_init();
memset(&rn, 0, sizeof(struct receiver_node));
ret = check_receiver_arg(OPT_STRING_VAL(RECEIVER, lpr), &receiver_lpr);
if (ret < 0)
* \sa \ref http_recv.c, \ref udp_recv.c.
*/
struct receiver {
- /**
- * The optional receiver init function.
- *
- * Performs any initialization needed before the receiver can be opened.
- */
- void (*init)(void);
/**
* Open one instance of the receiver.
*
/** Iterate over all available receivers. */
#define FOR_EACH_RECEIVER(i) for (i = 1; lls_cmd(i, recv_cmd_suite); i++)
-void recv_init(void);
int check_receiver_arg(const char *ra, struct lls_parse_result **lprp);
void print_receiver_helps(bool detailed);
int generic_recv_pre_select(struct sched *s, struct receiver_node *rn);
#include "recv.h"
#include "string.h"
-/**
- * Call the init function of each paraslash receiver.
- *
- * Receivers employ the user_data feature of the lopsub library: Each receiver
- * of the recv_cmd suite defines a struct receiver as its user data.
- * recv_init() obtains a pointer to this structure by calling lls_user_data().
- * If the receiver has an init function (i.e., if ->init is not NULL), ->init()
- * is called to initialize the receiver.
- */
-void recv_init(void)
-{
- int i;
-
- FOR_EACH_RECEIVER(i) {
- const struct lls_command *cmd = RECV_CMD(i);
- const struct receiver *r = lls_user_data(cmd);
- if (r && r->init)
- r->init();
- }
-}
-
/**
* Check if the given string is a valid receiver specifier.
*
return ret;
}
-/** See \ref recv_init(). */
const struct receiver lsg_recv_cmd_com_udp_user_data = {
.open = udp_recv_open,
.close = udp_recv_close,