wftk_session_setuser
. Caveat callor.
Anyway, the enactment itself is just a child of the main datasheet element which is an "enactment" node. If there isn't
one, we create it, pretty much the same as the state.
XML * wftk_enactment (void * session, XML * datasheet) { XML * en; en = xml_loc (datasheet, "datasheet.enactment"); if (!en) { en = xml_create ("enactment"); xml_append (datasheet, en); } return (en); } |
int wftk_enactment_write (void * session, XML * datasheet, XML * xml, const char * attribute, const char * value) { XML * copy; ATTR * attr; XML * en = wftk_enactment (session, datasheet); if (!en) return 0; if (!xml) return 0; copy = xml_create (xml->name); attr = xml->attrs; while (attr) { xml_set (copy, attr->name, attr->value); attr = attr->next; } if (wftk_session_getuser(session)) { xml_set (copy, "by", xml_attrval (wftk_session_getuser(session), "id")); } xml_set (copy, "at", _wftk_value_special (session, datasheet, "!now")); if (attribute && value) { xml_set (copy, attribute, value); } xml_append (en, copy); return 1; } |
int wftk_log (void * session, XML * datasheet, char * log) { int retval; XML * logxml = xml_create ("log"); xml_set (logxml, "text", log); retval = wftk_enactment_write (session, datasheet, logxml, NULL, NULL); xml_free (logxml); return (retval); } |
This code and documentation are released under the terms of the GNU license. They are additionally copyright (c) 2000, Vivtek. All rights reserved except those explicitly granted under the terms of the GNU license. |