diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2017-01-22 16:03:10 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2017-02-08 17:27:13 +0000 |
commit | 5c8f4c9c8c98c0af71dfb2e41d8947a6edf09f47 (patch) | |
tree | e2dbcafd7179f2db0b157cbd041df723de32b808 /utils/nsurl | |
parent | 91a7fffd5637574aea7a1b52308968a99dee888c (diff) | |
download | netsurf-5c8f4c9c8c98c0af71dfb2e41d8947a6edf09f47.tar.gz netsurf-5c8f4c9c8c98c0af71dfb2e41d8947a6edf09f47.tar.bz2 |
nsurl: Rationalise debug build option.
Diffstat (limited to 'utils/nsurl')
-rw-r--r-- | utils/nsurl/nsurl.c | 36 | ||||
-rw-r--r-- | utils/nsurl/parse.c | 37 | ||||
-rw-r--r-- | utils/nsurl/private.h | 42 |
3 files changed, 42 insertions, 73 deletions
diff --git a/utils/nsurl/nsurl.c b/utils/nsurl/nsurl.c index 137a5acef..68188fbdb 100644 --- a/utils/nsurl/nsurl.c +++ b/utils/nsurl/nsurl.c @@ -46,9 +46,6 @@ #include "utils/nsurl.h" #include "utils/utils.h" -/* Define to enable NSURL debugging */ -#undef NSURL_DEBUG - /** * Compare two component values. @@ -99,39 +96,6 @@ static void nsurl_destroy_components(struct nsurl_components *c) } -#ifdef NSURL_DEBUG -/** - * Dump a NetSurf URL's internal components - * - * \param url The NetSurf URL to dump components of - */ -static void nsurl__dump(const nsurl *url) -{ - if (url->components.scheme) - LOG(" Scheme: %s", lwc_string_data(url->components.scheme)); - - if (url->components.username) - LOG("Username: %s", lwc_string_data(url->components.username)); - - if (url->components.password) - LOG("Password: %s", lwc_string_data(url->components.password)); - - if (url->components.host) - LOG(" Host: %s", lwc_string_data(url->components.host)); - - if (url->components.port) - LOG(" Port: %s", lwc_string_data(url->components.port)); - - if (url->components.path) - LOG(" Path: %s", lwc_string_data(url->components.path)); - - if (url->components.query) - LOG(" Query: %s", lwc_string_data(url->components.query)); - - if (url->components.fragment) - LOG("Fragment: %s", lwc_string_data(url->components.fragment)); -} -#endif /****************************************************************************** * NetSurf URL Public API * diff --git a/utils/nsurl/parse.c b/utils/nsurl/parse.c index 2d74ea92c..6ec02fc1e 100644 --- a/utils/nsurl/parse.c +++ b/utils/nsurl/parse.c @@ -46,9 +46,6 @@ #include "utils/nsurl/private.h" #include "utils/utils.h" -/* Define to enable NSURL debugging */ -#undef NSURL_DEBUG - /** Marker set, indicating positions of sections within a URL string */ struct url_markers { @@ -1275,40 +1272,6 @@ static void nsurl_destroy_components(struct nsurl_components *c) } -#ifdef NSURL_DEBUG -/** - * Dump a NetSurf URL's internal components - * - * \param url The NetSurf URL to dump components of - */ -static void nsurl__dump(const nsurl *url) -{ - if (url->components.scheme) - LOG(" Scheme: %s", lwc_string_data(url->components.scheme)); - - if (url->components.username) - LOG("Username: %s", lwc_string_data(url->components.username)); - - if (url->components.password) - LOG("Password: %s", lwc_string_data(url->components.password)); - - if (url->components.host) - LOG(" Host: %s", lwc_string_data(url->components.host)); - - if (url->components.port) - LOG(" Port: %s", lwc_string_data(url->components.port)); - - if (url->components.path) - LOG(" Path: %s", lwc_string_data(url->components.path)); - - if (url->components.query) - LOG(" Query: %s", lwc_string_data(url->components.query)); - - if (url->components.fragment) - LOG("Fragment: %s", lwc_string_data(url->components.fragment)); -} -#endif - /****************************************************************************** * NetSurf URL Public API * ******************************************************************************/ diff --git a/utils/nsurl/private.h b/utils/nsurl/private.h index a5291af21..67945e2e7 100644 --- a/utils/nsurl/private.h +++ b/utils/nsurl/private.h @@ -24,6 +24,11 @@ #include "utils/nsurl.h" #include "utils/utils.h" + +/* Define to enable NSURL debugging */ +#undef NSURL_DEBUG + + /** A type for URL schemes */ enum nsurl_scheme_type { NSURL_SCHEME_OTHER, @@ -135,4 +140,41 @@ nserror nsurl__string( */ void nsurl__calc_hash(nsurl *url); + + +#ifdef NSURL_DEBUG +/** + * Dump a NetSurf URL's internal components + * + * \param url The NetSurf URL to dump components of + */ +static inline void nsurl__dump(const nsurl *url) +{ + if (url->components.scheme) + LOG(" Scheme: %s", lwc_string_data(url->components.scheme)); + + if (url->components.username) + LOG("Username: %s", lwc_string_data(url->components.username)); + + if (url->components.password) + LOG("Password: %s", lwc_string_data(url->components.password)); + + if (url->components.host) + LOG(" Host: %s", lwc_string_data(url->components.host)); + + if (url->components.port) + LOG(" Port: %s", lwc_string_data(url->components.port)); + + if (url->components.path) + LOG(" Path: %s", lwc_string_data(url->components.path)); + + if (url->components.query) + LOG(" Query: %s", lwc_string_data(url->components.query)); + + if (url->components.fragment) + LOG("Fragment: %s", lwc_string_data(url->components.fragment)); +} +#endif + + #endif |