Add sr_ prefix to session_{add,remove}.

This commit is contained in:
Uwe Hermann 2011-02-20 13:19:27 +01:00
parent 77b454421a
commit 6f1be0a2d4
8 changed files with 17 additions and 17 deletions

View File

@ -331,7 +331,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
} }
alsa->session_id = 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.type = SR_DF_HEADER;
packet.length = sizeof(struct sr_datafeed_header); packet.length = sizeof(struct sr_datafeed_header);

View File

@ -1309,7 +1309,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
sr_session_bus(session_device_id, &packet); sr_session_bus(session_device_id, &packet);
/* Add capture source. */ /* 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; sigma->state.state = SIGMA_CAPTURE;

View File

@ -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[0], FALSE);
g_io_channel_set_buffered(channels[1], FALSE); g_io_channel_set_buffered(channels[1], FALSE);
source_add(mydata->pipe_fds[0], G_IO_IN | G_IO_ERR, 40, receive_data, sr_source_add(mydata->pipe_fds[0], G_IO_IN | G_IO_ERR, 40,
session_device_id); receive_data, session_device_id);
/* Run the demo thread. */ /* Run the demo thread. */
g_thread_init(NULL); g_thread_init(NULL);

View File

@ -721,7 +721,7 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
return ret; return ret;
mso->session_id = session_device_id; 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.type = SR_DF_HEADER;
packet.length = sizeof(struct sr_datafeed_header); packet.length = sizeof(struct sr_datafeed_header);

View File

@ -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 * longer than it takes to send a byte, that means it's
* finished. We'll double that to 30ms to be sure... * finished. We'll double that to 30ms to be sure...
*/ */
source_remove(fd); sr_source_remove(fd);
source_add(fd, G_IO_IN, 30, receive_data, user_data); sr_source_add(fd, G_IO_IN, 30, receive_data, user_data);
raw_sample_buf = malloc(limit_samples * 4); raw_sample_buf = malloc(limit_samples * 4);
/* fill with 1010... for debugging */ /* fill with 1010... for debugging */
memset(raw_sample_buf, 0x82, limit_samples * 4); 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) if (send_shortcommand(sdi->serial->fd, CMD_RUN) != SR_OK)
return SR_ERR; return SR_ERR;
source_add(sdi->serial->fd, G_IO_IN, -1, receive_data, sr_source_add(sdi->serial->fd, G_IO_IN, -1, receive_data,
session_device_id); session_device_id);
/* Send header packet to the session bus. */ /* Send header packet to the session bus. */
packet = g_malloc(sizeof(struct sr_datafeed_packet)); packet = g_malloc(sizeof(struct sr_datafeed_packet));

View File

@ -704,8 +704,8 @@ static int hw_start_acquisition(int device_index, gpointer session_device_id)
lupfd = libusb_get_pollfds(usb_context); lupfd = libusb_get_pollfds(usb_context);
for (i = 0; lupfd[i]; i++) for (i = 0; lupfd[i]; i++)
source_add(lupfd[i]->fd, lupfd[i]->events, 40, receive_data, sr_source_add(lupfd[i]->fd, lupfd[i]->events, 40, receive_data,
NULL); NULL);
free(lupfd); free(lupfd);
packet->type = SR_DF_HEADER; packet->type = SR_DF_HEADER;

View File

@ -230,13 +230,13 @@ struct sr_hwcap_option *sr_find_hwcap_option(int hwcap)
/* unnecessary level of indirection follows. */ /* unnecessary level of indirection follows. */
void source_remove(int fd) void sr_source_remove(int fd)
{ {
sr_session_source_remove(fd); sr_session_source_remove(fd);
} }
void source_add(int fd, int events, int timeout, receive_data_callback rcv_cb, void sr_source_add(int fd, int events, int timeout,
void *user_data) receive_data_callback rcv_cb, void *user_data)
{ {
sr_session_source_add(fd, events, timeout, rcv_cb, user_data); sr_session_source_add(fd, events, timeout, rcv_cb, user_data);
} }

View File

@ -85,9 +85,9 @@ void sr_serial_device_instance_free(struct sr_serial_device_instance *serial);
int sr_find_hwcap(int *capabilities, int hwcap); int sr_find_hwcap(int *capabilities, int hwcap);
struct sr_hwcap_option *sr_find_hwcap_option(int hwcap); struct sr_hwcap_option *sr_find_hwcap_option(int hwcap);
void source_remove(int fd); void sr_source_remove(int fd);
void source_add(int fd, int events, int timeout, receive_data_callback rcv_cb, void sr_source_add(int fd, int events, int timeout,
void *user_data); receive_data_callback rcv_cb, void *user_data);
/*--- session.c -------------------------------------------------------------*/ /*--- session.c -------------------------------------------------------------*/