+/**
+ * environment for the pattern encoder
+ */
+typedef struct _codec_enc_t {
+ CODE_BUFFER *buf; /**< the code buffer */
+ set *id_set; /**< the set containing all already seen nodes */
+ unsigned curr_id; /**< current node id */
+ unsigned options; /**< encoding options */
+ pattern_dumper_t *dmp; /**< dumper for the decoder */
+} codec_env_t;
+
+typedef struct _addr_entry_t {
+ void *addr; /**< the address */
+ unsigned id; /**< associated ID */
+} addr_entry_t;
+
+/**
+ * hash value of an address
+ */
+static INLINE unsigned addr_hash(void *addr)
+{
+ return ((unsigned)addr) >> 3;
+}
+
+/**
+ * compare two addresses
+ */
+static int addr_cmp(const void *p1, const void *p2, size_t size) {
+ const addr_entry_t *e1 = p1;
+ const addr_entry_t *e2 = p2;
+
+ return e1->addr != e2->addr;
+}
+
+/**