/* * MathPlanner 3.0.1 - Mathematical design tool. * Copyright(C) 2002 Jarmo Nikkanen * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation. * * You should have received a copy of the GNU General Public License with this program. * */ #ifndef _MATHPLANNER_SERVERS_H #define _MATHPLANNER_SERVERS_H #include "MathHeaders.h" #include #include #define MAX_INTEGERS 512 class string_object; class function_defination_object; class m_function_object; struct m_integer { math_node value; QString name; bool used; class m_function_object *local; }; struct m_function { class string_object *string; class function_defination_object *fdo; QString fname; bool pointer; int count; }; class int_server { private: math_node zero,pii; struct m_integer integer[MAX_INTEGERS]; int stack_integer_no[MAX_INTEGERS]; math_node stack_integer_value[MAX_INTEGERS]; int space,last_used; int position; public: int_server(); int AddInteger(QString name,math_node value,class m_function_object *lo=NULL); void DeleteAllIntegers(); math_node *GetIntegerPointer(QString name,class m_function_object *lo=NULL); math_node *FindInteger(QString name,class m_function_object *lo=NULL); math_node GetInteger(QString name,class m_function_object *lo=NULL); math_node GetInteger(int no); void SetLocalValues(class m_function_object *); int FindEmptySlot(); void Protect(int); void UnProtect(); int GetIntegerNo(QString name,class m_function_object *lo=NULL); }; class function_serv { private: class m_function function[25]; int space; public: function_serv(); int AddFunction(QString,string_object *,function_defination_object *fdo,int count); void DeleteAllFunctions(); void SetPointer(QString,bool); bool GetPointer(QString); string_object **GetString(QString); function_defination_object *GetFDO(QString); int GetCount(QString); int FindEmptySlot(); int FindFunction(QString); QStringList CreateFunctionList(); }; #endif