Merge master into command_parser

This commit is contained in:
Nicholas Marriott
2026-07-15 10:34:14 +01:00
64 changed files with 6643 additions and 1637 deletions

15
hooks.c
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: hooks.c,v 1.13 2026/07/10 15:20:06 nicm Exp $ */
/* $OpenBSD: hooks.c,v 1.14 2026/07/13 22:03:08 nicm Exp $ */
/*
* Copyright (c) 2026 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -261,6 +261,19 @@ hooks_add_event(const char *name)
TAILQ_INSERT_TAIL(&hooks_events, he, entry);
}
/* Return if a hook event sink exists. */
int
hooks_is_event(const char *name)
{
struct hooks_event *he;
TAILQ_FOREACH(he, &hooks_events, entry) {
if (strcmp(he->name, name) == 0)
return (1);
}
return (0);
}
/* Return if an event name can be fired through the hooks path. */
int
hooks_valid_event_name(const char *name)