fx.term: convert to new assembly build system
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
#ifndef FX_TERM_H_
|
||||
#define FX_TERM_H_
|
||||
|
||||
#include <fx/core/status.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <fx/term/tty.h>
|
||||
#include <fx/term/print.h>
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef FX_TERM_PRINT_H_
|
||||
#define FX_TERM_PRINT_H_
|
||||
|
||||
#include <fx/core/misc.h>
|
||||
#include <fx/core/status.h>
|
||||
#include <fx/misc.h>
|
||||
#include <fx/status.h>
|
||||
#include <fx/term/tty.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -40,13 +40,16 @@ typedef enum 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);
|
||||
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);
|
||||
const struct fx_error *,
|
||||
enum fx_error_report_flags flags);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,38 +1,35 @@
|
||||
#ifndef FX_TERM_TTY_H_
|
||||
#define FX_TERM_TTY_H_
|
||||
|
||||
#include <fx/core/misc.h>
|
||||
#include <fx/core/status.h>
|
||||
#include <fx/misc.h>
|
||||
#include <fx/status.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define fx_stdtty (z__fx_tty_get_std())
|
||||
#define fx_stdtty_err (z__fx_tty_get_err())
|
||||
#define fx_stdtty (z__fx_tty_get_std())
|
||||
#define fx_stdtty_err (z__fx_tty_get_err())
|
||||
|
||||
#define FX_TTY_CTRL_KEY(c) ((c) | FX_MOD_CTRL)
|
||||
#define FX_TTY_CTRL_KEY(c) ((c) | FX_MOD_CTRL)
|
||||
|
||||
#define FX_MAKE_VMODE(fg, bg, a) \
|
||||
{ \
|
||||
.v_fg = fg, .v_bg = bg, .v_attrib = (a) \
|
||||
}
|
||||
#define FX_MAKE_VMODE(fg, bg, a) {.v_fg = fg, .v_bg = bg, .v_attrib = (a)}
|
||||
|
||||
#define FX_MAKE_COLOUR_DEFAULT(v) \
|
||||
#define FX_MAKE_COLOUR_DEFAULT(v) \
|
||||
{ \
|
||||
.c_mode = TTY_COLOUR_NONE, \
|
||||
}
|
||||
|
||||
#define FX_MAKE_COLOUR_16(v) \
|
||||
#define FX_MAKE_COLOUR_16(v) \
|
||||
{ \
|
||||
.c_mode = TTY_COLOUR_16, .c_16 = {.value = (v) } \
|
||||
}
|
||||
|
||||
#define FX_MAKE_COLOUR_256(v) \
|
||||
#define FX_MAKE_COLOUR_256(v) \
|
||||
{ \
|
||||
.c_mode = TTY_COLOUR_256, .c_256 = {.value = (v) } \
|
||||
}
|
||||
|
||||
#define FX_MAKE_COLOUR_TRUE(cr, cg, cb) \
|
||||
#define FX_MAKE_COLOUR_TRUE(cr, cg, cb) \
|
||||
{ \
|
||||
.c_mode = TTY_COLOUR_TRUE, .c_true \
|
||||
= {.r = (cr), \
|
||||
@@ -152,29 +149,49 @@ static inline unsigned int fx_keycode_get_key(fx_keycode v)
|
||||
|
||||
FX_API bool fx_tty_is_interactive(const struct fx_tty *tty);
|
||||
FX_API void fx_tty_set_mode(struct fx_tty *tty, enum fx_tty_mode mode);
|
||||
FX_API void fx_tty_set_vmode(struct fx_tty *tty, const struct fx_tty_vmode *vmode);
|
||||
FX_API void fx_tty_set_vmode(
|
||||
struct fx_tty *tty,
|
||||
const struct fx_tty_vmode *vmode);
|
||||
FX_API void fx_tty_reset_vmode(struct fx_tty *tty);
|
||||
|
||||
FX_API enum fx_status fx_tty_get_dimensions(
|
||||
struct fx_tty *tty, unsigned int *w, unsigned int *h);
|
||||
struct fx_tty *tty,
|
||||
unsigned int *w,
|
||||
unsigned int *h);
|
||||
FX_API enum fx_status fx_tty_get_cursor_position(
|
||||
struct fx_tty *tty, unsigned int *x, unsigned int *y);
|
||||
struct fx_tty *tty,
|
||||
unsigned int *x,
|
||||
unsigned int *y);
|
||||
|
||||
FX_API fx_keycode fx_tty_read_key(struct fx_tty *tty);
|
||||
|
||||
FX_API void fx_tty_move_cursor_x(
|
||||
struct fx_tty *tty, enum fx_tty_position_base base, int pos);
|
||||
struct fx_tty *tty,
|
||||
enum fx_tty_position_base base,
|
||||
int pos);
|
||||
FX_API void fx_tty_move_cursor_y(
|
||||
struct fx_tty *tty, enum fx_tty_position_base base, int pos);
|
||||
struct fx_tty *tty,
|
||||
enum fx_tty_position_base base,
|
||||
int pos);
|
||||
FX_API void fx_tty_clear(struct fx_tty *tty, enum fx_tty_clear_mode mode);
|
||||
|
||||
FX_API int fx_tty_putc(struct fx_tty *tty, enum fx_tty_print_flags flags, char c);
|
||||
FX_API int fx_tty_putc(
|
||||
struct fx_tty *tty,
|
||||
enum fx_tty_print_flags flags,
|
||||
char c);
|
||||
FX_API int fx_tty_puts(
|
||||
struct fx_tty *tty, enum fx_tty_print_flags flags, const char *s);
|
||||
struct fx_tty *tty,
|
||||
enum fx_tty_print_flags flags,
|
||||
const char *s);
|
||||
FX_API int fx_tty_printf(
|
||||
struct fx_tty *tty, enum fx_tty_print_flags flags, const char *s, ...);
|
||||
struct fx_tty *tty,
|
||||
enum fx_tty_print_flags flags,
|
||||
const char *s,
|
||||
...);
|
||||
FX_API int fx_tty_vprintf(
|
||||
struct fx_tty *tty, enum fx_tty_print_flags flags, const char *s,
|
||||
struct fx_tty *tty,
|
||||
enum fx_tty_print_flags flags,
|
||||
const char *s,
|
||||
va_list args);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user