*****************************************************************************
* Copyright (C) 2003-2004 Commonwealth Scientific and Industrial Research
* Organisation (CSIRO) Australia
- * Copyright (C) 2004 VideoLAN
+ * Copyright (C) 2004 the VideoLAN team
*
* $Id$
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include "xurl.h"
{
/* psz_append is a relative URL */
char *psz_new_url;
-
+
/* strip off last path component */
psz_new_url = XURL_GetHead( psz_url );
psz_new_url = streallocat( psz_new_url, psz_append );
return psz_scheme_and_hostname;
}
-static
+static
char *XURL_FindFragment( char *psz_url )
{
char *pc_hash = NULL;
char *pc_return_value = NULL;
-
+
pc_hash = strchr( psz_url, '#' );
if( pc_hash != NULL )
{
{
char *pc_question_mark = NULL;
char *pc_return_value = NULL;
-
+
pc_question_mark = strchr( psz_url, '?' );
if( pc_question_mark != NULL )
{
}
#ifndef HAVE_STRDUP
-static
+static
char *xurl_strdup( const char *psz_string )
{
size_t i_length;
char *psz_new_string;
if( !psz_string ) return NULL;
-
+
i_length = strlen( psz_string ) + 1;
psz_new_string = (char *) xurl_malloc( i_length );
if( psz_new_string == NULL ) return NULL;
}
#endif
-static
+static
char *XURL_FindPath( char *psz_url )
{
char *psz_return_value = NULL;
psz_return_value = psz_without_fragment;
}
}
-
+
return psz_return_value;
}
-static
+static
char *streallocat( char *psz_string, char *psz_to_append )
{
size_t i_new_string_length = strlen( psz_string ) +
strlen( psz_to_append ) + 1;
psz_string = (char *) realloc( psz_string, i_new_string_length );
-
+
return strcat( psz_string, psz_to_append );
}