FFmpeg
Functions | Variables
uuid.c File Reference
#include "uuid.h"
#include "error.h"
#include "avstring.h"

Go to the source code of this file.

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. More...
 
static int xdigit_to_int (char c)
 
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. More...
 
void av_uuid_unparse (const AVUUID uuid, char *out)
 Serializes a AVUUID into a string representation according to IETF RFC 4122. More...
 
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. More...
 

Variables

static const char hexdigits_lower [16] = "0123456789abcdef"
 

Detailed Description

UUID parsing and serialization utilities. The library treat 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.c.

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]inString representation of a UUID, e.g. 2fceebd0-7017-433d-bafb-d073a7116696
[out]uuAVUUID
Returns
A non-zero value in case of an error.

Definition at line 67 of file uuid.c.

Referenced by av_uuid_urn_parse(), and main().

◆ xdigit_to_int()

static int xdigit_to_int ( char  c)
static

Definition at line 75 of file uuid.c.

Referenced by av_uuid_parse_range().

◆ 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_startPointer to the first character of the string representation
[in]in_endPointer 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]uuAVUUID
Returns
A non-zero value in case of an error.

Definition at line 88 of file uuid.c.

Referenced by av_uuid_parse(), and main().

◆ 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]uuAVUUID
[out]outPointer to an array of no less than 37 characters.

Definition at line 117 of file uuid.c.

◆ 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]inURN UUID
[out]uuAVUUID
Returns
A non-zero value in case of an error.

Definition at line 135 of file uuid.c.

Referenced by ff_imf_xml_read_uuid(), and main().

Variable Documentation

◆ hexdigits_lower

const char hexdigits_lower[16] = "0123456789abcdef"
static

Definition at line 115 of file uuid.c.

Referenced by av_uuid_unparse().