value ? config_xml_true : config_xml_false);
}
+LTTNG_HIDDEN
+int config_writer_write_element_double(struct config_writer *writer,
+ const char *element_name,
+ double value)
+{
+ int ret;
+ xmlChar *encoded_element_name;
+
+ if (!writer || !writer->writer || !element_name || !element_name[0]) {
+ ret = -1;
+ goto end;
+ }
+
+ encoded_element_name = encode_string(element_name);
+ if (!encoded_element_name) {
+ ret = -1;
+ goto end;
+ }
+
+ ret = xmlTextWriterWriteFormatElement(
+ writer->writer, encoded_element_name, "%f", value);
+ xmlFree(encoded_element_name);
+end:
+ return ret >= 0 ? 0 : ret;
+}
+
LTTNG_HIDDEN
int config_writer_write_element_string(struct config_writer *writer,
const char *element_name, const char *value)
int config_writer_write_element_string(struct config_writer *writer,
const char *element_name, const char *value);
+/*
+ * Write an element of type double.
+ *
+ * writer An instance of a configuration writer.
+ *
+ * element_name Element name.
+ *
+ * value Double value of the element
+ *
+ * Returns zero if the element's value could be written.
+ * Negative values indicate an error.
+ */
+LTTNG_HIDDEN
+int config_writer_write_element_double(struct config_writer *writer,
+ const char *element_name,
+ double value);
+
/*
* Load session configurations from a file.
*
element_name, value);
}
+LTTNG_HIDDEN
+int mi_lttng_writer_write_element_double(struct mi_writer *writer,
+ const char *element_name,
+ double value)
+{
+ return config_writer_write_element_double(
+ writer->writer, element_name, value);
+}
+
LTTNG_HIDDEN
int mi_lttng_version(struct mi_writer *writer, struct mi_lttng_version *version,
const char *lttng_description, const char *lttng_license)
int mi_lttng_writer_write_element_string(struct mi_writer *writer,
const char *element_name, const char *value);
+/*
+ * Write an element of type double.
+ *
+ * writer An instance of a machine interface writer.
+ * element_name Element name.
+ * value Double value of the element.
+ *
+ * Returns zero if the element's value could be written.
+ * Negative values indicate an error.
+ */
+int mi_lttng_writer_write_element_double(struct mi_writer *writer,
+ const char *element_name,
+ double value);
+
/*
* Machine interface of struct version.
*