From: Uwe Hermann Date: Sun, 30 Jan 2011 15:19:42 +0000 (+0100) Subject: Prefix device structs with sr_. X-Git-Tag: libsigrok-0.1.0~365 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=5c2d46d1dbfa636fb3cdbeaffdc0e9ca77c66ee1;p=libsigrok.git Prefix device structs with sr_. --- diff --git a/device.c b/device.c index 216442b4..dedae3a6 100644 --- a/device.c +++ b/device.c @@ -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; diff --git a/hardware/alsa/alsa.c b/hardware/alsa/alsa.c index 7dbb9ca6..cef1814b 100644 --- a/hardware/alsa/alsa.c +++ b/hardware/alsa/alsa.c @@ -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, diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index de89f7ac..f085c85c 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -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, diff --git a/hardware/common/skeleton.c b/hardware/common/skeleton.c index e5e1372a..cc673291 100644 --- a/hardware/common/skeleton.c +++ b/hardware/common/skeleton.c @@ -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, diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 0811cbf3..06722c4f 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -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, diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index 180c8351..42779942 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -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, diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index 7b1a75a3..dbad1888 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -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, diff --git a/hardware/saleae-logic/saleae-logic.c b/hardware/saleae-logic/saleae-logic.c index 4f62ca4b..51375392 100644 --- a/hardware/saleae-logic/saleae-logic.c +++ b/hardware/saleae-logic/saleae-logic.c @@ -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, diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index c73efaed..92c33204 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -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, diff --git a/hwplugin.c b/hwplugin.c index e9bd582e..efd8f5e1 100644 --- a/hwplugin.c +++ b/hwplugin.c @@ -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 diff --git a/session.c b/session.c index e08b39b2..68b1913e 100644 --- a/session.c +++ b/session.c @@ -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; diff --git a/sigrok-proto.h b/sigrok-proto.h index 6cf3ff1d..4d700f31 100644 --- a/sigrok-proto.h +++ b/sigrok-proto.h @@ -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, diff --git a/sigrok.h b/sigrok.h index b7c4aaf5..20bd5943 100644 --- a/sigrok.h +++ b/sigrok.h @@ -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;