Lines Matching refs:ctx
21 #define CTX_PUTC(c,ctx) ctx->putC(ctx, c) argument
23 static void _php_image_output_putc(struct gdIOCtx *ctx, int c) /* {{{ */ in _php_image_output_putc() argument
33 static int _php_image_output_putbuf(struct gdIOCtx *ctx, const void* buf, int l) /* {{{ */ in _php_image_output_putbuf() argument
38 static void _php_image_output_ctxfree(struct gdIOCtx *ctx) /* {{{ */ in _php_image_output_ctxfree() argument
40 if(ctx) { in _php_image_output_ctxfree()
41 efree(ctx); in _php_image_output_ctxfree()
45 static void _php_image_stream_putc(struct gdIOCtx *ctx, int c) /* {{{ */ { in _php_image_stream_putc() argument
47 php_stream * stream = (php_stream *)ctx->data; in _php_image_stream_putc()
51 static int _php_image_stream_putbuf(struct gdIOCtx *ctx, const void* buf, int l) /* {{{ */ in _php_image_stream_putbuf() argument
53 php_stream * stream = (php_stream *)ctx->data; in _php_image_stream_putbuf()
57 static void _php_image_stream_ctxfree(struct gdIOCtx *ctx) /* {{{ */ in _php_image_stream_ctxfree() argument
59 if(ctx->data) { in _php_image_stream_ctxfree()
60 ctx->data = NULL; in _php_image_stream_ctxfree()
62 if(ctx) { in _php_image_stream_ctxfree()
63 efree(ctx); in _php_image_stream_ctxfree()
67 static void _php_image_stream_ctxfreeandclose(struct gdIOCtx *ctx) /* {{{ */ in _php_image_stream_ctxfreeandclose() argument
70 if(ctx->data) { in _php_image_stream_ctxfreeandclose()
71 php_stream_close((php_stream *) ctx->data); in _php_image_stream_ctxfreeandclose()
72 ctx->data = NULL; in _php_image_stream_ctxfreeandclose()
74 if(ctx) { in _php_image_stream_ctxfreeandclose()
75 efree(ctx); in _php_image_stream_ctxfreeandclose()
91 gdIOCtx *ctx = NULL; in _php_image_output_ctx() local
161 ctx = ecalloc(1, sizeof(gdIOCtx)); in _php_image_output_ctx()
162 ctx->putC = _php_image_output_putc; in _php_image_output_ctx()
163 ctx->putBuf = _php_image_output_putbuf; in _php_image_output_ctx()
164 ctx->gd_free = _php_image_output_ctxfree; in _php_image_output_ctx()
167 if (!ctx) { in _php_image_output_ctx()
168 ctx = ecalloc(1, sizeof(gdIOCtx)); in _php_image_output_ctx()
169 ctx->putC = _php_image_stream_putc; in _php_image_output_ctx()
170 ctx->putBuf = _php_image_stream_putbuf; in _php_image_output_ctx()
172 ctx->gd_free = _php_image_stream_ctxfreeandclose; in _php_image_output_ctx()
174 ctx->gd_free = _php_image_stream_ctxfree; in _php_image_output_ctx()
176 ctx->data = (void *)stream; in _php_image_output_ctx()
185 (*func_p)(im, ctx, q); in _php_image_output_ctx()
191 (*func_p)(im, ctx, q); in _php_image_output_ctx()
194 (*func_p)(im, ctx, q, f); in _php_image_output_ctx()
205 (*func_p)(im, file ? file : "", q, ctx); in _php_image_output_ctx()
207 (*func_p)(im, q, ctx); in _php_image_output_ctx()
211 (*func_p)(im, ctx, (int) compressed); in _php_image_output_ctx()
214 (*func_p)(im, ctx); in _php_image_output_ctx()
218 ctx->gd_free(ctx); in _php_image_output_ctx()