/[fuse.before_github]/perl/trunk/Fuse.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /perl/trunk/Fuse.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 18 by dpavlin, Wed Dec 21 15:33:37 2005 UTC revision 19 by dpavlin, Tue Dec 27 12:47:00 2005 UTC
# Line 5  use strict; Line 5  use strict;
5  use warnings;  use warnings;
6  use Errno;  use Errno;
7  use Carp;  use Carp;
8    use Config;
9    
10  require Exporter;  require Exporter;
11  require DynaLoader;  require DynaLoader;
# Line 20  our @ISA = qw(Exporter DynaLoader); Line 21  our @ISA = qw(Exporter DynaLoader);
21  # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK  # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
22  # will save memory.  # will save memory.
23  our %EXPORT_TAGS = (  our %EXPORT_TAGS = (
24                      'all' => [ qw(FUSE_DEBUG XATTR_CREATE XATTR_REPLACE) ],                      'all' => [ qw(XATTR_CREATE XATTR_REPLACE) ],
                     'debug' => [ qw(FUSE_DEBUG) ],  
25                      'xattr' => [ qw(XATTR_CREATE XATTR_REPLACE) ]                      'xattr' => [ qw(XATTR_CREATE XATTR_REPLACE) ]
26                      );                      );
27    
28  our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );  our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
29    
30  our @EXPORT = qw(  our @EXPORT = ();
31          FUSE_DEBUG  our $VERSION = '0.07';
 );  
 our $VERSION = '0.06';  
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()
# Line 77  sub XATTR_REPLACE { Line 75  sub XATTR_REPLACE {
75  bootstrap Fuse $VERSION;  bootstrap Fuse $VERSION;
76    
77  sub main {  sub main {
78          my (@subs) = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);          my (@subs) = (undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,
79                          undef,undef,undef,undef,undef,undef,undef,undef,undef,undef,
80                          undef,undef,undef,undef,undef);
81          my (@names) = qw(getattr readlink getdir mknod mkdir unlink rmdir symlink          my (@names) = qw(getattr readlink getdir mknod mkdir unlink rmdir symlink
82                           rename link chmod chown truncate utime open read write statfs                           rename link chmod chown truncate utime open read write statfs
83                           flush release fsync setxattr getxattr listxattr removexattr);                           flush release fsync setxattr getxattr listxattr removexattr);
# Line 96  sub main { Line 96  sub main {
96                          $subs[$mapping{$name}] = $subref;                          $subs[$mapping{$name}] = $subref;
97                  }                  }
98          }          }
99          foreach my $opt ( split(/,/,$otherargs{mountopts}) ) {          foreach my $opt ( split(/,/,$otherargs{mountopts}) ) {
100            if ( ! exists($optmap{$opt}) ) {                  if ( ! exists($optmap{$opt}) ) {
101              croak "Use of an invalid mountopt argument";                          croak "Use of an invalid mountopt argument";
102            }                  }
103          }          }
104          perl_fuse_main($otherargs{debug},$otherargs{threaded},$otherargs{mountpoint},$otherargs{mountopts},@subs);          if($otherargs{threaded}) {
105                    # make sure threads are both available, and loaded.
106                    if($Config{useithreads}) {
107                            if(exists($threads::{VERSION})) {
108                                    if(exists($threads::shared::{VERSION})) {
109                                            # threads will work.
110                                    } else {
111                                            carp("Thread support requires you to use threads::shared.\nThreads are disabled.\n");
112                                            $otherargs{threaded} = 0;
113                                    }
114                            } else {
115                                    carp("Thread support requires you to use threads and threads::shared.\nThreads are disabled.\n");
116                                    $otherargs{threaded} = 0;
117                            }
118                    } else {
119                            carp("Thread support was not compiled into this build of perl.\nThreads are disabled.\n");
120                            $otherargs{threaded} = 0;
121                    }
122            }
123            perl_fuse_main($otherargs{debug},$otherargs{threaded},$otherargs{mountpoint},$otherargs{mountopts},@subs);
124  }  }
125    
126  # Autoload methods go after =cut, and are processed by the autosplit program.  # Autoload methods go after =cut, and are processed by the autosplit program.
# Line 139  See their respective documentations, for Line 158  See their respective documentations, for
158    
159  =head2 EXPORTED SYMBOLS  =head2 EXPORTED SYMBOLS
160    
161  FUSE_DEBUG by default.  None by default.
162    
163  You can request all exportable symbols by using the tag ":all".  You can request all exportable symbols by using the tag ":all".
164    
 You can request all debug symbols by using the tag ":debug".  
 This will export FUSE_DEBUG.  
   
165  You can request the extended attribute symbols by using the tag ":xattr".  You can request the extended attribute symbols by using the tag ":xattr".
166  This will export XATTR_CREATE and XATTR_REPLACE.  This will export XATTR_CREATE and XATTR_REPLACE.
167    
# Line 215  conditions and locking bugs, too.  Pleas Line 231  conditions and locking bugs, too.  Pleas
231  you're using are also thread-safe.  you're using are also thread-safe.
232    
233  (If enabled, this option will cause a warning if your perl interpreter was not  (If enabled, this option will cause a warning if your perl interpreter was not
234  built with USE_ITHREADS.)  built with USE_ITHREADS, or if you have failed to use threads or
235    threads::shared.)
236    
237  =back  =back
238    

Legend:
Removed from v.18  
changed lines
  Added in v.19

  ViewVC Help
Powered by ViewVC 1.1.26