X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=sigrok.h;h=9109201d51df6e04079c0db4bda484b449345ee0;hb=120b259ea8f17b74deca3ba4b71e78771539bde8;hp=ba571c2c79eeb4ca23f2e99b34de93856890d51f;hpb=54ac5277c5e462f1778300b9bc3fdd4709ecb2dc;p=libsigrok.git diff --git a/sigrok.h b/sigrok.h index ba571c2c..9109201d 100644 --- a/sigrok.h +++ b/sigrok.h @@ -55,24 +55,16 @@ extern "C" { #define SR_ERR_MALLOC -2 /* Malloc/calloc/realloc error */ #define SR_ERR_SAMPLERATE -3 /* Incorrect samplerate */ -/* limited by uint64_t */ -#define MAX_NUM_PROBES 64 -#define MAX_PROBENAME_LEN 32 +#define SR_MAX_NUM_PROBES 64 /* Limited by uint64_t. */ +#define SR_MAX_PROBENAME_LEN 32 /* Handy little macros */ -#define KHZ(n) ((n) * 1000) -#define MHZ(n) ((n) * 1000000) -#define GHZ(n) ((n) * 1000000000) +#define SR_HZ(n) (n) +#define SR_KHZ(n) ((n) * 1000) +#define SR_MHZ(n) ((n) * 1000000) +#define SR_GHZ(n) ((n) * 1000000000) -#define HZ_TO_NS(n) (1000000000 / (n)) - -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) -#endif - -#ifndef ARRAY_AND_SIZE -#define ARRAY_AND_SIZE(a) (a), ARRAY_SIZE(a) -#endif +#define SR_HZ_TO_NS(n) (1000000000 / (n)) typedef int (*sr_receive_data_callback) (int fd, int revents, void *user_data); @@ -172,9 +164,6 @@ struct sr_analyzer { */ }; -/* Size of a chunk in units */ -#define DATASTORE_CHUNKSIZE 512000 - struct sr_datastore { /* Size in bytes of the number of units stored in this datastore */ int ds_unitsize;