From: Kevin Day Date: Sun, 2 May 2021 05:12:42 +0000 (-0500) Subject: Update: Remove the "amount" from file stream functions. X-Git-Tag: 0.5.4~69 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=06d70fc4c0402167d02764413d96a49bf1df1f1a;p=fll Update: Remove the "amount" from file stream functions. The "amount" is present to support the parameters that fread() and fwrite() utilize. This makes no sense to me and it is annoying and confusing. I end up having to just put 1. Get rid of it and just use the file.size_read and file.size_write to specify the buffer size to read/write. The only things that I can thing of might be atomic operations, locking, and calling the function multiple times. These are good reasons to have an "amount". If I end up wanting o needing an "amount", I may add additional functions later on. --- diff --git a/level_0/f_file/c/file.c b/level_0/f_file/c/file.c index 513896b..62501a0 100644 --- a/level_0/f_file/c/file.c +++ b/level_0/f_file/c/file.c @@ -1981,10 +1981,9 @@ extern "C" { #endif // _di_f_file_stream_open_ #ifndef _di_f_file_stream_read_ - f_status_t f_file_stream_read(const f_file_t file, const f_array_length_t amount, f_string_dynamic_t *buffer) { + f_status_t f_file_stream_read(const f_file_t file, f_string_dynamic_t *buffer) { #ifndef _di_level_0_parameter_checking_ if (!file.size_read) return F_status_set_error(F_parameter); - if (amount < 1) return F_status_set_error(F_parameter); if (buffer->used > buffer->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -2008,7 +2007,7 @@ extern "C" { memset(buffer->string + buffer->used, 0, sizeof(file.size_read)); } - size_read = fread(buffer->string + buffer->used, amount, file.size_read, file.stream); + size_read = fread(buffer->string + buffer->used, 1, file.size_read, file.stream); if (ferror(file.stream)) { if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); @@ -2022,7 +2021,7 @@ extern "C" { return F_status_set_error(F_failure); } - buffer->used += size_read * amount; + buffer->used += size_read; if (feof(file.stream)) break; } // for @@ -2032,30 +2031,27 @@ extern "C" { #endif // _di_f_file_stream_read_ #ifndef _di_f_file_stream_read_block_ - f_status_t f_file_stream_read_block(const f_file_t file, const f_array_length_t amount, f_string_dynamic_t *buffer) { + f_status_t f_file_stream_read_block(const f_file_t file, f_string_dynamic_t *buffer) { #ifndef _di_level_0_parameter_checking_ if (!file.size_read) return F_status_set_error(F_parameter); - if (amount < 1) return F_status_set_error(F_parameter); if (buffer->used > buffer->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (!file.stream) return F_status_set_error(F_file_closed); - const f_array_length_t buffer_size = file.size_read * amount; - f_status_t status = F_none; ssize_t size_read = 0; - if (buffer->used + buffer_size > buffer->size) { - if (buffer->size + buffer_size > f_array_length_t_size) { + if (buffer->used + file.size_read > buffer->size) { + if (buffer->size + file.size_read > f_array_length_t_size) { return F_status_set_error(F_string_too_large); } - macro_f_string_dynamic_t_resize(status, (*buffer), buffer->size + buffer_size); + macro_f_string_dynamic_t_resize(status, (*buffer), buffer->size + file.size_read); if (F_status_is_error(status)) return status; } - size_read = fread(buffer->string + buffer->used, amount, file.size_read, file.stream); + size_read = fread(buffer->string + buffer->used, 1, file.size_read, file.stream); if (ferror(file.stream)) { if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); @@ -2069,7 +2065,7 @@ extern "C" { return F_status_set_error(F_failure); } - buffer->used += size_read * amount; + buffer->used += size_read; if (feof(file.stream)) { return F_none_eof; @@ -2080,10 +2076,9 @@ extern "C" { #endif // _di_f_file_stream_read_block_ #ifndef _di_f_file_stream_read_until_ - f_status_t f_file_stream_read_until(const f_file_t file, const f_array_length_t amount, const f_array_length_t total, f_string_dynamic_t *buffer) { + f_status_t f_file_stream_read_until(const f_file_t file, const f_array_length_t total, f_string_dynamic_t *buffer) { #ifndef _di_level_0_parameter_checking_ if (!file.size_read) return F_status_set_error(F_parameter); - if (amount < 1) return F_status_set_error(F_parameter); if (buffer->used > buffer->size) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -2110,7 +2105,7 @@ extern "C" { if (F_status_is_error(status)) return status; } - size_read = fread(buffer->string + buffer->used, amount, file.size_read, file.stream); + size_read = fread(buffer->string + buffer->used, 1, file.size_read, file.stream); if (ferror(file.stream)) { if (errno == EAGAIN || errno == EWOULDBLOCK) return F_status_set_error(F_block); @@ -2124,13 +2119,13 @@ extern "C" { return F_status_set_error(F_failure); } - buffer->used += size_read * amount; + buffer->used += size_read; if (feof(file.stream)) { return F_none_eof; } - buffer_count += size_read * amount; + buffer_count += size_read; if (buffer_count == total) break; } // for @@ -2182,11 +2177,10 @@ extern "C" { #endif // _di_f_file_stream_reopen_ #ifndef _di_f_file_stream_write_ - f_status_t f_file_stream_write(const f_file_t file, const f_string_static_t buffer, const f_array_length_t amount, f_array_length_t *written) { + f_status_t f_file_stream_write(const f_file_t file, const f_string_static_t buffer, f_array_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (!file.size_write) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); - if (amount < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (!file.stream) { @@ -2201,7 +2195,7 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_stream_write_until(file, buffer.string, amount, buffer.used, written); + private_f_file_stream_write_until(file, buffer.string, buffer.used, written); if (status == F_none && *written == buffer.used) { return F_none_eos; @@ -2210,7 +2204,7 @@ extern "C" { else { f_array_length_t written_local = 0; - private_f_file_stream_write_until(file, buffer.string, amount, buffer.used, &written_local); + private_f_file_stream_write_until(file, buffer.string, buffer.used, &written_local); if (status == F_none && written_local == buffer.used) { return F_none_eos; @@ -2226,11 +2220,10 @@ extern "C" { #endif // _di_f_file_stream_write_ #ifndef _di_f_file_stream_write_block_ - f_status_t f_file_stream_write_block(const f_file_t file, const f_string_static_t buffer, const f_array_length_t amount, f_array_length_t *written) { + f_status_t f_file_stream_write_block(const f_file_t file, const f_string_static_t buffer, f_array_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (!file.size_write) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); - if (amount < 1) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ if (!file.stream) { @@ -2252,7 +2245,7 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_stream_write_until(file, buffer.string, amount, write_max, written); + private_f_file_stream_write_until(file, buffer.string, write_max, written); if (status == F_none) { if (*written == buffer.used) { @@ -2267,7 +2260,7 @@ extern "C" { else { f_array_length_t written_local = 0; - private_f_file_stream_write_until(file, buffer.string, amount, write_max, &written_local); + private_f_file_stream_write_until(file, buffer.string, write_max, &written_local); if (status == F_none) { if (written_local == buffer.used) { @@ -2285,11 +2278,10 @@ extern "C" { #endif // _di_f_file_stream_write_block_ #ifndef _di_f_file_stream_write_until_ - f_status_t f_file_stream_write_until(const f_file_t file, const f_string_static_t buffer, const f_array_length_t amount, const f_array_length_t total, f_array_length_t *written) { + f_status_t f_file_stream_write_until(const f_file_t file, const f_string_static_t buffer, const f_array_length_t total, f_array_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (!file.size_write) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); - if (amount < 1) return F_status_set_error(F_parameter); if (!total) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -2312,7 +2304,7 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_stream_write_until(file, buffer.string, amount, write_max, written); + private_f_file_stream_write_until(file, buffer.string, write_max, written); if (status == F_none) { if (*written == buffer.used) { @@ -2327,7 +2319,7 @@ extern "C" { else { f_array_length_t written_local = 0; - private_f_file_stream_write_until(file, buffer.string, amount, buffer.used, &written_local); + private_f_file_stream_write_until(file, buffer.string, buffer.used, &written_local); if (status == F_none) { if (written_local == buffer.used) { @@ -2345,11 +2337,10 @@ extern "C" { #endif // _di_f_file_stream_write_until_ #ifndef _di_f_file_stream_write_range_ - f_status_t f_file_stream_write_range(const f_file_t file, const f_string_static_t buffer, const f_array_length_t amount, const f_string_range_t range, f_array_length_t *written) { + f_status_t f_file_stream_write_range(const f_file_t file, const f_string_static_t buffer, const f_string_range_t range, f_array_length_t *written) { #ifndef _di_level_0_parameter_checking_ if (!file.size_write) return F_status_set_error(F_parameter); if (buffer.used > buffer.size) return F_status_set_error(F_parameter); - if (amount < 1) return F_status_set_error(F_parameter); if (range.stop < range.start) return F_status_set_error(F_parameter); if (range.start >= buffer.used) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ @@ -2374,7 +2365,7 @@ extern "C" { f_status_t status = F_none; if (written) { - private_f_file_stream_write_until(file, buffer.string + range.start, amount, write_max, written); + private_f_file_stream_write_until(file, buffer.string + range.start, write_max, written); if (status == F_none) { if (range.start + *written == buffer.used) { @@ -2389,7 +2380,7 @@ extern "C" { else { f_array_length_t written_local = 0; - private_f_file_stream_write_until(file, buffer.string + range.start, amount, write_max, &written_local); + private_f_file_stream_write_until(file, buffer.string + range.start, write_max, &written_local); if (status == F_none) { if (range.start + written_local == buffer.used) { diff --git a/level_0/f_file/c/file.h b/level_0/f_file/c/file.h index ba9c4f6..f20e7f9 100644 --- a/level_0/f_file/c/file.h +++ b/level_0/f_file/c/file.h @@ -1415,8 +1415,8 @@ extern "C" { * To determine how much was read into the buffer, record buffer->used before execution and compare to buffer->used after execution. * * This is different from simply using the file.size_read. - * The file.size_read represents the amount to process for a given buffer size. - * The total represents the maximum number of bytes to process. + * The file.size_read represents the amount to process at a given time. + * The total represents the maximum number of file.size_read to process. * For example, if file.size_read is 16 and total is 128, then this function would need to be called 8 times until total is reached. * * @param file @@ -2012,9 +2012,7 @@ extern "C" { * @param file * The file to read. * The file must already be open. - * @param amount - * The total amount of file.size_read to process. - * This amount is multiplied against file.size_read and must be greater than 0. + * The file.size_read represents the amount to process at a given time. * @param buffer * The buffer the file is being read into. * The contents of the file is appended into this buffer. @@ -2034,7 +2032,7 @@ extern "C" { * @see fread() */ #ifndef _di_f_file_stream_read_ - extern f_status_t f_file_stream_read(const f_file_t file, const f_array_length_t amount, f_string_dynamic_t *buffer); + extern f_status_t f_file_stream_read(const f_file_t file, f_string_dynamic_t *buffer); #endif // _di_f_file_stream_read_ /** @@ -2045,9 +2043,7 @@ extern "C" { * @param file * The file to read. * The file must already be open. - * @param amount - * The total amount of file.size_read to process. - * This amount is multiplied against file.size_read and must be greater than 0. + * The file.size_read represents the amount to process at a given time. * @param buffer * The buffer the file is being read into. * The contents of the file is appended into this buffer. @@ -2068,7 +2064,7 @@ extern "C" { * @see fread() */ #ifndef _di_f_file_stream_read_block_ - extern f_status_t f_file_stream_read_block(const f_file_t file, const f_array_length_t amount, f_string_dynamic_t *buffer); + extern f_status_t f_file_stream_read_block(const f_file_t file, f_string_dynamic_t *buffer); #endif // _di_f_file_stream_read_block_ /** @@ -2077,16 +2073,14 @@ extern "C" { * To check how much was read into the buffer, record buffer->used before execution and compare to buffer->used after execution. * * This is different from simply using the file.size_read. - * The file.size_read represents the amount to process for a given buffer size. - * The total represents the maximum number of "size" to process. + * The file.size_read represents the amount to process at a given time. + * The total represents the maximum number of file.size_read to process. * For example, if file.size_read is 16 and total is 128, then this function would need to be called 8 times until total is reached. * * @param file * The file to read. * The file must already be open. - * @param amount - * The total amount of file.size_read to process. - * This amount is multiplied against file.size_read and must be greater than 0. + * The file.size_read represents the amount to process at a given time. * @param total * The total bytes to read, unless EOF is reached first. * @param buffer @@ -2108,7 +2102,7 @@ extern "C" { * @see fread() */ #ifndef _di_f_file_stream_read_until_ - extern f_status_t f_file_stream_read_until(const f_file_t file, const f_array_length_t amount, const f_array_length_t total, f_string_dynamic_t *buffer); + extern f_status_t f_file_stream_read_until(const f_file_t file, const f_array_length_t total, f_string_dynamic_t *buffer); #endif // _di_f_file_stream_read_until_ /** @@ -2131,8 +2125,8 @@ extern "C" { * * @return * F_none is returned on success. - * F_access_denied (with error bit) on access denied. * + * F_access_denied (with error bit) on access denied. * F_buffer (with error bit) if the buffer is invalid. * F_busy (with error bit) if filesystem is too busy to perform write. * F_file_descriptor (with error bit) if unable to load the file descriptor. @@ -2164,11 +2158,9 @@ extern "C" { * @param file * The file to write to. * The file must already be open. + * The file.size_write represents the amount to process at a given time. * @param buffer * The buffer to write to the file. - * @param amount - * The total amount of file.size_write to process. - * This amount is multiplied against file.size_write and must be greater than 0. * @param written * The total bytes written. * Set pointer to 0 to not use. @@ -2189,7 +2181,7 @@ extern "C" { * @see fwrite() */ #ifndef _di_f_file_stream_write_ - extern f_status_t f_file_stream_write(const f_file_t file, const f_string_static_t buffer, const f_array_length_t amount, f_array_length_t *written); + extern f_status_t f_file_stream_write(const f_file_t file, const f_string_static_t buffer, f_array_length_t *written); #endif // _di_f_file_stream_write_ /** @@ -2200,11 +2192,9 @@ extern "C" { * @param file * The file to write to. * The file must already be open. + * The file.size_write represents the amount to process at a given time. * @param buffer * The buffer to write to the file. - * @param amount - * The total amount of file.size_write to process. - * This amount is multiplied against file.size_write and must be greater than 0. * @param written * The total bytes written. * Set pointer to 0 to not use. @@ -2225,7 +2215,7 @@ extern "C" { * @see fwrite() */ #ifndef _di_f_file_stream_write_block_ - extern f_status_t f_file_stream_write_block(const f_file_t file, const f_string_static_t buffer, const f_array_length_t amount, f_array_length_t *written); + extern f_status_t f_file_stream_write_block(const f_file_t file, const f_string_static_t buffer, f_array_length_t *written); #endif // _di_f_file_stream_write_block_ /** @@ -2234,11 +2224,9 @@ extern "C" { * @param file * The file to write to. * The file must already be open. + * The file.size_write represents the amount to process at a given time. * @param buffer * The buffer to write to the file. - * @param amount - * The total amount of file.size_write to process. - * This amount is multiplied against file.size_write and must be greater than 0. * @param total * The total bytes to write, unless end of buffer is reached first. * @param written @@ -2262,7 +2250,7 @@ extern "C" { * @see fwrite() */ #ifndef _di_f_file_stream_write_until_ - extern f_status_t f_file_stream_write_until(const f_file_t file, const f_string_static_t buffer, const f_array_length_t amount, const f_array_length_t total, f_array_length_t *written); + extern f_status_t f_file_stream_write_until(const f_file_t file, const f_string_static_t buffer, const f_array_length_t total, f_array_length_t *written); #endif // _di_f_file_stream_write_until_ /** @@ -2271,11 +2259,9 @@ extern "C" { * @param file * The file to write to. * The file must already be open. + * The file.size_write represents the amount to process at a given time. * @param buffer * The buffer to write to the file. - * @param amount - * The total amount of file.size_write to process. - * This amount is multiplied against file.size_write and must be greater than 0. * @param range * An inclusive start an stop range within the buffer to read. * @param written @@ -2298,7 +2284,7 @@ extern "C" { * @see fwrite() */ #ifndef _di_f_file_stream_write_range_ - extern f_status_t f_file_stream_write_range(const f_file_t file, const f_string_static_t buffer, const f_array_length_t amount, const f_string_range_t range, f_array_length_t *written); + extern f_status_t f_file_stream_write_range(const f_file_t file, const f_string_static_t buffer, const f_string_range_t range, f_array_length_t *written); #endif // _di_f_file_stream_write_range_ diff --git a/level_0/f_file/c/private-file.c b/level_0/f_file/c/private-file.c index 44268f5..0179afb 100644 --- a/level_0/f_file/c/private-file.c +++ b/level_0/f_file/c/private-file.c @@ -8,7 +8,9 @@ extern "C" { #if !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) || !defined(_di_f_file_stream_close_) f_status_t private_f_file_close(const bool flush, int *id) { - if (id == 0 || *id == -1) return F_none; + if (id == 0 || *id == -1) { + return F_none; + } if (flush && F_status_is_error(private_f_file_flush(*id))) { return F_status_set_error(F_file_synchronize); @@ -69,7 +71,9 @@ extern "C" { private_f_file_close(F_true, &file_destination.id); private_f_file_close(F_true, &file_source.id); - if (size_read < 0) return F_status_set_error(F_file_read); + if (size_read < 0) { + return F_status_set_error(F_file_read); + } return F_none; } @@ -115,7 +119,9 @@ extern "C" { private_f_file_close(F_true, &file_destination.id); private_f_file_close(F_true, &file_source.id); - if (size_read < 0) return F_status_set_error(F_file_read); + if (size_read < 0) { + return F_status_set_error(F_file_read); + } return F_none; } @@ -592,26 +598,34 @@ extern "C" { if (uid != -1) { result = chown(path, uid, -1); - if (result < 0 && errno == EPERM) return F_status_set_error(F_access_owner); + if (result < 0 && errno == EPERM) { + return F_status_set_error(F_access_owner); + } } if (result == 0 && gid != -1) { result = chown(path, -1, gid); - if (result < 0 && errno == EPERM) return F_status_set_error(F_access_group); + if (result < 0 && errno == EPERM) { + return F_status_set_error(F_access_group); + } } } else { if (uid != -1) { result = lchown(path, uid, -1); - if (result < 0 && errno == EPERM) return F_status_set_error(F_access_owner); + if (result < 0 && errno == EPERM) { + return F_status_set_error(F_access_owner); + } } if (gid != -1) { result = lchown(path, -1, gid); - if (result < 0 && errno == EPERM) return F_status_set_error(F_access_group); + if (result < 0 && errno == EPERM) { + return F_status_set_error(F_access_group); + } } } @@ -641,13 +655,17 @@ extern "C" { if (uid != -1) { result = fchownat(at_id, path, uid, -1, flag); - if (result < 0 && errno == EPERM) return F_status_set_error(F_access_owner); + if (result < 0 && errno == EPERM) { + return F_status_set_error(F_access_owner); + } } if (gid != -1) { result = fchownat(at_id, path, -1, gid, flag); - if (result < 0 && errno == EPERM) return F_status_set_error(F_access_group); + if (result < 0 && errno == EPERM) { + return F_status_set_error(F_access_group); + } } if (result < 0) { @@ -762,12 +780,12 @@ extern "C" { #endif // !defined(_di_f_file_stream_descriptor_) || !defined(_di_f_file_stream_open_) || !defined(_di_f_file_stream_reopen_) #if !defined(f_file_stream_write) || !defined(_di_f_file_stream_write_block_) || !defined(f_file_stream_write_until) || !defined(f_file_stream_write_range) - f_status_t private_f_file_stream_write_until(const f_file_t file, const f_string_t string, const f_array_length_t amount, const f_array_length_t total, f_array_length_t *written) { + f_status_t private_f_file_stream_write_until(const f_file_t file, const f_string_t string, const f_array_length_t total, f_array_length_t *written) { *written = 0; f_status_t status = F_none; - f_array_length_t write_amount = amount; + f_array_length_t write_amount = 1; f_array_length_t write_size = file.size_write; f_array_length_t write_max = total; @@ -777,7 +795,7 @@ extern "C" { write_amount = 1; write_size = write_max; } - else if (amount * file.size_write > total) { + else if (file.size_write > total) { write_amount = total / file.size_write; if (total % file.size_write) { @@ -786,6 +804,7 @@ extern "C" { } while (*written < write_max) { + size_write = fwrite(string + *written, write_amount, write_size, file.stream); if (size_write < 0) { @@ -827,6 +846,7 @@ extern "C" { } while (*written < write_max && (size_write = write(file.id, string + *written, write_size)) > 0) { + *written += size_write; if (*written + write_size > write_max) { diff --git a/level_0/f_file/c/private-file.h b/level_0/f_file/c/private-file.h index 375f232..4747b02 100644 --- a/level_0/f_file/c/private-file.h +++ b/level_0/f_file/c/private-file.h @@ -915,9 +915,6 @@ extern "C" { * The file must already be open. * @param string * The string to write to the file. - * @param amount - * The total amount of file.size_write to process. - * This amount is multiplied against file.size_write and must be greater than 0. * @param total * The total bytes to write. * @param written @@ -943,7 +940,7 @@ extern "C" { * @see f_file_stream_write_until() */ #if !defined(f_file_stream_write) || !defined(_di_f_file_stream_write_block_) || !defined(f_file_stream_write_until) || !defined(f_file_stream_write_range) - extern f_status_t private_f_file_stream_write_until(const f_file_t file, const f_string_t string, const f_array_length_t amount, const f_array_length_t total, f_array_length_t *written) f_attribute_visibility_internal; + extern f_status_t private_f_file_stream_write_until(const f_file_t file, const f_string_t string, const f_array_length_t total, f_array_length_t *written) f_attribute_visibility_internal; #endif // !defined(f_file_stream_write) || !defined(_di_f_file_stream_write_block_) || !defined(f_file_stream_write_until) || !defined(f_file_stream_write_range) /** diff --git a/level_3/controller/c/private-controller.c b/level_3/controller/c/private-controller.c index 0eff3f0..52bb3dd 100644 --- a/level_3/controller/c/private-controller.c +++ b/level_3/controller/c/private-controller.c @@ -117,7 +117,7 @@ extern "C" { } } else { - status = f_file_stream_read(file, 1, &cache->buffer_file); + status = f_file_stream_read(file, &cache->buffer_file); if (F_status_is_error(status)) { if (global.main->error.verbosity != f_console_verbosity_quiet) { @@ -219,7 +219,7 @@ extern "C" { f_string_dynamic_t pid_buffer = f_string_dynamic_t_initialize; - status = f_file_stream_read(pid_file, 1, &pid_buffer); + status = f_file_stream_read(pid_file, &pid_buffer); if (F_status_is_error_not(status)) { status = f_file_stream_close(F_true, &pid_file); @@ -272,7 +272,7 @@ extern "C" { f_string_dynamic_t pid_buffer = f_string_dynamic_t_initialize; - status = f_file_stream_read(pid_file, 1, &pid_buffer); + status = f_file_stream_read(pid_file, &pid_buffer); if (F_status_is_error_not(status)) { status = f_file_stream_close(F_true, &pid_file); diff --git a/level_3/controller/c/private-rule.h b/level_3/controller/c/private-rule.h index ef84f26..f55a3d7 100644 --- a/level_3/controller/c/private-rule.h +++ b/level_3/controller/c/private-rule.h @@ -751,8 +751,6 @@ extern "C" { * * @see controller_rule_items_increase_by(). * @see controller_rule_item_read(). - * @see f_file_stream_open(). - * @see f_file_stream_read(). * @see f_fss_count_lines(). * @see fl_fss_apply_delimit(). * @see f_string_dynamic_partial_append(). diff --git a/level_3/fss_basic_read/c/fss_basic_read.c b/level_3/fss_basic_read/c/fss_basic_read.c index 4ecc4ad..c9209de 100644 --- a/level_3/fss_basic_read/c/fss_basic_read.c +++ b/level_3/fss_basic_read/c/fss_basic_read.c @@ -393,7 +393,7 @@ extern "C" { files.array[0].name = 0; files.array[0].range.start = 0; - status = f_file_stream_read(file, 1, &main->buffer); + status = f_file_stream_read(file, &main->buffer); if (F_status_is_error(status)) { fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, "-", "read", fll_error_file_type_pipe); @@ -430,7 +430,7 @@ extern "C" { break; } - status = f_file_stream_read(file, 1, &main->buffer); + status = f_file_stream_read(file, &main->buffer); f_file_stream_close(F_true, &file);