From 73cfb27201cfafd327598cfccc4fa7176f9d89c1 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 4 Jul 2023 19:25:55 -0700 Subject: Add bubblewrap 0.8.0 --- pkg/bubblewrap/caps.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pkg/bubblewrap/caps.c (limited to 'pkg/bubblewrap/caps.c') diff --git a/pkg/bubblewrap/caps.c b/pkg/bubblewrap/caps.c new file mode 100644 index 00000000..557302f5 --- /dev/null +++ b/pkg/bubblewrap/caps.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include "caps.h" + +int +cap_from_name(const char *name) +{ + int i; + + static_assert(sizeof cap_names / sizeof *cap_names <= INT_MAX); + for (i = 0; i < sizeof cap_names / sizeof *cap_names; ++i) { + if (cap_names[i] && strcmp(cap_names[i], name) == 0) + return i; + } + return -1; +} -- cgit v1.2.3