commit - 116ee6e420f66fb76dd885361d9d80765bbee07b
commit + 35c6cd0e100a9bf0cc9354f261b656d497fa34cd
blob - db48d7e0a64590177becf74fe80661d26f1c0d01
blob + db25c4112dcb5d9713a34fc25b24c1d432b60eab
--- kamid/kamid.h
+++ kamid/kamid.h
/* ... */
};
-enum table_type {
- T_NONE = 0,
- T_HASH = 0x01,
-};
+struct table;
-struct table {
- char t_name[LINE_MAX];
- enum table_type t_type;
- char t_path[PATH_MAX];
- void *t_handle;
- struct table_backend *t_backend;
-};
-
-struct table_backend {
- const char *name;
- int (*open)(struct table *);
- int (*add)(struct table *, const char *, const char *);
- int (*lookup)(struct table *, const char *, char **);
- void (*close)(struct table *);
-};
-
-/* table_static.c */
-extern struct table_backend table_static;
-
#define L_NONE 0x0
#define L_TLS 0x1
struct kd_listen_conf {
blob - 441a98c2d2203d5c5de63b34018689b42d132d86
blob + 349da7d484c5aa3cfe63cf34384860cdd7fcf814
--- kamid/table.h
+++ kamid/table.h
/*
- * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
+ * Copyright (c) 2021, 2022 Omar Polo <op@omarpolo.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#ifndef TABLE_H
#define TABLE_H
+enum table_type {
+ T_NONE = 0,
+ T_HASH = 0x01,
+};
+
+struct table {
+ char t_name[LINE_MAX];
+ enum table_type t_type;
+ char t_path[PATH_MAX];
+ void *t_handle;
+ struct table_backend *t_backend;
+};
+
+struct table_backend {
+ const char *name;
+ int (*open)(struct table *);
+ int (*add)(struct table *, const char *, const char *);
+ int (*lookup)(struct table *, const char *, char **);
+ void (*close)(struct table *);
+};
+
+/* table_static.c */
+extern struct table_backend table_static;
+
int table_open(struct kd_conf *, const char *, const char *, const char *);
int table_add(struct table *, const char *, const char *);
int table_lookup(struct table *, const char *, char **);
blob - 550bb623efc8f59242d5ce988876022df5e09e01
blob + b7e0bc26af5909933e7c490f75bcebff16a7a6ce
--- kamid/table_static.c
+++ kamid/table_static.c
#include "utils.h"
#include "kamid.h"
+#include "table.h"
static void *hash_alloc(size_t, void *);
static void *hash_calloc(size_t, size_t, void *);