1106184Smarcel/*-
2139601Smarcel * Copyright (c) 2002,2005 Marcel Moolenaar
3106184Smarcel * Copyright (c) 2002 Hiten Mahesh Pandya
4106184Smarcel * All rights reserved.
5106184Smarcel *
6106184Smarcel * Redistribution and use in source and binary forms, with or without
7106184Smarcel * modification, are permitted provided that the following conditions
8106184Smarcel * are met:
9106184Smarcel * 1. Redistributions of source code must retain the above copyright
10106184Smarcel *    notice, this list of conditions and the following disclaimer.
11106184Smarcel * 2. Redistributions in binary form must reproduce the above copyright
12106184Smarcel *    notice, this list of conditions and the following disclaimer in the
13106184Smarcel *    documentation and/or other materials provided with the distribution.
14106184Smarcel *
15106184Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16106184Smarcel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17106184Smarcel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18106184Smarcel * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19106184Smarcel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20106184Smarcel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21106184Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22106184Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23106184Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24106184Smarcel * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25106184Smarcel * SUCH DAMAGE.
26106184Smarcel *
27106184Smarcel * $FreeBSD$
28106184Smarcel */
29106184Smarcel
30106184Smarcel#ifndef _UUID_H_
31106184Smarcel#define	_UUID_H_
32106184Smarcel
33106184Smarcel#include <sys/types.h>
34106184Smarcel#include <sys/uuid.h>
35106184Smarcel
36106184Smarcel/*
37106184Smarcel * This implementation mostly conforms to the DCE 1.1 specification.
38106184Smarcel * See Also:
39106184Smarcel *	uuidgen(1), uuidgen(2), uuid(3)
40106184Smarcel */
41106184Smarcel
42106184Smarcel/* Status codes returned by the functions. */
43106184Smarcel#define	uuid_s_ok			0
44106184Smarcel#define	uuid_s_bad_version		1
45106184Smarcel#define	uuid_s_invalid_string_uuid	2
46106184Smarcel#define	uuid_s_no_memory		3
47106184Smarcel
48106452Sjmallett__BEGIN_DECLS
49139601Smarcelint32_t	uuid_compare(const uuid_t *, const uuid_t *, uint32_t *);
50106184Smarcelvoid	uuid_create(uuid_t *, uint32_t *);
51106184Smarcelvoid	uuid_create_nil(uuid_t *, uint32_t *);
52139601Smarcelint32_t	uuid_equal(const uuid_t *, const uuid_t *, uint32_t *);
53106184Smarcelvoid	uuid_from_string(const char *, uuid_t *, uint32_t *);
54139601Smarceluint16_t uuid_hash(const uuid_t *, uint32_t *);
55139601Smarcelint32_t	uuid_is_nil(const uuid_t *, uint32_t *);
56139601Smarcelvoid	uuid_to_string(const uuid_t *, char **, uint32_t *);
57183057Semaxvoid	uuid_enc_le(void *, const uuid_t *);
58183057Semaxvoid	uuid_dec_le(const void *, uuid_t *);
59183057Semaxvoid	uuid_enc_be(void *, const uuid_t *);
60183057Semaxvoid	uuid_dec_be(const void *, uuid_t *);
61106452Sjmallett__END_DECLS
62106184Smarcel
63106184Smarcel#endif	/* _UUID_H_ */
64