From: Uwe Hermann Date: Fri, 31 May 2013 13:46:57 +0000 (+0200) Subject: std: Drop hw_ from function names. X-Git-Tag: libsigrok-0.2.1~76 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f6beaac55ca58c406d6621038abe57c16a47e87f;p=libsigrok.git std: Drop hw_ from function names. The per-driver API calls no longer have a hw_ prefix (e.g. hw_init() became init() and so on), so drop the 'hw_' from the std versions for those API callbacks too. --- diff --git a/hardware/agilent-dmm/api.c b/hardware/agilent-dmm/api.c index a7f3beb5..41e3075d 100644 --- a/hardware/agilent-dmm/api.c +++ b/hardware/agilent-dmm/api.c @@ -68,7 +68,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) @@ -283,7 +283,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { - return std_hw_dev_acquisition_stop_serial(sdi, cb_data, dev_close, + return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close, sdi->conn, LOG_PREFIX); } diff --git a/hardware/alsa/api.c b/hardware/alsa/api.c index aeac8713..2d4da263 100644 --- a/hardware/alsa/api.c +++ b/hardware/alsa/api.c @@ -53,7 +53,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 2ddbbea9..a0975776 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -396,7 +396,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/brymen-dmm/api.c b/hardware/brymen-dmm/api.c index ac0ad86b..fc371a79 100644 --- a/hardware/brymen-dmm/api.c +++ b/hardware/brymen-dmm/api.c @@ -36,7 +36,7 @@ static struct sr_dev_driver *di = &brymen_bm857_driver_info; static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static int clear_instances(void) @@ -264,8 +264,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { - return std_hw_dev_acquisition_stop_serial(sdi, cb_data, dev_close, - sdi->conn, LOG_PREFIX); + return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close, + sdi->conn, LOG_PREFIX); } SR_PRIV struct sr_dev_driver brymen_bm857_driver_info = { diff --git a/hardware/chronovu-la8/api.c b/hardware/chronovu-la8/api.c index 13ed8062..cbf91df3 100644 --- a/hardware/chronovu-la8/api.c +++ b/hardware/chronovu-la8/api.c @@ -73,7 +73,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/colead-slm/api.c b/hardware/colead-slm/api.c index a1687276..44064029 100644 --- a/hardware/colead-slm/api.c +++ b/hardware/colead-slm/api.c @@ -52,7 +52,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) @@ -231,8 +231,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { - return std_hw_dev_acquisition_stop_serial(sdi, cb_data, dev_close, - sdi->conn, LOG_PREFIX); + return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close, + sdi->conn, LOG_PREFIX); } SR_PRIV struct sr_dev_driver colead_slm_driver_info = { diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index fa07cad3..93d47c29 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -152,7 +152,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/fluke-dmm/api.c b/hardware/fluke-dmm/api.c index c64aa5ca..20021d77 100644 --- a/hardware/fluke-dmm/api.c +++ b/hardware/fluke-dmm/api.c @@ -65,7 +65,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *fluke_scan(const char *conn, const char *serialcomm) @@ -323,8 +323,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data) static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { - return std_hw_dev_acquisition_stop_serial(sdi, cb_data, dev_close, - sdi->conn, LOG_PREFIX); + return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close, + sdi->conn, LOG_PREFIX); } SR_PRIV struct sr_dev_driver flukedmm_driver_info = { diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 278563a4..5932e553 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -353,7 +353,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/hantek-dso/api.c b/hardware/hantek-dso/api.c index dee781eb..6ac9ba61 100644 --- a/hardware/hantek-dso/api.c +++ b/hardware/hantek-dso/api.c @@ -251,7 +251,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/lascar-el-usb/api.c b/hardware/lascar-el-usb/api.c index 761862d2..d2eaecde 100644 --- a/hardware/lascar-el-usb/api.c +++ b/hardware/lascar-el-usb/api.c @@ -45,7 +45,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/link-mso19/api.c b/hardware/link-mso19/api.c index b11818ef..a77a37e2 100644 --- a/hardware/link-mso19/api.c +++ b/hardware/link-mso19/api.c @@ -53,7 +53,7 @@ static struct sr_dev_driver *di = &link_mso19_driver_info; static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/mic-985xx/api.c b/hardware/mic-985xx/api.c index 98ec7f79..858f2a3e 100644 --- a/hardware/mic-985xx/api.c +++ b/hardware/mic-985xx/api.c @@ -58,7 +58,7 @@ static int init(struct sr_context *sr_ctx, int idx) { sr_dbg("Selected '%s' subdriver.", mic_devs[idx].di->name); - return std_hw_init(sr_ctx, mic_devs[idx].di, LOG_PREFIX); + return std_init(sr_ctx, mic_devs[idx].di, LOG_PREFIX); } static GSList *mic_scan(const char *conn, const char *serialcomm, int idx) @@ -262,8 +262,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { - return std_hw_dev_acquisition_stop_serial(sdi, cb_data, dev_close, - sdi->conn, LOG_PREFIX); + return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close, + sdi->conn, LOG_PREFIX); } /* Driver-specific API function wrappers */ diff --git a/hardware/nexus-osciprime/api.c b/hardware/nexus-osciprime/api.c index 3aafb066..b6d1a60b 100644 --- a/hardware/nexus-osciprime/api.c +++ b/hardware/nexus-osciprime/api.c @@ -112,7 +112,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 31f38656..04a06b2e 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -55,7 +55,7 @@ static struct sr_dev_driver *di = &ols_driver_info; static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/rigol-ds1xx2/api.c b/hardware/rigol-ds1xx2/api.c index 81ea6695..04d3f0ae 100644 --- a/hardware/rigol-ds1xx2/api.c +++ b/hardware/rigol-ds1xx2/api.c @@ -178,7 +178,7 @@ static int set_cfg(const struct sr_dev_inst *sdi, const char *format, ...) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static int probe_port(const char *port, GSList **devices) diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index 330ada96..b0c097cd 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -201,7 +201,7 @@ static int init(struct sr_context *sr_ctx, int dmm) { sr_dbg("Selected '%s' subdriver.", dmms[dmm].di->name); - return std_hw_init(sr_ctx, dmms[dmm].di, LOG_PREFIX); + return std_init(sr_ctx, dmms[dmm].di, LOG_PREFIX); } static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm) @@ -445,8 +445,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { - return std_hw_dev_acquisition_stop_serial(sdi, cb_data, dev_close, - sdi->conn, LOG_PREFIX); + return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close, + sdi->conn, LOG_PREFIX); } /* Driver-specific API function wrappers */ diff --git a/hardware/tondaj-sl-814/api.c b/hardware/tondaj-sl-814/api.c index 583b9422..36a884a5 100644 --- a/hardware/tondaj-sl-814/api.c +++ b/hardware/tondaj-sl-814/api.c @@ -47,7 +47,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) @@ -227,8 +227,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data) { - return std_hw_dev_acquisition_stop_serial(sdi, cb_data, dev_close, - sdi->conn, LOG_PREFIX); + return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close, + sdi->conn, LOG_PREFIX); } SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info = { diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index b5866531..4570e526 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -98,7 +98,7 @@ static int init(struct sr_context *sr_ctx, int dmm) { sr_dbg("Selected '%s' subdriver.", udmms[dmm].di->name); - return std_hw_init(sr_ctx, udmms[dmm].di, LOG_PREFIX); + return std_init(sr_ctx, udmms[dmm].di, LOG_PREFIX); } static GSList *scan(GSList *options, int dmm) diff --git a/hardware/victor-dmm/api.c b/hardware/victor-dmm/api.c index ea293168..41edc1d8 100644 --- a/hardware/victor-dmm/api.c +++ b/hardware/victor-dmm/api.c @@ -53,7 +53,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, LOG_PREFIX); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/hardware/zeroplus-logic-cube/api.c b/hardware/zeroplus-logic-cube/api.c index ab062ea2..2117afbc 100644 --- a/hardware/zeroplus-logic-cube/api.c +++ b/hardware/zeroplus-logic-cube/api.c @@ -245,7 +245,7 @@ static int clear_instances(void) static int init(struct sr_context *sr_ctx) { - return std_hw_init(sr_ctx, di, "zeroplus: "); + return std_init(sr_ctx, di, LOG_PREFIX); } static GSList *scan(GSList *options) diff --git a/libsigrok-internal.h b/libsigrok-internal.h index e21aa43d..5fc0fbfa 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -125,9 +125,9 @@ SR_PRIV int sr_session_stop_sync(void); typedef int (*dev_close_t)(struct sr_dev_inst *sdi); typedef void (*std_dev_clear_t)(void *priv); -SR_PRIV int std_hw_init(struct sr_context *sr_ctx, struct sr_dev_driver *di, +SR_PRIV int std_init(struct sr_context *sr_ctx, struct sr_dev_driver *di, const char *prefix); -SR_PRIV int std_hw_dev_acquisition_stop_serial(struct sr_dev_inst *sdi, +SR_PRIV int std_dev_acquisition_stop_serial(struct sr_dev_inst *sdi, void *cb_data, dev_close_t dev_close_fn, struct sr_serial_dev_inst *serial, const char *prefix); SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi, diff --git a/std.c b/std.c index 059bf759..46ab5ad9 100644 --- a/std.c +++ b/std.c @@ -37,8 +37,8 @@ * @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or * SR_ERR_MALLOC upon memory allocation errors. */ -SR_PRIV int std_hw_init(struct sr_context *sr_ctx, struct sr_dev_driver *di, - const char *prefix) +SR_PRIV int std_init(struct sr_context *sr_ctx, struct sr_dev_driver *di, + const char *prefix) { struct drv_context *drvc; @@ -120,7 +120,7 @@ SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi, * @return SR_OK upon success, SR_ERR_ARG upon invalid arguments, or * SR_ERR upon other errors. */ -SR_PRIV int std_hw_dev_acquisition_stop_serial(struct sr_dev_inst *sdi, +SR_PRIV int std_dev_acquisition_stop_serial(struct sr_dev_inst *sdi, void *cb_data, dev_close_t dev_close_fn, struct sr_serial_dev_inst *serial, const char *prefix) {