Adjust option helpers to new sr_config struct
This commit is contained in:
parent
2df1e81970
commit
72e435ab94
24
hwdriver.c
24
hwdriver.c
|
@ -350,12 +350,12 @@ SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap)
|
||||||
* @return A pointer to a struct sr_hwcap_option, or NULL if the option
|
* @return A pointer to a struct sr_hwcap_option, or NULL if the option
|
||||||
* was not found.
|
* was not found.
|
||||||
*/
|
*/
|
||||||
SR_API const struct sr_hwcap_option *sr_drvopt_get(int opt)
|
SR_API const struct sr_config_info *sr_drvopt_get(int opt)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; sr_drvopts[i].hwcap; i++) {
|
for (i = 0; sr_drvopts[i].key; i++) {
|
||||||
if (sr_drvopts[i].hwcap == opt)
|
if (sr_drvopts[i].key == opt)
|
||||||
return &sr_drvopts[i];
|
return &sr_drvopts[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,12 +370,12 @@ SR_API const struct sr_hwcap_option *sr_drvopt_get(int opt)
|
||||||
* @return A pointer to a struct sr_hwcap_option, or NULL if the option
|
* @return A pointer to a struct sr_hwcap_option, or NULL if the option
|
||||||
* was not found.
|
* was not found.
|
||||||
*/
|
*/
|
||||||
SR_API const struct sr_hwcap_option *sr_drvopt_name_get(const char *optname)
|
SR_API const struct sr_config_info *sr_drvopt_name_get(const char *optname)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; sr_drvopts[i].hwcap; i++) {
|
for (i = 0; sr_drvopts[i].key; i++) {
|
||||||
if (!strcmp(sr_drvopts[i].shortname, optname))
|
if (!strcmp(sr_drvopts[i].id, optname))
|
||||||
return &sr_drvopts[i];
|
return &sr_drvopts[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,12 +390,12 @@ SR_API const struct sr_hwcap_option *sr_drvopt_name_get(const char *optname)
|
||||||
* @return A pointer to a struct sr_hwcap_option, or NULL if the option
|
* @return A pointer to a struct sr_hwcap_option, or NULL if the option
|
||||||
* was not found.
|
* was not found.
|
||||||
*/
|
*/
|
||||||
SR_API const struct sr_hwcap_option *sr_devopt_get(int opt)
|
SR_API const struct sr_config_info *sr_devopt_get(int opt)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; sr_devopts[i].hwcap; i++) {
|
for (i = 0; sr_devopts[i].key; i++) {
|
||||||
if (sr_devopts[i].hwcap == opt)
|
if (sr_devopts[i].key == opt)
|
||||||
return &sr_devopts[i];
|
return &sr_devopts[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,12 +410,12 @@ SR_API const struct sr_hwcap_option *sr_devopt_get(int opt)
|
||||||
* @return A pointer to a struct sr_hwcap_option, or NULL if the option
|
* @return A pointer to a struct sr_hwcap_option, or NULL if the option
|
||||||
* was not found.
|
* was not found.
|
||||||
*/
|
*/
|
||||||
SR_API const struct sr_hwcap_option *sr_devopt_name_get(const char *optname)
|
SR_API const struct sr_config_info *sr_devopt_name_get(const char *optname)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; sr_devopts[i].hwcap; i++) {
|
for (i = 0; sr_devopts[i].key; i++) {
|
||||||
if (!strcmp(sr_devopts[i].shortname, optname))
|
if (!strcmp(sr_devopts[i].id, optname))
|
||||||
return &sr_devopts[i];
|
return &sr_devopts[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
8
proto.h
8
proto.h
|
@ -73,10 +73,10 @@ SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options);
|
||||||
SR_API int sr_info_get(struct sr_dev_driver *driver, int id,
|
SR_API int sr_info_get(struct sr_dev_driver *driver, int id,
|
||||||
const void **data, const struct sr_dev_inst *sdi);
|
const void **data, const struct sr_dev_inst *sdi);
|
||||||
SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap);
|
SR_API gboolean sr_driver_hwcap_exists(struct sr_dev_driver *driver, int hwcap);
|
||||||
SR_API const struct sr_hwcap_option *sr_drvopt_get(int opt);
|
SR_API const struct sr_config_info *sr_drvopt_get(int opt);
|
||||||
SR_API const struct sr_hwcap_option *sr_drvopt_name_get(const char *optname);
|
SR_API const struct sr_config_info *sr_drvopt_name_get(const char *optname);
|
||||||
SR_API const struct sr_hwcap_option *sr_devopt_get(int opt);
|
SR_API const struct sr_config_info *sr_devopt_get(int opt);
|
||||||
SR_API const struct sr_hwcap_option *sr_devopt_name_get(const char *optname);
|
SR_API const struct sr_config_info *sr_devopt_name_get(const char *optname);
|
||||||
|
|
||||||
/*--- session.c -------------------------------------------------------------*/
|
/*--- session.c -------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue