X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=sigrok-internal.h;h=d385340357c551d6323105443d49970fd975beee;hb=f38bdf5678d35a1493c17a5c260fc1120d93bd93;hp=85004aa13f14b8c0d27586bd6efd654825a2495b;hpb=8233ff53ae7c6e120af4784bc61a036882d5c234;p=libsigrok.git diff --git a/sigrok-internal.h b/sigrok-internal.h index 85004aa1..d3853403 100644 --- a/sigrok-internal.h +++ b/sigrok-internal.h @@ -20,10 +20,40 @@ #ifndef SIGROK_SIGROK_INTERNAL_H #define SIGROK_SIGROK_INTERNAL_H +#include + +/*--- Macros ----------------------------------------------------------------*/ + +#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 + +/* Size of a datastore chunk in units */ +#define DATASTORE_CHUNKSIZE 512000 + /*--- hwplugin.c ------------------------------------------------------------*/ int load_hwplugins(void); +/*--- log.c -----------------------------------------------------------------*/ + +/* Log levels for sr_log() and friends. */ +#define SR_LOG_NONE 0 +#define SR_LOG_DBG 1 +#define SR_LOG_INFO 2 +#define SR_LOG_WARN 3 +#define SR_LOG_ERR 4 + +int sr_log(int loglevel, const char *format, ...); +int sr_dbg(const char *format, ...); +int sr_info(const char *format, ...); +int sr_warn(const char *format, ...); +int sr_err(const char *format, ...); + /*--- hardware/common/serial.c ----------------------------------------------*/ GSList *list_serial_ports(void);