UUID(3)
okay bestie, this is the UUID(3) page from the Library Functions Manual, and we're doing DCE 1.1 compliant UUID functions today. it's giving universal unique identifiers, C library realness, and honestly? iconic. π
π NAME π
uuid_compare, uuid_create, uuid_create_nil, uuid_equal, uuid_from_string, uuid_hash, uuid_is_nil, uuid_to_string β DCE 1.1 compliant UUID functions. periodt. π
π LIBRARY π
Standard C Library (libc, -lc). yes bestie, that's the link line.
β¨ SYNOPSIS β¨
ok so here's the whole cast in C form, no cap:
#include <uuid.h>
int32_t
uuid_compare(const uuid_t *uuid1, const uuid_t *uuid2,
uint32_t *status);
void
uuid_create(uuid_t *uuid, uint32_t *status);
void
uuid_create_nil(uuid_t *uuid, uint32_t *status);
int32_t
uuid_equal(const uuid_t *uuid1, const uuid_t *uuid2, uint32_t *status);
void
uuid_from_string(const char *str, uuid_t *uuid, uint32_t *status);
uint16_t
uuid_hash(const uuid_t *uuid, uint32_t *status);
int32_t
uuid_is_nil(const uuid_t *uuid, uint32_t *status);
void
uuid_to_string(const uuid_t *uuid, char **str, uint32_t *status);
void
uuid_enc_le(void *buf, const uuid_t *uuid);
void
uuid_dec_le(const void *buf, uuid_t *);
void
uuid_enc_be(void *buf, const uuid_t *uuid);
void
uuid_dec_be(const void *buf, uuid_t *);
π DESCRIPTION π
okay so the DCE 1.1 compliant UUID functions are a whole family that lets applications operate on universally unique identifiers, aka UUIDs. uuid_create() and uuid_create_nil() create UUIDs. Need to convert from the binary representation to the string representation, or vice versa? use uuid_to_string() or uuid_from_string() respectively. easy. π¦
about uuid_to_string(): it sets *str to be a pointer to a buffer sufficiently large to hold the string. that pointer should be passed to free(3) to release the allocated storage when it is no longer needed. do not ghost that cleanup, bestie. π«Ά
uuid_enc_le() and uuid_enc_be() encode a binary representation of a UUID into an octet stream in little-endian and big-endian byte-order, respectively. the destination buffer must be pre-allocated by the caller, and must be large enough to hold the 16-octet binary UUID. these routines are not part of the DCE RPC API. they are provided for convenience. love that for them. β¨
uuid_dec_le() and uuid_dec_be() decode a UUID from an octet stream in little-endian and big-endian byte-order, respectively. these routines are not part of the DCE RPC API. they are provided for convenience. same energy, same convenience. πΈ
uuid_compare() and uuid_equal() compare two UUIDs for equality. UUIDs are equal if pointers a and b are equal or both NULL, or if the structures a and b point to are equal. uuid_compare() returns 0 if the UUIDs are equal, -1 if a is less than b, and 1 if a is greater than b. uuid_equal() returns 1 if the UUIDs are equal, 0 if they are not equal. no cap. π₯
uuid_is_nil() compares a UUID to NULL. the function returns 1 if u is NULL or if the UUID consists of all zeros, and zero otherwise. π«‘
uuid_hash() returns a 16-bit hash value for the specified UUID. iconic little hash. β
π RETURN VALUES π
the successful or unsuccessful completion of the function is returned in the status argument. possible values are:
uuid_s_okβ the function completed successfully.uuid_s_bad_versionβ the UUID does not have a known version.uuid_s_invalid_string_uuidβ the string representation of an UUID is not valid.uuid_s_no_memoryβ the function can not allocate memory to store an UUID representation.
uuid_compare(), uuid_equal(), uuid_is_nil(), and uuid_hash() always set status to uuid_s_ok. no stress. π
π SEE ALSO π
uuidgen(1), uuidgen(2). go sip. π
π STANDARDS π
the UUID functions conform to the DCE 1.1 RPC specification. standards queen. π
π BUGS π
This manpage can be improved. not me, the manpage said it π but also yes, self-awareness is main character energy. π
Debian Β· November 19, 2021 β that's the footer's source/version and date, bestie. mwah π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 2002 Marcel Moolenaar
- Copyright (c) 2002 Hiten Mahesh Pandya
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms