/usr/share/ratbox-services/scripts/definetolength.pl is in ratbox-services-common 1.2.4+repack-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | # definetolength.pl
# Reads include files, extracting the lengths from the selected defines.
#
# Copyright (C) 2006 Lee Hardy <lee -at- leeh.co.uk>
# Copyright (C) 2006 ircd-ratbox development team
#
# $Id: definetolength.pl 22896 2006-07-18 18:06:04Z leeh $
my %lengths = (
"USERREGNAME_LEN" => 1,
"PASSWDLEN" => 1,
"EMAILLEN" => 1,
"OPERNAMELEN" => 1,
"NICKLEN" => 1,
"USERLEN" => 1,
"CHANNELLEN" => 1,
"TOPICLEN" => 1,
"HOSTLEN" => 1,
"REALLEN" => 1,
"REASONLEN" => 1,
"SUSPENDREASONLEN" => 1,
"URLLEN" => 1
);
my @srcs = ("setup.h", "rserv.h", "channel.h", "client.h");
sub parse_includes
{
my $path = shift;
foreach my $i (@srcs)
{
unless(open(INPUT, '<', "$path/$i"))
{
next;
}
while(<INPUT>)
{
chomp;
if($_ =~ /^#define ([A-Z_]+)\s+\(?(\d+)/)
{
$key = $1;
$value = $2;
$lengths{"$key"} = $value
if($lengths{"$key"});
}
}
close(INPUT);
}
return %lengths;
}
|