// uuid.h :
//

#if !defined(AGD_UUID_H__E2CBFDC3_1EA5_4220_8D44_D0C26219B529__INCLUDED_)
#define AGD_UUID_H__E2CBFDC3_1EA5_4220_8D44_D0C26219B529__INCLUDED_

#include <inttypes.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
#endif	//	__cplusplus

/////////////////////////////////////////////////////////////////////////////
// uuid.h - Declarations:

#ifdef __linux__
typedef struct _UUID
{
    uint32_t Data1;
    uint16_t Data2;
    uint16_t Data3;
    uint8_t  Data4[8];
}UUID;
#define uuid_t UUID
#endif	//	__linux__

#define DEFINE_UUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
											const uuid_t name = {l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}

#define _UUID_STRING_LEN					36

/////////////////////////////////////////////////////////////////////////////

extern const uuid_t UUID_NULL;

/////////////////////////////////////////////////////////////////////////////

int		_uuid_parse		(const char *pszIn, uuid_t *uuid);
int		_uuid_unparse	(const uuid_t *uuid, char *pszOut, size_t nCChOut);
int		_uuid_compare	(const uuid_t *uuid1, const uuid_t *uuid2);
void	_uuid_copy		(uuid_t *uuDest, const uuid_t *uuSrc);
int		_uuid_is_null	(const uuid_t *uuid);

/////////////////////////////////////////////////////////////////////////////
#ifdef __cplusplus
}
#endif	//	__cplusplus
#endif	//	!defined(AGD_UUID_H__E2CBFDC3_1EA5_4220_8D44_D0C26219B529__INCLUDED_)
