meta: replace bluelib with fx
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include <blue/core/queue.h>
|
||||
#include <blue/core/stringstream.h>
|
||||
#include <blue/ds/string.h>
|
||||
#include <fx/core/queue.h>
|
||||
#include <fx/core/stringstream.h>
|
||||
#include <fx/ds/string.h>
|
||||
#include <ivy/selector.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -25,12 +25,12 @@ void ivy_selector_destroy(struct ivy_selector *sel)
|
||||
free(sel->sel_name);
|
||||
}
|
||||
|
||||
b_queue_entry *entry = b_queue_first(&sel->sel_args);
|
||||
fx_queue_entry *entry = fx_queue_first(&sel->sel_args);
|
||||
while (entry) {
|
||||
struct ivy_selector_arg *arg
|
||||
= b_unbox(struct ivy_selector_arg, entry, arg_entry);
|
||||
b_queue_entry *next = b_queue_next(entry);
|
||||
b_queue_delete(&sel->sel_args, entry);
|
||||
= fx_unbox(struct ivy_selector_arg, entry, arg_entry);
|
||||
fx_queue_entry *next = fx_queue_next(entry);
|
||||
fx_queue_delete(&sel->sel_args, entry);
|
||||
|
||||
if (arg->arg_label) {
|
||||
free(arg->arg_label);
|
||||
@@ -56,7 +56,7 @@ void ivy_selector_set_recipient(
|
||||
|
||||
enum ivy_status ivy_selector_set_name(struct ivy_selector *sel, const char *name)
|
||||
{
|
||||
sel->sel_name = b_strdup(name);
|
||||
sel->sel_name = fx_strdup(name);
|
||||
return sel->sel_name ? IVY_OK : IVY_ERR_NO_MEMORY;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ enum ivy_status ivy_selector_add_arg(
|
||||
memset(arg, 0x0, sizeof *arg);
|
||||
|
||||
if (label) {
|
||||
arg->arg_label = b_strdup(label);
|
||||
arg->arg_label = fx_strdup(label);
|
||||
|
||||
if (!arg->arg_label) {
|
||||
free(arg);
|
||||
@@ -80,7 +80,7 @@ enum ivy_status ivy_selector_add_arg(
|
||||
}
|
||||
|
||||
if (name) {
|
||||
arg->arg_name = b_strdup(name);
|
||||
arg->arg_name = fx_strdup(name);
|
||||
|
||||
if (!arg->arg_name) {
|
||||
free(arg->arg_label);
|
||||
@@ -89,49 +89,49 @@ enum ivy_status ivy_selector_add_arg(
|
||||
}
|
||||
}
|
||||
|
||||
b_queue_push_back(&sel->sel_args, &arg->arg_entry);
|
||||
fx_queue_push_back(&sel->sel_args, &arg->arg_entry);
|
||||
return IVY_OK;
|
||||
}
|
||||
|
||||
size_t ivy_selector_to_string(const struct ivy_selector *sel, char *out, size_t max)
|
||||
{
|
||||
b_stringstream *str = b_stringstream_create_with_buffer(out, max);
|
||||
fx_stringstream *str = fx_stringstream_create_with_buffer(out, max);
|
||||
|
||||
switch (sel->sel_recipient) {
|
||||
case IVY_SEL_OBJECT:
|
||||
b_stream_write_char(str, '-');
|
||||
fx_stream_write_char(str, '-');
|
||||
break;
|
||||
case IVY_SEL_CLASS:
|
||||
b_stream_write_char(str, '+');
|
||||
fx_stream_write_char(str, '+');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (sel->sel_name) {
|
||||
b_stream_write_string(str, sel->sel_name, NULL);
|
||||
fx_stream_write_string(str, sel->sel_name, NULL);
|
||||
}
|
||||
|
||||
if (sel->sel_name && !b_queue_empty(&sel->sel_args)) {
|
||||
b_stream_write_char(str, '(');
|
||||
if (sel->sel_name && !fx_queue_empty(&sel->sel_args)) {
|
||||
fx_stream_write_char(str, '(');
|
||||
}
|
||||
|
||||
b_queue_entry *entry = b_queue_first(&sel->sel_args);
|
||||
fx_queue_entry *entry = fx_queue_first(&sel->sel_args);
|
||||
while (entry) {
|
||||
struct ivy_selector_arg *arg
|
||||
= b_unbox(struct ivy_selector_arg, entry, arg_entry);
|
||||
b_stream_write_fmt(
|
||||
= fx_unbox(struct ivy_selector_arg, entry, arg_entry);
|
||||
fx_stream_write_fmt(
|
||||
str, NULL, "%s:", arg->arg_label ? arg->arg_label : "_");
|
||||
|
||||
entry = b_queue_next(entry);
|
||||
entry = fx_queue_next(entry);
|
||||
}
|
||||
|
||||
if (sel->sel_name && !b_queue_empty(&sel->sel_args)) {
|
||||
b_stream_write_char(str, ')');
|
||||
if (sel->sel_name && !fx_queue_empty(&sel->sel_args)) {
|
||||
fx_stream_write_char(str, ')');
|
||||
}
|
||||
|
||||
size_t len = b_stringstream_get_length(str);
|
||||
b_stringstream_unref(str);
|
||||
size_t len = fx_stringstream_get_length(str);
|
||||
fx_stringstream_unref(str);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user