datapath-windows: Avoid BSOD when no event queue found.
[cascardo/ovs.git] / lib / ovsdb-types.h
index 6903aa8..5b6b0f0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010 Nicira Networks
+/* Copyright (c) 2009, 2010, 2011 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -152,6 +152,8 @@ bool ovsdb_type_is_valid(const struct ovsdb_type *);
 
 static inline bool ovsdb_type_is_scalar(const struct ovsdb_type *);
 static inline bool ovsdb_type_is_optional(const struct ovsdb_type *);
+static inline bool ovsdb_type_is_optional_scalar(
+    const struct ovsdb_type *);
 static inline bool ovsdb_type_is_composite(const struct ovsdb_type *);
 static inline bool ovsdb_type_is_set(const struct ovsdb_type *);
 static inline bool ovsdb_type_is_map(const struct ovsdb_type *);
@@ -168,13 +170,13 @@ struct json *ovsdb_type_to_json(const struct ovsdb_type *);
 static inline bool
 ovsdb_atomic_type_is_valid(enum ovsdb_atomic_type atomic_type)
 {
-    return atomic_type >= 0 && atomic_type < OVSDB_N_TYPES;
+    return (int) atomic_type >= 0 && atomic_type < OVSDB_N_TYPES;
 }
 
 static inline bool
 ovsdb_base_type_is_ref(const struct ovsdb_base_type *base)
 {
-    return base->type == OVSDB_TYPE_UUID && base->u.uuid.refTable;
+    return base->type == OVSDB_TYPE_UUID && base->u.uuid.refTableName;
 }
 
 static inline bool
@@ -202,6 +204,13 @@ static inline bool ovsdb_type_is_optional(const struct ovsdb_type *type)
     return type->n_min == 0;
 }
 
+static inline bool ovsdb_type_is_optional_scalar(
+    const struct ovsdb_type *type)
+{
+    return (type->value.type == OVSDB_TYPE_VOID
+            && type->n_min == 0 && type->n_max == 1);
+}
+
 static inline bool ovsdb_type_is_composite(const struct ovsdb_type *type)
 {
     return type->n_max > 1;