chiark / gitweb /
make: do not delete autotools generated file with distclean
[elogind.git] / extras / volume_id / lib / libvolume_id-private.h
index 3b5c083a8849d4031135a29b212bb3c8cb531763..8a5c327aeac89388424a1152db32caacfd503495 100644 (file)
@@ -3,17 +3,27 @@
  *
  * Copyright (C) 2005-2007 Kay Sievers <kay.sievers@vrfy.org>
  *
- *     This program is free software; you can redistribute it and/or modify it
- *     under the terms of the GNU General Public License as published by the
- *     Free Software Foundation version 2 of the License.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #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)
@@ -81,11 +94,9 @@ enum endian {
 
 enum volume_id_usage {
        VOLUME_ID_UNUSED,
-       VOLUME_ID_UNPROBED,
        VOLUME_ID_OTHER,
        VOLUME_ID_FILESYSTEM,
        VOLUME_ID_RAID,
-       VOLUME_ID_DISKLABEL,
        VOLUME_ID_CRYPTO,
 };
 
@@ -107,6 +118,7 @@ struct volume_id {
        uint8_t         *seekbuf;
        uint64_t        seekbuf_off;
        size_t          seekbuf_len;
+       int             force_unique_result;
 };
 
 /* utils */
@@ -143,6 +155,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);