File: plugin.mpi

package info (click to toggle)
madoka 4.2.3-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 960 kB
  • ctags: 45
  • sloc: perl: 1,006; makefile: 45; sh: 4
file content (28 lines) | stat: -rw-r--r-- 659 bytes parent folder | download
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
# madoka 4.2 rc_plugin
#
# rc/plugin.mpi
#    Copyright(c)1998- cookie / The madoka project
#

my($var, $arg) = split(/=\s*/, $rc_line, 2);

if ($var eq 'dir') {
  $arg =~ s/^~\//$homedir\//;
  if (-d $arg) {
    push(@plugindir, $arg);
  } else {
    &down("[ERROR] not a directory: $arg in [plugin]\n");
  }
} elsif ($var eq 'bot') {
  &list_add($plugin_sub, $arg);
} else {
  my $file = &search_file($arg);
  &down("[ERROR] no such file or cannot read: $file in [plugin]\n")
    unless (-r $file && -f $file);
  if ($var eq 'main') {
    &list_add($plugin_do, $file);
  } elsif ($var eq 'sub') {
    &list_add($plugin_redo, $file);
    &redo($file);
  }
}