Lines Matching refs:ctx

89 	struct hesiod_p	*ctx;
92 ctx = malloc(sizeof(struct hesiod_p));
93 if (ctx) {
94 *context = ctx;
101 if (read_config_file(ctx, configname) >= 0) {
111 if (ctx->rhs)
112 free(ctx->rhs);
113 ctx->rhs = malloc(strlen(p) + 2);
114 if (ctx->rhs) {
115 *ctx->rhs = '.';
116 strcpy(ctx->rhs + 1,
127 if (ctx->lhs)
128 free(ctx->lhs);
129 if (ctx->rhs)
130 free(ctx->rhs);
131 if (ctx)
132 free(ctx);
144 struct hesiod_p *ctx = (struct hesiod_p *) context;
146 free(ctx->rhs);
147 if (ctx->lhs)
148 free(ctx->lhs);
149 free(ctx);
160 struct hesiod_p *ctx = (struct hesiod_p *) context;
189 rhs = ctx->rhs;
193 if (ctx->lhs)
194 len += strlen(ctx->lhs) + ((ctx->lhs[0] != '.') ? 1 : 0);
206 if (ctx->lhs && ctx->lhs[0] != '\0' ) {
207 if (ctx->lhs[0] != '.')
209 strcat(bindname, ctx->lhs);
237 struct hesiod_p *ctx = (struct hesiod_p *) context;
244 retvec = get_txt_records(ctx->classes[0], bindname);
245 if (retvec == NULL && errno == ENOENT && ctx->classes[1])
246 retvec = get_txt_records(ctx->classes[1], bindname);
270 * -1 on failure. On failure, it might leave values in ctx->lhs
271 * or ctx->rhs which need to be freed by the caller.
274 read_config_file(ctx, filename)
275 struct hesiod_p *ctx;
284 ctx->classes[0] = C_IN;
285 ctx->classes[1] = C_HS;
291 ctx->lhs = strdup(DEF_LHS);
292 ctx->rhs = strdup(DEF_RHS);
293 if (ctx->lhs && ctx->rhs)
300 ctx->lhs = NULL;
301 ctx->rhs = NULL;
323 ? &ctx->lhs : &ctx->rhs;
340 ctx->classes[n++] = C_IN;
343 ctx->classes[n++] =
348 ctx->classes[n++] = 0;
354 if (!ctx->rhs || ctx->classes[0] == 0 ||
355 ctx->classes[0] == ctx->classes[1]) {