Improve country() by using "static const" for lookup table (makes function 25% smaller)
and const-correctness. Add .mobi TLD. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@112 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -4902,14 +4902,13 @@ void check_server_connect(int server)
|
||||
#endif
|
||||
}
|
||||
|
||||
char *country(char *hostname)
|
||||
const char *country(char *hostname)
|
||||
{
|
||||
#ifndef BITCHX_LITE
|
||||
typedef struct _domain {
|
||||
char *code;
|
||||
char *country;
|
||||
} Domain;
|
||||
Domain domain[] = {
|
||||
static const struct {
|
||||
const char *code;
|
||||
const char *country;
|
||||
} domain[] = {
|
||||
{"AC", "Ascension Island" },
|
||||
{"AD", "Andorra" },
|
||||
{"AE", "United Arab Emirates" },
|
||||
@@ -5166,6 +5165,7 @@ Domain domain[] = {
|
||||
{"INFO", "Informational" },
|
||||
{"INT", "International" },
|
||||
{"MIL", "United States Military" },
|
||||
{"MOBI", "Mobile Device" },
|
||||
{"MUSEUM", "Museum" },
|
||||
{"NET", "Network" },
|
||||
{"NAME", "Individuals" },
|
||||
|
||||
Reference in New Issue
Block a user