summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src/templates.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-04-04 15:13:16 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-04-04 15:13:16 +0300
commit35f3a41206cc576853943620d7d9a7efe593fed5 (patch)
tree3162d34e89ce942f6c0347c718d991a3604b6a97 /plugins/NewStory/src/templates.h
parentdb915e4f76078302d66cff79ed9a3eb63024a261 (diff)
more code cleaning
Diffstat (limited to 'plugins/NewStory/src/templates.h')
-rw-r--r--plugins/NewStory/src/templates.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/NewStory/src/templates.h b/plugins/NewStory/src/templates.h
index 2067d4118f..89b5d2a431 100644
--- a/plugins/NewStory/src/templates.h
+++ b/plugins/NewStory/src/templates.h
@@ -11,6 +11,17 @@ struct TemplateVars
{
bool del[256];
wchar_t* val[256];
+
+ __forceinline wchar_t* GetVar(uint8_t id) {
+ return val[id];
+ }
+
+ __forceinline void SetVar(uint8_t id, wchar_t *v, bool d) {
+ if (val[id] && del[id])
+ mir_free(val[id]);
+ val[id] = mir_wstrdup(v);
+ del[id] = d;
+ }
};
typedef void(*VarFunc)(int mode, TemplateVars* vars, MCONTACT hContact, HistoryArray::ItemData* item);