A keyword is an integer mbtk_kw_t which is derived from a string. The string is the textual representation of the keyword: an identifier or name. Each unique string will result in an unique mbtk_kw_t integer value, assigned runtime. There is only one keyword system per process, used by all backends and displays. The purpose of the keyword system is to make storing and comparing identifiers efficiently while keeping the set of keywords dynamic. It is cheap to store a keyword because it is really an integer. If is chap to compare keywords for the same reason. In these regards, it is similar to enum values. The major difference to enums is that the keyword system is dynamic: there is no central list in the source that contains all keywords, but different parts of the code register their own keywords runtime. For example a widget type is a keyword (mbtk_kw_t). Each widget (mbtk_widget_t) has a ->type field that remembers what widget it is. When a new widget is created, for example a label widget, the code loads widget->type like this: widget->type = mbtk_kw("label"); This looks up the integer keyword value for "label"; if not found, it allocates it with a new unique value (and subsequent mbtk_kw("label") calls will find this specific value). If the user application or a 3rd party library decides to implement a new widget type, it needs to pick an unique textual identifier for it, e.g. "foobar" and create its new widgets with widget->type = mbtk_kw("foobar");. That is how the system is dynamic: - miniboxtk does not need to have a central list of all widget types ever existed (including in 3rd party apps and libs), - we start from human readable, textual identifiers - but we still don't need to store and compare strings The lookup in mbtk_kw() is a string hash table, which is relatively cheap. However, if some piece of code tends to need the same keyword over and over, it should look it up only once then cache the integer value. For example a widget implementation is expected to create a lot of the same widget type so it should look up its widget type keyword upon the first widget creation and store the integer value locally so the lookup doesn't need to be repeated for subsequent widget creations of the same type. Example code for manual caching: mbtk_widget_t *create_my_widget(...) { mbtk_widget_t *res; static mbtk_kw_t kw_foobar = mbtk_kw_invalid; if (kw_foobar == mbtk_kw_invalid) kw_foobar = mbtk_kw("foobar"); ... res->type = kw_foobar; return res; } There is a shorthand macro mbtk_kw_cache() for the above caching: mbtk_widget_t *create_my_widget(...) { mbtk_widget_t *res; mbtk_kw_t kw_foobar; mbtk_kw_cache(type, "foobar"); ... res->type = kw_foobar; return res; }