iPXE
datauri.h
Go to the documentation of this file.
1#ifndef _IPXE_DATAURI_H
2#define _IPXE_DATAURI_H
3
4/** @file
5 *
6 * Data URIs
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <string.h>
15#include <ipxe/uri.h>
16
17/**
18 * Get maximum length of parsed data URI
19 *
20 * @v uri Data URI
21 * @ret max_len Maximum length
22 */
23static inline size_t datauri_max_len ( struct uri *uri ) {
24
25 /* Neither URI decoding nor base64 decoding can ever expand data */
26 return ( uri->opaque ? strlen ( uri->opaque ) : 0 );
27}
28
29extern int datauri_parse ( struct uri *uri, void *buf );
30
31#endif /* _IPXE_DATAURI_H */
static size_t datauri_max_len(struct uri *uri)
Get maximum length of parsed data URI.
Definition datauri.h:23
int datauri_parse(struct uri *uri, void *buf)
Parse data URI.
Definition datauri.c:62
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
String functions.
size_t strlen(const char *src)
Get length of string.
Definition string.c:244
A Uniform Resource Identifier.
Definition uri.h:65
const char * opaque
Opaque part.
Definition uri.h:71
Uniform Resource Identifiers.