Lines Matching defs:ctx
29 ** ctx -- Opaque context structure
40 smfi_header(ctx, cmd, hdridx, headerf, headerv)
41 SMFICTX *ctx;
55 timeout.tv_sec = ctx->ctx_timeout;
74 r = mi_wr_cmd(ctx->ctx_sd, &timeout, cmd, buf, len);
83 ** ctx -- Opaque context structure
92 smfi_addheader(ctx, headerf, headerv)
93 SMFICTX *ctx;
97 if (!mi_sendok(ctx, SMFIF_ADDHDRS))
100 return smfi_header(ctx, SMFIR_ADDHEADER, -1, headerf, headerv);
107 ** ctx -- Opaque context structure
117 smfi_insheader(ctx, hdridx, headerf, headerv)
118 SMFICTX *ctx;
123 if (!mi_sendok(ctx, SMFIF_ADDHDRS) || hdridx < 0)
126 return smfi_header(ctx, SMFIR_INSHEADER, hdridx, headerf, headerv);
133 ** ctx -- Opaque context structure
143 smfi_chgheader(ctx, headerf, hdridx, headerv)
144 SMFICTX *ctx;
149 if (!mi_sendok(ctx, SMFIF_CHGHDRS) || hdridx < 0)
154 return smfi_header(ctx, SMFIR_CHGHEADER, hdridx, headerf, headerv);
162 ** ctx -- Opaque context structure
175 buf_crt_send(ctx, cmd, arg0, argv)
176 SMFICTX *ctx;
188 timeout.tv_sec = ctx->ctx_timeout;
217 r = mi_wr_cmd(ctx->ctx_sd, &timeout, cmd, buf, len);
227 ** ctx -- Opaque context structure
240 send2(ctx, cmd, arg0, arg1)
241 SMFICTX *ctx;
253 timeout.tv_sec = ctx->ctx_timeout;
280 r = mi_wr_cmd(ctx->ctx_sd, &timeout, cmd, buf, len);
289 ** ctx -- Opaque context structure
298 smfi_chgfrom(ctx, from, args)
299 SMFICTX *ctx;
305 if (!mi_sendok(ctx, SMFIF_CHGFROM))
307 return send2(ctx, SMFIR_CHGFROM, from, args);
314 ** ctx -- Opaque context structure
323 smfi_setsymlist(ctx, where, macros)
324 SMFICTX *ctx;
328 SM_ASSERT(ctx != NULL);
337 if (ctx->ctx_mac_list[where] != NULL)
340 ctx->ctx_mac_list[where] = strdup(macros);
341 if (ctx->ctx_mac_list[where] == NULL)
351 ** ctx -- Opaque context structure
360 smfi_addrcpt_par(ctx, rcpt, args)
361 SMFICTX *ctx;
367 if (!mi_sendok(ctx, SMFIF_ADDRCPT_PAR))
369 return send2(ctx, SMFIR_ADDRCPT_PAR, rcpt, args);
376 ** ctx -- Opaque context structure
384 smfi_addrcpt(ctx, rcpt)
385 SMFICTX *ctx;
393 if (!mi_sendok(ctx, SMFIF_ADDRCPT))
395 timeout.tv_sec = ctx->ctx_timeout;
398 return mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_ADDRCPT, rcpt, len);
405 ** ctx -- Opaque context structure
413 smfi_delrcpt(ctx, rcpt)
414 SMFICTX *ctx;
422 if (!mi_sendok(ctx, SMFIF_DELRCPT))
424 timeout.tv_sec = ctx->ctx_timeout;
427 return mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_DELRCPT, rcpt, len);
434 ** ctx -- Opaque context structure
443 smfi_replacebody(ctx, bodyp, bodylen)
444 SMFICTX *ctx;
454 if (!mi_sendok(ctx, SMFIF_CHGBODY))
456 timeout.tv_sec = ctx->ctx_timeout;
465 if ((r = mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_REPLBODY,
478 ** ctx -- Opaque context structure
486 smfi_quarantine(ctx, reason)
487 SMFICTX *ctx;
497 if (!mi_sendok(ctx, SMFIF_QUARANTINE))
499 timeout.tv_sec = ctx->ctx_timeout;
506 r = mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_QUARANTINE, buf, len);
556 ** ctx -- Opaque context structure
566 smfi_setreply(ctx, rcode, xcode, message)
567 SMFICTX *ctx;
575 if (rcode == NULL || ctx == NULL)
617 if (ctx->ctx_reply != NULL)
618 free(ctx->ctx_reply);
619 ctx->ctx_reply = buf;
627 ** ctx -- Opaque context structure
639 smfi_setmlreply(SMFICTX *ctx, const char *rcode, const char *xcode, ...)
641 smfi_setmlreply(ctx, rcode, xcode, va_alist)
642 SMFICTX *ctx;
656 if (rcode == NULL || ctx == NULL)
728 if (ctx->ctx_reply != NULL)
729 free(ctx->ctx_reply);
730 ctx->ctx_reply = buf;
739 ** ctx -- Opaque context structure
747 smfi_setpriv(ctx, privatedata)
748 SMFICTX *ctx;
751 if (ctx == NULL)
753 ctx->ctx_privdata = privatedata;
761 ** ctx -- Opaque context structure
768 smfi_getpriv(ctx)
769 SMFICTX *ctx;
771 if (ctx == NULL)
773 return ctx->ctx_privdata;
782 ** ctx -- Opaque context structure
790 smfi_getsymval(ctx, symname)
791 SMFICTX *ctx;
799 if (ctx == NULL || symname == NULL || *symname == '\0')
822 if ((s = ctx->ctx_mac_ptr[i]) == NULL ||
823 ctx->ctx_mac_buf[i] == NULL)
845 ** ctx -- Opaque context structure
852 smfi_progress(ctx)
853 SMFICTX *ctx;
857 if (ctx == NULL)
860 timeout.tv_sec = ctx->ctx_timeout;
863 return mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_PROGRESS, NULL, 0);