Files
tp/libs/SSystem/SComponent/c_tree_iter.cpp
T

31 lines
787 B
C++
Raw Normal View History

2020-11-30 14:26:55 -08:00
#include "SComponent/c_tree_iter.h"
2020-12-26 11:31:49 -05:00
#include "SComponent/c_list_iter.h"
#include "global.h"
2020-11-30 14:26:55 -08:00
extern "C" {
2020-12-26 11:31:49 -05:00
int cTrIt_Method(node_lists_tree_class* pTree, cNdIt_MethodFunc pMethod, void* pUserData) {
node_list_class* pList = pTree->mpLists;
2020-11-30 14:26:55 -08:00
int i = pTree->mNumLists;
int ret = 1;
while (i-- > 0) {
int sub = cLsIt_Method(pList++, pMethod, pUserData);
if (sub == 0)
ret = 0;
}
return ret;
}
2020-12-26 11:31:49 -05:00
void* cTrIt_Judge(node_lists_tree_class* pTree, cNdIt_JudgeFunc pJudge, void* pUserData) {
node_list_class* pList = pTree->mpLists;
2020-11-30 14:26:55 -08:00
int i = pTree->mNumLists;
while (i-- > 0) {
2020-12-26 11:31:49 -05:00
void* pJudgeRet = cLsIt_Judge(pList++, pJudge, pUserData);
2020-11-30 14:26:55 -08:00
if (pJudgeRet != NULL)
return pJudgeRet;
}
return NULL;
}
};