Lines Matching refs:ctx
56 struct window *ctx; in zip_source_window() local
63 if ((ctx=(struct window *)malloc(sizeof(*ctx))) == NULL) { in zip_source_window()
68 ctx->skip = start; in zip_source_window()
69 ctx->len = len; in zip_source_window()
70 ctx->left = len; in zip_source_window()
72 return zip_source_layered(za, src, window_read, ctx); in zip_source_window()
81 struct window *ctx; in window_read() local
86 ctx = (struct window *)_ctx; in window_read()
90 for (n=0; n<ctx->skip; n+=(zip_uint64_t)ret) { in window_read()
91 i = (ctx->skip-n > sizeof(b) ? sizeof(b) : ctx->skip-n); in window_read()
95 ctx->e[0] = ZIP_ER_EOF; in window_read()
96 ctx->e[1] = 0; in window_read()
103 if (len > ctx->left) in window_read()
104 len = ctx->left; in window_read()
112 ctx->left -= (zip_uint64_t)ret; in window_read()
115 if (ctx->left > 0) { in window_read()
116 ctx->e[0] = ZIP_ER_EOF; in window_read()
117 ctx->e[1] = 0; in window_read()
132 st->size = ctx->len; in window_read()
139 memcpy(data, ctx->e, sizeof(ctx->e)); in window_read()
143 free(ctx); in window_read()