[vlc-devel] commit: Remove unused unescape_URI() and unescape_URI_duplicate() ( Rafaël Carré )
git version control
git at videolan.org
Sat May 30 00:32:48 CEST 2009
vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Wed May 27 19:22:28 2009 +0200| [2341f8bbc23622d0d8b8a511b7cc745d20beb878] | committer: Jean-Baptiste Kempf
Remove unused unescape_URI() and unescape_URI_duplicate()
(cherry picked from commit b5687139f9ac84a7bdf03d9a9612950c43fe6ec2)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2341f8bbc23622d0d8b8a511b7cc745d20beb878
---
include/vlc_url.h | 2 -
src/libvlccore.sym | 2 -
src/text/strings.c | 83 ----------------------------------------------------
3 files changed, 0 insertions(+), 87 deletions(-)
diff --git a/include/vlc_url.h b/include/vlc_url.h
index 448c685..e5b29eb 100644
--- a/include/vlc_url.h
+++ b/include/vlc_url.h
@@ -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 ) );
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 0b0f405..69eddac 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -382,8 +382,6 @@ tls_ClientCreate
tls_ClientDelete
ToLocale
ToLocaleDup
-unescape_URI
-unescape_URI_duplicate
update_Check
update_Delete
update_Download
diff --git a/src/text/strings.c b/src/text/strings.c
index 9c6d931..736bb87 100644
--- a/src/text/strings.c
+++ b/src/text/strings.c
@@ -49,89 +49,6 @@
#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
*/
More information about the vlc-devel
mailing list