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
160 ctx = ecalloc(1, sizeof(gdIOCtx)); in _php_image_output_ctx()
161 ctx->putC = _php_image_output_putc; in _php_image_output_ctx()
162 ctx->putBuf = _php_image_output_putbuf; in _php_image_output_ctx()
163 ctx->gd_free = _php_image_output_ctxfree; in _php_image_output_ctx()
166 if (!ctx) { in _php_image_output_ctx()
167 ctx = ecalloc(1, sizeof(gdIOCtx)); in _php_image_output_ctx()
168 ctx->putC = _php_image_stream_putc; in _php_image_output_ctx()
169 ctx->putBuf = _php_image_stream_putbuf; in _php_image_output_ctx()
171 ctx->gd_free = _php_image_stream_ctxfreeandclose; in _php_image_output_ctx()
173 ctx->gd_free = _php_image_stream_ctxfree; in _php_image_output_ctx()
175 ctx->data = (void *)stream; in _php_image_output_ctx()
180 (*func_p)(im, ctx, q); in _php_image_output_ctx()
186 (*func_p)(im, ctx, q); in _php_image_output_ctx()
189 (*func_p)(im, ctx, q, f); in _php_image_output_ctx()
200 (*func_p)(im, file ? file : "", q, ctx); in _php_image_output_ctx()
202 (*func_p)(im, q, ctx); in _php_image_output_ctx()
206 (*func_p)(im, ctx, (int) compressed); in _php_image_output_ctx()
209 (*func_p)(im, ctx); in _php_image_output_ctx()
213 ctx->gd_free(ctx); in _php_image_output_ctx()