/* * Copyright (c) 1997-8 Andrew G. Morgan * * This is a file to make the capability <-> string mappings for * libcap. */ #include #include /* * #include 'sed' generated array */ struct { const char *name; int index; } const list[] = { #include "cap_names.list.h" {NULL, -1} }; /* this should be more than big enough (factor of three at least) */ const char *pointers[8*12]; int main(void) { int i, maxcaps=0; for ( i=0; list[i].index >= 0 && list[i].name; ++i ) { if (maxcaps <= list[i].index) { maxcaps = list[i].index + 1; } pointers[list[i].index] = list[i].name; } printf("/*\n" " * DO NOT EDIT: this file is generated automatically from\n" " *\n" " * \n" " */\n" "#define __CAP_BITS %d\n" "\n" "#ifdef LIBCAP_PLEASE_INCLUDE_ARRAY\n" " char const *_cap_names[__CAP_BITS] = {\n", maxcaps); for (i=0; i