open-source-search-engine/Domains.h

22 lines
632 B
C
Raw Normal View History

2013-08-03 00:12:24 +04:00
// Matt Wells, copyright Nov 2001
#ifndef _DOMAINS_H_
#define _DOMAINS_H_
// . get the domain name (name + tld) from a hostname
// . returns NULL if not in the accepted list
// . "host" must be NULL terminated and in LOWER CASE
// . returns ptr into host that marks the domain name
2014-11-11 01:45:11 +03:00
char *getDomain ( char *host , int32_t hostLen , char *tld , int32_t *dlen );
2013-08-03 00:12:24 +04:00
// when host is like 1.2.3.4 use this one
2014-11-11 01:45:11 +03:00
char *getDomainOfIp ( char *host , int32_t hostLen , int32_t *dlen );
2013-08-03 00:12:24 +04:00
// used by getDomain() above
2014-11-11 01:45:11 +03:00
char *getTLD ( char *host , int32_t hostLen ) ;
2013-08-03 00:12:24 +04:00
// used by getTLD() above
2014-11-11 01:45:11 +03:00
bool isTLD ( char *tld , int32_t tldLen ) ;
2013-08-03 00:12:24 +04:00
#endif