Lines Matching defs:ctx
54 smb_ctxbuf_init(smb_ctxbuf_t *ctx, unsigned char *buf, size_t buflen)
56 if (ctx == 0 || buf == 0 || buflen == 0)
61 ctx->basep = buf;
62 ctx->curp = buf;
63 ctx->endp = &buf[buflen];
75 * Returns 0 if the ctx is invalid.
78 smb_ctxbuf_len(smb_ctxbuf_t *ctx)
80 if (ctx == 0 || ctx->basep == 0 ||
81 ctx->curp == 0 || ctx->endp == 0)
85 return (ctx->curp - ctx->basep);
101 smb_ctxbuf_printf(smb_ctxbuf_t *ctx, const char *fmt, ...)
106 if (ctx == 0 || ctx->basep == 0 ||
107 ctx->curp == 0 || ctx->endp == 0)
112 n = vsnprintf((char *)ctx->curp, ctx->endp-ctx->curp, fmt, args);
113 ctx->curp += n;