netdev-dpdk: fix mbuf leaks
[cascardo/ovs.git] / lib / ovsdb-parser.h
index 6efa0a7..2f9f483 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009 Nicira Networks
+/* Copyright (c) 2009, 2010, 2011, 2015 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include <stdbool.h>
 #include "compiler.h"
 #include "json.h"
-#include "svec.h"
+#include "sset.h"
 #include "util.h"
 
 struct ovsdb_parser {
     char *name;                 /* Used only in error messages. */
-    struct svec used;           /* Already-parsed names from 'object'. */
+    struct sset used;           /* Already-parsed names from 'object'. */
     const struct json *json;    /* JSON object being parsed. */
     struct ovsdb_error *error;  /* Error signaled, if any. */
 };
@@ -49,6 +49,8 @@ enum ovsdb_parser_types {
     OP_INTEGER = 1 << JSON_INTEGER,       /* 123. */
     OP_NONINTEGER = 1 << JSON_REAL,       /* 123.456. */
     OP_STRING = 1 << JSON_STRING,         /* "..." */
+    OP_ANY = (OP_NULL | OP_FALSE | OP_TRUE | OP_OBJECT | OP_ARRAY
+              | OP_INTEGER | OP_NONINTEGER | OP_STRING),
 
     OP_BOOLEAN = OP_FALSE | OP_TRUE,
     OP_NUMBER = OP_INTEGER | OP_NONINTEGER,
@@ -59,17 +61,19 @@ enum ovsdb_parser_types {
 
 void ovsdb_parser_init(struct ovsdb_parser *, const struct json *,
                        const char *name, ...)
-    PRINTF_FORMAT(3, 4);
+    OVS_PRINTF_FORMAT(3, 4);
 const struct json *ovsdb_parser_member(struct ovsdb_parser *, const char *name,
                                        enum ovsdb_parser_types);
 
 void ovsdb_parser_raise_error(struct ovsdb_parser *parser,
                               const char *format, ...)
-    PRINTF_FORMAT(2, 3);
+    OVS_PRINTF_FORMAT(2, 3);
 bool ovsdb_parser_has_error(const struct ovsdb_parser *);
 struct ovsdb_error *ovsdb_parser_get_error(const struct ovsdb_parser *);
 struct ovsdb_error *ovsdb_parser_finish(struct ovsdb_parser *)
-    WARN_UNUSED_RESULT;
+    OVS_WARN_UNUSED_RESULT;
+struct ovsdb_error *ovsdb_parser_destroy(struct ovsdb_parser *)
+    OVS_WARN_UNUSED_RESULT;
 
 bool ovsdb_parser_is_id(const char *string);