Re: [PATCHv2 1/5] Introduce virXMLValidator structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/08/2016 04:10 AM, Ján Tomko wrote:
On Wed, Jun 08, 2016 at 08:49:37AM +0200, Peter Krempa wrote:
On Tue, Jun 07, 2016 at 20:07:28 +0200, Ján Tomko wrote:
Store all the data related to RNG validation in one structure to
allow splitting virXMLValidateAgainstSchema.
---
  src/util/virxml.c | 47 +++++++++++++++++++++++++++--------------------
  src/util/virxml.h | 10 ++++++++++
  2 files changed, 37 insertions(+), 20 deletions(-)
[...]

@@ -177,6 +179,14 @@ int virXMLInjectNamespace(xmlNodePtr node,
                            const char *uri,
                            const char *key);
+typedef struct _virXMLValidator {
+    xmlRelaxNGParserCtxtPtr rngParser;
+    xmlRelaxNGPtr rng;
+    xmlRelaxNGValidCtxtPtr rngValid;
+    virBuffer buf;
+    char *schemafile;
+} virXMLValidator, *virXMLValidatorPtr;
This is too revolutionary. I'd stick with the few extra typedefs as we
do (almost) everywhere.
The revolution has already been started by commit ff89e9b with a fitting
summary:
conf: move virDomainDeviceInfo definition from domain_conf.h to device_conf.h

The revolution started long before that (and it wasn't me who filed the declaration, although I did fire the latest shot):

grep "^typedef struct.*{$" src/*/*.[ch]

I really see no point in the ancient notation (nor in the extra _virBlah naming of the struct when it's never otherwise used (and could have just as easily been named virBlah to match the typedef - those are different namespaces), although I forgot to remove those when I moved virDomainDeviceInfo). Maybe there was some compiler in days of yore that required it?


ACK with the above changed.
I have changed it to honour the tradition.

Death to the redundant oppressors!!

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]