chiark / gitweb /
volume_id: remove deprecated functions and bump major version
[elogind.git] / extras / volume_id / lib / libvolume_id.h
1 /*
2  * volume_id - reads volume label and uuid
3  *
4  * Copyright (C) 2005-2008 Kay Sievers <kay.sievers@vrfy.org>
5  *
6  *      This program is free software; you can redistribute it and/or modify it
7  *      under the terms of the GNU General Public License as published by the
8  *      Free Software Foundation version 2 of the License.
9  */
10
11 #ifndef _LIBVOLUME_ID_H_
12 #define _LIBVOLUME_ID_H_
13
14 #include <stdint.h>
15 #include <stddef.h>
16
17 struct volume_id;
18 typedef void (*volume_id_log_fn_t)(int priority, const char *file, int line, const char *format, ...)
19              __attribute__ ((format(printf, 4, 5)));
20 extern volume_id_log_fn_t volume_id_log_fn;
21
22 typedef int (*volume_id_probe_fn_t)(struct volume_id *id, uint64_t off, uint64_t size);
23 typedef int (*all_probers_fn_t)(volume_id_probe_fn_t probe_fn,
24                                 struct volume_id *id, uint64_t off, uint64_t size,
25                                 void *data);
26
27 extern struct volume_id *volume_id_open_fd(int fd);
28 extern void volume_id_close(struct volume_id *id);
29 extern int volume_id_probe_filesystem(struct volume_id *id, uint64_t off, uint64_t size);
30 extern int volume_id_probe_raid(struct volume_id *id, uint64_t off, uint64_t size);
31 extern int volume_id_probe_all(struct volume_id *id, uint64_t off, uint64_t size);
32 extern const volume_id_probe_fn_t *volume_id_get_prober_by_type(const char *type);
33 extern void volume_id_all_probers(all_probers_fn_t all_probers_fn,
34                                   struct volume_id *id, uint64_t off, uint64_t size,
35                                   void *data);
36 extern int volume_id_get_label(struct volume_id *id, const char **label);
37 extern int volume_id_get_label_raw(struct volume_id *id, const uint8_t **label, size_t *len);
38 extern int volume_id_get_uuid(struct volume_id *id, const char **uuid);
39 extern int volume_id_get_uuid_raw(struct volume_id *id, const uint8_t **uuid, size_t *len);
40 extern int volume_id_get_usage(struct volume_id *id, const char **usage);
41 extern int volume_id_get_type(struct volume_id *id, const char **type);
42 extern int volume_id_get_type_version(struct volume_id *id, const char **type_version);
43 extern int volume_id_encode_string(const char *str, char *str_enc, size_t len);
44
45 #endif