/** * @file NCDModuleIndex.h * @author Ambroz Bizjak * * @section LICENSE * * This file is part of BadVPN. * * BadVPN is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * BadVPN is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef BADVPN_NCDMODULEINDEX_H #define BADVPN_NCDMODULEINDEX_H #include #include #include #include #define NCDMODULEINDEX_MAX_TYPE_LEN 63 typedef struct { BAVL modules_tree; BAVL base_types_tree; DebugObject d_obj; } NCDModuleIndex; struct NCDModuleIndex_module { char type[NCDMODULEINDEX_MAX_TYPE_LEN + 1]; const struct NCDModule *module; BAVLNode modules_tree_node; }; struct NCDModuleIndex_base_type { const char *base_type; const struct NCDModuleGroup *group; BAVLNode base_types_tree_node; }; void NCDModuleIndex_Init (NCDModuleIndex *o); void NCDModuleIndex_Free (NCDModuleIndex *o); int NCDModuleIndex_AddGroup (NCDModuleIndex *o, const struct NCDModuleGroup *group) WARN_UNUSED; const struct NCDModule * NCDModuleIndex_FindModule (NCDModuleIndex *o, const char *type); #endif