|
|
1e8c27 |
From cdbe6f07c929b0c9a80b7fbeb61b3a9f66015085 Mon Sep 17 00:00:00 2001
|
|
|
393826 |
From: Lukas Czerner <lczerner@redhat.com>
|
|
|
393826 |
Date: Tue, 14 Jan 2020 09:49:31 +0100
|
|
|
1e8c27 |
Subject: [PATCH 6/7] Revert "libext2fs: hide struct ext2fs_hashmap as an
|
|
|
393826 |
internal implementation detail"
|
|
|
393826 |
|
|
|
393826 |
This reverts commit ef54444e6d1da4b464c11e749c9643ed945a770b
|
|
|
393826 |
because it breaks ABI.
|
|
|
393826 |
|
|
|
393826 |
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
|
|
|
393826 |
---
|
|
|
393826 |
lib/ext2fs/hashmap.c | 16 ----------------
|
|
|
393826 |
lib/ext2fs/hashmap.h | 30 +++++++++++++++++++++---------
|
|
|
393826 |
2 files changed, 21 insertions(+), 25 deletions(-)
|
|
|
393826 |
|
|
|
393826 |
diff --git a/lib/ext2fs/hashmap.c b/lib/ext2fs/hashmap.c
|
|
|
393826 |
index ffe61ce9..3d8ee814 100644
|
|
|
393826 |
--- a/lib/ext2fs/hashmap.c
|
|
|
393826 |
+++ b/lib/ext2fs/hashmap.c
|
|
|
393826 |
@@ -1,22 +1,6 @@
|
|
|
393826 |
#include "hashmap.h"
|
|
|
393826 |
#include <string.h>
|
|
|
393826 |
|
|
|
393826 |
-struct ext2fs_hashmap {
|
|
|
393826 |
- uint32_t size;
|
|
|
393826 |
- uint32_t(*hash)(const void *key, size_t len);
|
|
|
393826 |
- void(*free)(void*);
|
|
|
393826 |
- struct ext2fs_hashmap_entry *first;
|
|
|
393826 |
- struct ext2fs_hashmap_entry *last;
|
|
|
393826 |
-#if __GNUC_PREREQ (4, 8)
|
|
|
393826 |
-#pragma GCC diagnostic push
|
|
|
393826 |
-#pragma GCC diagnostic ignored "-Wpedantic"
|
|
|
393826 |
-#endif
|
|
|
393826 |
- struct ext2fs_hashmap_entry *entries[0];
|
|
|
393826 |
-#if __GNUC_PREREQ (4, 8)
|
|
|
393826 |
-#pragma GCC diagnostic pop
|
|
|
393826 |
-#endif
|
|
|
393826 |
-};
|
|
|
393826 |
-
|
|
|
393826 |
uint32_t ext2fs_djb2_hash(const void *str, size_t size)
|
|
|
393826 |
{
|
|
|
393826 |
int c;
|
|
|
393826 |
diff --git a/lib/ext2fs/hashmap.h b/lib/ext2fs/hashmap.h
|
|
|
393826 |
index dcfa7455..656d3d90 100644
|
|
|
393826 |
--- a/lib/ext2fs/hashmap.h
|
|
|
393826 |
+++ b/lib/ext2fs/hashmap.h
|
|
|
393826 |
@@ -13,15 +13,27 @@
|
|
|
393826 |
#endif
|
|
|
393826 |
#endif
|
|
|
393826 |
|
|
|
393826 |
-struct ext2fs_hashmap;
|
|
|
393826 |
-
|
|
|
393826 |
-struct ext2fs_hashmap_entry {
|
|
|
393826 |
- void *data;
|
|
|
393826 |
- const void *key;
|
|
|
393826 |
- size_t key_len;
|
|
|
393826 |
- struct ext2fs_hashmap_entry *next;
|
|
|
393826 |
- struct ext2fs_hashmap_entry *list_next;
|
|
|
393826 |
- struct ext2fs_hashmap_entry *list_prev;
|
|
|
393826 |
+struct ext2fs_hashmap {
|
|
|
393826 |
+ uint32_t size;
|
|
|
393826 |
+ uint32_t(*hash)(const void *key, size_t len);
|
|
|
393826 |
+ void(*free)(void*);
|
|
|
393826 |
+ struct ext2fs_hashmap_entry *first;
|
|
|
393826 |
+ struct ext2fs_hashmap_entry *last;
|
|
|
393826 |
+ struct ext2fs_hashmap_entry {
|
|
|
393826 |
+ void *data;
|
|
|
393826 |
+ const void *key;
|
|
|
393826 |
+ size_t key_len;
|
|
|
393826 |
+ struct ext2fs_hashmap_entry *next;
|
|
|
393826 |
+ struct ext2fs_hashmap_entry *list_next;
|
|
|
393826 |
+ struct ext2fs_hashmap_entry *list_prev;
|
|
|
393826 |
+#if __GNUC_PREREQ (4, 8)
|
|
|
393826 |
+#pragma GCC diagnostic push
|
|
|
393826 |
+#pragma GCC diagnostic ignored "-Wpedantic"
|
|
|
393826 |
+#endif
|
|
|
393826 |
+ } *entries[0];
|
|
|
393826 |
+#if __GNUC_PREREQ (4, 8)
|
|
|
393826 |
+#pragma GCC diagnostic pop
|
|
|
393826 |
+#endif
|
|
|
393826 |
};
|
|
|
393826 |
|
|
|
393826 |
struct ext2fs_hashmap *ext2fs_hashmap_create(
|
|
|
393826 |
--
|
|
|
1e8c27 |
2.21.3
|
|
|
393826 |
|