Loading...
Searching...
No Matches
uuid.h File Reference

UUID parsing and serialization utilities. More...

`#include <stdint.h>`
`#include <string.h>`

Go to the source code of this file.

## Macros

#define | AV_PRI_UUID
#define | AV_PRI_URN_UUID
#define | AV_UUID_ARG(x)
#define | AV_UUID_LEN 16

## Typedefs

typedef uint8_t | AVUUID[AV_UUID_LEN]

## Functions

int | av_uuid_parse (const char *in, AVUUID uu)
| Parses a string representation of a UUID formatted according to IETF RFC 4122 into an AVUUID.
int | av_uuid_urn_parse (const char *in, AVUUID uu)
| Parses a URN representation of a UUID, as specified at IETF RFC 4122, into an AVUUID.
int | av_uuid_parse_range (const char *in_start, const char *in_end, AVUUID uu)
| Parses a string representation of a UUID formatted according to IETF RFC 4122 into an AVUUID.
void | av_uuid_unparse (const AVUUID uu, char *out)
| Serializes a AVUUID into a string representation according to IETF RFC 4122.
static int | av_uuid_equal (const AVUUID uu1, const AVUUID uu2)
| Compares two UUIDs for equality.
static void | av_uuid_copy (AVUUID dest, const AVUUID src)
| Copies the bytes of src into dest.
static void | av_uuid_nil (AVUUID uu)
| Sets a UUID to the nil UUID, i.e.

## Detailed Description

UUID parsing and serialization utilities.

The library treats the UUID as an opaque sequence of 16 unsigned bytes, i.e. ignoring the internal layout of the UUID, which depends on the type of the UUID.

Author
  Pierre-Anthony Lemieux pal@p.nosp@m.alem.nosp@m.ieux..nosp@m.com
  Zane van Iperen zane@.nosp@m.zane.nosp@m.vanip.nosp@m.eren.nosp@m..com

Definition in file uuid.h.

## Macro Definition Documentation

## AV_PRI_UUID

#define AV_PRI_UUID

Value:
"%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-" \
"%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"

Definition at line 39 of file uuid.h.

## AV_PRI_URN_UUID

#define AV_PRI_URN_UUID

Value:
"urn:uuid:%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-" \
"%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"

Definition at line 43 of file uuid.h.

## AV_UUID_ARG

#define AV_UUID_ARG | ( |  | x | ) |

Value:
(x)[ 0], (x)[ 1], (x)[ 2], (x)[ 3], \
(x)[ 4], (x)[ 5], (x)[ 6], (x)[ 7], \
(x)[ 8], (x)[ 9], (x)[10], (x)[11], \
(x)[12], (x)[13], (x)[14], (x)[15]

Definition at line 51 of file uuid.h.

## AV_UUID_LEN

#define AV_UUID_LEN 16

Definition at line 57 of file uuid.h.

## Typedef Documentation

## AVUUID

typedef uint8_t AVUUID[AV_UUID_LEN]

Definition at line 60 of file uuid.h.

## Function Documentation

## av_uuid_parse()

int av_uuid_parse | ( | const char * | in,
|  | AVUUID | uu
| ) |  |

Parses a string representation of a UUID formatted according to IETF RFC 4122 into an AVUUID.

The parsing is case-insensitive. The string must be 37 characters long, including the terminating NUL character.

Example string representation: "2fceebd0-7017-433d-bafb-d073a7116696"

Parameters

  [in] | in | String representation of a UUID, e.g. 2fceebd0-7017-433d-bafb-d073a7116696
  [out] | uu | AVUUID

Returns
  A non-zero value in case of an error.

## av_uuid_urn_parse()

int av_uuid_urn_parse | ( | const char * | in,
|  | AVUUID | uu
| ) |  |

Parses a URN representation of a UUID, as specified at IETF RFC 4122, into an AVUUID.

The parsing is case-insensitive. The string must be 46 characters long, including the terminating NUL character.

Example string representation: "urn:uuid:2fceebd0-7017-433d-bafb-d073a7116696"

Parameters

  [in] | in | URN UUID
  [out] | uu | AVUUID

Returns
  A non-zero value in case of an error.

## av_uuid_parse_range()

int av_uuid_parse_range | ( | const char * | in_start,
|  | const char * | in_end,
|  | AVUUID | uu
| ) |  |

Parses a string representation of a UUID formatted according to IETF RFC 4122 into an AVUUID.

The parsing is case-insensitive.

Parameters

  [in] | in_start | Pointer to the first character of the string representation
  [in] | in_end | Pointer to the character after the last character of the string representation. That memory location is never accessed. It is an error if `in_end - in_start != 36`.
  [out] | uu | AVUUID

Returns
  A non-zero value in case of an error.

## av_uuid_unparse()

void av_uuid_unparse | ( | const AVUUID | uu,
|  | char * | out
| ) |  |

Serializes a AVUUID into a string representation according to IETF RFC 4122.

The string is lowercase and always 37 characters long, including the terminating NUL character.

Parameters

  [in] | uu | AVUUID
  [out] | out | Pointer to an array of no less than 37 characters.

## av_uuid_equal()

static int av_uuid_equal | ( | const AVUUID | uu1,
|  | const AVUUID | uu2
| ) |  |

inline static

Compares two UUIDs for equality.

Parameters

  [in] | uu1 | AVUUID
  [in] | uu2 | AVUUID

Returns
  Nonzero if uu1 and uu2 are identical, 0 otherwise

Definition at line 119 of file uuid.h.

## av_uuid_copy()

static void av_uuid_copy | ( | AVUUID | dest,
|  | const AVUUID | src
| ) |  |

inline static

Copies the bytes of src into dest.

Parameters

  [out] | dest | AVUUID
  [in] | src | AVUUID

Definition at line 130 of file uuid.h.

## av_uuid_nil()

static void av_uuid_nil | ( | AVUUID | uu | ) |

inline static

Sets a UUID to the nil UUID, i.e.

a UUID with have all its 128 bits set to zero.

Parameters

  [in,out] | uu | UUID to be set to the nil UUID

Definition at line 141 of file uuid.h.