Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change signature of the _next method of iterators #56

Merged
merged 7 commits into from
Aug 21, 2023

Conversation

Gottox
Copy link
Owner

@Gottox Gottox commented Aug 21, 2023

No description provided.

Currently the iterator's next function returns an int which
returns >0 on success, 0 on end of iterator and <0 on error.
This commit changes the generic iterator implementation to return
a bool instead of an int. The bool is true if the iterator has
more data and false if the iterator is at the end. The error
code is now passed as a pointer parameter to the next function.
This commit changes the return type of sqsh_file_iterator_next() from
int to bool. The return value is now used to indicate whether there is
more data to read from the file iterator. The error code is now stored
in a pointer to an int instead of being returned directly.
This commit changes the return type of
sqsh__directory_index_iterator_next() from int to bool. The return
value is now used to indicate whether there is more data to read from
the directory index iterator. The error code is now stored in a pointer
to an int instead of being returned directly.
This commit changes the return type of sqsh__map_iterator_next() from
int to bool. The return value is now used to indicate whether there is
more data to read from the map iterator. The error code is now stored
in a pointer to an int instead of being returned directly.
This commit changes the return type of sqsh__metablock_iterator_next()
from int to bool. The return value is now used to indicate whether
there is more data to read from the metablock iterator. The error code
is now stored in a pointer to an int instead of being returned directly.
This commit changes the return type of sqsh_directory_iterator_next()
from int to bool. The return value is now used to indicate whether
there is more data to read from the directory iterator. The error code
is now stored in a pointer to an int instead of being returned directly.
This commit changes the return type of sqsh_xattr_iterator_next() from
int to bool. The return value is now used to indicate whether there is
more data to read from the xattr iterator. The error code is now stored
in a pointer to an int instead of being returned directly.
@Gottox Gottox merged commit c5eef74 into main Aug 21, 2023
9 checks passed
@Gottox Gottox deleted the refactor/next-signatur-change branch August 21, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant