You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
782 B

  1. #ifndef INPUTHANDLING_H
  2. #define INPUTHANDLING_H
  3. typedef enum{
  4. opAdd, opSub, opDiv, opMult, opExp, opLog, opEmpty, opNotSupported, opResult
  5. }op;
  6. typedef struct {
  7. op functionsType;
  8. char* formular;
  9. double inputNumbers[10];
  10. int arrayLength;
  11. void* children[10]; // all children structs which depends on this struct
  12. void* parent; // the parent struct which this struct depends on
  13. double result;
  14. }calc_op;
  15. extern void processInput(char* formStr, int len);
  16. extern void showStruct(calc_op* formRef);
  17. extern void deleteWhitespace(char* formStr, int len);
  18. extern op detectFunctionOperator(char* formStr, int len);
  19. extern char* getNumbers(char* formStr, int len, calc_op* formRef);
  20. extern void showStruct(calc_op* formRef);
  21. extern calc_op* getNextCalc();
  22. #endif // INPUTHANDLING_H