T_word32 Hash32GetNumberItems(T_hash32 hash) { T_word32 numItems = 0 ; T_hash32Struct *p_hash ; DebugRoutine("Hash32GetNumberItems") ; /* Make sure this is a valid hash table type. */ DebugCheck(hash != HASH32_BAD) ; if (hash != HASH32_BAD) { /* Get a quick pointer to the header. */ p_hash = (T_hash32Struct *)hash ; /* Make sure this is a pointer to a not already dead */ /* hash table. */ DebugCheck(p_hash->tag == HASH32_TAG) ; if (p_hash->tag == HASH32_TAG) { numItems = DoubleLinkListGetNumberElements( p_hash->itemList) ; } } DebugEnd() ; return numItems ; }
/* adds a game to the list of active 'open' games */ T_void GuildUIAddGame(T_word16 mapNumber, T_gameGroupID groupID, T_word16 questNumber) { T_gameDescriptionStruct *p_game; DebugRoutine ("GuildUIAddGame"); p_game=MemAlloc(sizeof(T_gameDescriptionStruct)); p_game->mapNumber=mapNumber; p_game->groupID = groupID ; p_game->questNumber = questNumber; DoubleLinkListAddElementAtEnd (G_gameList,p_game); /* Only redraw the list if we are not joining or creating a game. */ if (PeopleHereGetOurState() == 0) GuildUIDrawGameList(); /* If this is the first time entry, go to it. */ if (DoubleLinkListGetNumberElements(G_gameList) == 1) TxtboxCursTop(G_displayBoxes[GUILD_GAME_LIST]) ; DebugEnd(); }
T_void FormPop(T_void) { T_formObjectID *p_formObjs; T_doubleLinkListElement element; T_void *p_state; T_formVariousValues *p_values; DebugRoutine("FormPop"); /* Recover the form callback */ element = DoubleLinkListGetFirst(G_formStack); p_values = (T_formVariousValues *)DoubleLinkListElementGetData(element); formcallback = p_values->callback; G_formHasTextBoxes = p_values->hasText; G_formHasButtons = p_values->hasButtons; MemFree(p_values); DoubleLinkListRemoveElement(element); /* Recover the list of text boxes */ element = DoubleLinkListGetFirst(G_formStack); p_state = DoubleLinkListElementGetData(element); TxtboxSetStateBlock(p_state); MemFree(p_state); DoubleLinkListRemoveElement(element); /* Recover the list of sliders */ element = DoubleLinkListGetFirst(G_formStack); p_state = DoubleLinkListElementGetData(element); SliderSetStateBlock(p_state); MemFree(p_state); DoubleLinkListRemoveElement(element); /* Recover the list of graphics */ element = DoubleLinkListGetFirst(G_formStack); p_state = DoubleLinkListElementGetData(element); GraphicSetStateBlock(p_state); MemFree(p_state); DoubleLinkListRemoveElement(element); /* Recover the list of buttons */ element = DoubleLinkListGetFirst(G_formStack); p_state = DoubleLinkListElementGetData(element); ButtonSetStateBlock(p_state); MemFree(p_state); DoubleLinkListRemoveElement(element); /* Recover the list of form objects */ element = DoubleLinkListGetFirst(G_formStack); p_formObjs = DoubleLinkListElementGetData(element); memcpy(G_formObjectArray, p_formObjs, sizeof(G_formObjectArray)); MemFree(p_formObjs); DoubleLinkListRemoveElement(element); /* If the list is empty, destroy it. */ if (DoubleLinkListGetNumberElements(G_formStack) == 0) { DoubleLinkListDestroy(G_formStack); G_formStack = DOUBLE_LINK_LIST_BAD; } DebugEnd(); }