summaryrefslogtreecommitdiff
path: root/gl/lib/dev-map.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/lib/dev-map.h')
-rw-r--r--gl/lib/dev-map.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/gl/lib/dev-map.h b/gl/lib/dev-map.h
new file mode 100644
index 000000000..f093d908f
--- /dev/null
+++ b/gl/lib/dev-map.h
@@ -0,0 +1,23 @@
+#include <stddef.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include "hash.h"
+
+struct dev_map
+{
+ /* KEY,VAL pair, where KEY is the raw st_dev value
+ and VAL is the small number that maps to. */
+ struct hash_table *dev_map;
+ size_t n_device;
+};
+
+#undef _ATTRIBUTE_NONNULL_
+#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || 3 < __GNUC__
+# define _ATTRIBUTE_NONNULL_(m) __attribute__ ((__nonnull__ (m)))
+#else
+# define _ATTRIBUTE_NONNULL_(m)
+#endif
+
+int dev_map_init (struct dev_map *) _ATTRIBUTE_NONNULL_ (1);
+void dev_map_free (struct dev_map *) _ATTRIBUTE_NONNULL_ (1);
+int dev_map_insert (struct dev_map *, dev_t) _ATTRIBUTE_NONNULL_ (1);