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()
92 gdIOCtx *ctx = NULL; in _php_image_output_ctx() local
155 ctx = ecalloc(1, sizeof(gdIOCtx)); in _php_image_output_ctx()
156 ctx->putC = _php_image_output_putc; in _php_image_output_ctx()
157 ctx->putBuf = _php_image_output_putbuf; in _php_image_output_ctx()
158 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); in _php_image_output_ctx()
215 ctx->gd_free(ctx); in _php_image_output_ctx()