2025-05-08 10:48:23 +01:00
|
|
|
#ifndef _DIAG_DIAG_H_
|
|
|
|
|
#define _DIAG_DIAG_H_
|
|
|
|
|
|
2026-03-16 14:07:33 +00:00
|
|
|
#include <fx/core/queue.h>
|
2025-05-08 10:48:23 +01:00
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
|
struct ivy_diag_msg;
|
|
|
|
|
|
|
|
|
|
enum diag_component_type {
|
|
|
|
|
DIAG_COMPONENT_NONE = 0,
|
|
|
|
|
DIAG_COMPONENT_MSG,
|
|
|
|
|
DIAG_COMPONENT_SNIPPET,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct diag_component {
|
|
|
|
|
enum diag_component_type c_type;
|
2026-03-16 14:07:33 +00:00
|
|
|
fx_queue_entry c_entry;
|
2025-05-08 10:48:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct diag_c_msg {
|
|
|
|
|
struct diag_component msg_base;
|
|
|
|
|
char *msg_content;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct diag_c_snippet {
|
|
|
|
|
struct diag_component s_base;
|
|
|
|
|
unsigned long s_first_line, s_last_line;
|
|
|
|
|
|
|
|
|
|
struct ivy_diag_amendment *s_amendments;
|
|
|
|
|
size_t s_nr_amendments;
|
|
|
|
|
|
|
|
|
|
struct ivy_diag_highlight *s_highlights;
|
|
|
|
|
size_t s_nr_highlights;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct ivy_diag {
|
|
|
|
|
struct ivy_diag_ctx *diag_parent;
|
|
|
|
|
unsigned long diag_class;
|
|
|
|
|
|
|
|
|
|
unsigned long diag_row, diag_col;
|
2026-03-16 14:07:33 +00:00
|
|
|
fx_queue_entry diag_entry;
|
|
|
|
|
fx_queue diag_components;
|
2025-05-08 10:48:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern struct diag_c_msg *diag_msg_create(const struct ivy_diag_msg *content);
|
|
|
|
|
extern struct diag_c_snippet *diag_snippet_create(
|
|
|
|
|
unsigned long first_line, unsigned long last_line,
|
|
|
|
|
const struct ivy_diag_amendment *amendmends, size_t nr_amendments,
|
|
|
|
|
const struct ivy_diag_highlight *highlights, size_t nr_highlights);
|
|
|
|
|
|
|
|
|
|
#endif
|