3
use ExtUtils::MakeMaker qw(prompt);
6
my $just_check = @ARGV ? $ARGV[0] eq '-c' : 0;
8
my $dir = shift || '.';
15
my($old, $new) = grep { s/^$prefix//o } split;
16
next unless $old and $new;
20
my $pattern = join '|', keys %names;
21
#print "replacement pattern=$pattern\n";
25
return unless /\.[ch]$/;
26
my $file = "$File::Find::dir/$_";
27
print "looking in $file\n";
29
replace($_, !$just_check);
34
my($file, $replace) = @_;
39
open IN, $file or die "open $file: $!";
42
for (m/[^_\"]*$prefix($pattern)\b/og) {
44
print " $file:$. apr_$_ -> apr_$names{$_}\n";
46
push @lines, $_ if $replace;
51
return unless $found and $replace;
53
# my $ans = prompt("replace?", 'y');
54
# return unless $ans =~ /^y/i;
56
open OUT, ">$file" or die "open $file: $!";
59
unless (/^\#include/) {
60
s/([^_\"]*$prefix)($pattern)\b/$1$names{$2}/og;
70
apr_implode_gmt apr_time_exp_gmt_get
73
apr_close_socket apr_socket_close
74
apr_create_socket apr_socket_create
75
apr_get_sockaddr apr_socket_addr_get
76
apr_get_socketdata apr_socket_data_get
77
apr_set_socketdata apr_socket_data_set
78
apr_shutdown apr_socket_shutdown
79
apr_bind apr_socket_bind
80
apr_listen apr_socket_listen
81
apr_accept apr_socket_accept
82
apr_connect apr_socket_connect
83
apr_send apr_socket_send
84
apr_sendv apr_socket_sendv
85
apr_sendto apr_socket_sendto
86
apr_recvfrom apr_socket_recvfrom
87
apr_sendfile apr_socket_sendfile
88
apr_recv apr_socket_recv
91
apr_filename_of_pathname apr_filepath_name_get
94
apr_get_groupid apr_gid_get
95
apr_get_groupname apr_gid_name_get
96
apr_group_name_get apr_gid_name_get
97
apr_compare_groups apr_gid_compare
100
apr_get_home_directory apr_uid_homepath_get
101
apr_get_userid apr_uid_get
102
apr_current_userid apr_uid_current
103
apr_compare_users apr_uid_compare
104
apr_get_username apr_uid_name_get
105
apr_compare_users apr_uid_compare