libnexus-rv
hist-array.h
Go to the documentation of this file.
1 // SPDX-License-Identifer: Apache 2.0
2 /*
3  * hist-array.h - HIST array structure and functions
4  *
5  * Copyright (C) 2025, Bo Gan <ganboing@gmail.com>
6  */
7 
8 #ifndef LIBNEXUS_RV_HIST_ARRAY_H
9 #define LIBNEXUS_RV_HIST_ARRAY_H
10 
11 #include <stdbool.h>
12 #include <stdint.h>
13 #include <stddef.h>
21 typedef struct nexusrv_hist_arr_element {
22  uint32_t hist;
23  uint32_t repeat;
24  uint64_t timestamp;
26 
27 struct nexusrv_hist_array;
28 
29 struct nexusrv_hist_array* nexusrv_hist_array_new(void);
30 
31 void nexusrv_hist_array_free(struct nexusrv_hist_array* arr);
32 
33 nexusrv_hist_arr_element *nexusrv_hist_array_front(struct nexusrv_hist_array* arr);
34 
35 void nexusrv_hist_array_pop(struct nexusrv_hist_array* arr);
36 
37 int nexusrv_hist_array_push(struct nexusrv_hist_array* arr, nexusrv_hist_arr_element ele);
38 
39 size_t nexusrv_hist_array_size(struct nexusrv_hist_array* arr);
40 
41 void nexusrv_hist_array_clear(struct nexusrv_hist_array* arr);
42 
43 #endif
struct nexusrv_hist_arr_element nexusrv_hist_arr_element
HIST array element.
HIST array element.
Definition: hist-array.h:21
uint32_t hist
Definition: hist-array.h:22
uint64_t timestamp
Definition: hist-array.h:24
uint32_t repeat
Definition: hist-array.h:23