int r;
o = malloc(30 + 1); /* Enough for a uint64_t as string + " GHz". */
- if (o == NULL)
+ if (!o)
return NULL;
if (samplerate >= GHZ(1))
return o;
}
-
/**
* Convert a numeric samplerate value to the "natural" string representation
* of its period.
int r;
o = malloc(30 + 1); /* Enough for a uint64_t as string + " ms". */
- if (o == NULL)
+ if (!o)
return NULL;
if (frequency >= GHZ(1))
return o;
}
-
#include <glib.h>
#include <libusb.h>
-
/*
* Status/error codes returned by libsigrok functions.
*
#define MAX_NUM_PROBES 64
#define MAX_PROBENAME_LEN 32
-
/* Handy little macros */
#define KHZ(n) ((n) * 1000)
#define MHZ(n) ((n) * 1000000)
#define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a)
#endif
-
typedef int (*receive_data_callback) (int fd, int revents, void *user_data);
-
/* Data types used by hardware plugins for set_configuration() */
enum {
T_UINT64,
int stackindex;
};
-
-
/* datafeed_packet.type values */
enum {
DF_HEADER,
int num_logic_probes;
};
-
-
struct input {
struct input_format *format;
char *param;
int (*loadfile) (struct input *in, const char *filename);
};
-
-
struct output {
struct output_format *format;
struct device *device;
uint64_t *length_out);
};
-
struct analyzer {
char *name;
char *filename;
*/
};
-
/* Size of a chunk in units */
#define DATASTORE_CHUNKSIZE 512000
GSList *chunklist;
};
-
/*
* This represents a generic device connected to the system.
* For device-specific information, ask the plugin. The plugin_index refers
extern GSList *devices;
-
/* Hardware plugin capabilities */
enum {
HWCAP_DUMMY, /* Used to terminate lists */
char *shortname;
};
-
struct sigrok_device_instance {
int index;
int status;