diff --git a/apps/dsm/DSMModule.h b/apps/dsm/DSMModule.h index 0153971e..5f541a02 100644 --- a/apps/dsm/DSMModule.h +++ b/apps/dsm/DSMModule.h @@ -130,6 +130,19 @@ class SCStrArgAction map* event_params); \ }; \ +#define DEF_ACTION_3P(CL_Name) \ + class CL_Name \ + : public DSMAction { \ + string par1; \ + string par2; \ + string par3; \ + public: \ + CL_Name(const string& arg); \ + bool execute(AmSession* sess, DSMSession* sc_sess, \ + DSMCondition::EventType event, \ + map* event_params); \ + }; + /* bool xsplit(const string& arg, char sep, bool optional, string& par1, string& par2); */ #define SPLIT_ARGS(sep, optional) \ @@ -197,12 +210,120 @@ class SCStrArgAction return; \ } +#define SPLIT_ARGS3(sep, optional) \ + size_t p = 0; \ + size_t p2 = 0; \ + char last_c = ' '; \ + bool quot=false; \ + char quot_c = ' '; \ + bool sep_found = false; \ + bool sep_found2 = false; \ + \ + while (p* event_params); \ }; +#define DEF_CONDITION_3P(cond_name) \ + class cond_name \ + : public DSMCondition { \ + string par1; \ + string par2; \ + string par3; \ + bool inv; \ + public: \ + cond_name(const string& arg, bool inv); \ + bool match(AmSession* sess, DSMSession* sc_sess, DSMCondition::EventType event, \ + map* event_params); \ + }; + #define CONST_CONDITION_2P(cond_name, _sep, _optional) \ cond_name::cond_name(const string& arg, bool inv) \ : inv(inv) { \ SPLIT_ARGS(_sep, _optional); \ } +#define CONST_CONDITION_3P(cond_name, _sep, _optional) \ + cond_name::cond_name(const string& arg, bool inv) \ + : inv(inv) { \ + SPLIT_ARGS3(_sep, _optional); \ + } + #define MATCH_CONDITION_START(cond_clsname) \ bool cond_clsname::match(AmSession* sess, DSMSession* sc_sess, \ DSMCondition::EventType event, \