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) void device_scan(void)
{ {
GSList *plugins, *l; GSList *plugins, *l;
struct device_plugin *plugin; struct sr_device_plugin *plugin;
plugins = list_hwplugins(); 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; int num_devices, num_probes, i;
@ -60,7 +60,7 @@ int device_plugin_init(struct device_plugin *plugin)
void device_close_all(void) void device_close_all(void)
{ {
struct device *device; struct sr_device *device;
while (devices) { while (devices) {
device = devices->data; device = devices->data;
@ -79,14 +79,14 @@ GSList *device_list(void)
return devices; return devices;
} }
struct device *device_new(struct device_plugin *plugin, int plugin_index, struct sr_device *device_new(struct sr_device_plugin *plugin, int plugin_index,
int num_probes) int num_probes)
{ {
struct device *device; struct sr_device *device;
int i; int i;
char probename[16]; char probename[16];
device = g_malloc0(sizeof(struct device)); device = g_malloc0(sizeof(struct sr_device));
device->plugin = plugin; device->plugin = plugin;
device->plugin_index = plugin_index; device->plugin_index = plugin_index;
devices = g_slist_append(devices, device); devices = g_slist_append(devices, device);
@ -99,7 +99,7 @@ struct device *device_new(struct device_plugin *plugin, int plugin_index,
return device; return device;
} }
void device_clear(struct device *device) void device_clear(struct sr_device *device)
{ {
unsigned int pnum; unsigned int pnum;
@ -112,7 +112,7 @@ void device_clear(struct device *device)
device_probe_clear(device, pnum); device_probe_clear(device, pnum);
} }
void device_destroy(struct device *device) void device_destroy(struct sr_device *device)
{ {
unsigned int pnum; unsigned int pnum;
@ -130,7 +130,7 @@ void device_destroy(struct device *device)
g_free(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; 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; struct probe *p;
@ -161,7 +161,7 @@ void device_probe_add(struct device *device, char *name)
device->probes = g_slist_append(device->probes, p); 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; GSList *l;
struct probe *p, *found_probe; struct probe *p, *found_probe;
@ -178,7 +178,7 @@ struct probe *probe_find(struct device *device, int probenum)
return found_probe; 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; struct probe *p;
@ -191,7 +191,7 @@ void device_probe_name(struct device *device, int probenum, char *name)
p->name = g_strdup(name); p->name = g_strdup(name);
} }
void device_trigger_clear(struct device *device) void device_trigger_clear(struct sr_device *device)
{ {
struct probe *p; struct probe *p;
unsigned int pnum; 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; 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; session_device_id = session_device_id;
} }
struct device_plugin alsa_plugin_info = { struct sr_device_plugin alsa_plugin_info = {
"alsa", "alsa",
"ALSA driver", "ALSA driver",
1, 1,

View File

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

View File

@ -390,7 +390,7 @@ static void hw_stop_acquisition(int device_index, gpointer session_device_id)
thread_running = 0; thread_running = 0;
} }
struct device_plugin demo_plugin_info = { struct sr_device_plugin demo_plugin_info = {
"demo", "demo",
"Demo driver and pattern generator", "Demo driver and pattern generator",
1, 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); session_bus(session_device_id, &packet);
} }
struct device_plugin link_mso19_plugin_info = { struct sr_device_plugin link_mso19_plugin_info = {
.name = "link-mso19", .name = "link-mso19",
.longname = "Link Instruments MSO-19", .longname = "Link Instruments MSO-19",
.api_version = 1, .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); session_bus(session_device_id, &packet);
} }
struct device_plugin ols_plugin_info = { struct sr_device_plugin ols_plugin_info = {
"ols", "ols",
"Openbench Logic Sniffer", "Openbench Logic Sniffer",
1, 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. */ /* 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",
"Saleae Logic", "Saleae Logic",
1, 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. */ /* 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",
"Zeroplus Logic Cube LAP-C series", "Zeroplus Logic Cube LAP-C series",
1, 1,

View File

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

View File

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

View File

@ -35,21 +35,21 @@ void datastore_put(struct datastore *ds, void *data, unsigned int length,
/*--- device.c --------------------------------------------------------------*/ /*--- device.c --------------------------------------------------------------*/
void device_scan(void); 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); void device_close_all(void);
GSList *device_list(void); GSList *device_list(void);
struct device *device_new(struct device_plugin *plugin, int plugin_index, struct sr_device *device_new(struct sr_device_plugin *plugin, int plugin_index,
int num_probes); int num_probes);
void device_clear(struct device *device); void device_clear(struct sr_device *device);
void device_destroy(struct device *dev); void device_destroy(struct sr_device *dev);
void device_probe_clear(struct device *device, int probenum); void device_probe_clear(struct sr_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 *probe_find(struct device *device, int probenum); struct probe *probe_find(struct sr_device *device, int probenum);
void device_probe_name(struct device *device, int probenum, char *name); void device_probe_name(struct sr_device *device, int probenum, char *name);
void device_trigger_clear(struct device *device); void device_trigger_clear(struct sr_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);
/*--- filter.c --------------------------------------------------------------*/ /*--- 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_remove) (int fd);
typedef void (*source_callback_add) (int fd, int events, int timeout, typedef void (*source_callback_add) (int fd, int events, int timeout,
receive_data_callback callback, void *user_data); 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); struct sr_datafeed_packet *packet);
/* Session setup */ /* Session setup */
@ -98,7 +98,7 @@ struct session *session_load(const char *filename);
struct session *session_new(void); struct session *session_new(void);
void session_destroy(void); void session_destroy(void);
void session_device_clear(void); void session_device_clear(void);
int session_device_add(struct device *device); int session_device_add(struct sr_device *device);
/* Protocol analyzers setup */ /* Protocol analyzers setup */
void session_pa_clear(void); void session_pa_clear(void);
@ -113,7 +113,7 @@ int session_start(void);
void session_run(void); void session_run(void);
void session_halt(void); void session_halt(void);
void session_stop(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); void make_metadata(char *filename);
int session_save(char *filename); int session_save(char *filename);
void session_source_add(int fd, int events, int timeout, 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 {
struct sr_input_format *format; struct sr_input_format *format;
char *param; char *param;
struct device *vdevice; struct sr_device *vdevice;
}; };
struct sr_input_format { struct sr_input_format {
@ -145,7 +145,7 @@ struct sr_input_format {
struct sr_output { struct sr_output {
struct sr_output_format *format; struct sr_output_format *format;
struct device *device; struct sr_device *device;
char *param; char *param;
void *internal; void *internal;
}; };
@ -186,9 +186,9 @@ struct datastore {
* to the device index within that plugin; it may be handling more than one * 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. * device. All relevant plugin calls take a device_index parameter for this.
*/ */
struct device { struct sr_device {
/* Which plugin handles this 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 */ /* A plugin may handle multiple devices of the same type */
int plugin_index; int plugin_index;
/* List of struct probe* */ /* List of struct probe* */
@ -312,7 +312,7 @@ struct samplerates {
uint64_t *list; uint64_t *list;
}; };
struct device_plugin { struct sr_device_plugin {
/* Plugin-specific */ /* Plugin-specific */
char *name; char *name;
char *longname; char *longname;
@ -339,7 +339,7 @@ struct gsource_fd {
}; };
struct session { struct session {
/* List of struct device* */ /* List of struct sr_device* */
GSList *devices; GSList *devices;
/* List of struct analyzer* */ /* List of struct analyzer* */
GSList *analyzers; GSList *analyzers;