mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-14 02:15:10 +00:00
[MOD/WIP] Externalise and add errors to commands
Still need forms...
This commit is contained in:
parent
408888ef67
commit
a880769c48
9 changed files with 311 additions and 89 deletions
38
src/include/XMPPFormTool.h
Normal file
38
src/include/XMPPFormTool.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#ifndef PARSEE_FORM_H
|
||||
#define PARSEE_FORM_H
|
||||
|
||||
#define Report(id, label) do \
|
||||
{ \
|
||||
field = XMLCreateTag("field"); \
|
||||
XMLAddAttr(field, "var", id); \
|
||||
XMLAddAttr(field, "label", label); \
|
||||
XMLAddChild(reported, field); \
|
||||
} \
|
||||
while(0)
|
||||
#define BeginItem() item = XMLCreateTag("item")
|
||||
#define EndItem() XMLAddChild(x, item)
|
||||
#define SetField(id, val) do \
|
||||
{ \
|
||||
field = XMLCreateTag("field"); \
|
||||
value = XMLCreateTag("value"); \
|
||||
txt = XMLCreateText(val); \
|
||||
XMLAddAttr(field, "var", id); \
|
||||
XMLAddChild(value, txt); \
|
||||
XMLAddChild(field, value); \
|
||||
XMLAddChild(item, field); \
|
||||
} \
|
||||
while(0)
|
||||
#define SetFixed(id, val) do \
|
||||
{ \
|
||||
field = XMLCreateTag("field"); \
|
||||
value = XMLCreateTag("value"); \
|
||||
txt = XMLCreateText(val); \
|
||||
XMLAddAttr(field, "var", id); \
|
||||
XMLAddAttr(field, "type", "fixed"); \
|
||||
XMLAddChild(value, txt); \
|
||||
XMLAddChild(field, value); \
|
||||
XMLAddChild(item, field); \
|
||||
} \
|
||||
while(0)
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue