feat: kprintf now goes into dedicated pseudo-dev rather than flooding the framebuffer
[lunaix-os.git] / lunaix-os / kernel / kprint / kp_records.h
1 #ifndef __LUNAIX_KP_RECORDS_H
2 #define __LUNAIX_KP_RECORDS_H
3
4 #include <lunaix/ds/llist.h>
5 #include <lunaix/time.h>
6
7 struct kp_entry
8 {
9     struct llist_header ents;
10     int lvl;
11     time_t time;
12     char* content;
13 };
14 #define KP_ENT_SIZE sizeof(struct kp_entry)
15
16 struct kp_records
17 {
18     struct kp_entry kp_ents;
19
20     struct llist_header* kp_ent_wp;
21
22     int max_recs;
23     int cur_recs;
24     int log_lvl;
25 };
26 #define KP_RECS_SIZE sizeof(struct kp_records)
27
28 struct kp_records*
29 kp_rec_create(int max_recs);
30
31 void
32 kp_rec_put(struct kp_records*, int lvl, char* content, size_t len);
33
34 #endif /* __LUNAIX_KP_RECORDS_H */