diff options
-rw-r--r-- | libmpdemux/url.c | 28 | ||||
-rw-r--r-- | libmpdemux/url.h | 8 |
2 files changed, 35 insertions, 1 deletions
diff --git a/libmpdemux/url.c b/libmpdemux/url.c index b73a51fe44..5a13513076 100644 --- a/libmpdemux/url.c +++ b/libmpdemux/url.c @@ -192,3 +192,31 @@ url_escape_string(char *outbuf, char *inbuf) { } while (c != '\0'); } +#ifdef __URL_DEBUG +void +url_debug(URL_t *url) { + if( url==NULL ) { + printf("URL pointer NULL\n"); + return; + } + if( url->url!=NULL ) { + printf("url=%s\n", url->url ); + } + if( url->protocol!=NULL ) { + printf("protocol=%s\n", url->protocol ); + } + if( url->hostname!=NULL ) { + printf("hostname=%s\n", url->hostname ); + } + printf("port=%d\n", url->port ); + if( url->file!=NULL ) { + printf("file=%s\n", url->file ); + } + if( url->username!=NULL ) { + printf("username=%s\n", url->username ); + } + if( url->password!=NULL ) { + printf("password=%s\n", url->password ); + } +} +#endif //__URL_DEBUG diff --git a/libmpdemux/url.h b/libmpdemux/url.h index a7a9e1f545..6679d97501 100644 --- a/libmpdemux/url.h +++ b/libmpdemux/url.h @@ -7,6 +7,8 @@ #ifndef __URL_H #define __URL_H +//#define __URL_DEBUG + typedef struct { char *url; char *protocol; @@ -24,4 +26,8 @@ void url_free(URL_t* url); void url_unescape_string(char *outbuf, char *inbuf); void url_escape_string(char *outbuf, char *inbuf); -#endif +#ifndef __URL_DEBUG +void url_debug(URL_t* url); +#endif // __URL_DEBUG + +#endif // __URL_H |