/*
- * Copyright (C) 2014 Jonathan Rajotte <jonathan.r.julien@gmail.com>
+ * Copyright (C) 2014 EfficiOS Inc.
*
* SPDX-License-Identifier: LGPL-2.1-only
*
#include <libxml/parser.h>
#include <lttng/lttng-error.h>
-#include <common/macros.h>
-
-#include <common/macros.h>
+#include <common/macros.hpp>
+namespace {
struct validation_ctx {
xmlSchemaParserCtxtPtr parser_ctx;
xmlSchemaPtr schema;
xmlSchemaValidCtxtPtr schema_validation_ctx;
};
+} /* namespace */
enum command_err_code {
CMD_SUCCESS = 0,
};
static ATTR_FORMAT_PRINTF(2, 3)
-void xml_error_handler(void *ctx, const char *format, ...)
+void xml_error_handler(void *ctx __attribute__((unused)),
+ const char *format, ...)
{
char *err_msg;
va_list args;
ret = CMD_SUCCESS;
end:
+ if (doc) {
+ xmlFreeDoc(doc);
+ }
return ret;
-
-
}
-int main(int argc, char **argv, char *env[])
+
+int main(int argc, char **argv)
{
int ret;
- struct validation_ctx ctx = { 0 };
+ struct validation_ctx ctx = {};
/* Check if we have all argument */
if (argc < 3) {