1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-11-08 21:21:50 +00:00
TegraExplorer/source/script/arrayReferenceClass.c

24 lines
964 B
C
Raw Normal View History

2021-07-09 21:56:13 +01:00
#include "model.h"
#include "compat.h"
#include "genericClass.h"
#include "intClass.h"
#include "arrayReferenceClass.h"
ClassFunction(projectArray) {
Variable_t newArray = { .variableType = caller->solvedArray.arrayClassReference->variableType, .reference = 1, .readOnly = 1 };
newArray.solvedArray.vector = caller->solvedArray.arrayClassReference->solvedArray.vector;
newArray.solvedArray.vector.data = (u8*)caller->solvedArray.arrayClassReference->solvedArray.vector.data + (caller->solvedArray.offset * caller->solvedArray.arrayClassReference->solvedArray.vector.elemSz);
newArray.solvedArray.vector.count = caller->solvedArray.len;
return copyVariableToPtr(newArray);
}
ClassFunctionTableEntry_t arrayReferenceFunctions[] = {
{"project", projectArray, 0, 0},
};
Variable_t getArrayReferenceMember(Variable_t* var, char* memberName) {
return getGenericFunctionMember(var, memberName, arrayReferenceFunctions, ARRAY_SIZE(arrayReferenceFunctions));
}