From: Uwe Hermann Date: Sun, 20 Feb 2011 12:19:27 +0000 (+0100) Subject: Add sr_ prefix to session_{add,remove}. X-Git-Tag: libsigrok-0.1.0~325 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6f1be0a2d40b3998abd8d10b5479e4538bc4ff1e;p=libsigrok.git Add sr_ prefix to session_{add,remove}. --- diff --git a/hardware/alsa/alsa.c b/hardware/alsa/alsa.c index 4dd542d5..e4618cdf 100644 --- a/hardware/alsa/alsa.c +++ b/hardware/alsa/alsa.c @@ -331,7 +331,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) } alsa->session_id = session_device_id; - source_add(ufds[0].fd, ufds[0].events, 10, receive_data, sdi); + sr_source_add(ufds[0].fd, ufds[0].events, 10, receive_data, sdi); packet.type = SR_DF_HEADER; packet.length = sizeof(struct sr_datafeed_header); diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index b19c06f3..ce67cc00 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -1309,7 +1309,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) sr_session_bus(session_device_id, &packet); /* Add capture source. */ - source_add(0, G_IO_IN, 10, receive_data, sdi); + sr_source_add(0, G_IO_IN, 10, receive_data, sdi); sigma->state.state = SIGMA_CAPTURE; diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 734b01da..6bacaf03 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -363,8 +363,8 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) g_io_channel_set_buffered(channels[0], FALSE); g_io_channel_set_buffered(channels[1], FALSE); - source_add(mydata->pipe_fds[0], G_IO_IN | G_IO_ERR, 40, receive_data, - session_device_id); + sr_source_add(mydata->pipe_fds[0], G_IO_IN | G_IO_ERR, 40, + receive_data, session_device_id); /* Run the demo thread. */ g_thread_init(NULL); diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index b3ad9304..bb72fd3f 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -721,7 +721,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) return ret; mso->session_id = session_device_id; - source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, sdi); + sr_source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, sdi); packet.type = SR_DF_HEADER; packet.length = sizeof(struct sr_datafeed_header); diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index ec5ce75c..3c17e7e1 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -506,8 +506,8 @@ static int receive_data(int fd, int revents, void *user_data) * longer than it takes to send a byte, that means it's * finished. We'll double that to 30ms to be sure... */ - source_remove(fd); - source_add(fd, G_IO_IN, 30, receive_data, user_data); + sr_source_remove(fd); + sr_source_add(fd, G_IO_IN, 30, receive_data, user_data); raw_sample_buf = malloc(limit_samples * 4); /* fill with 1010... for debugging */ memset(raw_sample_buf, 0x82, limit_samples * 4); @@ -755,8 +755,8 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) if (send_shortcommand(sdi->serial->fd, CMD_RUN) != SR_OK) return SR_ERR; - source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, - session_device_id); + sr_source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, + session_device_id); /* Send header packet to the session bus. */ packet = g_malloc(sizeof(struct sr_datafeed_packet)); diff --git a/hardware/saleae-logic/saleae-logic.c b/hardware/saleae-logic/saleae-logic.c index 4d3e718f..81ef3e8c 100644 --- a/hardware/saleae-logic/saleae-logic.c +++ b/hardware/saleae-logic/saleae-logic.c @@ -704,8 +704,8 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id) lupfd = libusb_get_pollfds(usb_context); for (i = 0; lupfd[i]; i++) - source_add(lupfd[i]->fd, lupfd[i]->events, 40, receive_data, - NULL); + sr_source_add(lupfd[i]->fd, lupfd[i]->events, 40, receive_data, + NULL); free(lupfd); packet->type = SR_DF_HEADER; diff --git a/hwplugin.c b/hwplugin.c index 78621c16..554dc5df 100644 --- a/hwplugin.c +++ b/hwplugin.c @@ -230,13 +230,13 @@ struct sr_hwcap_option *sr_find_hwcap_option(int hwcap) /* unnecessary level of indirection follows. */ -void source_remove(int fd) +void sr_source_remove(int fd) { sr_session_source_remove(fd); } -void source_add(int fd, int events, int timeout, receive_data_callback rcv_cb, - void *user_data) +void sr_source_add(int fd, int events, int timeout, + receive_data_callback rcv_cb, void *user_data) { sr_session_source_add(fd, events, timeout, rcv_cb, user_data); } diff --git a/sigrok-proto.h b/sigrok-proto.h index 7b337d48..83b84adc 100644 --- a/sigrok-proto.h +++ b/sigrok-proto.h @@ -85,9 +85,9 @@ void sr_serial_device_instance_free(struct sr_serial_device_instance *serial); int sr_find_hwcap(int *capabilities, int hwcap); struct sr_hwcap_option *sr_find_hwcap_option(int hwcap); -void source_remove(int fd); -void source_add(int fd, int events, int timeout, receive_data_callback rcv_cb, - void *user_data); +void sr_source_remove(int fd); +void sr_source_add(int fd, int events, int timeout, + receive_data_callback rcv_cb, void *user_data); /*--- session.c -------------------------------------------------------------*/