dish/src/dish.cxx
//----------------------------------------------------------------
// This static function will return 0 if the given host is in the
// readable name format and will return 1 if it is in decimal
// delimeted format.
// ----------------------------------------------------------------
This static function will return 0 if the given host is in the
readable name format and will return 1 if it is in decimal
delimeted format.
This static function will return 0 if the given host is in the readable name format and will return 1 if it is in decimal delimeted format .
static int IsIp(const char* host)
{
    int dcount = 0;
    int result = 1;
    for(int i = 0; i < strlen(host); ++i) {
        if(host[i]=='.') {
            dcount++;
            continue;
        }
        if(host[i] < '0' || host[i] > '9') {
            result = 0;
            break;
        }
    }
    if(dcount!=3) result = 0;
    return result;
}
static int IsIp ( const char * host ) { int dcount = 0 ; int result = 1 ; for ( int i = 0 ; i < strlen ( host ) ; ++ i ) { if ( host [ i ] == ' ' ) { dcount ++ ; continue ; } if ( host [ i ] < ' ' || host [ i ] > ' ' ) { result = 0 ; break ; } } if ( dcount != 3 ) result = 0 ; return result ; }
This static function will return 0 if the given host is in the
readable name format and will return 1 if it is in decimal
delimeted format.
This static function will return 0 if the given host is in the readable name format and will return 1 if it is in decimal delimeted format .