typedef unsigned char bool;
//represents an individual menu item which belongs to a menu level
typedef rom struct MenuItem
{
//bool. describes whether or not this node is a top level node.
//i.e when MenuClick() is called on this item, topLevelHandler will be called
//and the current item will be stored in history
char topLevel;
//Pointer to an array of characters representing the menu item
near rom char *text;
//A pointer which points to the next level up in the menu heirarchy
//Actually a MenuLevel pointer.
near rom *subMenu;
//Pointer to handler method that deals with the application specifics.
void (*topLevelHandler)(void);
}MenuItem;
//represents a level of menu heirarchy.
typedef rom struct MenuLevel
{
//The index of the current selected menu on this level
char currentIndex;
//The length of the item array specified by *items
bool itemCount;
//Pointer to an array of menu items that represent this level
rom MenuItem *items;
}MenuLevel;