uuid.h revision 106184
11590Srgrimes/*-
21590Srgrimes * Copyright (c) 2002 Marcel Moolenaar
31590Srgrimes * Copyright (c) 2002 Hiten Mahesh Pandya
41590Srgrimes * All rights reserved.
51590Srgrimes *
61590Srgrimes * Redistribution and use in source and binary forms, with or without
71590Srgrimes * modification, are permitted provided that the following conditions
81590Srgrimes * are met:
91590Srgrimes * 1. Redistributions of source code must retain the above copyright
101590Srgrimes *    notice, this list of conditions and the following disclaimer.
111590Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
121590Srgrimes *    notice, this list of conditions and the following disclaimer in the
131590Srgrimes *    documentation and/or other materials provided with the distribution.
141590Srgrimes *
151590Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
161590Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
171590Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
181590Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
191590Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
201590Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
211590Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
221590Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
231590Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
241590Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
251590Srgrimes * SUCH DAMAGE.
261590Srgrimes *
271590Srgrimes * $FreeBSD: head/include/uuid.h 106184 2002-10-30 03:51:00Z marcel $
281590Srgrimes */
291590Srgrimes
301590Srgrimes#ifndef _UUID_H_
311590Srgrimes#define	_UUID_H_
3250477Speter
331590Srgrimes#include <sys/types.h>
34231586Sglebius#include <sys/uuid.h>
351590Srgrimes
361590Srgrimes/*
371590Srgrimes * This implementation mostly conforms to the DCE 1.1 specification.
381590Srgrimes * See Also:
391590Srgrimes *	uuidgen(1), uuidgen(2), uuid(3)
401590Srgrimes */
4168963Sru
421590Srgrimes/* Status codes returned by the functions. */
43146466Sru#define	uuid_s_ok			0
441590Srgrimes#define	uuid_s_bad_version		1
4595124Scharnier#define	uuid_s_invalid_string_uuid	2
4695124Scharnier#define	uuid_s_no_memory		3
4795124Scharnier
481590Srgrimesint32_t	uuid_compare(uuid_t *, uuid_t *, uint32_t *);
491590Srgrimesvoid	uuid_create(uuid_t *, uint32_t *);
501590Srgrimesvoid	uuid_create_nil(uuid_t *, uint32_t *);
5128794Scharnierint32_t	uuid_equal(uuid_t *, uuid_t *, uint32_t *);
521590Srgrimesvoid	uuid_from_string(const char *, uuid_t *, uint32_t *);
531590Srgrimesuint16_t uuid_hash(uuid_t *, uint32_t *);
541590Srgrimesint32_t	uuid_is_nil(uuid_t *, uint32_t *);
551590Srgrimesvoid	uuid_to_string(uuid_t *, char **, uint32_t *);
561590Srgrimes
571590Srgrimes#endif	/* _UUID_H_ */
581590Srgrimes