File: history.h

package info (click to toggle)
fence-virt 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 772 kB
  • sloc: ansic: 10,257; cpp: 382; makefile: 272; sh: 214; lex: 113; yacc: 105
file content (25 lines) | stat: -rw-r--r-- 586 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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