ofctl: Improve manpage.
[openvswitch] / lib / ovsdb-types.h
index 633b50f6616cce354a8bb4133ebd432edccdf8dd..0eca931f2c3f3a640fea82b632111c2367f239a8 100644 (file)
 #define OVSDB_TYPES_H 1
 
 #include <float.h>
-#include <pcre.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include "compiler.h"
 #include "uuid.h"
 
+#ifdef HAVE_PCRE
+#include <pcre.h>
+#endif
+
 struct json;
 
 /* An atomic type: one that OVSDB regards as a single unit of data. */
@@ -61,12 +64,19 @@ struct ovsdb_base_type {
         /* No constraints for Boolean types. */
 
         struct ovsdb_string_constraints {
+#ifdef HAVE_PCRE
             pcre *re;           /* Compiled regular expression. */
+#endif
             char *reMatch;      /* reMatch or NULL. */
             char *reComment;    /* reComment or NULL. */
             unsigned int minLen; /* minLength or 0. */
             unsigned int maxLen; /* maxLength or UINT_MAX. */
         } string;
+
+        struct ovsdb_uuid_constraints {
+            char *refTableName; /* Name of referenced table, or NULL. */
+            struct ovsdb_table *refTable; /* Referenced table, if available. */
+        } uuid;
     } u;
 };
 
@@ -76,10 +86,17 @@ struct ovsdb_base_type {
 #define OVSDB_BASE_REAL_INIT    { .type = OVSDB_TYPE_REAL,          \
                                   .u.real = { -DBL_MAX, DBL_MAX } }
 #define OVSDB_BASE_BOOLEAN_INIT { .type = OVSDB_TYPE_BOOLEAN }
+#ifdef HAVE_PCRE
 #define OVSDB_BASE_STRING_INIT  { .type = OVSDB_TYPE_STRING,        \
                                   .u.string = { NULL, NULL, NULL,   \
                                                 0, UINT_MAX } }
-#define OVSDB_BASE_UUID_INIT    { .type = OVSDB_TYPE_UUID }
+#else
+#define OVSDB_BASE_STRING_INIT  { .type = OVSDB_TYPE_STRING,    \
+                                  .u.string = { NULL, NULL,     \
+                                                0, UINT_MAX } }
+#endif
+#define OVSDB_BASE_UUID_INIT    { .type = OVSDB_TYPE_UUID,      \
+                                  .u.uuid = { NULL, NULL } }
 
 void ovsdb_base_type_init(struct ovsdb_base_type *, enum ovsdb_atomic_type);
 void ovsdb_base_type_clone(struct ovsdb_base_type *,