bool Components::createCharacterStats(const char* name) { if (addComponentToList(ginger::CharacterStats(), name)) { return true; } return false; }
bool Components::createSprite(const char* name) { if (addComponentToList(ginger::Sprite(), name)) { return true; } return false; }
omr_error_t removeModuleFromList(UtModuleInfo *module, UtComponentList *componentList) { UtComponentData *compDataCursor = componentList->head; UtComponentData *prevCompData; UT_DBGOUT(2, ("<UT> removeModuleFromList: searching for module %s in componentList %p\n", module->name, componentList)); /* for flight controller functinality, any unloaded components should be moved onto an unloaded list, so their formatting strings and a memcpy of their moduleInfo is available */ while (compDataCursor != NULL) { if (0 == strcmp(compDataCursor->componentName, module->name)) { UT_DBGOUT(2, ("<UT> removeModuleFromList: found component %s in componentList %p\n", module->name, componentList)); /* remove this module from the linked list within the component */ if (module->traceVersionInfo->traceVersion < 6) { /* pre version 6 modules can't be treated as a linked list */ compDataCursor->moduleInfo = NULL; } else { UtModuleInfo **moduleCursor = &compDataCursor->moduleInfo; while (*moduleCursor != NULL) { if (*moduleCursor == module) { *moduleCursor = module->next; break; } moduleCursor = &(*moduleCursor)->next; } } /* if this component has no more modules, remove it from the list */ if (NULL == compDataCursor->moduleInfo) { prevCompData = compDataCursor->prev; if (NULL == prevCompData) { /* this is the head of the list */ componentList->head = compDataCursor->next; if (NULL != compDataCursor->next) { compDataCursor->next->prev = NULL; } } else { /* this is in the middle of the list */ prevCompData->next = compDataCursor->next; if (compDataCursor->next != NULL) { compDataCursor->next->prev = prevCompData; } } if (componentList == OMR_TRACEGLOBAL(componentList)) { /* ensure no-one tries to continue using this as it will be going away */ compDataCursor->moduleInfo = NULL; /* add to the unloaded modules list */ addComponentToList(compDataCursor, OMR_TRACEGLOBAL(unloadedComponentList)); } else { /* otherwise we are unloading it from some other list so free it before we lose * our reference to it */ freeComponentData(omrTraceGlobal, compDataCursor); } } return OMR_ERROR_NONE; } compDataCursor = compDataCursor->next; } UT_DBGOUT(2, ("<UT> removeModuleFromList: didn't find component %s in componentList %p\n", module->name, componentList)); return OMR_ERROR_INTERNAL; }