Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl.h:
/* A value from vkd3d_result. 0 means success. */ int result;
/* Pointer to an opaque data structure managed by FLEX (during lexing), that encapsulates the
* current state of the scanner. This pointer is required by all FLEX API functions when the
* scanner is declared as reentrant, which is the case. */
void *scanner;
/* Pointer to the current scope; changes as the parser reads the code. */ struct hlsl_scope *cur_scope;
/* Scope of global variables. */ struct hlsl_scope *globals;
/* Container entry for hlsl_scope.entry fields, containing all the scopes in the program. */ struct list scopes;
/* Container entry for hlsl_ir_var.extern_entry, containing all the extern variables. */ struct list extern_vars;
Why does this exist? [Answer: it's a convenience, to gather together extern variables which can be declared in global scope, as function parameters, or as the function return value. In many cases we need to iterate over all extern variables, and it's more convenient just to put them all in one list first.]