X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Finput%2Finput.c;h=b078f5a6bf4febac814d9b0375243ad3f2271869;hb=329733d92c5004f0fe308eff26b9537fded2cdf3;hp=5292481381404bc3540b289d4dbd5c5f08d607e8;hpb=7a54232ba06b0715e4c98a913d1b316c8c521c2c;p=libsigrok.git diff --git a/src/input/input.c b/src/input/input.c index 52924813..b078f5a6 100644 --- a/src/input/input.c +++ b/src/input/input.c @@ -26,7 +26,9 @@ #include "libsigrok.h" #include "libsigrok-internal.h" +/** @cond PRIVATE */ #define LOG_PREFIX "input" +/** @endcond */ /** * @file @@ -89,14 +91,14 @@ SR_API const struct sr_input_module **sr_input_list(void) * * @since 0.4.0 */ -SR_API const char *sr_input_id_get(const struct sr_input_module *o) +SR_API const char *sr_input_id_get(const struct sr_input_module *imod) { - if (!o) { + if (!imod) { sr_err("Invalid input module NULL!"); return NULL; } - return o->id; + return imod->id; } /** @@ -104,14 +106,14 @@ SR_API const char *sr_input_id_get(const struct sr_input_module *o) * * @since 0.4.0 */ -SR_API const char *sr_input_name_get(const struct sr_input_module *o) +SR_API const char *sr_input_name_get(const struct sr_input_module *imod) { - if (!o) { + if (!imod) { sr_err("Invalid input module NULL!"); return NULL; } - return o->name; + return imod->name; } /** @@ -119,14 +121,33 @@ SR_API const char *sr_input_name_get(const struct sr_input_module *o) * * @since 0.4.0 */ -SR_API const char *sr_input_description_get(const struct sr_input_module *o) +SR_API const char *sr_input_description_get(const struct sr_input_module *imod) { - if (!o) { + if (!imod) { sr_err("Invalid input module NULL!"); return NULL; } - return o->desc; + return imod->desc; +} + +/** + * Returns the specified input module's file extensions typical for the file + * format, as a NULL terminated array, or returns a NULL pointer if there is + * no preferred extension. + * @note these are a suggestions only. + * + * @since 0.4.0 + */ +SR_API const char *const *sr_input_extensions_get( + const struct sr_input_module *imod) +{ + if (!imod) { + sr_err("Invalid input module NULL!"); + return NULL; + } + + return imod->exts; } /** @@ -569,5 +590,4 @@ SR_API void sr_input_free(const struct sr_input *in) g_free((gpointer)in); } - /** @} */