diff --git a/iiod/ops.c b/iiod/ops.c index e6ac75b47..7c7527e48 100644 --- a/iiod/ops.c +++ b/iiod/ops.c @@ -10,7 +10,6 @@ #include "parser.h" #include "thread-pool.h" #include "../debug.h" -#include "../iio-private.h" #include #include diff --git a/iiod/ops.h b/iiod/ops.h index 1b60c0475..4cd33ae59 100644 --- a/iiod/ops.h +++ b/iiod/ops.h @@ -9,11 +9,11 @@ #ifndef __OPS_H__ #define __OPS_H__ -#include "../iio-private.h" #include "queue.h" #include #include +#include #include #include #include @@ -38,9 +38,21 @@ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) #endif +#define BIT(x) (1 << (x)) +#define BIT_MASK(bit) BIT((bit) % 32) +#define BIT_WORD(bit) ((bit) / 32) +#define TEST_BIT(addr, bit) (!!(*(((uint32_t *) addr) + BIT_WORD(bit)) \ + & BIT_MASK(bit))) + struct thread_pool; extern struct thread_pool *main_thread_pool; +enum iio_attr_type { + IIO_ATTR_TYPE_DEVICE, + IIO_ATTR_TYPE_DEBUG, + IIO_ATTR_TYPE_BUFFER, +}; + struct parser_pdata { struct iio_context *ctx; bool stop, verbose; @@ -69,6 +81,11 @@ struct parser_pdata { extern bool server_demux; /* Defined in iiod.c */ +static inline void *zalloc(size_t size) +{ + return calloc(1, size); +} + void interpreter(struct iio_context *ctx, int fd_in, int fd_out, bool verbose, bool is_socket, bool use_aio, struct thread_pool *pool, const void *xml_zstd, size_t xml_zstd_len); diff --git a/iiod/usbd.c b/iiod/usbd.c index fc773a848..22ad7197b 100644 --- a/iiod/usbd.c +++ b/iiod/usbd.c @@ -7,7 +7,6 @@ */ #include "../debug.h" -#include "../iio-private.h" #include "ops.h" #include "thread-pool.h"