From: Uwe Hermann Date: Tue, 8 Feb 2011 16:47:38 +0000 (+0100) Subject: Add sr_ prefix for 'struct probe'. X-Git-Tag: libsigrok-0.1.0~343 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=1afe89897cf100b1a3a5896184ddaca5705681cc;p=libsigrok.git Add sr_ prefix for 'struct probe'. --- diff --git a/device.c b/device.c index f5674b4c..9e4254ad 100644 --- a/device.c +++ b/device.c @@ -129,7 +129,7 @@ void device_destroy(struct sr_device *device) void device_probe_clear(struct sr_device *device, int probenum) { - struct probe *p; + struct sr_probe *p; p = probe_find(device, probenum); if (!p) @@ -148,12 +148,12 @@ void device_probe_clear(struct sr_device *device, int probenum) void device_probe_add(struct sr_device *device, char *name) { - struct probe *p; + struct sr_probe *p; char probename[16]; int probenum; probenum = g_slist_length(device->probes) + 1; - p = g_malloc0(sizeof(struct probe)); + p = g_malloc0(sizeof(struct sr_probe)); p->index = probenum; p->enabled = TRUE; if (name) { @@ -166,10 +166,10 @@ void device_probe_add(struct sr_device *device, char *name) device->probes = g_slist_append(device->probes, p); } -struct probe *probe_find(struct sr_device *device, int probenum) +struct sr_probe *probe_find(struct sr_device *device, int probenum) { GSList *l; - struct probe *p, *found_probe; + struct sr_probe *p, *found_probe; found_probe = NULL; for (l = device->probes; l; l = l->next) { @@ -186,7 +186,7 @@ struct probe *probe_find(struct sr_device *device, int probenum) /* TODO: return SIGROK_ERR if probenum not found */ void device_probe_name(struct sr_device *device, int probenum, char *name) { - struct probe *p; + struct sr_probe *p; p = probe_find(device, probenum); if (!p) @@ -200,7 +200,7 @@ void device_probe_name(struct sr_device *device, int probenum, char *name) /* TODO: return SIGROK_ERR if probenum not found */ void device_trigger_clear(struct sr_device *device) { - struct probe *p; + struct sr_probe *p; unsigned int pnum; if (!device->probes) @@ -218,7 +218,7 @@ void device_trigger_clear(struct sr_device *device) /* TODO: return SIGROK_ERR if probenum not found */ void device_trigger_set(struct sr_device *device, int probenum, char *trigger) { - struct probe *p; + struct sr_probe *p; p = probe_find(device, probenum); if (!p) diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 4673a398..e86c1d28 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -594,7 +594,7 @@ static int set_samplerate(struct sr_device_instance *sdi, static int configure_probes(struct sr_device_instance *sdi, GSList *probes) { struct sigma *sigma = sdi->priv; - struct probe *probe; + struct sr_probe *probe; GSList *l; int trigger_set = 0; int probebit; @@ -602,7 +602,7 @@ static int configure_probes(struct sr_device_instance *sdi, GSList *probes) memset(&sigma->trigger, 0, sizeof(struct sigma_trigger)); for (l = probes; l; l = l->next) { - probe = (struct probe *)l->data; + probe = (struct sr_probe *)l->data; probebit = 1 << (probe->index - 1); if (!probe->enabled || !probe->trigger) diff --git a/hardware/openbench-logic-sniffer/ols.c b/hardware/openbench-logic-sniffer/ols.c index ec9fa4ed..4df5ef05 100644 --- a/hardware/openbench-logic-sniffer/ols.c +++ b/hardware/openbench-logic-sniffer/ols.c @@ -147,7 +147,7 @@ static int send_longcommand(int fd, uint8_t command, uint32_t data) static int configure_probes(GSList *probes) { - struct probe *probe; + struct sr_probe *probe; GSList *l; int probe_bit, stage, i; char *tc; @@ -160,7 +160,7 @@ static int configure_probes(GSList *probes) num_stages = 0; for (l = probes; l; l = l->next) { - probe = (struct probe *)l->data; + probe = (struct sr_probe *)l->data; if (!probe->enabled) continue; diff --git a/hardware/saleae-logic/saleae-logic.c b/hardware/saleae-logic/saleae-logic.c index a270e0b4..b99523f8 100644 --- a/hardware/saleae-logic/saleae-logic.c +++ b/hardware/saleae-logic/saleae-logic.c @@ -243,7 +243,7 @@ static void close_device(struct sr_device_instance *sdi) static int configure_probes(GSList *probes) { - struct probe *probe; + struct sr_probe *probe; GSList *l; int probe_bit, stage, i; char *tc; @@ -256,7 +256,7 @@ static int configure_probes(GSList *probes) stage = -1; for (l = probes; l; l = l->next) { - probe = (struct probe *)l->data; + probe = (struct sr_probe *)l->data; if (probe->enabled == FALSE) continue; probe_bit = 1 << (probe->index - 1); diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index ba5fd522..cb56a09f 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -234,7 +234,7 @@ static void close_device(struct sr_device_instance *sdi) static int configure_probes(GSList *probes) { - struct probe *probe; + struct sr_probe *probe; GSList *l; int probe_bit, stage, i; char *tc; @@ -247,7 +247,7 @@ static int configure_probes(GSList *probes) stage = -1; for (l = probes; l; l = l->next) { - probe = (struct probe *)l->data; + probe = (struct sr_probe *)l->data; if (probe->enabled == FALSE) continue; probe_bit = 1 << (probe->index - 1); diff --git a/output/output_analog.c b/output/output_analog.c index f00bffa3..7c5c622f 100644 --- a/output/output_analog.c +++ b/output/output_analog.c @@ -92,7 +92,7 @@ static void flush_linebufs(struct context *ctx, char *outbuf) static int init(struct sr_output *o, int default_spl, enum outputmode mode) { struct context *ctx; - struct probe *probe; + struct sr_probe *probe; GSList *l; uint64_t samplerate; int num_probes; diff --git a/output/output_gnuplot.c b/output/output_gnuplot.c index 440e848c..99ab6d6b 100644 --- a/output/output_gnuplot.c +++ b/output/output_gnuplot.c @@ -49,7 +49,7 @@ const char *gnuplot_header_comment = "\ static int init(struct sr_output *o) { struct context *ctx; - struct probe *probe; + struct sr_probe *probe; GSList *l; uint64_t samplerate; unsigned int i; @@ -194,7 +194,7 @@ static int data(struct sr_output *o, char *data_in, uint64_t length_in, static int analog_init(struct sr_output *o) { struct context *ctx; - struct probe *probe; + struct sr_probe *probe; GSList *l; uint64_t samplerate; unsigned int i; diff --git a/output/output_ols.c b/output/output_ols.c index 1c57aee8..e199bb46 100644 --- a/output/output_ols.c +++ b/output/output_ols.c @@ -71,7 +71,7 @@ static void make_header(struct sr_output *o) static int init(struct sr_output *o) { struct context *ctx; - struct probe *probe; + struct sr_probe *probe; GSList *l; int num_enabled_probes; diff --git a/output/output_vcd.c b/output/output_vcd.c index f34eaa8c..332a67d0 100644 --- a/output/output_vcd.c +++ b/output/output_vcd.c @@ -52,7 +52,7 @@ $comment\n Acquisition with %d/%d probes at %s\n$end\n"; static int init(struct sr_output *o) { struct context *ctx; - struct probe *probe; + struct sr_probe *probe; GSList *l; int num_probes, i; char *samplerate_s, *frequency_s, *timestamp; diff --git a/output/text/text.c b/output/text/text.c index da41b733..f51a8f31 100644 --- a/output/text/text.c +++ b/output/text/text.c @@ -67,7 +67,7 @@ void flush_linebufs(struct context *ctx, char *outbuf) int init(struct sr_output *o, int default_spl, enum outputmode mode) { struct context *ctx; - struct probe *probe; + struct sr_probe *probe; GSList *l; uint64_t samplerate; int num_probes; diff --git a/session_file.c b/session_file.c index 8ed2c401..2a727c86 100644 --- a/session_file.c +++ b/session_file.c @@ -39,7 +39,7 @@ int session_load(const char *filename) struct zip_stat zs; struct session *session; struct sr_device *device; - struct probe *probe; + struct sr_probe *probe; int ret, err, probenum, devcnt, i, j; uint64_t tmp_u64, total_probes, enabled_probes, p; char **sections, **keys, *metafile, *val, c; @@ -141,7 +141,7 @@ int session_save(char *filename) GSList *l, *p, *d; FILE *meta; struct sr_device *device; - struct probe *probe; + struct sr_probe *probe; struct datastore *ds; struct zip *zipfile; struct zip_source *versrc, *metasrc, *logicsrc; diff --git a/sigrok-proto.h b/sigrok-proto.h index 57b899df..c0d09da5 100644 --- a/sigrok-proto.h +++ b/sigrok-proto.h @@ -45,7 +45,7 @@ void device_destroy(struct sr_device *dev); 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); +struct sr_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 sr_device *device); diff --git a/sigrok.h b/sigrok.h index 983246bb..9518041c 100644 --- a/sigrok.h +++ b/sigrok.h @@ -193,7 +193,7 @@ struct sr_device { struct sr_device_plugin *plugin; /* A plugin may handle multiple devices of the same type */ int plugin_index; - /* List of struct probe* */ + /* List of struct sr_probe* */ GSList *probes; /* Data acquired by this device, if any */ struct datastore *datastore; @@ -204,7 +204,7 @@ enum { SR_PROBE_TYPE_ANALOG, }; -struct probe { +struct sr_probe { int index; int type; gboolean enabled; diff --git a/strutil.c b/strutil.c index b8eb0f8e..955adedb 100644 --- a/strutil.c +++ b/strutil.c @@ -99,7 +99,7 @@ char *sr_period_string(uint64_t frequency) char **sr_parse_triggerstring(struct sr_device *device, const char *triggerstring) { GSList *l; - struct probe *probe; + struct sr_probe *probe; int max_probes, probenum, i; char **tokens, **triggerlist, *trigger, *tc, *trigger_types; gboolean error; @@ -117,7 +117,7 @@ char **sr_parse_triggerstring(struct sr_device *device, const char *triggerstrin /* Named probe */ probenum = 0; for (l = device->probes; l; l = l->next) { - probe = (struct probe *)l->data; + probe = (struct sr_probe *)l->data; if (probe->enabled && !strncmp(probe->name, tokens[i], strlen(probe->name))) {