summaryrefslogtreecommitdiffstats
path: root/agents/virt/include/history.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:50:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:50:17 +0000
commit86ed03f8adee56c050c73018537371c230a664a6 (patch)
treeeae3d04cdf1c49848e5a671327ab38297f4acb0d /agents/virt/include/history.h
parentInitial commit. (diff)
downloadfence-agents-86ed03f8adee56c050c73018537371c230a664a6.tar.xz
fence-agents-86ed03f8adee56c050c73018537371c230a664a6.zip
Adding upstream version 4.12.1.upstream/4.12.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'agents/virt/include/history.h')
-rw-r--r--agents/virt/include/history.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/agents/virt/include/history.h b/agents/virt/include/history.h
new file mode 100644
index 0000000..3d28518
--- /dev/null
+++ b/agents/virt/include/history.h
@@ -0,0 +1,25 @@
+#ifndef _HISTORY_H
+#define _HISTORY_H
+
+typedef struct _history_node {
+ list_head();
+ void *data;
+ time_t when;
+} history_node;
+
+typedef int (*history_compare_fn)(void *, void *);
+
+typedef struct _history_info {
+ history_node *hist;
+ history_compare_fn compare_func;
+ time_t timeout;
+ size_t element_size;
+} history_info_t;
+
+history_info_t *history_init(history_compare_fn func,
+ time_t expiration, size_t element_size);
+int history_check(history_info_t *hinfo, void *stuff);
+int history_record(history_info_t *hinfo, void *data);
+int history_wipe(history_info_t *hinfo);
+
+#endif