Prefix device structs with sr_.

This commit is contained in:
Uwe Hermann 2011-01-30 16:19:42 +01:00
parent 9f8274a544
commit 5c2d46d1db
13 changed files with 55 additions and 55 deletions

View File

@ -28,7 +28,7 @@ GSList *devices = NULL;
void device_scan(void)
{
GSList *plugins, *l;
struct device_plugin *plugin;
struct sr_device_plugin *plugin;
plugins = list_hwplugins();
@ -44,7 +44,7 @@ void device_scan(void)
}
int device_plugin_init(struct device_plugin *plugin)
int device_plugin_init(struct sr_device_plugin *plugin)
{
int num_devices, num_probes, i;
@ -60,7 +60,7 @@ int device_plugin_init(struct device_plugin *plugin)
void device_close_all(void)
{
struct device *device;
struct sr_device *device;
while (devices) {
device = devices->data;
@ -79,14 +79,14 @@ GSList *device_list(void)
return devices;
}
struct device *device_new(struct device_plugin *plugin, int plugin_index,
int num_probes)
struct sr_device *device_new(struct sr_device_plugin *plugin, int plugin_index,
int num_probes)
{
struct device *device;
struct sr_device *device;
int i;
char probename[16];
device = g_malloc0(sizeof(struct device));
device = g_malloc0(sizeof(struct sr_device));
device->plugin = plugin;
device->plugin_index = plugin_index;
devices = g_slist_append(devices, device);
@ -99,7 +99,7 @@ struct device *device_new(struct device_plugin *plugin, int plugin_index,
return device;
}
void device_clear(struct device *device)
void device_clear(struct sr_device *device)
{
unsigned int pnum;
@ -112,7 +112,7 @@ void device_clear(struct device *device)
device_probe_clear(device, pnum);
}
void device_destroy(struct device *device)
void device_destroy(struct sr_device *device)
{
unsigned int pnum;
@ -130,7 +130,7 @@ void device_destroy(struct device *device)
g_free(device);
}
void device_probe_clear(struct device *device, int probenum)
void device_probe_clear(struct sr_device *device, int probenum)
{
struct probe *p;
@ -149,7 +149,7 @@ void device_probe_clear(struct device *device, int probenum)
}
}
void device_probe_add(struct device *device, char *name)
void device_probe_add(struct sr_device *device, char *name)
{
struct probe *p;
@ -161,7 +161,7 @@ void device_probe_add(struct device *device, char *name)
device->probes = g_slist_append(device->probes, p);
}
struct probe *probe_find(struct device *device, int probenum)
struct probe *probe_find(struct sr_device *device, int probenum)
{
GSList *l;
struct probe *p, *found_probe;
@ -178,7 +178,7 @@ struct probe *probe_find(struct device *device, int probenum)
return found_probe;
}
void device_probe_name(struct device *device, int probenum, char *name)
void device_probe_name(struct sr_device *device, int probenum, char *name)
{
struct probe *p;
@ -191,7 +191,7 @@ void device_probe_name(struct device *device, int probenum, char *name)
p->name = g_strdup(name);
}
void device_trigger_clear(struct device *device)
void device_trigger_clear(struct sr_device *device)
{
struct probe *p;
unsigned int pnum;
@ -208,7 +208,7 @@ void device_trigger_clear(struct device *device)
}
}
void device_trigger_set(struct device *device, int probenum, char *trigger)
void device_trigger_set(struct sr_device *device, int probenum, char *trigger)
{
struct probe *p;

View File

@ -355,7 +355,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
session_device_id = session_device_id;
}
struct device_plugin alsa_plugin_info = {
struct sr_device_plugin alsa_plugin_info = {
"alsa",
"ALSA driver",
1,

View File

@ -1349,7 +1349,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
sigma->state.state = SIGMA_DOWNLOAD;
}
struct device_plugin asix_sigma_plugin_info = {
struct sr_device_plugin asix_sigma_plugin_info = {
"asix-sigma",
"ASIX SIGMA",
1,

View File

@ -59,7 +59,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
{
}
struct device_plugin skeleton_plugin_info = {
struct sr_device_plugin skeleton_plugin_info = {
"skeleton",
"Skeleton driver",
1,

View File

@ -390,7 +390,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
thread_running = 0;
}
struct device_plugin demo_plugin_info = {
struct sr_device_plugin demo_plugin_info = {
"demo",
"Demo driver and pattern generator",
1,

View File

@ -750,7 +750,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
session_bus(session_device_id, &packet);
}
struct device_plugin link_mso19_plugin_info = {
struct sr_device_plugin link_mso19_plugin_info = {
.name = "link-mso19",
.longname = "Link Instruments MSO-19",
.api_version = 1,

View File

@ -789,7 +789,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
session_bus(session_device_id, &packet);
}
struct device_plugin ols_plugin_info = {
struct sr_device_plugin ols_plugin_info = {
"ols",
"Openbench Logic Sniffer",
1,

View File

@ -740,7 +740,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
/* TODO: Need to cancel and free any queued up transfers. */
}
struct device_plugin saleae_logic_plugin_info = {
struct sr_device_plugin saleae_logic_plugin_info = {
"saleae-logic",
"Saleae Logic",
1,

View File

@ -560,7 +560,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
/* TODO: Need to cancel and free any queued up transfers. */
}
struct device_plugin zeroplus_logic_cube_plugin_info = {
struct sr_device_plugin zeroplus_logic_cube_plugin_info = {
"zeroplus-logic-cube",
"Zeroplus Logic Cube LAP-C series",
1,

View File

@ -41,25 +41,25 @@ struct hwcap_option hwcap_options[] = {
};
#ifdef HAVE_LA_DEMO
extern struct device_plugin demo_plugin_info;
extern struct sr_device_plugin demo_plugin_info;
#endif
#ifdef HAVE_LA_SALEAE_LOGIC
extern struct device_plugin saleae_logic_plugin_info;
extern struct sr_device_plugin saleae_logic_plugin_info;
#endif
#ifdef HAVE_LA_OLS
extern struct device_plugin ols_plugin_info;
extern struct sr_device_plugin ols_plugin_info;
#endif
#ifdef HAVE_LA_ZEROPLUS_LOGIC_CUBE
extern struct device_plugin zeroplus_logic_cube_plugin_info;
extern struct sr_device_plugin zeroplus_logic_cube_plugin_info;
#endif
#ifdef HAVE_LA_ASIX_SIGMA
extern struct device_plugin asix_sigma_plugin_info;
extern struct sr_device_plugin asix_sigma_plugin_info;
#endif
#ifdef HAVE_LA_LINK_MSO19
extern struct device_plugin link_mso19_plugin_info;
extern struct sr_device_plugin link_mso19_plugin_info;
#endif
#ifdef HAVE_LA_ALSA
extern struct device_plugin alsa_plugin_info;
extern struct sr_device_plugin alsa_plugin_info;
#endif

View File

@ -83,7 +83,7 @@ void session_device_clear(void)
session->devices = NULL;
}
int session_device_add(struct device *device)
int session_device_add(struct sr_device *device)
{
int ret;
@ -127,7 +127,7 @@ void session_datafeed_callback_add(datafeed_callback callback)
int session_start(void)
{
struct device *device;
struct sr_device *device;
GSList *l;
int ret;
@ -196,7 +196,7 @@ void session_halt(void)
void session_stop(void)
{
struct device *device;
struct sr_device *device;
GSList *l;
g_message("stopping session");
@ -209,7 +209,7 @@ void session_stop(void)
}
void session_bus(struct device *device, struct sr_datafeed_packet *packet)
void session_bus(struct sr_device *device, struct sr_datafeed_packet *packet)
{
GSList *l;
datafeed_callback cb;
@ -228,7 +228,7 @@ int session_save(char *filename)
{
GSList *l, *p, *d;
FILE *meta;
struct device *device;
struct sr_device *device;
struct probe *probe;
struct datastore *ds;
struct zip *zipfile;

View File

@ -35,21 +35,21 @@ void datastore_put(struct datastore *ds, void *data, unsigned int length,
/*--- device.c --------------------------------------------------------------*/
void device_scan(void);
int device_plugin_init(struct device_plugin *plugin);
int device_plugin_init(struct sr_device_plugin *plugin);
void device_close_all(void);
GSList *device_list(void);
struct device *device_new(struct device_plugin *plugin, int plugin_index,
int num_probes);
void device_clear(struct device *device);
void device_destroy(struct device *dev);
struct sr_device *device_new(struct sr_device_plugin *plugin, int plugin_index,
int num_probes);
void device_clear(struct sr_device *device);
void device_destroy(struct sr_device *dev);
void device_probe_clear(struct device *device, int probenum);
void device_probe_add(struct device *device, char *name);
struct probe *probe_find(struct device *device, int probenum);
void device_probe_name(struct device *device, int probenum, char *name);
void device_probe_clear(struct sr_device *device, int probenum);
void device_probe_add(struct sr_device *device, char *name);
struct probe *probe_find(struct sr_device *device, int probenum);
void device_probe_name(struct sr_device *device, int probenum, char *name);
void device_trigger_clear(struct device *device);
void device_trigger_set(struct device *device, int probenum, char *trigger);
void device_trigger_clear(struct sr_device *device);
void device_trigger_set(struct sr_device *device, int probenum, char *trigger);
/*--- filter.c --------------------------------------------------------------*/
@ -90,7 +90,7 @@ void source_add(int fd, int events, int timeout, receive_data_callback rcv_cb,
typedef void (*source_callback_remove) (int fd);
typedef void (*source_callback_add) (int fd, int events, int timeout,
receive_data_callback callback, void *user_data);
typedef void (*datafeed_callback) (struct device *device,
typedef void (*datafeed_callback) (struct sr_device *device,
struct sr_datafeed_packet *packet);
/* Session setup */
@ -98,7 +98,7 @@ struct session *session_load(const char *filename);
struct session *session_new(void);
void session_destroy(void);
void session_device_clear(void);
int session_device_add(struct device *device);
int session_device_add(struct sr_device *device);
/* Protocol analyzers setup */
void session_pa_clear(void);
@ -113,7 +113,7 @@ int session_start(void);
void session_run(void);
void session_halt(void);
void session_stop(void);
void session_bus(struct device *device, struct sr_datafeed_packet *packet);
void session_bus(struct sr_device *device, struct sr_datafeed_packet *packet);
void make_metadata(char *filename);
int session_save(char *filename);
void session_source_add(int fd, int events, int timeout,

View File

@ -132,7 +132,7 @@ struct analog_sample {
struct sr_input {
struct sr_input_format *format;
char *param;
struct device *vdevice;
struct sr_device *vdevice;
};
struct sr_input_format {
@ -145,7 +145,7 @@ struct sr_input_format {
struct sr_output {
struct sr_output_format *format;
struct device *device;
struct sr_device *device;
char *param;
void *internal;
};
@ -186,9 +186,9 @@ struct datastore {
* to the device index within that plugin; it may be handling more than one
* device. All relevant plugin calls take a device_index parameter for this.
*/
struct device {
struct sr_device {
/* Which plugin handles this device */
struct device_plugin *plugin;
struct sr_device_plugin *plugin;
/* A plugin may handle multiple devices of the same type */
int plugin_index;
/* List of struct probe* */
@ -312,7 +312,7 @@ struct samplerates {
uint64_t *list;
};
struct device_plugin {
struct sr_device_plugin {
/* Plugin-specific */
char *name;
char *longname;
@ -339,7 +339,7 @@ struct gsource_fd {
};
struct session {
/* List of struct device* */
/* List of struct sr_device* */
GSList *devices;
/* List of struct analyzer* */
GSList *analyzers;