Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / include / uuid.h
blob92436dcdeb5984b39101b7206a0b2e158593992f
1 /* $NetBSD$ */
3 /*
4 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
5 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
7 * This file is part of LVM2.
9 * This copyrighted material is made available to anyone wishing to use,
10 * modify, copy, or redistribute it subject to the terms and conditions
11 * of the GNU Lesser General Public License v.2.1.
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 #ifndef _LVM_UUID_H
19 #define _LVM_UUID_H
21 #define ID_LEN 32
22 #define ID_LEN_S "32"
24 struct id {
25 int8_t uuid[ID_LEN];
29 * Unique logical volume identifier
30 * With format1 this is VG uuid + LV uuid + '\0' + padding
32 union lvid {
33 struct id id[2];
34 char s[2 * sizeof(struct id) + 1 + 7];
37 int lvid_from_lvnum(union lvid *lvid, struct id *vgid, uint32_t lv_num);
38 int lvnum_from_lvid(union lvid *lvid);
39 int lvid_in_restricted_range(union lvid *lvid);
41 void uuid_from_num(char *uuid, uint32_t num);
43 int lvid_create(union lvid *lvid, struct id *vgid);
44 int id_create(struct id *id);
45 int id_valid(struct id *id);
46 int id_equal(const struct id *lhs, const struct id *rhs);
49 * Fills 'buffer' with a more human readable form
50 * of the uuid.
52 int id_write_format(const struct id *id, char *buffer, size_t size);
55 * Reads a formatted uuid.
57 int id_read_format(struct id *id, const char *buffer);
59 #endif