fx.term: convert to new assembly build system
This commit is contained in:
+19
-8
@@ -1,6 +1,6 @@
|
||||
#include <fx/ds/string.h>
|
||||
#include <fx/term/print.h>
|
||||
#include <ctype.h>
|
||||
#include <fx/string.h>
|
||||
#include <fx/term/print.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -9,7 +9,9 @@
|
||||
#define DEFAULT_PARAGRAPH_WIDTH 160
|
||||
|
||||
static void indent(
|
||||
struct fx_paragraph_format *format, struct fx_tty *tty, unsigned int margin)
|
||||
struct fx_paragraph_format *format,
|
||||
struct fx_tty *tty,
|
||||
unsigned int margin)
|
||||
{
|
||||
unsigned int x = 0;
|
||||
while (x < margin) {
|
||||
@@ -19,7 +21,9 @@ static void indent(
|
||||
}
|
||||
|
||||
static unsigned int extract_line(
|
||||
const char **sp, unsigned int line_length, fx_string *out,
|
||||
const char **sp,
|
||||
unsigned int line_length,
|
||||
fx_string *out,
|
||||
struct fx_paragraph_format *format)
|
||||
{
|
||||
const char *start = *sp;
|
||||
@@ -95,7 +99,9 @@ static unsigned int extract_line(
|
||||
}
|
||||
|
||||
static fx_status print_paragraph_tty(
|
||||
const char *str, struct fx_tty *tty, struct fx_paragraph_format *format)
|
||||
const char *str,
|
||||
struct fx_tty *tty,
|
||||
struct fx_paragraph_format *format)
|
||||
{
|
||||
unsigned int w = 0, h = 0;
|
||||
fx_tty_get_dimensions(tty, &w, &h);
|
||||
@@ -134,7 +140,8 @@ static fx_status print_paragraph_tty(
|
||||
need_indent = true;
|
||||
|
||||
while (*str == '\n') {
|
||||
if (format->p_flags & FX_PARAGRAPH_MULTI_LINE_BREAK) {
|
||||
if (format->p_flags
|
||||
& FX_PARAGRAPH_MULTI_LINE_BREAK) {
|
||||
fx_tty_putc(tty, 0, '\n');
|
||||
}
|
||||
|
||||
@@ -164,13 +171,17 @@ static fx_status print_paragraph_tty(
|
||||
}
|
||||
|
||||
static fx_status print_paragraph_file(
|
||||
const char *str, FILE *fp, struct fx_paragraph_format *format)
|
||||
const char *str,
|
||||
FILE *fp,
|
||||
struct fx_paragraph_format *format)
|
||||
{
|
||||
return FX_SUCCESS;
|
||||
}
|
||||
|
||||
fx_status fx_print_paragraph(
|
||||
const char *str, struct fx_tty *fp, struct fx_paragraph_format *format)
|
||||
const char *str,
|
||||
struct fx_tty *fp,
|
||||
struct fx_paragraph_format *format)
|
||||
{
|
||||
return print_paragraph_tty(str, fp, format);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user