Files
bluelib/term/include/blue/term/print.h

53 lines
1.3 KiB
C

#ifndef BLUELIB_TERM_PRINT_H_
#define BLUELIB_TERM_PRINT_H_
#include <blue/core/misc.h>
#include <blue/core/status.h>
#include <blue/term/tty.h>
#include <stdarg.h>
#define b_i(...) b_print(B_PRINT_I, __VA_ARGS__)
#define b_warn(...) b_print(B_PRINT_WARN, __VA_ARGS__)
#define b_err(...) b_print(B_PRINT_ERR, __VA_ARGS__)
struct b_tty;
struct b_error;
struct b_error_vendor;
enum b_error_report_flags;
typedef enum b_paragraph_format_flags {
B_PARAGRAPH_DONT_INDENT_FIRST_LINE = 0x01u,
B_PARAGRAPH_HYPHENATE = 0x02u,
B_PARAGRAPH_DOUBLE_LINE_BREAK = 0x04u,
B_PARAGRAPH_MULTI_LINE_BREAK = 0x08u,
} b_paragraph_format_flags;
typedef struct b_paragraph_format {
b_paragraph_format_flags p_flags;
unsigned int p_left_margin;
unsigned int p_right_margin;
unsigned int p_line_length;
} b_paragraph_format;
typedef enum b_print_format {
B_PRINT_NORMAL = 0,
B_PRINT_I,
B_PRINT_WARN,
B_PRINT_ERR,
} b_print_format;
BLUE_API b_status b_print(b_print_format format, const char *str, ...);
BLUE_API b_status b_print_paragraph(
const char *str, struct b_tty *tty, b_paragraph_format *format);
BLUE_API int b_putc(char c);
BLUE_API int b_puts(const char *s);
BLUE_API int b_printf(const char *format, ...);
BLUE_API void b_enhanced_error_reporter(
const struct b_error *, enum b_error_report_flags flags);
#endif