| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

is_full_url

#include "sflhttp.h"
Bool
is_full_url (const char *string)

Synopsis

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 ':'.

Source Code - (sflhttp.c)

{
    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      */
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation