Add a struct sr_context * parameter to sr_driver_init()

Since the public API is changed, this commit also bumps the libtool
version component SR_LIB_VERSION_CURRENT in configure.ac.
This commit is contained in:
Peter Stuge 2012-12-03 02:42:57 +01:00 committed by Bert Vermeulen
parent 73496bb571
commit 44fc870c9c
4 changed files with 7 additions and 4 deletions

View File

@ -64,7 +64,7 @@ PKG_PROG_PKG_CONFIG([0.22])
# Carefully read the libtool docs before updating these numbers! # Carefully read the libtool docs before updating these numbers!
# The algorithm for determining which number to change (and how) is nontrivial! # The algorithm for determining which number to change (and how) is nontrivial!
# http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info # http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
SR_LIB_VERSION_CURRENT=1 SR_LIB_VERSION_CURRENT=2
SR_LIB_VERSION_REVISION=0 SR_LIB_VERSION_REVISION=0
SR_LIB_VERSION_AGE=0 SR_LIB_VERSION_AGE=0
SR_LIB_VERSION="$SR_LIB_VERSION_CURRENT:$SR_LIB_VERSION_REVISION:$SR_LIB_VERSION_AGE" SR_LIB_VERSION="$SR_LIB_VERSION_CURRENT:$SR_LIB_VERSION_REVISION:$SR_LIB_VERSION_AGE"

View File

@ -212,11 +212,13 @@ SR_API struct sr_dev_driver **sr_driver_list(void)
/** /**
* Initialize a hardware driver. * Initialize a hardware driver.
* *
* @param ctx A libsigrok context object allocated by a previous call to
* sr_init().
* @param driver The driver to initialize. * @param driver The driver to initialize.
* *
* @return SR_OK if all went well, or an error code otherwise. * @return SR_OK if all went well, or an error code otherwise.
*/ */
SR_API int sr_driver_init(struct sr_dev_driver *driver) SR_API int sr_driver_init(struct sr_context *ctx, struct sr_dev_driver *driver)
{ {
if (driver->init) if (driver->init)

View File

@ -75,7 +75,8 @@ SR_API int sr_filter_probes(int in_unitsize, int out_unitsize,
/*--- hwdriver.c ------------------------------------------------------------*/ /*--- hwdriver.c ------------------------------------------------------------*/
SR_API struct sr_dev_driver **sr_driver_list(void); SR_API struct sr_dev_driver **sr_driver_list(void);
SR_API int sr_driver_init(struct sr_dev_driver *driver); SR_API int sr_driver_init(struct sr_context *ctx,
struct sr_dev_driver *driver);
SR_API GSList *sr_driver_scan(struct sr_dev_driver *driver, GSList *options); 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);

View File

@ -144,7 +144,7 @@ SR_API int sr_session_load(const char *filename)
sdi->driver = &session_driver; sdi->driver = &session_driver;
if (devcnt == 0) if (devcnt == 0)
/* first device, init the driver */ /* first device, init the driver */
sdi->driver->init(); sdi->driver->init(NULL);
sr_session_dev_add(sdi); sr_session_dev_add(sdi);
sdi->driver->dev_config_set(sdi, SR_HWCAP_SESSIONFILE, filename); sdi->driver->dev_config_set(sdi, SR_HWCAP_SESSIONFILE, filename);
sdi->driver->dev_config_set(sdi, SR_HWCAP_CAPTUREFILE, val); sdi->driver->dev_config_set(sdi, SR_HWCAP_CAPTUREFILE, val);