auto-sync
This commit is contained in:
parent
3c1f1043f5
commit
40791c86e4
|
@ -200,6 +200,7 @@ void LEElementPool::reset() {
|
|||
|
||||
LEElement *LEElementPool::next() {
|
||||
if (index == size - 1) {
|
||||
// todo: this should not be a fatal error, just an error
|
||||
firmwareError("LE_ELEMENT_POOL_SIZE overflow");
|
||||
return NULL;
|
||||
}
|
||||
|
@ -283,3 +284,15 @@ LEElement * parseExpression(LEElementPool *pool, const char * line) {
|
|||
}
|
||||
return first;
|
||||
}
|
||||
|
||||
#if (EFI_PROD_CODE || EFI_SIMULATOR)
|
||||
|
||||
static void eval(char *line, Engine *engine) {
|
||||
|
||||
}
|
||||
|
||||
void initEval(Engine *engine) {
|
||||
addConsoleActionSP("evan", (VoidCharPtrVoidPtr)eval, engine);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -100,5 +100,6 @@ const char *getNextToken(const char *line, char *buffer);
|
|||
bool isNumeric(const char* line);
|
||||
le_action_e parseAction(const char * line);
|
||||
LEElement * parseExpression(LEElementPool *pool, const char * line);
|
||||
void initEval(Engine *engine);
|
||||
|
||||
#endif /* LOGIC_EXPRESSION_H_ */
|
||||
|
|
|
@ -89,6 +89,10 @@ void addConsoleActionS(const char *token, VoidCharPtr callback) {
|
|||
doAddAction(token, STRING_PARAMETER, (Void) callback, NULL);
|
||||
}
|
||||
|
||||
void addConsoleActionSP(const char *token, VoidCharPtrVoidPtr callback, void *param) {
|
||||
doAddAction(token, STRING_PARAMETER_P, (Void) callback, NULL);
|
||||
}
|
||||
|
||||
void addConsoleActionSS(const char *token, VoidCharPtrCharPtr callback) {
|
||||
doAddAction(token, STRING2_PARAMETER, (Void) callback, NULL);
|
||||
}
|
||||
|
@ -204,6 +208,12 @@ void handleActionWithParameter(TokenCallback *current, char *parameter) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (current->parameterType == STRING_PARAMETER_P) {
|
||||
VoidCharPtrVoidPtr callbackS = (VoidCharPtrVoidPtr) current->callback;
|
||||
(*callbackS)(parameter, current->param);
|
||||
return;
|
||||
}
|
||||
|
||||
// todo: refactor this hell!
|
||||
if (current->parameterType == STRING2_PARAMETER || current->parameterType == STRING2_PARAMETER_P) {
|
||||
int spaceIndex = findEndOfToken(parameter);
|
||||
|
|
|
@ -24,6 +24,7 @@ typedef enum {
|
|||
FLOAT_PARAMETER,
|
||||
FLOAT_PARAMETER_P,
|
||||
STRING_PARAMETER,
|
||||
STRING_PARAMETER_P,
|
||||
STRING2_PARAMETER,
|
||||
STRING2_PARAMETER_P,
|
||||
STRING3_PARAMETER,
|
||||
|
@ -89,7 +90,7 @@ void addConsoleActionFF(const char *token, VoidFloatFloat callback);
|
|||
void addConsoleActionFFP(const char *token, VoidFloatFloatVoidPtr callback, void *param);
|
||||
|
||||
void addConsoleActionS(const char *token, VoidCharPtr callback);
|
||||
void addConsoleActionSP(const char *token, VoidCharPtrVoidPtr callback);
|
||||
void addConsoleActionSP(const char *token, VoidCharPtrVoidPtr callback, void *param);
|
||||
|
||||
void addConsoleActionSS(const char *token, VoidCharPtrCharPtr callback);
|
||||
void addConsoleActionSSP(const char *token, VoidCharPtrCharPtrVoidPtr callback, void *param);
|
||||
|
|
Loading…
Reference in New Issue