diff options
| author | Michael Forney <mforney@mforney.org> | 2023-07-04 19:25:55 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2023-07-07 13:34:48 -0700 |
| commit | 73cfb27201cfafd327598cfccc4fa7176f9d89c1 (patch) | |
| tree | cf990f11043de2d9557453e47548dfab21cd5107 /pkg/bubblewrap/caps.c | |
| parent | 875f1e20701b509e95b6474cb4794409f20136d5 (diff) | |
Add bubblewrap 0.8.0
Diffstat (limited to 'pkg/bubblewrap/caps.c')
| -rw-r--r-- | pkg/bubblewrap/caps.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 <assert.h> +#include <limits.h> +#include <string.h> +#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; +} |
