#!/usr/bin/perl # # Copyright (C) 2003, Matt Mahoney. This program is distributed # without warranty under terms of the GNU general public license # See http://www.gnu.org/licenses/gpl.txt # # Convert hosts file to initialization data for eval.cpp while (<>) { if (/^(\d+)\.(\d+)\.(\d+)\.(\d+) +(\S+)/) { $ip=(($1*256+$2)*256+$3)*256+$4; printf("{0x%X,\"%s\"},\n", $ip, $5); } }