Make getting hyperlinks from ids useable throughtout the codebase

This commit is contained in:
Kovid Goyal
2020-09-22 09:25:16 +05:30
parent fdaf857885
commit 0d665495b8
4 changed files with 7 additions and 7 deletions

View File

@@ -137,11 +137,11 @@ get_id_for_hyperlink(Screen *screen, const char *id, const char *url) {
}
const char*
get_hyperlink_for_id(Screen *screen, hyperlink_id_type id) {
HyperLinkPool *pool = (HyperLinkPool*)screen->hyperlink_pool;
get_hyperlink_for_id(const HYPERLINK_POOL_HANDLE handle, hyperlink_id_type id, bool only_url) {
const HyperLinkPool *pool = (HyperLinkPool*)handle;
HyperLinkEntry *s, *tmp;
HASH_ITER(hh, pool->hyperlinks, s, tmp) {
if (s->id == id) return strstr(s->key, ":") + 1;
if (s->id == id) return only_url ? strstr(s->key, ":") + 1 : s->key;
}
return NULL;
}