meta: replace bluelib with fx
This commit is contained in:
+13
-13
@@ -13,7 +13,7 @@ static void copy_string(
|
||||
size_t dest_max)
|
||||
{
|
||||
size_t start = strlen(dest);
|
||||
size_t max = b_min(size_t, src_max, dest_max - start);
|
||||
size_t max = fx_min(size_t, src_max, dest_max - start);
|
||||
|
||||
for (size_t i = 0; i < max; i++) {
|
||||
dest[start + i] = src[i];
|
||||
@@ -47,23 +47,23 @@ static long long from_octal(const char *s, size_t len)
|
||||
|
||||
static enum ropkg_status read_file_header(struct ropkg_reader *reader)
|
||||
{
|
||||
if (b_cstream_in_compressed_section(reader->r_stream)) {
|
||||
b_cstream_tx_bytes_uncompressed(
|
||||
if (fx_cstream_in_compressed_section(reader->r_stream)) {
|
||||
fx_cstream_tx_bytes_uncompressed(
|
||||
reader->r_stream,
|
||||
&reader->r_cur_header_offset);
|
||||
} else {
|
||||
b_cstream_tx_bytes(
|
||||
fx_cstream_tx_bytes(
|
||||
reader->r_stream,
|
||||
&reader->r_cur_header_offset);
|
||||
}
|
||||
|
||||
size_t nr_read = 0;
|
||||
b_status status = b_cstream_read(
|
||||
fx_status status = fx_cstream_read(
|
||||
reader->r_stream,
|
||||
&reader->r_cur_header,
|
||||
sizeof reader->r_cur_header,
|
||||
&nr_read);
|
||||
if (!B_OK(status)) {
|
||||
if (!FX_OK(status)) {
|
||||
return ROPKG_ERR_IO_FAILURE;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ static enum ropkg_status read_file_header(struct ropkg_reader *reader)
|
||||
return ROPKG_SUCCESS;
|
||||
}
|
||||
|
||||
enum ropkg_status ropkg_reader_open(b_cstream *fp, struct ropkg_reader **out)
|
||||
enum ropkg_status ropkg_reader_open(fx_cstream *fp, struct ropkg_reader **out)
|
||||
{
|
||||
struct ropkg_reader *reader = malloc(sizeof *reader);
|
||||
if (!reader) {
|
||||
@@ -127,7 +127,7 @@ enum ropkg_status ropkg_reader_open(b_cstream *fp, struct ropkg_reader **out)
|
||||
}
|
||||
|
||||
if (!memcmp(&reader->r_cur_header, &null_header, sizeof null_header)) {
|
||||
b_cstream_skip(reader->r_stream, sizeof null_header, NULL);
|
||||
fx_cstream_skip(reader->r_stream, sizeof null_header, NULL);
|
||||
reader->r_eof = true;
|
||||
}
|
||||
|
||||
@@ -154,10 +154,10 @@ enum ropkg_status ropkg_reader_move_next(struct ropkg_reader *pkg)
|
||||
}
|
||||
|
||||
size_t pos = 0;
|
||||
if (b_cstream_in_compressed_section(pkg->r_stream)) {
|
||||
b_cstream_tx_bytes_uncompressed(pkg->r_stream, &pos);
|
||||
if (fx_cstream_in_compressed_section(pkg->r_stream)) {
|
||||
fx_cstream_tx_bytes_uncompressed(pkg->r_stream, &pos);
|
||||
} else {
|
||||
b_cstream_tx_bytes(pkg->r_stream, &pos);
|
||||
fx_cstream_tx_bytes(pkg->r_stream, &pos);
|
||||
}
|
||||
|
||||
size_t end = pkg->r_cur_header_offset + sizeof pkg->r_cur_header
|
||||
@@ -169,7 +169,7 @@ enum ropkg_status ropkg_reader_move_next(struct ropkg_reader *pkg)
|
||||
size_t skip = end - pos;
|
||||
|
||||
size_t nr_skipped = 0;
|
||||
b_cstream_skip(pkg->r_stream, skip, &nr_skipped);
|
||||
fx_cstream_skip(pkg->r_stream, skip, &nr_skipped);
|
||||
|
||||
if (nr_skipped != skip) {
|
||||
pkg->r_eof = true;
|
||||
@@ -182,7 +182,7 @@ enum ropkg_status ropkg_reader_move_next(struct ropkg_reader *pkg)
|
||||
}
|
||||
|
||||
if (!memcmp(&pkg->r_cur_header, &null_header, sizeof null_header)) {
|
||||
b_cstream_skip(pkg->r_stream, sizeof null_header, NULL);
|
||||
fx_cstream_skip(pkg->r_stream, sizeof null_header, NULL);
|
||||
pkg->r_eof = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user