Lines Matching defs:ctx
102 idn_mapselector_t ctx = NULL;
108 ctx = (idn_mapselector_t)malloc(sizeof(struct idn_mapselector));
109 if (ctx == NULL) {
114 ctx->maphash = NULL;
115 ctx->reference_count = 1;
117 r = idn__strhash_create(&(ctx->maphash));
121 *ctxp = ctx;
126 if (ctx != NULL)
127 free(ctx->maphash);
128 free(ctx);
135 idn_mapselector_destroy(idn_mapselector_t ctx) {
136 assert(ctx != NULL);
140 ctx->reference_count--;
141 if (ctx->reference_count <= 0) {
144 idn__strhash_destroy(ctx->maphash,
146 free(ctx);
150 ctx->reference_count + 1, ctx->reference_count));
155 idn_mapselector_incrref(idn_mapselector_t ctx) {
156 assert(ctx != NULL);
160 ctx->reference_count, ctx->reference_count + 1));
162 ctx->reference_count++;
166 idn_mapselector_add(idn_mapselector_t ctx, const char *tld, const char *name) {
171 assert(ctx != NULL && tld != NULL);
194 if (idn__strhash_get(ctx->maphash, hash_key, (void **)&mapper)
200 r = idn__strhash_put(ctx->maphash, hash_key, mapper);
212 idn_mapselector_addall(idn_mapselector_t ctx, const char *tld,
217 assert(ctx != NULL && tld != NULL && scheme_names != NULL);
223 r = idn_mapselector_add(ctx, tld, (const char *)*scheme_names);
236 idn_mapselector_mapper(idn_mapselector_t ctx, const char *tld) {
241 assert(ctx != NULL && tld != NULL);
257 r = idn__strhash_get(ctx->maphash, hash_key, (void **)&mapper);
267 idn_mapselector_map(idn_mapselector_t ctx, const unsigned long *from,
274 assert(ctx != NULL && from != NULL && to != NULL);
300 if (idn__strhash_get(ctx->maphash, hash_key, (void **)&mapper)
303 idn__strhash_get(ctx->maphash, hash_key, (void **)&mapper);
336 idn_mapselector_map2(idn_mapselector_t ctx, const unsigned long *from,
342 assert(ctx != NULL && from != NULL && to != NULL);
356 r = idn_mapselector_map(ctx, from, tld_utf8, to, tolen);