aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-impl.h
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2020-06-05 21:10:37 +0100
committerNick Alcock <nick.alcock@oracle.com>2020-07-22 18:02:18 +0100
commit1f2e8b5b87df91a0b8ff76fab75538dfcc2478f5 (patch)
tree30c1e1bd40beca648b6ac032d5a6983b3c5ca3f4 /libctf/ctf-impl.h
parent6dd2819ffc282e644e7feb476cc803d4f39d9f17 (diff)
downloadbinutils-1f2e8b5b87df91a0b8ff76fab75538dfcc2478f5.zip
binutils-1f2e8b5b87df91a0b8ff76fab75538dfcc2478f5.tar.gz
binutils-1f2e8b5b87df91a0b8ff76fab75538dfcc2478f5.tar.bz2
libctf: add SHA-1 support for libctf
This very thin abstraction layer provides SHA-1ing facilities to all of libctf, almost all inlined wrappers around the libiberty functionality other than ctf_sha1_fini. The deduplicator will use this to recursively hash types to prove their identity. libctf/ * ctf-sha1.h: New, inline wrappers around sha1_init_ctx and sha1_process_bytes. * ctf-impl.h: Include it. (ctf_sha1_init): New. (ctf_sha1_add): Likewise. (ctf_sha1_fini): Likewise. * ctf-sha1.c: New, non-inline wrapper around sha1_finish_ctx producing strings. * Makefile.am: Add file. * Makefile.in: Regenerate.
Diffstat (limited to 'libctf/ctf-impl.h')
-rw-r--r--libctf/ctf-impl.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libctf/ctf-impl.h b/libctf/ctf-impl.h
index 7f47c68..9c5f7ba 100644
--- a/libctf/ctf-impl.h
+++ b/libctf/ctf-impl.h
@@ -25,6 +25,7 @@
#include <sys/param.h>
#include "ctf-decls.h"
#include <ctf-api.h>
+#include "ctf-sha1.h"
#include <sys/types.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -499,6 +500,10 @@ extern int ctf_dynset_exists (ctf_dynset_t *, const void *key,
extern int ctf_dynset_next (ctf_dynset_t *, ctf_next_t **, void **key);
extern void *ctf_dynset_lookup_any (ctf_dynset_t *);
+extern void ctf_sha1_init (ctf_sha1_t *);
+extern void ctf_sha1_add (ctf_sha1_t *, const void *, size_t);
+extern char *ctf_sha1_fini (ctf_sha1_t *, char *);
+
#define ctf_list_prev(elem) ((void *)(((ctf_list_t *)(elem))->l_prev))
#define ctf_list_next(elem) ((void *)(((ctf_list_t *)(elem))->l_next))