X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fovsdb-types.h;h=0eca931f2c3f3a640fea82b632111c2367f239a8;hb=fea39b9f1c6a1d05f8a89fbcd82dd01d5c8aa2d4;hp=b11f8277576b3dbec1ef709c4bc56f9232cc4a2b;hpb=0d0f05b909b6428d44eb147bd4edd73782d2a137;p=openvswitch diff --git a/lib/ovsdb-types.h b/lib/ovsdb-types.h index b11f8277..0eca931f 100644 --- a/lib/ovsdb-types.h +++ b/lib/ovsdb-types.h @@ -17,12 +17,15 @@ #define OVSDB_TYPES_H 1 #include -#include #include #include #include "compiler.h" #include "uuid.h" +#ifdef HAVE_PCRE +#include +#endif + struct json; /* An atomic type: one that OVSDB regards as a single unit of data. */ @@ -61,7 +64,9 @@ 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. */ @@ -81,9 +86,15 @@ 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 } } +#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 } }