meta: replace bluelib with fx
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
#include "../write.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <blue/core/stringstream.h>
|
||||
#include <blue/term/print.h>
|
||||
#include <blue/term/tty.h>
|
||||
#include <fx/core/stringstream.h>
|
||||
#include <fx/term/print.h>
|
||||
#include <fx/term/tty.h>
|
||||
#include <ctype.h>
|
||||
#include <ivy/line-source.h>
|
||||
#include <stdlib.h>
|
||||
@@ -25,7 +25,7 @@ struct snippet_print_ctx {
|
||||
size_t ctx_line_buf_ptr;
|
||||
|
||||
bool ctx_has_underline;
|
||||
b_stringstream *ctx_underline;
|
||||
fx_stringstream *ctx_underline;
|
||||
|
||||
struct diag_c_snippet *ctx_snippet;
|
||||
|
||||
@@ -67,23 +67,23 @@ struct snippet_print_ctx {
|
||||
|
||||
#define STREAM_COLOUR_ERROR_B(stream, str) \
|
||||
if (DIAG_STREAM_FLAG_SET(stream, IVY_DIAG_STREAM_F_COLOUR)) { \
|
||||
b_stream_write_string(str, __STREAM_COLOUR_ERROR, NULL); \
|
||||
fx_stream_write_string(str, __STREAM_COLOUR_ERROR, NULL); \
|
||||
}
|
||||
#define STREAM_COLOUR_WARN_B(stream, str) \
|
||||
if (DIAG_STREAM_FLAG_SET(stream, IVY_DIAG_STREAM_F_COLOUR)) { \
|
||||
b_stream_write_string(str, __STREAM_COLOUR_WARN, NULL); \
|
||||
fx_stream_write_string(str, __STREAM_COLOUR_WARN, NULL); \
|
||||
}
|
||||
#define STREAM_COLOUR_HINT_B(stream, str) \
|
||||
if (DIAG_STREAM_FLAG_SET(stream, IVY_DIAG_STREAM_F_COLOUR)) { \
|
||||
b_stream_write_string(str, __STREAM_COLOUR_HINT, NULL); \
|
||||
fx_stream_write_string(str, __STREAM_COLOUR_HINT, NULL); \
|
||||
}
|
||||
#define STREAM_COLOUR_ACCENT_B(stream, str) \
|
||||
if (DIAG_STREAM_FLAG_SET(stream, IVY_DIAG_STREAM_F_COLOUR)) { \
|
||||
b_stream_write_string(str, __STREAM_COLOUR_ACCENT, NULL); \
|
||||
fx_stream_write_string(str, __STREAM_COLOUR_ACCENT, NULL); \
|
||||
}
|
||||
#define STREAM_COLOUR_RESET_B(stream, str) \
|
||||
if (DIAG_STREAM_FLAG_SET(stream, IVY_DIAG_STREAM_F_COLOUR)) { \
|
||||
b_stream_write_string(str, __STREAM_COLOUR_RESET, NULL); \
|
||||
fx_stream_write_string(str, __STREAM_COLOUR_RESET, NULL); \
|
||||
}
|
||||
|
||||
static void print_header(
|
||||
@@ -143,12 +143,12 @@ static void print_msg(
|
||||
struct ivy_diag_stream *stream)
|
||||
{
|
||||
if (stream->s_type == IVY_DIAG_STREAM_TTY) {
|
||||
b_paragraph_format format = {
|
||||
fx_paragraph_format format = {
|
||||
.p_left_margin = 2,
|
||||
.p_right_margin = 2,
|
||||
};
|
||||
|
||||
b_print_paragraph(msg->msg_content, stream->s_tty, &format);
|
||||
fx_print_paragraph(msg->msg_content, stream->s_tty, &format);
|
||||
} else {
|
||||
diag_stream_puts(stream, " ");
|
||||
diag_stream_puts(stream, msg->msg_content);
|
||||
@@ -218,7 +218,7 @@ static bool amendment_contains_cell(
|
||||
}
|
||||
|
||||
limit = a->a_replace.a_col
|
||||
+ b_max(ulong, a->a_replace.a_length, a->__x) - 1;
|
||||
+ fx_max(ulong, a->a_replace.a_length, a->__x) - 1;
|
||||
|
||||
if (col > limit) {
|
||||
return false;
|
||||
@@ -316,7 +316,7 @@ static enum ivy_status read_row(struct snippet_print_ctx *ctx, size_t row)
|
||||
ctx->ctx_line_buf_ptr = 0;
|
||||
ctx->ctx_has_underline = false;
|
||||
|
||||
ctx->ctx_underline = b_stringstream_create_with_buffer(
|
||||
ctx->ctx_underline = fx_stringstream_create_with_buffer(
|
||||
ctx->ctx_underline_buf, sizeof ctx->ctx_underline_buf);
|
||||
|
||||
size_t nr_read;
|
||||
@@ -380,7 +380,7 @@ static int get_char(struct snippet_print_ctx *ctx)
|
||||
static void update_underline(struct snippet_print_ctx *ctx)
|
||||
{
|
||||
if (!ctx->ctx_hl) {
|
||||
b_stream_write_char(ctx->ctx_underline, ' ');
|
||||
fx_stream_write_char(ctx->ctx_underline, ' ');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -388,10 +388,10 @@ static void update_underline(struct snippet_print_ctx *ctx)
|
||||
case IVY_DIAG_HIGHLIGHT_ERROR:
|
||||
case IVY_DIAG_HIGHLIGHT_WARNING:
|
||||
case IVY_DIAG_HIGHLIGHT_HINT:
|
||||
b_stream_write_char(ctx->ctx_underline, '^');
|
||||
fx_stream_write_char(ctx->ctx_underline, '^');
|
||||
break;
|
||||
default:
|
||||
b_stream_write_char(ctx->ctx_underline, ' ');
|
||||
fx_stream_write_char(ctx->ctx_underline, ' ');
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -481,15 +481,15 @@ static enum ivy_status write(
|
||||
print_header(ctx, diag, stream);
|
||||
print_location(ctx, diag, stream);
|
||||
|
||||
b_queue_entry *entry = b_queue_first(&diag->diag_components);
|
||||
fx_queue_entry *entry = fx_queue_first(&diag->diag_components);
|
||||
while (entry) {
|
||||
struct diag_component *c
|
||||
= b_unbox(struct diag_component, entry, c_entry);
|
||||
= fx_unbox(struct diag_component, entry, c_entry);
|
||||
|
||||
diag_stream_putc(stream, '\n');
|
||||
print_component(ctx, diag, c, stream);
|
||||
|
||||
entry = b_queue_next(entry);
|
||||
entry = fx_queue_next(entry);
|
||||
}
|
||||
|
||||
return IVY_OK;
|
||||
|
||||
Reference in New Issue
Block a user