fix building without plugin support
[project/uci.git] / uci.h
diff --git a/uci.h b/uci.h
index 1b2fd63eaa1f8f5780a31e24d0f875b792ab5af0..97bff7d337d620ddd130d307370764b8b69d57cc 100644 (file)
--- a/uci.h
+++ b/uci.h
 #ifndef __LIBUCI_H
 #define __LIBUCI_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "uci_config.h"
 
 /*
@@ -698,4 +702,20 @@ uci_lookup_option(struct uci_context *ctx, struct uci_section *s, const char *na
                return NULL;
 }
 
+static inline const char *
+uci_lookup_option_string(struct uci_context *ctx, struct uci_section *s, const char *name)
+{
+       struct uci_option *o;
+
+       o = uci_lookup_option(ctx, s, name);
+       if (!o || o->type != UCI_TYPE_STRING)
+               return NULL;
+
+       return o->v.string;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif