5. Knobs Type Flag
5.1. Typeflag Declaration
The typeflag for knobs is stored as a global variable called
knobs_type
. It initialized to be 0.
<<knobs_typeflag>>=
static int knobs_type = 0;
5.2. Setting the knobs type
<<knobs_runtime_init>>=
knobs_type = monolith_dict_newtype(monolith_dict_get(m));
5.3. Check if page is knobs type
A page is checked if it is of type "knobs" via the function
is_knobs
.
<<knobs_function_declarations>>=
static int is_knobs(monolith_page *pg);
<<knobs_functions>>=
static int is_knobs(monolith_page *pg)
{
int type;
type = monolith_page_type_get(pg);
if(type == 0) return 0;
return type == knobs_type;
}
prev | home | next