/[fuse.before_github]/perl-llin/Fuse.xs
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-llin/Fuse.xs

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 501  int _PLfuse_read (const char *file, char Line 501  int _PLfuse_read (const char *file, char
501                                  rv = 0;                                  rv = 0;
502                          }                          }
503                          if(rv > buflen)                          if(rv > buflen)
504                                  croak("%i: read() handler returned more than buflen! (%i > %i)",getpid(),rv,buflen);                                  croak("read() handler returned more than buflen! (%i > %i)",rv,buflen);
505                          if(rv)                          if(rv)
506                                  memcpy(buf,SvPV_nolen(mysv),rv);                                  memcpy(buf,SvPV_nolen(mysv),rv);
507                  }                  }
# Line 857  PROTOTYPES: DISABLE Line 857  PROTOTYPES: DISABLE
857  void  void
858  perl_fuse_main(...)  perl_fuse_main(...)
859          PREINIT:          PREINIT:
860          struct fuse_operations fops = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};          struct fuse_operations fops =
861                    {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
862                     NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
863          int i, fd, varnum = 0, debug, threaded, have_mnt;          int i, fd, varnum = 0, debug, threaded, have_mnt;
864          char *mountpoint;          char *mountpoint;
865          char *mountopts;          char *mountopts;
# Line 885  perl_fuse_main(...) Line 887  perl_fuse_main(...)
887          mountopts = SvPV_nolen(ST(3));          mountopts = SvPV_nolen(ST(3));
888          for(i=0;i<N_CALLBACKS;i++) {          for(i=0;i<N_CALLBACKS;i++) {
889                  SV *var = ST(i+4);                  SV *var = ST(i+4);
890          /* allow symbolic references, or real code references. */                  /* allow symbolic references, or real code references. */
891                  if((var != &PL_sv_undef) && (SvPOK(var) || (SvROK(var) && SvTYPE(SvRV(var)) == SVt_PVCV))) {                  if(SvOK(var) && (SvPOK(var) || (SvROK(var) && SvTYPE(SvRV(var)) == SVt_PVCV))) {
892                          void **tmp1 = (void**)&_available_ops, **tmp2 = (void**)&fops;                          void **tmp1 = (void**)&_available_ops, **tmp2 = (void**)&fops;
893                          tmp2[i] = tmp1[i];                          tmp2[i] = tmp1[i];
894    #ifdef FUSE_USE_ITHREADS
895                          if(threaded)                          if(threaded)
896                  /* note: under 5.8.7, this croaks for code references. */                  /* note: under 5.8.7, this croaks for code references. */
897                  SvSHARE(var);                  SvSHARE(var);
898    #endif
899                          _PLfuse_callbacks[i] = var;                          _PLfuse_callbacks[i] = var;
900                    } else
901                    if(SvOK(var)) {
902                            croak("invalid callback passed to perl_fuse_main "
903                                  "(%s is not a string, code ref, or undef).\n",
904                                  i+4,SvPVbyte_nolen(var));
905                  }                  }
906          }          }
907          /* FIXME: need to pass fusermount arguments */          /* FIXME: need to pass fusermount arguments */

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

  ViewVC Help
Powered by ViewVC 1.1.26