Lines Matching defs:ctx

27 **		ctx -- Opaque context structure
38 smfi_header(ctx, cmd, hdridx, headerf, headerv)
39 SMFICTX *ctx;
53 timeout.tv_sec = ctx->ctx_timeout;
72 r = mi_wr_cmd(ctx->ctx_sd, &timeout, cmd, buf, len);
81 ** ctx -- Opaque context structure
90 smfi_addheader(ctx, headerf, headerv)
91 SMFICTX *ctx;
95 if (!mi_sendok(ctx, SMFIF_ADDHDRS))
98 return smfi_header(ctx, SMFIR_ADDHEADER, -1, headerf, headerv);
105 ** ctx -- Opaque context structure
115 smfi_insheader(ctx, hdridx, headerf, headerv)
116 SMFICTX *ctx;
121 if (!mi_sendok(ctx, SMFIF_ADDHDRS) || hdridx < 0)
124 return smfi_header(ctx, SMFIR_INSHEADER, hdridx, headerf, headerv);
131 ** ctx -- Opaque context structure
141 smfi_chgheader(ctx, headerf, hdridx, headerv)
142 SMFICTX *ctx;
147 if (!mi_sendok(ctx, SMFIF_CHGHDRS) || hdridx < 0)
152 return smfi_header(ctx, SMFIR_CHGHEADER, hdridx, headerf, headerv);
160 ** ctx -- Opaque context structure
173 buf_crt_send(ctx, cmd, arg0, argv)
174 SMFICTX *ctx;
186 timeout.tv_sec = ctx->ctx_timeout;
215 r = mi_wr_cmd(ctx->ctx_sd, &timeout, cmd, buf, len);
225 ** ctx -- Opaque context structure
238 send2(ctx, cmd, arg0, arg1)
239 SMFICTX *ctx;
251 timeout.tv_sec = ctx->ctx_timeout;
278 r = mi_wr_cmd(ctx->ctx_sd, &timeout, cmd, buf, len);
287 ** ctx -- Opaque context structure
296 smfi_chgfrom(ctx, from, args)
297 SMFICTX *ctx;
303 if (!mi_sendok(ctx, SMFIF_CHGFROM))
305 return send2(ctx, SMFIR_CHGFROM, from, args);
312 ** ctx -- Opaque context structure
321 smfi_setsymlist(ctx, where, macros)
322 SMFICTX *ctx;
326 SM_ASSERT(ctx != NULL);
335 if (ctx->ctx_mac_list[where] != NULL)
338 ctx->ctx_mac_list[where] = strdup(macros);
339 if (ctx->ctx_mac_list[where] == NULL)
349 ** ctx -- Opaque context structure
358 smfi_addrcpt_par(ctx, rcpt, args)
359 SMFICTX *ctx;
365 if (!mi_sendok(ctx, SMFIF_ADDRCPT_PAR))
367 return send2(ctx, SMFIR_ADDRCPT_PAR, rcpt, args);
374 ** ctx -- Opaque context structure
382 smfi_addrcpt(ctx, rcpt)
383 SMFICTX *ctx;
391 if (!mi_sendok(ctx, SMFIF_ADDRCPT))
393 timeout.tv_sec = ctx->ctx_timeout;
396 return mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_ADDRCPT, rcpt, len);
403 ** ctx -- Opaque context structure
411 smfi_delrcpt(ctx, rcpt)
412 SMFICTX *ctx;
420 if (!mi_sendok(ctx, SMFIF_DELRCPT))
422 timeout.tv_sec = ctx->ctx_timeout;
425 return mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_DELRCPT, rcpt, len);
432 ** ctx -- Opaque context structure
441 smfi_replacebody(ctx, bodyp, bodylen)
442 SMFICTX *ctx;
452 if (!mi_sendok(ctx, SMFIF_CHGBODY))
454 timeout.tv_sec = ctx->ctx_timeout;
463 if ((r = mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_REPLBODY,
476 ** ctx -- Opaque context structure
484 smfi_quarantine(ctx, reason)
485 SMFICTX *ctx;
495 if (!mi_sendok(ctx, SMFIF_QUARANTINE))
497 timeout.tv_sec = ctx->ctx_timeout;
504 r = mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_QUARANTINE, buf, len);
554 ** ctx -- Opaque context structure
564 smfi_setreply(ctx, rcode, xcode, message)
565 SMFICTX *ctx;
573 if (rcode == NULL || ctx == NULL)
615 if (ctx->ctx_reply != NULL)
616 free(ctx->ctx_reply);
617 ctx->ctx_reply = buf;
625 ** ctx -- Opaque context structure
637 smfi_setmlreply(SMFICTX *ctx, const char *rcode, const char *xcode, ...)
639 smfi_setmlreply(ctx, rcode, xcode, va_alist)
640 SMFICTX *ctx;
654 if (rcode == NULL || ctx == NULL)
726 if (ctx->ctx_reply != NULL)
727 free(ctx->ctx_reply);
728 ctx->ctx_reply = buf;
737 ** ctx -- Opaque context structure
745 smfi_setpriv(ctx, privatedata)
746 SMFICTX *ctx;
749 if (ctx == NULL)
751 ctx->ctx_privdata = privatedata;
759 ** ctx -- Opaque context structure
766 smfi_getpriv(ctx)
767 SMFICTX *ctx;
769 if (ctx == NULL)
771 return ctx->ctx_privdata;
780 ** ctx -- Opaque context structure
788 smfi_getsymval(ctx, symname)
789 SMFICTX *ctx;
797 if (ctx == NULL || symname == NULL || *symname == '\0')
820 if ((s = ctx->ctx_mac_ptr[i]) == NULL ||
821 ctx->ctx_mac_buf[i] == NULL)
843 ** ctx -- Opaque context structure
850 smfi_progress(ctx)
851 SMFICTX *ctx;
855 if (ctx == NULL)
858 timeout.tv_sec = ctx->ctx_timeout;
861 return mi_wr_cmd(ctx->ctx_sd, &timeout, SMFIR_PROGRESS, NULL, 0);