struct xref_block *xref_blocks;
static struct xref_block **xref_block_last = &xref_blocks;
+struct xrefdata_uid_head xrefdata_uid = INIT_RBTREE_UNIQ(xrefdata_uid);
+
static void base32(uint8_t **inpos, int *bitpos,
char *out, size_t n_chars)
{
base32(&h, &bitpos, &xrefdata->uid[0], 5);
xrefdata->uid[5] = '-';
base32(&h, &bitpos, &xrefdata->uid[6], 5);
+
+ xrefdata_uid_add(&xrefdata_uid, xrefdata);
}
void xref_gcc_workaround(const struct xref *xref)
#include <limits.h>
#include <errno.h>
#include "compiler.h"
+#include "typesafe.h"
#ifdef __cplusplus
extern "C" {
/* type-specific bits appended by embedding this struct */
};
+PREDECL_RBTREE_UNIQ(xrefdata_uid);
+
struct xrefdata {
/* pointer back to the const part; this will be initialized at
* program startup by xref_block_add(). (Creating structs with
uint32_t hashu32[2];
/* -- 32 bytes (on 64bit) -- */
+ struct xrefdata_uid_item xui;
};
+static inline int xrefdata_uid_cmp(const struct xrefdata *a,
+ const struct xrefdata *b)
+{
+ return strcmp(a->uid, b->uid);
+}
+
+DECLARE_RBTREE_UNIQ(xrefdata_uid, struct xrefdata, xui, xrefdata_uid_cmp);
+extern struct xrefdata_uid_head xrefdata_uid;
+
/* linker "magic" is used to create an array of pointers to struct xref.
* the result is a contiguous block of pointers, each pointing to an xref
* somewhere in the code. The linker gives us start and end pointers, we