summaryrefslogtreecommitdiffstats
path: root/addons/deviceatlas/dummy
diff options
context:
space:
mode:
Diffstat (limited to 'addons/deviceatlas/dummy')
-rw-r--r--addons/deviceatlas/dummy/Makefile2
-rw-r--r--addons/deviceatlas/dummy/dac.c15
-rw-r--r--addons/deviceatlas/dummy/dac.h18
-rw-r--r--addons/deviceatlas/dummy/dacache.cpp26
-rw-r--r--addons/deviceatlas/dummy/dadwarc.c1
-rw-r--r--addons/deviceatlas/dummy/dadwcurl.c1
6 files changed, 43 insertions, 20 deletions
diff --git a/addons/deviceatlas/dummy/Makefile b/addons/deviceatlas/dummy/Makefile
index 8bba840..0e87738 100644
--- a/addons/deviceatlas/dummy/Makefile
+++ b/addons/deviceatlas/dummy/Makefile
@@ -1,7 +1,7 @@
# makefile for dummy DeviceAtlas library
#
# To enable the DeviceAtlas module support, the following are needed
-# make TARGET=<target> DEVICEATLAS_SRC=addons/deviceatlas/dummy USE_PCRE=1 USE_DEVICEATLAS=1
+# make TARGET=<target> DEVICEATLAS_SRC=addons/deviceatlas/dummy USE_DEVICEATLAS=1
build: libda.a
diff --git a/addons/deviceatlas/dummy/dac.c b/addons/deviceatlas/dummy/dac.c
index 720dc6a..c846ec0 100644
--- a/addons/deviceatlas/dummy/dac.c
+++ b/addons/deviceatlas/dummy/dac.c
@@ -37,21 +37,21 @@ da_typename(da_type_t fieldtype)
}
char *
-da_getdataversion(da_atlas_t *atlas)
+da_getdataversion(const da_atlas_t *atlas)
{
return "dummy library version 1.0";
}
time_t
-da_getdatacreation(da_atlas_t *atlas)
+da_getdatacreation(const da_atlas_t *atlas)
{
return time(NULL);
}
-int
-da_getdatarevision(da_atlas_t *atlas)
+char *
+da_getdatacreationiso8601(const da_atlas_t *atlas)
{
- return 1;
+ return "20000123T012345.678+0900";
}
da_status_t
@@ -118,11 +118,6 @@ da_atlas_getpropcount(const da_atlas_t *atlas)
return 1;
}
-void
-da_atlas_setconfig(da_atlas_t *atlas, da_config_t *config)
-{
-}
-
da_status_t
da_searchv(const da_atlas_t *atlas, da_deviceinfo_t *result, da_evidence_t *evidence, size_t count)
{
diff --git a/addons/deviceatlas/dummy/dac.h b/addons/deviceatlas/dummy/dac.h
index bf166ae..836a9af 100644
--- a/addons/deviceatlas/dummy/dac.h
+++ b/addons/deviceatlas/dummy/dac.h
@@ -26,9 +26,8 @@ typedef int _Bool;
#endif
#endif
-#define MOBI_DA_MAJOR 2
-#define MOBI_DA_MINOR 1
-#define MOBI_DA_DUMMY_LIBRARY 1
+#define DATLAS_DA_MAJOR 3
+#define DATLAS_DA_DUMMY_LIBRARY 1
/**
@@ -134,6 +133,7 @@ typedef void (*da_errorfunc_t)(da_severity_t severity, da_status_t status, const
/* Manifest constants. */
enum {
+ DA_CACHE_MAX = 50000,
/*
* used as the initial guess for the compiled size of an atlas.
* If atlas sizes grow more beyond this, it can be expanded to avoid multiple scans of the data.
@@ -142,9 +142,8 @@ enum {
};
struct da_config {
- unsigned int ua_props;
- unsigned int lang_props;
- unsigned int __reserved[14]; /* enough reserved keywords for future use */
+ unsigned int cache_size;
+ unsigned int __reserved[15]; /* enough reserved keywords for future use */
};
/**
@@ -451,21 +450,22 @@ const char *da_typename(da_type_t type);
* @param atlas
* @return version
*/
-char *da_getdataversion(da_atlas_t *atlas);
+char *da_getdataversion(const da_atlas_t *atlas);
/**
* @brief returns the date creation's timestamp from the JSON in memory
* @param atlas
* @return version
*/
-time_t da_getdatacreation(da_atlas_t *atlas);
+time_t da_getdatacreation(const da_atlas_t *atlas);
+char *da_getdatacreationiso8601(const da_atlas_t *atlas);
/**
* @brief returns the revision's number from the JSON in memory
* @param atlas
* @return version
*/
-int da_getdatarevision(da_atlas_t *atlas);
+int da_getdatarevision(const da_atlas_t *atlas);
/**
* @brief returns the name of a global property
diff --git a/addons/deviceatlas/dummy/dacache.cpp b/addons/deviceatlas/dummy/dacache.cpp
new file mode 100644
index 0000000..bab71cc
--- /dev/null
+++ b/addons/deviceatlas/dummy/dacache.cpp
@@ -0,0 +1,26 @@
+#include "dac.h"
+
+extern "C" {
+void da_atlas_cache_init(const da_atlas_t *atlas) {
+ (void)atlas;
+}
+
+da_status_t da_atlas_cache_insert(const da_atlas_t *atlas, unsigned long long h, da_deviceinfo_t *info) {
+ (void)atlas;
+ (void)h;
+ (void)info;
+ return DA_OK;
+}
+
+da_status_t da_atlas_cache_search(const da_atlas_t *atlas, unsigned long long h, da_deviceinfo_t **info) {
+ (void)atlas;
+ (void)h;
+ (void)info;
+ return DA_OK;
+}
+
+void da_atlas_cache_close(da_atlas_t *atlas) {
+ (void)atlas;
+}
+}
+
diff --git a/addons/deviceatlas/dummy/dadwarc.c b/addons/deviceatlas/dummy/dadwarc.c
new file mode 100644
index 0000000..53c5fdf
--- /dev/null
+++ b/addons/deviceatlas/dummy/dadwarc.c
@@ -0,0 +1 @@
+#include <stdio.h>
diff --git a/addons/deviceatlas/dummy/dadwcurl.c b/addons/deviceatlas/dummy/dadwcurl.c
new file mode 100644
index 0000000..53c5fdf
--- /dev/null
+++ b/addons/deviceatlas/dummy/dadwcurl.c
@@ -0,0 +1 @@
+#include <stdio.h>