Пример #1
0
void GWEN_XMLNode_SetIntValue(GWEN_XMLNODE *n,
                              const char *name,
                              int value) {
  char numbuf[32];

  snprintf(numbuf, sizeof(numbuf)-1, "%d", value);
  numbuf[sizeof(numbuf)-1]=0;
  GWEN_XMLNode_SetCharValue(n, name, numbuf);
}
Пример #2
0
void GWEN_Param_WriteXml(const GWEN_PARAM *p_struct, GWEN_XMLNODE *p_db)
{
  assert(p_struct);
  /* member "name" */
  GWEN_XMLNode_SetCharValue(p_db, "name", p_struct->name);

  /* member "flags" */
  GWEN_XMLNode_SetIntValue(p_db, "flags", p_struct->flags);

  /* member "type" */
  GWEN_XMLNode_SetCharValue(p_db, "type", GWEN_Param_Type_toString(p_struct->type));

  /* member "dataType" */
  GWEN_XMLNode_SetCharValue(p_db, "dataType", GWEN_Param_DataType_toString(p_struct->dataType));

  /* member "shortDescription" */
  GWEN_XMLNode_SetCharValue(p_db, "shortDescription", p_struct->shortDescription);

  /* member "longDescription" */
  GWEN_XMLNode_SetCharValue(p_db, "longDescription", p_struct->longDescription);

  /* member "currentValue" */
  GWEN_XMLNode_SetCharValue(p_db, "currentValue", p_struct->currentValue);

  /* member "defaultValue" */
  GWEN_XMLNode_SetCharValue(p_db, "defaultValue", p_struct->defaultValue);

  /* member "choices" */
  if (p_struct->choices) {
    GWEN_XMLNODE *n;
    n=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "choices");
    GWEN_StringList2_toXml(p_struct->choices, n);
    GWEN_XMLNode_AddChild(p_db, n);
  }

  /* member "internalIntValue" is volatile, not writing to xml */

  /* member "internalFloatValue" is volatile, not writing to xml */

  /* member "runtimeFlags" is volatile, not writing to xml */

}