28 |
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
29 |
|
|
30 |
our @EXPORT = (); |
our @EXPORT = (); |
31 |
our $VERSION = '0.07'; |
our $VERSION = '0.08'; |
32 |
|
|
33 |
sub AUTOLOAD { |
sub AUTOLOAD { |
34 |
# This AUTOLOAD is used to 'autoload' constants from the constant() |
# This AUTOLOAD is used to 'autoload' constants from the constant() |
75 |
bootstrap Fuse $VERSION; |
bootstrap Fuse $VERSION; |
76 |
|
|
77 |
sub main { |
sub main { |
78 |
my (@subs) = (undef,undef,undef,undef,undef,undef,undef,undef,undef,undef, |
my @names = qw(getattr readlink getdir mknod mkdir unlink rmdir symlink |
79 |
undef,undef,undef,undef,undef,undef,undef,undef,undef,undef, |
rename link chmod chown truncate utime open read write statfs |
80 |
undef,undef,undef,undef,undef); |
flush release fsync setxattr getxattr listxattr removexattr); |
81 |
my (@names) = qw(getattr readlink getdir mknod mkdir unlink rmdir symlink |
my @subs = map {undef} @names; |
82 |
rename link chmod chown truncate utime open read write statfs |
my @validOpts = qw(ro allow_other default_permissions fsname use_ino nonempty); |
83 |
flush release fsync setxattr getxattr listxattr removexattr); |
my $tmp = 0; |
84 |
my (@validOpts) = qw(allow_other); |
my %mapping = map { $_ => $tmp++ } @names; |
85 |
my ($tmp) = 0; |
my %optmap = map { $_ => 1 } @validOpts; |
86 |
my (%mapping) = map { $_ => $tmp++ } (@names); |
my @otherargs = qw(debug threaded mountpoint mountopts); |
87 |
my (%optmap) = map { $_ => 1 } (@validOpts); |
my %otherargs = (debug=>0, threaded=>0, mountpoint=>"", mountopts=>""); |
|
my (%otherargs) = (debug=>0, threaded=>0, mountpoint=>"", mountopts=>""); |
|
88 |
while(my $name = shift) { |
while(my $name = shift) { |
89 |
my ($subref) = shift; |
my ($subref) = shift; |
90 |
if(exists($otherargs{$name})) { |
if(exists($otherargs{$name})) { |
95 |
$subs[$mapping{$name}] = $subref; |
$subs[$mapping{$name}] = $subref; |
96 |
} |
} |
97 |
} |
} |
98 |
foreach my $opt ( split(/,/,$otherargs{mountopts}) ) { |
foreach my $opt ( map {m/^([^=]*)/; $1} split(/,/,$otherargs{mountopts}) ) { |
99 |
if ( ! exists($optmap{$opt}) ) { |
next if exists($optmap{$opt}); |
100 |
croak "Use of an invalid mountopt argument"; |
croak "Fuse::main: invalid '$opt' argument in mountopts"; |
|
} |
|
101 |
} |
} |
102 |
if($otherargs{threaded}) { |
if($otherargs{threaded}) { |
103 |
# make sure threads are both available, and loaded. |
# make sure threads are both available, and loaded. |
118 |
$otherargs{threaded} = 0; |
$otherargs{threaded} = 0; |
119 |
} |
} |
120 |
} |
} |
121 |
perl_fuse_main($otherargs{debug},$otherargs{threaded},$otherargs{mountpoint},$otherargs{mountopts},@subs); |
perl_fuse_main(@otherargs{@otherargs},@subs); |
122 |
} |
} |
123 |
|
|
124 |
# Autoload methods go after =cut, and are processed by the autosplit program. |
# Autoload methods go after =cut, and are processed by the autosplit program. |