• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/bind9-45.101/bind9/contrib/idn/idnkit-1.0-src/lib/

Lines Matching refs:ctx

154 	idn_mapper_t ctx = NULL;
162 ctx = (idn_mapper_t) malloc(sizeof(struct idn_mapper));
163 if (ctx == NULL) {
168 ctx->schemes = (map_scheme_t *) malloc(sizeof(map_scheme_t)
170 if (ctx->schemes == NULL) {
175 ctx->nschemes = 0;
176 ctx->scheme_size = MAPPER_INITIAL_SCHEME_SIZE;
177 ctx->reference_count = 1;
178 *ctxp = ctx;
183 if (ctx != NULL)
184 free(ctx->schemes);
185 free(ctx);
192 idn_mapper_destroy(idn_mapper_t ctx) {
196 assert(ctx != NULL);
200 ctx->reference_count--;
201 if (ctx->reference_count <= 0) {
203 for (i = 0; i < ctx->nschemes; i++)
204 ctx->schemes[i].destroy(ctx->schemes[i].context);
205 free(ctx->schemes);
206 free(ctx);
210 ctx->reference_count + 1, ctx->reference_count));
215 idn_mapper_incrref(idn_mapper_t ctx) {
216 assert(ctx != NULL && scheme_hash != NULL);
220 ctx->reference_count, ctx->reference_count + 1));
222 ctx->reference_count++;
226 idn_mapper_add(idn_mapper_t ctx, const char *scheme_name) {
236 assert(ctx != NULL);
284 assert(ctx->nschemes <= ctx->scheme_size);
286 if (ctx->nschemes == ctx->scheme_size) {
289 new_schemes = (map_scheme_t *) realloc(ctx->schemes,
290 sizeof(map_scheme_t) * ctx->scheme_size * 2);
295 ctx->schemes = new_schemes;
296 ctx->scheme_size *= 2;
303 memcpy(ctx->schemes + ctx->nschemes, scheme, sizeof(map_scheme_t));
304 ctx->schemes[ctx->nschemes].context = scheme_context;
305 ctx->nschemes++;
317 idn_mapper_addall(idn_mapper_t ctx, const char **scheme_names, int nschemes) {
322 assert(ctx != NULL && scheme_names != NULL);
327 r = idn_mapper_add(ctx, (const char *)*scheme_names);
340 idn_mapper_map(idn_mapper_t ctx, const unsigned long *from,
351 assert(ctx != NULL && from != NULL && to != NULL);
356 if (ctx->nschemes <= 0) {
373 while (i < ctx->nschemes) {
374 TRACE(("idn_mapper_map(): map %s\n", ctx->schemes[i].prefix));
379 if (i + 1 == ctx->nschemes) {
410 r = (ctx->schemes[i].map)(ctx->schemes[i].context, src, dst,