/* * libbsdl - internal keyword lookup tables. * SPDX-License-Identifier: LGPL-2.1-or-later * * These map BSDL tokens onto the public enums. They are the seed for the * parser port from Viveris, and already extend it with the two attributes * Viveris omits: LINKAGE ports and the TAP_SCAN_* roles. */ #ifndef LIBBSDL_BSDL_STRINGS_H #define LIBBSDL_BSDL_STRINGS_H typedef struct bsdl_kw { const char* name; /* BSDL token, upper-cased before lookup. */ int code; /* corresponding bsdl_* enum value. */ } bsdl_kw_t; extern const bsdl_kw_t bsdl_dir_kw[]; /* -> bsdl_dir_t */ extern const bsdl_kw_t bsdl_cell_kw[]; /* -> bsdl_cell_t */ extern const bsdl_kw_t bsdl_bittype_kw[]; /* -> bsdl_bittype_t */ extern const bsdl_kw_t bsdl_state_kw[]; /* -> bsdl_state_t */ extern const bsdl_kw_t bsdl_tap_kw[]; /* -> bsdl_tap_role_t */ /* Linear lookup; returns the first table entry's code (UNKNOWN/NONE) if absent. */ int bsdl_kw_lookup(const bsdl_kw_t* table, const char* name); #endif /* LIBBSDL_BSDL_STRINGS_H */