Lines Matching defs:table

1 /*	$OpenBSD: table.c,v 1.54 2024/06/09 10:13:05 gilles Exp $	*/
125 struct table *
132 table_match(struct table *table, enum table_service kind, const char *key)
134 return table_lookup(table, kind, key, NULL);
138 table_lookup(struct table *table, enum table_service kind, const char *key,
145 if (table->t_backend->lookup == NULL)
152 r = table->t_backend->lookup(table, kind, lkey, lk ? &buf : NULL);
155 log_trace(TRACE_LOOKUP, "lookup: %s \"%s\" as %s in table %s:%s -> %s%s%s",
159 table->t_backend->name,
160 table->t_name,
168 log_trace(TRACE_LOOKUP, "lookup: %s \"%s\" as %s in table %s:%s -> %s%s",
172 table->t_backend->name,
173 table->t_name,
183 table_fetch(struct table *table, enum table_service kind, union lookup *lk)
189 if (table->t_backend->fetch == NULL)
192 r = table->t_backend->fetch(table, kind, &buf);
195 log_trace(TRACE_LOOKUP, "lookup: fetch %s from table %s:%s -> \"%s\"",
197 table->t_backend->name,
198 table->t_name,
203 log_trace(TRACE_LOOKUP, "lookup: fetch %s from table %s:%s -> %s%s",
205 table->t_backend->name,
206 table->t_name,
215 struct table *
219 struct table *t;
226 fatalx("table_create: table \"%s\" already defined", name);
229 if ((size_t)snprintf(path, sizeof(path), PATH_LIBEXEC"/table-%s",
232 PATH_LIBEXEC"/table-%s\"", backend);
257 fatalx("table_create: table config \"%s\" too large",
270 fatalx("table_create: table name too long");
279 table_destroy(struct smtpd *conf, struct table *t)
286 table_config(struct table *t)
294 table_add(struct table *t, const char *key, const char *val)
297 fatalx("table_add: cannot add to table");
300 log_warnx("warn: failed to add \"%s\" in table \"%s\"", key, t->t_name);
304 table_dump(struct table *t)
340 table_check_type(struct table *t, uint32_t mask)
346 table_check_service(struct table *t, uint32_t mask)
352 table_check_use(struct table *t, uint32_t tmask, uint32_t smask)
358 table_open(struct table *t)
366 table_close(struct table *t)
373 table_update(struct table *t)
383 * in *_match() s1 comes from session, s2 comes from table
515 struct table *t;
526 struct table *t;
532 fatalx("failed to open table %s", t->t_name);
538 struct table *t;