# Carefully read the libtool docs before updating these numbers!
# The algorithm for determining which number to change (and how) is nontrivial!
# 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_AGE=0
SR_LIB_VERSION="$SR_LIB_VERSION_CURRENT:$SR_LIB_VERSION_REVISION:$SR_LIB_VERSION_AGE"
/**
* Initialize a hardware driver.
*
+ * @param ctx A libsigrok context object allocated by a previous call to
+ * sr_init().
* @param driver The driver to initialize.
*
* @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)
/*--- hwdriver.c ------------------------------------------------------------*/
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 int sr_info_get(struct sr_dev_driver *driver, int id,
const void **data, const struct sr_dev_inst *sdi);
sdi->driver = &session_driver;
if (devcnt == 0)
/* first device, init the driver */
- sdi->driver->init();
+ sdi->driver->init(NULL);
sr_session_dev_add(sdi);
sdi->driver->dev_config_set(sdi, SR_HWCAP_SESSIONFILE, filename);
sdi->driver->dev_config_set(sdi, SR_HWCAP_CAPTUREFILE, val);