5. Grid Type Flag

5.1. Type Flag Declaration

The grid type flag is declared as a static global variable. It is initialized to be zero.

<<grid_typeflag>>=
static unsigned int grid_type = 0;

5.2. Setting the Grid Type

The grid type flag is set once inside of grid_init.

<<grid_init>>=
grid_type = monolith_dict_newtype(monolith_dict_get(m));

5.3. Checking the Grid Type

A page is checked to be a grid using the (static) function is_grid.

<<grid_function_declarations>>=
static int is_grid(monolith_page *pg);
<<grid_functions>>=
static int is_grid(monolith_page *pg)
{
    int type;
    type = monolith_page_type_get(pg);
    if(type == 0) return 0;
    return type == grid_type;
}



prev | home | next