Delete client.h/.c

This commit is contained in:
2022-12-29 11:47:59 +01:00
parent f92c26c350
commit 672745f6df
15 changed files with 769 additions and 894 deletions

View File

@ -208,3 +208,16 @@ int config_load(const char *filename) {
return 0;
}
host_config_t *get_host_config(const char *host) {
for (int i = 0; i < CONFIG_MAX_HOST_CONFIG; i++) {
host_config_t *hc = &config.hosts[i];
if (hc->type == CONFIG_TYPE_UNSET) break;
if (strcmp(hc->name, host) == 0) return hc;
if (hc->name[0] == '*' && hc->name[1] == '.') {
const char *pos = strstr(host, hc->name + 1);
if (pos != NULL && strlen(pos) == strlen(hc->name + 1)) return hc;
}
}
return NULL;
}