diff options
Diffstat (limited to 'src/include/ipxe/uri.h')
| -rw-r--r-- | src/include/ipxe/uri.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/include/ipxe/uri.h b/src/include/ipxe/uri.h index b7b8b4417..9a134690f 100644 --- a/src/include/ipxe/uri.h +++ b/src/include/ipxe/uri.h @@ -109,17 +109,27 @@ enum { * Note that this is a separate concept from a URI with an absolute * path. */ -static inline int uri_is_absolute ( struct uri *uri ) { +static inline int uri_is_absolute ( const struct uri *uri ) { return ( uri->scheme != NULL ); } /** + * URI has an opaque part + * + * @v uri URI + * @ret has_opaque URI has an opaque part + */ +static inline int uri_has_opaque ( const struct uri *uri ) { + return ( uri->opaque && ( uri->opaque[0] != '\0' ) ); + +} +/** * URI has a path * * @v uri URI * @ret has_path URI has a path */ -static inline int uri_has_path ( struct uri *uri ) { +static inline int uri_has_path ( const struct uri *uri ) { return ( uri->path && ( uri->path[0] != '\0' ) ); } @@ -133,7 +143,7 @@ static inline int uri_has_path ( struct uri *uri ) { * concept from an absolute URI. Note also that a URI may not have a * path at all. */ -static inline int uri_has_absolute_path ( struct uri *uri ) { +static inline int uri_has_absolute_path ( const struct uri *uri ) { return ( uri->path && ( uri->path[0] == '/' ) ); } @@ -147,7 +157,7 @@ static inline int uri_has_absolute_path ( struct uri *uri ) { * this is a separate concept from a relative URI. Note also that a * URI may not have a path at all. */ -static inline int uri_has_relative_path ( struct uri *uri ) { +static inline int uri_has_relative_path ( const struct uri *uri ) { return ( uri->path && ( uri->path[0] != '/' ) ); } |
