6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen#ifndef LOG_ERROR_BUFFER_H
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen#define LOG_ERROR_BUFFER_H
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainenstruct log_error_buffer;
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainenstruct log_error {
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen enum log_type type;
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen time_t timestamp;
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen const char *prefix;
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen const char *text;
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen};
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainenstruct log_error_buffer *log_error_buffer_init(void);
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainenvoid log_error_buffer_add(struct log_error_buffer *buf,
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen const struct log_error *error);
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainenvoid log_error_buffer_deinit(struct log_error_buffer **buf);
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainenstruct log_error_buffer_iter *
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainenlog_error_buffer_iter_init(struct log_error_buffer *buf);
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainenstruct log_error *
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainenlog_error_buffer_iter_next(struct log_error_buffer_iter *iter);
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainenvoid log_error_buffer_iter_deinit(struct log_error_buffer_iter **iter);
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen
6a3c23e577be41f7521995c5dae19abb2fb4ffb6Timo Sirainen#endif