From 829c628276b76b8ac92c985e207a547c67645715 Mon Sep 17 00:00:00 2001 From: Saverio Proto Date: Sat, 28 Jun 2014 14:52:46 +0200 Subject: [PATCH] Typedef of bitmap --- src/meshlink.h | 12 ++++++++++++ src/meshlink_internal.h | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/meshlink.h b/src/meshlink.h index 917d4548..0ef56e22 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -37,6 +37,18 @@ typedef struct meshlink_node meshlink_node_t; typedef struct meshlink_connection meshlink_connection_t; +//Structure to hold a single bit + +typedef struct { +unsigned int bit : 1; +} Bit; + +//BitArray structure. + +typedef struct { +Bit bitValues[1024]; //we will be able to use MAX 1024 sockets +} bitmap_t; + /// Code of most recent error encountered. typedef enum { MESHLINK_OK, ///< Everything is fine diff --git a/src/meshlink_internal.h b/src/meshlink_internal.h index f625857d..ab33c859 100644 --- a/src/meshlink_internal.h +++ b/src/meshlink_internal.h @@ -90,7 +90,7 @@ struct meshlink_handle { struct list_t *outpacketqueue; - uint16_t socketsbitmap; //bitmap of 16 bits + bitmap_t socketsbitmap; //bitmap of 16 bits int contradicting_add_edge; int contradicting_del_edge; -- 2.39.5