+# in_array()
+#
+# Check if a value is in an array
+#
+# Params: 1. Value to find
+# 2. Array
+#
+# Return: Status code (Boolean)
+
+sub in_array($$)
+{
+ my ($string,$array) = @_;
+
+ foreach my $element(@{$array})
+ {
+ return 1 if($string eq $element);
+ }
+
+ return;
+}
+
+# is_archive()
+#
+# Check if a file is an archive
+# (currently only by file extension)
+#
+# Params: Archive file name
+#
+# Return: Status code (Boolean)
+
+sub is_archive($)
+{
+ my $file = shift;
+
+ foreach my $ext(@archive_exts)
+ {
+ return 1 if(lc(substr($file,length($file)-length($ext),length($ext))) eq lc($ext));
+ }
+
+ return;
+}
+
+# is_disabled_command()
+#
+# Check if a command is disabled
+#
+# Params: 1. Array Reference containing the list
+# 2. Command to check
+#
+# Return: Status code (Boolean)
+
+sub is_disabled_command($$)
+{
+ my ($list,$command) = @_;
+ $command =~ s!/+$!!g;
+
+ foreach my $entry(@$list)
+ {
+ return 1 if(lc($command) eq lc($entry));
+ }
+
+ return;
+}
+
+# is_forbidden_file()
+#
+# Check if a file is in the list of forbidden files
+#
+# Params: 1. Array Reference containing the list
+# 2. Filename to check
+#
+# Return: Status code (Boolean)
+
+sub is_forbidden_file($$)
+{
+ my ($list,$file) = @_;
+ $file =~ s!/+$!!g;
+
+ foreach my $entry(@$list)
+ {
+ return 1 if($file eq $entry);
+ return 1 if(index($file,$entry.'/') == 0);
+ }
+
+ return;
+}
+