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
36 static int _php_image_output_putbuf(struct gdIOCtx *ctx, const void* buf, int l) in _php_image_output_putbuf() argument
42 static void _php_image_output_ctxfree(struct gdIOCtx *ctx) in _php_image_output_ctxfree() argument
44 if(ctx) { in _php_image_output_ctxfree()
45 efree(ctx); in _php_image_output_ctxfree()
49 static void _php_image_stream_putc(struct gdIOCtx *ctx, int c) { in _php_image_stream_putc() argument
51 php_stream * stream = (php_stream *)ctx->data; in _php_image_stream_putc()
56 static int _php_image_stream_putbuf(struct gdIOCtx *ctx, const void* buf, int l) in _php_image_stream_putbuf() argument
58 php_stream * stream = (php_stream *)ctx->data; in _php_image_stream_putbuf()
63 static void _php_image_stream_ctxfree(struct gdIOCtx *ctx) in _php_image_stream_ctxfree() argument
65 if(ctx->data) { in _php_image_stream_ctxfree()
66 ctx->data = NULL; in _php_image_stream_ctxfree()
68 if(ctx) { in _php_image_stream_ctxfree()
69 efree(ctx); in _php_image_stream_ctxfree()
73 static void _php_image_stream_ctxfreeandclose(struct gdIOCtx *ctx) /* {{{ */ in _php_image_stream_ctxfreeandclose() argument
77 if(ctx->data) { in _php_image_stream_ctxfreeandclose()
78 php_stream_close((php_stream *) ctx->data); in _php_image_stream_ctxfreeandclose()
79 ctx->data = NULL; in _php_image_stream_ctxfreeandclose()
81 if(ctx) { in _php_image_stream_ctxfreeandclose()
82 efree(ctx); in _php_image_stream_ctxfreeandclose()
97 gdIOCtx *ctx = NULL; in _php_image_output_ctx() local
158 ctx = emalloc(sizeof(gdIOCtx)); in _php_image_output_ctx()
159 ctx->putC = _php_image_output_putc; in _php_image_output_ctx()
160 ctx->putBuf = _php_image_output_putbuf; in _php_image_output_ctx()
161 ctx->gd_free = _php_image_output_ctxfree; in _php_image_output_ctx()
170 if (!ctx) { in _php_image_output_ctx()
171 ctx = emalloc(sizeof(gdIOCtx)); in _php_image_output_ctx()
172 ctx->putC = _php_image_stream_putc; in _php_image_output_ctx()
173 ctx->putBuf = _php_image_stream_putbuf; in _php_image_output_ctx()
175 ctx->gd_free = _php_image_stream_ctxfreeandclose; in _php_image_output_ctx()
177 ctx->gd_free = _php_image_stream_ctxfree; in _php_image_output_ctx()
179 ctx->data = (void *)stream; in _php_image_output_ctx()
188 (*func_p)(im, ctx, q); in _php_image_output_ctx()
194 (*func_p)(im, ctx, q); in _php_image_output_ctx()
197 (*func_p)(im, ctx, q, f); in _php_image_output_ctx()
208 (*func_p)(im, file ? file : "", q, ctx); in _php_image_output_ctx()
210 (*func_p)(im, q, ctx); 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()