5. Sliders Type Flag

5.1. Typeflag Declaration

The typeflag for sliders is stored as a global variable called sliders_type. It initialized to be 0.

<<sliders_typeflag>>=
static int sliders_type = 0;

5.2. Setting the sliders type

<<sliders_runtime_init>>=
sliders_type = monolith_dict_newtype(monolith_dict_get(m));

5.3. Check if page is sliders type

A page is checked if it is of type "sliders" via the funciton is_sliders.

<<sliders_function_declarations>>=
static int is_sliders(monolith_page *pg);
<<sliders_functions>>=
static int is_sliders(monolith_page *pg)
{
    int type;
    type = monolith_page_type_get(pg);
    if(type == 0) return 0;
    return type == sliders_type;
}



prev | home | next