Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1.  
  2. #ifndef __arggetter_h__
  3. #define __arggetter_h__
  4.  
  5. #include "yacasbase.h"
  6.  
  7.  
  8.  
  9. /// Get an argument that should be a (long) integer
  10. LispString * GetIntegerArgument(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
  11. /// Get a string (atom)
  12. LispString * GetStringArgument(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
  13. /// Get the atomic string of the argument
  14. LispString * GetAtomArgument(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
  15. /// Get an argument that should be a short integer
  16. LispInt GetShortIntegerArgument(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
  17. /// Get a list argument
  18. void GetListArgument(LispPtr& aResult, LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
  19. /// Get a void* pointer to a struct encapsulated in a generic class
  20. void* GetVoidStruct(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr, LispChar * aTypeString);
  21.  
  22.  
  23. #define ListArgument(_list,_argnr) LispPtr _list; GetListArgument(_list, aEnvironment,aStackTop,_argnr)
  24. #define IntegerArgument(_i,_argnr) LispString * _i = GetIntegerArgument(aEnvironment,aStackTop,_argnr)
  25. #define ShortIntegerArgument(_i,_argnr) LispInt _i = GetShortIntegerArgument(aEnvironment,aStackTop,_argnr)
  26. #define InpStringArgument(_i,_argnr) LispChar * _i = GetStringArgument(aEnvironment,aStackTop,_argnr)->c_str()
  27.  
  28. #define DoubleFloatArgument(_i,_argnr) double _i = GetDoubleFloatArgument(aEnvironment,aStackTop,_argnr)
  29. #define VoidStructArgument(_typ,_i,_argnr,_name) _typ _i = (_typ)GetVoidStruct(aEnvironment,aStackTop,_argnr,_name)
  30.  
  31.  
  32. void ReturnShortInteger(LispEnvironment& aEnvironment,
  33.                         LispPtr& aResult, LispInt r);
  34. void SetShortIntegerConstant(LispEnvironment& aEnvironment,
  35.                                     LispChar * aName,
  36.                                     LispInt aValue);
  37. double GetDoubleFloatArgument(LispEnvironment& aEnvironment, LispInt aStackTop, LispInt iArgNr);
  38. void ReturnDoubleFloat(LispEnvironment& aEnvironment,LispPtr& aResult, double r);
  39. void ReturnVoidStruct(LispEnvironment& aEnvironment,
  40.                       LispPtr& aResult,
  41.                       LispChar * aName,
  42.                       void* aData,
  43.                       void (*aFree)(void*));
  44.  
  45.  
  46. #endif
  47.  
  48.