]> sigrok.org Git - libsigrok.git/commitdiff
Add a struct sr_context * parameter to sr_driver_init()
authorPeter Stuge <redacted>
Mon, 3 Dec 2012 01:42:57 +0000 (02:42 +0100)
committerBert Vermeulen <redacted>
Mon, 3 Dec 2012 11:07:40 +0000 (12:07 +0100)
Since the public API is changed, this commit also bumps the libtool
version component SR_LIB_VERSION_CURRENT in configure.ac.

configure.ac
hwdriver.c
proto.h
session_file.c

index 6501310845c835fc850d18b36488e646972a5ee9..e8d440df96eba099e975a9bf768ee5112cc49858 100644 (file)
@@ -64,7 +64,7 @@ PKG_PROG_PKG_CONFIG([0.22])
 # 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"
index e685459feef37d8dbfefcf4f4a49b1aad3481ac5..d2f62e3a88d0768d26d4af1901b69e239926bc38 100644 (file)
@@ -212,11 +212,13 @@ SR_API struct sr_dev_driver **sr_driver_list(void)
 /**
  * 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)
diff --git a/proto.h b/proto.h
index 4c9286c103389d3628ce566a439c8eaaa96e7956..c93a796e94b50359a51f55737cbf30c85b9cba71 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -75,7 +75,8 @@ SR_API int sr_filter_probes(int in_unitsize, int out_unitsize,
 /*--- 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);
index 12c0bf863832d4d5afbeb56dec2f0d55aeb07459..204dee963182df92c756b1876711d326530bb031 100644 (file)
@@ -144,7 +144,7 @@ SR_API int sr_session_load(const char *filename)
                                        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);