mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-02 01:04:33 +03:00
nsurl: Tidy up component helper macros.
This commit is contained in:
parent
2acd90e28a
commit
91a7fffd56
@ -50,8 +50,13 @@
|
||||
#undef NSURL_DEBUG
|
||||
|
||||
|
||||
#define nsurl__component_copy(c) (c == NULL) ? NULL : lwc_string_ref(c)
|
||||
|
||||
/**
|
||||
* Compare two component values.
|
||||
*
|
||||
* Sets match to false if the components are not the same.
|
||||
* Does nothing if the components are the same, so ensure match is
|
||||
* preset to true.
|
||||
*/
|
||||
#define nsurl__component_compare(c1, c2, match) \
|
||||
if (c1 && c2 && lwc_error_ok == \
|
||||
lwc_string_isequal(c1, c2, match)) { \
|
||||
|
@ -81,16 +81,6 @@ enum url_sections {
|
||||
};
|
||||
|
||||
|
||||
#define nsurl__component_copy(c) (c == NULL) ? NULL : lwc_string_ref(c)
|
||||
|
||||
#define nsurl__component_compare(c1, c2, match) \
|
||||
if (c1 && c2 && lwc_error_ok == \
|
||||
lwc_string_isequal(c1, c2, match)) { \
|
||||
/* do nothing */ \
|
||||
} else if (c1 || c2) { \
|
||||
*match = false; \
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a hex digit for the given numerical value.
|
||||
*
|
||||
|
@ -107,6 +107,11 @@ enum nsurl_string_flags {
|
||||
NSURL_F_FRAGMENT = (1 << 11)
|
||||
};
|
||||
|
||||
/**
|
||||
* NULL-safe lwc_string_ref
|
||||
*/
|
||||
#define nsurl__component_copy(c) (c == NULL) ? NULL : lwc_string_ref(c)
|
||||
|
||||
|
||||
/**
|
||||
* Convert a set of nsurl components to a single string
|
||||
|
Loading…
Reference in New Issue
Block a user