Files
fx/fx.term/include/fx/term/print.h
T

53 lines
1.3 KiB
C

#ifndef FX_TERM_PRINT_H_
#define FX_TERM_PRINT_H_
#include <fx/core/misc.h>
#include <fx/core/status.h>
#include <fx/term/tty.h>
#include <stdarg.h>
#define fx_i(...) fx_print(FX_PRINT_I, __VA_ARGS__)
#define fx_warn(...) fx_print(FX_PRINT_WARN, __VA_ARGS__)
#define fx_err(...) fx_print(FX_PRINT_ERR, __VA_ARGS__)
struct fx_tty;
struct fx_error;
struct fx_error_vendor;
enum fx_error_report_flags;
typedef enum fx_paragraph_format_flags {
FX_PARAGRAPH_DONT_INDENT_FIRST_LINE = 0x01u,
FX_PARAGRAPH_HYPHENATE = 0x02u,
FX_PARAGRAPH_DOUBLE_LINE_BREAK = 0x04u,
FX_PARAGRAPH_MULTI_LINE_BREAK = 0x08u,
} fx_paragraph_format_flags;
typedef struct fx_paragraph_format {
fx_paragraph_format_flags p_flags;
unsigned int p_left_margin;
unsigned int p_right_margin;
unsigned int p_line_length;
} fx_paragraph_format;
typedef enum fx_print_format {
FX_PRINT_NORMAL = 0,
FX_PRINT_I,
FX_PRINT_WARN,
FX_PRINT_ERR,
} fx_print_format;
FX_API fx_status fx_print(fx_print_format format, const char *str, ...);
FX_API fx_status fx_print_paragraph(
const char *str, struct fx_tty *tty, fx_paragraph_format *format);
FX_API int fx_putc(char c);
FX_API int fx_puts(const char *s);
FX_API int fx_printf(const char *format, ...);
FX_API void fx_enhanced_error_reporter(
const struct fx_error *, enum fx_error_report_flags flags);
#endif