2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-15 14:17:18 +00:00

ovsdb: Fix support for systems where libpcre is not installed.

This is one of the loose ends that I intended to fix up and test before
pushing off my commits to add use of PCRE, but obviously I forgot.
This commit is contained in:
Ben Pfaff
2010-02-08 15:37:49 -08:00
parent 0d0f05b909
commit bfe8e67ad5
10 changed files with 98 additions and 45 deletions

View File

@@ -17,12 +17,15 @@
#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,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 } }