1 /* qu2bb_send.c - manager for qu --> bb */
8 extern struct ll_struct *logptr;
10 struct rp_construct rp_aend = { /* end of address list */
12 'b', 'b', 'o', 'a', 'r', 'd', 's', ' ', 'e', 'n', 'd', ' ',
13 'o', 'f', ' ', 'a', 'd', 'd', 'r', ' ', 'l', 'i', 's', 't',
17 struct rp_construct rp_badr = { /* no such bboard */
19 'u', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'b', 'b', 'o', 'a', 'r', 'd',
23 struct rp_construct rp_err = { /* error, retry later */
25 'u', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'e', 'r', 'r', 'o', 'r',
37 ll_log (logptr, LLOGBTR, "qu2bb_send()");
40 if (rp_isbad (result = qu_pkinit ()))
42 if (rp_isbad (result = bb_sbinit ()))
45 while (rp_gval ((result = qu_rinit (info, sender))) == RP_OK) {
47 ll_log (logptr, LLOGGEN, "info=%s sender=%s", info, sender);
49 if (rp_isbad (result = bb_winit (info, sender)))
51 if (rp_isbad (result = qu2bb_each (sender)))
55 if (rp_gval (result) != RP_DONE) {
56 ll_log (logptr, LLOGTMP, "not DONE [%s]", rp_valstr (result));
77 ll_log (logptr, LLOGBTR, "qu2bb_each(sender='%s')", sender);
80 FOREVER { /* loop through the addresses */
81 if (rp_isbad (result = qu_radr (host, adr)))
83 if (rp_gval (result) == RP_DONE) {
84 qu_wrply ((RP_Buf *) & rp_aend, rp_conlen (rp_aend));
88 switch (replyval.rp_val = bb_wtadr (host, adr)) {
91 switch (replyval.rp_val = bb_txtcpy ()) {
93 replyval.rp_line[0] = NULL;
96 ll_log (logptr, LLOGFAT, "unknown error [%s]",
97 rp_valstr (replyval.rp_val));
98 blt (&rp_err, (char *) & replyval, sizeof rp_err);
104 ll_log (logptr, LLOGFAT, "unknown bboard '%s'", adr);
105 blt (&rp_badr, (char *) & replyval, sizeof rp_badr);
109 ll_log (logptr, LLOGFAT, "unknown error [%s]",
110 rp_valstr (replyval.rp_val));
111 blt (&rp_err, (char *) & replyval, sizeof rp_err);
116 (sizeof replyval.rp_val) + strlen (replyval.rp_line));