Here is my Perl script for doing the renaming. It's simple enough that you can
determine the changes from it. To run it, put it the top directory and do
find . \( -name '*.cc' -o -name '*.h' -o -name '*.in' \) -exec perl
ts-995-rename.pl {} \; -print
The remaining open question is whether to keep the pton, ntop, and nptop stems
or change them to _string_to_addr, _addr_to_string, _addr_port_to_string for
readability.
Presumably we will also rename ink_inet.h to ts_ip.h after this change.
#!/usr/bin/perl -w -i -p
use strict;
our %CHANGES = (
'ts_ip_endpoint' => 'TsIpEndpoint',
'InkInetAddr' => 'TsIpAddr',
'ink_inet_invalidate' => 'ts_ip_invalidate',
'ink_inet_is_ip' => 'ts_is_ip',
'ink_inet_is_ip4' => 'ts_is_ip4',
'ink_inet_is_ip6' => 'ts_is_ip6',
'ink_inet_ip4_cast' => 'ts_ip4_cast',
'ink_inet_ip4_addr_cast' => 'ts_ip4_addr_cast',
'ink_inet_ip4_set' => 'ts_ip4_set',
'ink_inet_get_ip4_addr' => 'ts_ip4_addr_host_order',
'ink_inet_ip6_cast' => 'ts_ip6_cast',
'ink_inet_ip6_set' => 'ts_ip6_set',
'ink_inet_ip6_addr_cast' => 'ts_ip6_addr_cast',
'ink_inet_ip_set' => 'ts_ip_set',
'ink_inet_port_cast' => 'ts_ip_port_cast',
'ink_inet_get_port' => 'ts_ip_port_host_order',
'ink_inet_addr32_cast' => 'ts_ip_addr32_cast',
'ink_inet_addr8_cast' => 'ts_ip_addr8_cast',
'ink_inet_sa_cast' => 'ts_ip_sa_cast',
'ink_inet_ss_cast' => 'ts_ip_ss_cast',
'ink_inet_are_compatible' => 'ts_ip_are_compatible',
'ink_inet_ip_size' => 'ts_ip_size',
'ink_inet_addr_size' => 'ts_ip_addr_size',
'ink_inet_is_any' => 'ts_is_ip_any',
'ink_inet_is_loopback' => 'ts_is_ip_loopback',
'ink_inet_is_multicast' => 'ts_is_ip_multicast',
'ink_inet_is_nonroutable' => 'ts_is_ip_nonroutable',
'ink_inet_hash' => 'ts_ip_hash',
'ink_inet_copy' => 'ts_ip_copy',
'ink_inet_cmp' => 'ts_ip_addr_cmp',
'ink_inet_eq' => 'ts_ip_addr_eq',
'ink_inet_getbestaddrinfo' => 'ts_ip_getbestaddrinfo',
'ink_inet_to_hex' => 'ts_ip_to_hex',
'ink_inet_ntop' => 'ts_ip_ntop',
'ink_inet_nptop' => 'ts_ip_nptop',
'ink_inet_pton' => 'ts_ip_pton',
'ink_inet_family_name' => 'ts_ip_family_name'
);
while (my ($from, $to) = each %CHANGES) {
s/$from/$to/g;
}