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

Backends API rework #1059

Merged
merged 6 commits into from
Oct 10, 2023
Merged

Backends API rework #1059

merged 6 commits into from
Oct 10, 2023

Conversation

pcercuei
Copy link
Contributor

Update the backends API functions to better separate between built-in backends, and the ones loaded from external modules.

This array contains data known at compile-time and is never updated
later; so it can be const.

Signed-off-by: Paul Cercueil <[email protected]>
We only need to print it once; and it makes more sense to print it at
the "debug" log level.

Signed-off-by: Paul Cercueil <[email protected]>
They previously would only work with the backends provided by Libiio,
either built-in or modules, enabled at compilation time.

This meant that third-party modules were not listed in there, while
official modules were.

Change these functions so that they only work for built-in backends, and
rename them to iio_get_builtin_backends_count() and
iio_get_builtin_backend().

Signed-off-by: Paul Cercueil <[email protected]>
If the backend name cannot be found in the list of built-in backends,
check if a module exists for it.

Since the loading of a dynamic backend might print errors (e.g. if the
file is unrecognized), the iio_has_backend() function now accepts an
extra "params" argument.

Signed-off-by: Paul Cercueil <[email protected]>
Update to the new prototype of iio_has_backend(), and use the new
functions iio_get_builtin_backends_count() and
iio_get_builtin_backend().

Signed-off-by: Paul Cercueil <[email protected]>
Use the new functions iio_get_builtin_backends_count() and
iio_get_builtin_backend().

Signed-off-by: Paul Cercueil <[email protected]>
@pcercuei pcercuei merged commit 4aa6e20 into main Oct 10, 2023
25 checks passed
@pcercuei pcercuei deleted the pcercuei/backends-rework branch October 10, 2023 14:18
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.

2 participants