123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- // 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
- #else // __linux__
- #ifdef _MSC_VER
- #include <guiddef.h>
- #ifndef uuid_t
- #define uuid_t GUID
- #endif // uuid_t
- #endif // _MSC_VER
- #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 DECLARE_UUID(v) extern const uuid_t v
- #define _UUID_STRING_LEN 36
- /////////////////////////////////////////////////////////////////////////////
- DECLARE_UUID(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_)
|