Add sr_ prefix for 'struct probe'.

This commit is contained in:
Uwe Hermann 2011-02-08 17:47:38 +01:00
parent 3bbd9849e9
commit 1afe89897c
14 changed files with 29 additions and 29 deletions

View File

@ -129,7 +129,7 @@ void device_destroy(struct sr_device *device)
void device_probe_clear(struct sr_device *device, int probenum) void device_probe_clear(struct sr_device *device, int probenum)
{ {
struct probe *p; struct sr_probe *p;
p = probe_find(device, probenum); p = probe_find(device, probenum);
if (!p) 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) void device_probe_add(struct sr_device *device, char *name)
{ {
struct probe *p; struct sr_probe *p;
char probename[16]; char probename[16];
int probenum; int probenum;
probenum = g_slist_length(device->probes) + 1; probenum = g_slist_length(device->probes) + 1;
p = g_malloc0(sizeof(struct probe)); p = g_malloc0(sizeof(struct sr_probe));
p->index = probenum; p->index = probenum;
p->enabled = TRUE; p->enabled = TRUE;
if (name) { if (name) {
@ -166,10 +166,10 @@ void device_probe_add(struct sr_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 sr_device *device, int probenum) struct sr_probe *probe_find(struct sr_device *device, int probenum)
{ {
GSList *l; GSList *l;
struct probe *p, *found_probe; struct sr_probe *p, *found_probe;
found_probe = NULL; found_probe = NULL;
for (l = device->probes; l; l = l->next) { 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 */ /* TODO: return SIGROK_ERR if probenum not found */
void device_probe_name(struct sr_device *device, int probenum, char *name) void device_probe_name(struct sr_device *device, int probenum, char *name)
{ {
struct probe *p; struct sr_probe *p;
p = probe_find(device, probenum); p = probe_find(device, probenum);
if (!p) 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 */ /* TODO: return SIGROK_ERR if probenum not found */
void device_trigger_clear(struct sr_device *device) void device_trigger_clear(struct sr_device *device)
{ {
struct probe *p; struct sr_probe *p;
unsigned int pnum; unsigned int pnum;
if (!device->probes) if (!device->probes)
@ -218,7 +218,7 @@ void device_trigger_clear(struct sr_device *device)
/* TODO: return SIGROK_ERR if probenum not found */ /* TODO: return SIGROK_ERR if probenum not found */
void device_trigger_set(struct sr_device *device, int probenum, char *trigger) void device_trigger_set(struct sr_device *device, int probenum, char *trigger)
{ {
struct probe *p; struct sr_probe *p;
p = probe_find(device, probenum); p = probe_find(device, probenum);
if (!p) if (!p)

View File

@ -594,7 +594,7 @@ static int set_samplerate(struct sr_device_instance *sdi,
static int configure_probes(struct sr_device_instance *sdi, GSList *probes) static int configure_probes(struct sr_device_instance *sdi, GSList *probes)
{ {
struct sigma *sigma = sdi->priv; struct sigma *sigma = sdi->priv;
struct probe *probe; struct sr_probe *probe;
GSList *l; GSList *l;
int trigger_set = 0; int trigger_set = 0;
int probebit; 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)); memset(&sigma->trigger, 0, sizeof(struct sigma_trigger));
for (l = probes; l; l = l->next) { for (l = probes; l; l = l->next) {
probe = (struct probe *)l->data; probe = (struct sr_probe *)l->data;
probebit = 1 << (probe->index - 1); probebit = 1 << (probe->index - 1);
if (!probe->enabled || !probe->trigger) if (!probe->enabled || !probe->trigger)

View File

@ -147,7 +147,7 @@ static int send_longcommand(int fd, uint8_t command, uint32_t data)
static int configure_probes(GSList *probes) static int configure_probes(GSList *probes)
{ {
struct probe *probe; struct sr_probe *probe;
GSList *l; GSList *l;
int probe_bit, stage, i; int probe_bit, stage, i;
char *tc; char *tc;
@ -160,7 +160,7 @@ static int configure_probes(GSList *probes)
num_stages = 0; num_stages = 0;
for (l = probes; l; l = l->next) { for (l = probes; l; l = l->next) {
probe = (struct probe *)l->data; probe = (struct sr_probe *)l->data;
if (!probe->enabled) if (!probe->enabled)
continue; continue;

View File

@ -243,7 +243,7 @@ static void close_device(struct sr_device_instance *sdi)
static int configure_probes(GSList *probes) static int configure_probes(GSList *probes)
{ {
struct probe *probe; struct sr_probe *probe;
GSList *l; GSList *l;
int probe_bit, stage, i; int probe_bit, stage, i;
char *tc; char *tc;
@ -256,7 +256,7 @@ static int configure_probes(GSList *probes)
stage = -1; stage = -1;
for (l = probes; l; l = l->next) { for (l = probes; l; l = l->next) {
probe = (struct probe *)l->data; probe = (struct sr_probe *)l->data;
if (probe->enabled == FALSE) if (probe->enabled == FALSE)
continue; continue;
probe_bit = 1 << (probe->index - 1); probe_bit = 1 << (probe->index - 1);

View File

@ -234,7 +234,7 @@ static void close_device(struct sr_device_instance *sdi)
static int configure_probes(GSList *probes) static int configure_probes(GSList *probes)
{ {
struct probe *probe; struct sr_probe *probe;
GSList *l; GSList *l;
int probe_bit, stage, i; int probe_bit, stage, i;
char *tc; char *tc;
@ -247,7 +247,7 @@ static int configure_probes(GSList *probes)
stage = -1; stage = -1;
for (l = probes; l; l = l->next) { for (l = probes; l; l = l->next) {
probe = (struct probe *)l->data; probe = (struct sr_probe *)l->data;
if (probe->enabled == FALSE) if (probe->enabled == FALSE)
continue; continue;
probe_bit = 1 << (probe->index - 1); probe_bit = 1 << (probe->index - 1);

View File

@ -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) static int init(struct sr_output *o, int default_spl, enum outputmode mode)
{ {
struct context *ctx; struct context *ctx;
struct probe *probe; struct sr_probe *probe;
GSList *l; GSList *l;
uint64_t samplerate; uint64_t samplerate;
int num_probes; int num_probes;

View File

@ -49,7 +49,7 @@ const char *gnuplot_header_comment = "\
static int init(struct sr_output *o) static int init(struct sr_output *o)
{ {
struct context *ctx; struct context *ctx;
struct probe *probe; struct sr_probe *probe;
GSList *l; GSList *l;
uint64_t samplerate; uint64_t samplerate;
unsigned int i; 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) static int analog_init(struct sr_output *o)
{ {
struct context *ctx; struct context *ctx;
struct probe *probe; struct sr_probe *probe;
GSList *l; GSList *l;
uint64_t samplerate; uint64_t samplerate;
unsigned int i; unsigned int i;

View File

@ -71,7 +71,7 @@ static void make_header(struct sr_output *o)
static int init(struct sr_output *o) static int init(struct sr_output *o)
{ {
struct context *ctx; struct context *ctx;
struct probe *probe; struct sr_probe *probe;
GSList *l; GSList *l;
int num_enabled_probes; int num_enabled_probes;

View File

@ -52,7 +52,7 @@ $comment\n Acquisition with %d/%d probes at %s\n$end\n";
static int init(struct sr_output *o) static int init(struct sr_output *o)
{ {
struct context *ctx; struct context *ctx;
struct probe *probe; struct sr_probe *probe;
GSList *l; GSList *l;
int num_probes, i; int num_probes, i;
char *samplerate_s, *frequency_s, *timestamp; char *samplerate_s, *frequency_s, *timestamp;

View File

@ -67,7 +67,7 @@ void flush_linebufs(struct context *ctx, char *outbuf)
int init(struct sr_output *o, int default_spl, enum outputmode mode) int init(struct sr_output *o, int default_spl, enum outputmode mode)
{ {
struct context *ctx; struct context *ctx;
struct probe *probe; struct sr_probe *probe;
GSList *l; GSList *l;
uint64_t samplerate; uint64_t samplerate;
int num_probes; int num_probes;

View File

@ -39,7 +39,7 @@ int session_load(const char *filename)
struct zip_stat zs; struct zip_stat zs;
struct session *session; struct session *session;
struct sr_device *device; struct sr_device *device;
struct probe *probe; struct sr_probe *probe;
int ret, err, probenum, devcnt, i, j; int ret, err, probenum, devcnt, i, j;
uint64_t tmp_u64, total_probes, enabled_probes, p; uint64_t tmp_u64, total_probes, enabled_probes, p;
char **sections, **keys, *metafile, *val, c; char **sections, **keys, *metafile, *val, c;
@ -141,7 +141,7 @@ int session_save(char *filename)
GSList *l, *p, *d; GSList *l, *p, *d;
FILE *meta; FILE *meta;
struct sr_device *device; struct sr_device *device;
struct probe *probe; struct sr_probe *probe;
struct datastore *ds; struct datastore *ds;
struct zip *zipfile; struct zip *zipfile;
struct zip_source *versrc, *metasrc, *logicsrc; struct zip_source *versrc, *metasrc, *logicsrc;

View File

@ -45,7 +45,7 @@ void device_destroy(struct sr_device *dev);
void device_probe_clear(struct sr_device *device, int probenum); void device_probe_clear(struct sr_device *device, int probenum);
void device_probe_add(struct sr_device *device, char *name); 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_probe_name(struct sr_device *device, int probenum, char *name);
void device_trigger_clear(struct sr_device *device); void device_trigger_clear(struct sr_device *device);

View File

@ -193,7 +193,7 @@ struct sr_device {
struct sr_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 sr_probe* */
GSList *probes; GSList *probes;
/* Data acquired by this device, if any */ /* Data acquired by this device, if any */
struct datastore *datastore; struct datastore *datastore;
@ -204,7 +204,7 @@ enum {
SR_PROBE_TYPE_ANALOG, SR_PROBE_TYPE_ANALOG,
}; };
struct probe { struct sr_probe {
int index; int index;
int type; int type;
gboolean enabled; gboolean enabled;

View File

@ -99,7 +99,7 @@ char *sr_period_string(uint64_t frequency)
char **sr_parse_triggerstring(struct sr_device *device, const char *triggerstring) char **sr_parse_triggerstring(struct sr_device *device, const char *triggerstring)
{ {
GSList *l; GSList *l;
struct probe *probe; struct sr_probe *probe;
int max_probes, probenum, i; int max_probes, probenum, i;
char **tokens, **triggerlist, *trigger, *tc, *trigger_types; char **tokens, **triggerlist, *trigger, *tc, *trigger_types;
gboolean error; gboolean error;
@ -117,7 +117,7 @@ char **sr_parse_triggerstring(struct sr_device *device, const char *triggerstrin
/* Named probe */ /* Named probe */
probenum = 0; probenum = 0;
for (l = device->probes; l; l = l->next) { for (l = device->probes; l; l = l->next) {
probe = (struct probe *)l->data; probe = (struct sr_probe *)l->data;
if (probe->enabled if (probe->enabled
&& !strncmp(probe->name, tokens[i], && !strncmp(probe->name, tokens[i],
strlen(probe->name))) { strlen(probe->name))) {