search for: xmltextwriterwritestr

Displaying 20 results from an estimated 28 matches for "xmltextwriterwritestr".

2012 Feb 01
1
[PATCH] hivexml
...uot;; > } > > - start_value (writer, key, type, NULL); > + int validXML = isValidXMLString(str); > + start_value (writer, key, type, validXML ? NULL : "base64"); > XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value")); > - XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST str)); > + if (validXML) > + XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST str)); > + else > + XML_CHECK (xmlTextWriterWriteBase64, (writer, str, 0, strlen(str))); > + > XML_CHECK (xmlTextWriterEndAttribute, (writer)); > end_value (w...
2018 Nov 02
0
[PATCH v3 2/4] common/utils: Move libxml2 writer macros to a common header file.
...\ + } while (0) + +/** + * To define a verbatim string, use: + * + * string ("hello"); + */ +#define string(str) \ + do { \ + if (xmlTextWriterWriteString (xo, BAD_CAST(str)) == -1) { \ + xml_error ("xmlTextWriterWriteString"); \ + } \ + } while (0) + +/** + * To define a verbatim string using a format string, use: + * + * stri...
2011 Sep 17
3
[PATCH 1/1] hivexml: Base64-encode non-printable data
...case hive_t_string: type = "string"; break; @@ -286,11 +340,9 @@ value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value, } start_value (writer, key, type, NULL); - XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value")); - XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST str)); - XML_CHECK (xmlTextWriterEndAttribute, (writer)); + ret = safe_print_string_attribute (h, writer_v, "value", "value_encoding", str); end_value (writer); - return 0; + return ret; } static int @@ -299,17 +351,18 @@ value_multiple_strings (...
2018 Nov 02
7
[PATCH v3 0/4] common/utils: Move libxml2 writer macros to a common header file.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-October/msg00047.html v2 was here: https://www.redhat.com/archives/libguestfs/2018-October/msg00051.html v3: - Back to using string/string_format and attribute/attribute_format. - Add both single_element and single_element_format. - Rebased and retested. Rich.
2011 Sep 02
1
[PATCH 6/7] hivexml: Report attributes in values instead of text.
...xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "node")); @@ -278,7 +279,9 @@ value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value, } start_value (writer, key, type, NULL); - XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST str)); + XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value")); + XML_CHECK (xmlTextWriterWriteString, (writer, str)); + XML_CHECK (xmlTextWriterEndAttribute, (writer)); end_value (writer); return 0; } @@ -332,7 +335,9 @@ value_string_invalid_...
2018 Oct 04
0
[PATCH v2 2/4] common/utils: Move libxml2 writer macros to a common header file.
...BAD_CAST (value)) == -1) { \ - xml_error ("xmlTextWriterWriteAttribute"); \ - return -1; \ - } - -/* A string, eg. within an element. */ -#define string(str) \ - if (xmlTextWriterWriteString (xo, BAD_CAST (str)) == -1) { \ - xml_error ("xmlTextWriterWriteString"); \ - return -1; \ - } - -/* A string, using printf-style formatting. */ -#define string_format(fs,...) \ - if (xmlTextWriterWriteFormatString (xo, fs, ##__...
2018 Oct 04
2
[PATCH 0/2] Use common macros to help with libxml2 writer.
Consolidate and extend the use of funky start_element() etc macros. Rich.
2011 Aug 13
2
[Hivex] [PATCH v3] Report last-modified time of hive root and nodes
...e")); + int64_t hive_mtime = hivex_last_modified (h); + if (hive_mtime < 0) + goto skip_mtime; + char *timebuf = filetime_to_8601 (hive_mtime); + if (timebuf == NULL) + goto skip_mtime; + XML_CHECK (xmlTextWriterStartElement, (writer, BAD_CAST "mtime")); + XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST timebuf)); + XML_CHECK (xmlTextWriterEndElement, (writer)); + free (timebuf); + timebuf = NULL; + +skip_mtime: + if (hivex_visit (h, &visitor, sizeof visitor, writer, visit_flags) == -1) { perror (argv[optind]); exit (EXIT_FAILURE); @@ -141,13 +157,66 @@ ma...
2018 Oct 04
6
[PATCH v2 0/4] common/utils: Move libxml2 writer macros to a common header file.
v1 was here: https://www.redhat.com/archives/libguestfs/2018-October/msg00047.html However it was broken in a few ways. First of all the documentation was broken because "/**" enhanced comments were not permitted on macros. This is fixed in the new 1/4 patch. Secondly we didn't use single_element() everywhere possible, which is fixed in the new 4/4 patch. Lastly I've
2016 Jun 30
4
[PATCH 0/4] p2v: Send ^C to remote end to cancel the conversion.
(I don't have a BZ# for this yet, but I'm expecting it to be filed as an RFE) Currently if the user is in the virt-p2v GUI and cancels the conversion, all that happens is we abruptly close the ssh session to virt-v2v. That is bad .. possibly (or maybe not). But in any case there is an alternative: we can send a ^C key to the virt-v2v process, which it could catch and handle gracefully,
2013 Sep 06
1
[PATCH] arm: appliance: Add support for device trees (dtb's).
This is the libguestfs companion patch to: https://www.redhat.com/archives/libguestfs/2013-September/msg00045.html Rich.
2011 Dec 13
1
[hivex] [PATCH 2/2] hivex: Expose embedded hive file name
...ivexml.c index 3a4d9b7..059da56 100644 --- a/xml/hivexml.c +++ b/xml/hivexml.c @@ -160,6 +160,15 @@ main (int argc, char *argv[]) } } + char *hive_name = hivex_name (h); + if (hive_name) { + XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "name")); + XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST hive_name)); + XML_CHECK (xmlTextWriterEndAttribute, (writer)); + free (hive_name); + hive_name = NULL; + } + int64_t hive_mtime = hivex_last_modified (h); if (hive_mtime >= 0) { char *timebuf = filetime_to_8601 (hive_mtime); -- 1.7.6.4
2012 Jul 21
8
[PATCH libguestfs 0/4] Add a libvirt backend to libguestfs.
This preliminary patch series adds a libvirt backend to libguestfs. It's for review only because although it launches the guest OK, there are some missing features that need to be implemented. The meat of the patch is in part 4/4. To save you the trouble of interpreting libxml2 fragments, an example of the generated XML and the corresponding qemu command line are attached below. Note the
2012 Mar 31
2
[PATCH v6] hivexml: Add byte run reporting functions
...t char *type; + int ret = 0; switch (t) { case hive_t_string: type = "string"; break; @@ -297,8 +369,9 @@ value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value, XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value")); XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST str)); XML_CHECK (xmlTextWriterEndAttribute, (writer)); + ret = value_byte_runs (h, writer_v, value); end_value (writer); - return 0; + return ret; } static int @@ -307,6 +380,7 @@ value_multiple_strings (hive_h *h, void *writer_v, hive_node_h node,...
2011 Dec 13
1
[hivex] [PATCH 1/1] hivexml: Change value type output to standard names
...void *writer_v, hive_node_h node, hive_value_h value, type = "unknown"; } - start_value (writer, key, type, NULL); + start_value (writer, key, value_type_windows_string (t), NULL); XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value")); XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST str)); XML_CHECK (xmlTextWriterEndAttribute, (writer)); @@ -308,7 +334,7 @@ value_multiple_strings (hive_h *h, void *writer_v, hive_node_h node, const char *key, char **argv) { xmlTextWriterPtr writer = (xmlTextWriterPtr) writer_v; - start_valu...
2018 Oct 04
0
[PATCH v2 3/4] inspector: Use libxml writer macros.
...ntpoints[i+1]); - if (!p) - exit (EXIT_FAILURE); - - XMLERROR (-1, - xmlTextWriterStartElement (xo, BAD_CAST "mountpoint")); - XMLERROR (-1, - xmlTextWriterWriteAttribute (xo, BAD_CAST "dev", BAD_CAST p)); - XMLERROR (-1, - xmlTextWriterWriteString (xo, BAD_CAST mountpoints[i])); - XMLERROR (-1, xmlTextWriterEndElement (xo)); - } - - XMLERROR (-1, xmlTextWriterEndElement (xo)); + start_element ("mountpoint") { + attribute ("dev", "%s", p); + string ("%s", mountpoints[i]); +...
2011 Dec 13
1
[hivex] [PATCH 1/2] hivex: Expose hive major and minor version
...rsion buffer\n")); + exit (EXIT_FAILURE); + } else { + snprintf (hive_version_buf, 8, "%" PRIu32 ".%" PRIu32, hive_major_version, hive_minor_version); + XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "hive_version")); + XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST hive_version_buf)); + XML_CHECK (xmlTextWriterEndAttribute, (writer)); + free (hive_version_buf); + hive_version_buf = NULL; + } + } + int64_t hive_mtime = hivex_last_modified (h); if (hive_mtime >= 0) { char *timebuf = filetime_to_8601 (hive_m...
2013 Feb 28
5
[PATCH v2 0/5] Fix SELinux security contexts so we can access shared disks (RHBZ#912499).
Link to version 1: https://www.redhat.com/archives/libguestfs/2013-February/thread.html#00122 Changes since version 1: - I've pushed two (of the three) code refactoring patches. The third one proved rather hard to move. - selinuxnorelabel option is no more. Instead there is a second internal API (internal_set_libvirt_selinux_norelabel_disks). - fixed bogus commit message -
2015 Oct 05
0
[PATCH 2/2] Fix whitespace.
...== -1) { \ set_conversion_error ("xmlTextWriterWriteFormatAttribute: %m"); \ return NULL; \ } /* A string, eg. within an element. */ -#define string(str) \ - if (xmlTextWriterWriteString (xo, BAD_CAST (str)) == -1) { \ - set_conversion_error ("xmlTextWriterWriteString: %m"); \ - return NULL; \ +#define string(str) \ + if (xmlTextWriterWriteString (xo, BAD_CAST (str)) == -1) { \ +...
2011 Dec 08
1
[hivex] [PATCH 8/8] hivexml: Add byte run reporting functions
...t char *type; + int ret = 0; switch (t) { case hive_t_string: type = "string"; break; @@ -298,8 +369,9 @@ value_string (hive_h *h, void *writer_v, hive_node_h node, hive_value_h value, XML_CHECK (xmlTextWriterStartAttribute, (writer, BAD_CAST "value")); XML_CHECK (xmlTextWriterWriteString, (writer, BAD_CAST str)); XML_CHECK (xmlTextWriterEndAttribute, (writer)); + ret = value_byte_runs (h, writer_v, value); end_value (writer); - return 0; + return ret; } static int @@ -308,6 +380,7 @@ value_multiple_strings (hive_h *h, void *writer_v, hive_node_h node,...