chiark / gitweb /
scsi_id: make sure, we do not have slashes in values
[elogind.git] / extras / volume_id / lib / libvolume_id-private.h
index 2ce46502c42b4d7824f584f594b3c4432aa27659..1b4a782b6513c20022b770029140c6f5dbeee49f 100644 (file)
 #ifndef _LIBVOLUME_ID_PRIVATE_H_
 #define _LIBVOLUME_ID_PRIVATE_H_
 
-#include <stdint.h>
 #include <stddef.h>
 #include <endian.h>
+#include <stdint.h>
+#include <inttypes.h>
 #include <byteswap.h>
 #include <syslog.h>
 
 #define PACKED                         __attribute__((packed))
 #endif
 
+static inline void __attribute__ ((format(printf, 1, 2)))
+log_null(const char *format, ...) {}
+
 #define err(format, arg...)    volume_id_log_fn(LOG_ERR, __FILE__, __LINE__, format, ##arg)
 #define info(format, arg...)   volume_id_log_fn(LOG_INFO, __FILE__, __LINE__, format, ##arg)
 #ifdef DEBUG
 #define dbg(format, arg...)    volume_id_log_fn(LOG_DEBUG, __FILE__, __LINE__, format, ##arg)
 #else
-#define dbg(format, arg...)    do { } while (0)
+#define dbg(format, arg...)    log_null(format, ##arg)
 #endif
 
 #if (__BYTE_ORDER == __LITTLE_ENDIAN)
@@ -116,6 +120,7 @@ struct volume_id {
        uint8_t         *seekbuf;
        uint64_t        seekbuf_off;
        size_t          seekbuf_len;
+       int             force_unique_result;
 };
 
 /* utils */
@@ -152,6 +157,7 @@ extern int volume_id_probe_squashfs(struct volume_id *id, uint64_t off, uint64_t
 extern int volume_id_probe_netware(struct volume_id *id, uint64_t off, uint64_t size);
 extern int volume_id_probe_gfs(struct volume_id *id, uint64_t off, uint64_t size);
 extern int volume_id_probe_gfs2(struct volume_id *id, uint64_t off, uint64_t size);
+extern int volume_id_probe_btrfs(struct volume_id *id, uint64_t off, uint64_t size);
 
 /* special formats */
 extern int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off, uint64_t size);