📄 uuid.h
字号:
/* * Public include file for the UUID library * * Copyright (C) 1996, 1997, 1998 Theodore Ts'o. * * %Begin-Header% * This file may be redistributed under the terms of the GNU * Library General Public License. * %End-Header% */ #ifndef UUID_H_ECFFDD64_3A8A_471C_98AD_88A433118234_#define UUID_H_ECFFDD64_3A8A_471C_98AD_88A433118234_ 1/* UUID Variant definitions */#define UUID_VARIANT_NCS 0#define UUID_VARIANT_DCE 1#define UUID_VARIANT_MICROSOFT 2#define UUID_VARIANT_OTHER 3#if VS_TARGET_OS_MAC#pragma options align=packed#elif VS_TARGET_OS_LINUX#pragma pack (1)#elif VS_TARGET_OS_OPENBSD#pragma pack (1)#else#error undefined target OS!#endif // VS_TARGET_OS_MACstruct uuid_t { unsigned long time_low; unsigned short time_mid; unsigned short time_hi_and_version; unsigned char clock_seq_hi_and_reserved; unsigned char clock_seq_low; unsigned char node[6]; };#if VS_TARGET_OS_MAC#pragma options align=reset#elif VS_TARGET_OS_LINUX#pragma pack (0)#elif VS_TARGET_OS_OPENBSD#pragma pack ()#else#error undefined target OS!#endif // VS_TARGET_OS_MACtypedef struct uuid_t uuid_t;typedef struct uuid_t clsid_t; /* class ID; refers to a particular thing */typedef struct uuid_t iid_t; /* interface ID; refers to an interface */#ifdef __cplusplusextern "C" {#endif // __cplusplus/* clear.c */void uuid_clear(uuid_t* uu);/* compare.c */int uuid_compare(const uuid_t* uu1, const uuid_t* uu2);/* copy.c */void uuid_copy(uuid_t* dst, const uuid_t* src);/* gen_uuid.c */void uuid_generate(uuid_t* out);void uuid_generate_random(uuid_t* out);void uuid_generate_time(uuid_t* out);/* isnull.c */int uuid_is_null(const uuid_t* uu);/* parse.c */int uuid_parse(const char *in, uuid_t* uu);/* unparse.c */void uuid_unparse(const uuid_t* uu, char *out);/* uuid_time.c */time_t uuid_time(const uuid_t* uu, struct timeval *ret_tv);int uuid_type(const uuid_t* uu);int uuid_variant(const uuid_t* uu);inline int GenerateUUID(uuid_t *uuid) { uuid_generate(uuid); return 0; }// outString may be NULL, in which case result points to a static 256 char bufferconst char* GetUUIDString(uuid_t* pUUID, char* szOutString);// will use platform specific calls if possiblevoid CreatePlatformUUID(uuid_t *pUUID);#ifdef __cplusplus}#endif // __cplusplus#endif // UUID_H_ECFFDD64_3A8A_471C_98AD_88A433118234_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -