- E_( MMSHClose )( p_input );
- }
-}
-
-/****************************************************************************
- * parse hostname:port/path@username:password
- * FIXME ipv6 ip will be baddly parsed (contain ':' )
- ****************************************************************************/
-url_t *E_( url_new ) ( char * psz_url )
-{
- url_t *p_url = malloc( sizeof( url_t ) );
-
- char *psz_dup = strdup( psz_url );
- char *psz_parser = psz_dup;
-
- char *psz_tmp;
-
- /* 1: get hostname:port */
- while( *psz_parser == '/' )
- {
- psz_parser++;
- }
-
- psz_tmp = psz_parser;
-
- while( *psz_parser &&
- *psz_parser != ':' && *psz_parser != '/' && *psz_parser != '@' )
- {
- psz_parser++;
- }
-
- p_url->psz_host = strndup( psz_tmp, psz_parser - psz_tmp );
-
- if( *psz_parser == ':' )
- {
- psz_parser++;
- psz_tmp = psz_parser;
-
- while( *psz_parser && *psz_parser != '/' && *psz_parser != '@' )
- {
- psz_parser++;
- }
- p_url->i_port = atoi( psz_tmp );
- }
- else
- {
- p_url->i_port = 0;
- }
-
- /* 2: get path */
- if( *psz_parser == '/' )
- {
- //psz_parser++;
-
- psz_tmp = psz_parser;
-
- while( *psz_parser && *psz_parser != '@' )
- {
- psz_parser++;
- }
-
- p_url->psz_path = strndup( psz_tmp, psz_parser - psz_tmp );
- }
- else
- {
- p_url->psz_path = strdup( "" );