Lines Matching refs:ctx

23 #define CTX_PUTC(c,ctx) ctx->putC(ctx, c)  argument
25 static void _php_image_output_putc(struct gdIOCtx *ctx, int c) /* {{{ */ in _php_image_output_putc() argument
35 static int _php_image_output_putbuf(struct gdIOCtx *ctx, const void* buf, int l) /* {{{ */ in _php_image_output_putbuf() argument
40 static void _php_image_output_ctxfree(struct gdIOCtx *ctx) /* {{{ */ in _php_image_output_ctxfree() argument
42 if(ctx) { in _php_image_output_ctxfree()
43 efree(ctx); in _php_image_output_ctxfree()
47 static void _php_image_stream_putc(struct gdIOCtx *ctx, int c) /* {{{ */ { in _php_image_stream_putc() argument
49 php_stream * stream = (php_stream *)ctx->data; in _php_image_stream_putc()
53 static int _php_image_stream_putbuf(struct gdIOCtx *ctx, const void* buf, int l) /* {{{ */ in _php_image_stream_putbuf() argument
55 php_stream * stream = (php_stream *)ctx->data; in _php_image_stream_putbuf()
59 static void _php_image_stream_ctxfree(struct gdIOCtx *ctx) /* {{{ */ in _php_image_stream_ctxfree() argument
61 if(ctx->data) { in _php_image_stream_ctxfree()
62 ctx->data = NULL; in _php_image_stream_ctxfree()
64 if(ctx) { in _php_image_stream_ctxfree()
65 efree(ctx); in _php_image_stream_ctxfree()
69 static void _php_image_stream_ctxfreeandclose(struct gdIOCtx *ctx) /* {{{ */ in _php_image_stream_ctxfreeandclose() argument
72 if(ctx->data) { in _php_image_stream_ctxfreeandclose()
73 php_stream_close((php_stream *) ctx->data); in _php_image_stream_ctxfreeandclose()
74 ctx->data = NULL; in _php_image_stream_ctxfreeandclose()
76 if(ctx) { in _php_image_stream_ctxfreeandclose()
77 efree(ctx); in _php_image_stream_ctxfreeandclose()
93 gdIOCtx *ctx = NULL; in _php_image_output_ctx() local
163 ctx = ecalloc(1, sizeof(gdIOCtx)); in _php_image_output_ctx()
164 ctx->putC = _php_image_output_putc; in _php_image_output_ctx()
165 ctx->putBuf = _php_image_output_putbuf; in _php_image_output_ctx()
166 ctx->gd_free = _php_image_output_ctxfree; in _php_image_output_ctx()
175 if (!ctx) { in _php_image_output_ctx()
176 ctx = ecalloc(1, sizeof(gdIOCtx)); in _php_image_output_ctx()
177 ctx->putC = _php_image_stream_putc; in _php_image_output_ctx()
178 ctx->putBuf = _php_image_stream_putbuf; in _php_image_output_ctx()
180 ctx->gd_free = _php_image_stream_ctxfreeandclose; in _php_image_output_ctx()
182 ctx->gd_free = _php_image_stream_ctxfree; in _php_image_output_ctx()
184 ctx->data = (void *)stream; in _php_image_output_ctx()
193 (*func_p)(im, ctx, q); in _php_image_output_ctx()
199 (*func_p)(im, ctx, q); in _php_image_output_ctx()
202 (*func_p)(im, ctx, q, f); in _php_image_output_ctx()
213 (*func_p)(im, file ? file : "", q, ctx); in _php_image_output_ctx()
215 (*func_p)(im, q, ctx); in _php_image_output_ctx()
219 (*func_p)(im, ctx, (int) compressed); in _php_image_output_ctx()
222 (*func_p)(im, ctx); in _php_image_output_ctx()
226 ctx->gd_free(ctx); in _php_image_output_ctx()