]> git.sesse.net Git - vlc/commitdiff
Remove unused unescape_URI() and unescape_URI_duplicate()
authorRafaël Carré <rafael.carre@gmail.com>
Wed, 27 May 2009 17:22:28 +0000 (19:22 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 29 May 2009 22:32:42 +0000 (00:32 +0200)
(cherry picked from commit b5687139f9ac84a7bdf03d9a9612950c43fe6ec2)

include/vlc_url.h
src/libvlccore.sym
src/text/strings.c

index 448c685435182eee1e5e59ffca78a5712afc9eff..e5b29eba2364921cd6491800d40fea7115431a46 100644 (file)
@@ -45,8 +45,6 @@ struct vlc_url_t
     char *psz_buffer; /* to be freed */
 };
 
-VLC_EXPORT( char *, unescape_URI_duplicate, ( const char *psz ) );
-VLC_EXPORT( void, unescape_URI, ( char *psz ) );
 VLC_EXPORT( char *, decode_URI_duplicate, ( const char *psz ) );
 VLC_EXPORT( char *, decode_URI, ( char *psz ) );
 VLC_EXPORT( char *, encode_URI_component, ( const char *psz ) );
index 0b0f405ea350cab89142b449dd4cfd20486faacc..69eddaca0453f78891747a5af3af4e37b352ce66 100644 (file)
@@ -382,8 +382,6 @@ tls_ClientCreate
 tls_ClientDelete
 ToLocale
 ToLocaleDup
-unescape_URI
-unescape_URI_duplicate
 update_Check
 update_Delete
 update_Download
index 9c6d9315e107c8912cd06ce99bbb701d9319313d..736bb872592cc1877e6d90f39a669fdf9c39ade0 100644 (file)
 #include <vlc_url.h>
 #include <vlc_charset.h>
 
-/**
- * Unescape URI encoded string
- * \return decoded duplicated string
- */
-char *unescape_URI_duplicate( const char *psz )
-{
-    char *psz_dup = strdup( psz );
-    unescape_URI( psz_dup );
-    return psz_dup;
-}
-
-/**
- * Unescape URI encoded string in place
- * \return nothing
- */
-void unescape_URI( char *psz )
-{
-    unsigned char *in = (unsigned char *)psz, *out = in, c;
-    if( psz == NULL )
-        return;
-
-    while( ( c = *in++ ) != '\0' )
-    {
-        switch( c )
-        {
-            case '%':
-            {
-                char val[5], *pval = val;
-                unsigned long cp;
-
-                switch( c = *in++ )
-                {
-                    case '\0':
-                        return;
-
-                    case 'u':
-                    case 'U':
-                        if( ( *pval++ = *in++ ) == '\0' )
-                            return;
-                        if( ( *pval++ = *in++ ) == '\0' )
-                            return;
-                        c = *in++;
-
-                    default:
-                        *pval++ = c;
-                        if( ( *pval++ = *in++ ) == '\0' )
-                            return;
-                        *pval = '\0';
-                }
-
-                cp = strtoul( val, NULL, 0x10 );
-                if( cp < 0x80 )
-                    *out++ = cp;
-                else
-                if( cp < 0x800 )
-                {
-                    *out++ = (( cp >>  6)         | 0xc0);
-                    *out++ = (( cp        & 0x3f) | 0x80);
-                }
-                else
-                {
-                    assert( cp < 0x10000 );
-                    *out++ = (( cp >> 12)         | 0xe0);
-                    *out++ = (((cp >>  6) & 0x3f) | 0x80);
-                    *out++ = (( cp        & 0x3f) | 0x80);
-                }
-                break;
-            }
-
-            /* + is not a special case - it means plus, not space. */
-
-            default:
-                /* Inserting non-ASCII or non-printable characters is unsafe,
-                 * and no sane browser will send these unencoded */
-                if( ( c < 32 ) || ( c > 127 ) )
-                    *out++ = '?';
-                else
-                    *out++ = c;
-        }
-    }
-    *out = '\0';
-}
-
 /**
  * Decode encoded URI component. See also decode_URI().
  * \return decoded duplicated string