|
| iMatix home page | << | < | > | >> |
SFLVersion 2.11 |
#include "sflhttp.h" Bool is_full_url (const char *string)
If the specified URI string starts with a URL scheme, returns TRUE, else returns FALSE. A schema is one or more of [A-Za-z0- 9+-.] followed by a ':'.
{
Bool
scheme_size = 0;
ASSERT (string);
while (*string)
{
if (isalpha (*string)
|| isdigit (*string)
|| *string == '+'
|| *string == '-'
|| *string == '.')
scheme_size++; /* So far, a valid scheme name */
else
if (*string == ':')
return (scheme_size > 0); /* Okay if ':' was not first char */
else
return (FALSE); /* No scheme name found */
string++;
}
return (FALSE); /* End of string but no scheme */
}
| | << | < | > | >> |
|