/* Copyright (c) 2001, Stanford University
* All rights reserved
*
* See the file LICENSE.txt for information on redistributing this software.
*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "cr_string.h"
#include "cr_url.h"
#include "cr_error.h"
static int is_digit_string( const char *s )
{
if (!isdigit( (int) *s))
{
return 0;
}
while (*s && isdigit ( (int) *s))
{
s++;
}
return ( *s == 0 );
}
unsigned short *port, unsigned short default_port )
{
/* pull off the protocol */
{
}
else
{
}
temp += 3;
}
/* handle a trailing :<digits> to specify the port */
/* there might be a filename here */
{
}
{
}
if ( temp2 )
{
}
temp2++;
if ( !is_digit_string( temp2 ) )
goto bad_url;
}
else
{
*port = default_port;
}
return 1;
crWarning( "URL: expected <protocol>://"
"<destination>[:<port>], what is \"%s\"?", url );
return 0;
}