Description: port to Ruby 1.9.1 and 2.0
 add also some missing headers and fix a typo
Author: Cédric Boutillier <boutil@debian.org>
Origin: vendor
Forwarded: https://github.com/duairc/fusefs/pull/4
Last-Update: 2013-12-20

--- a/ext/fusefs_lib.c
+++ b/ext/fusefs_lib.c
@@ -17,6 +17,8 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <ruby.h>
+#include <unistd.h>
+#include <ctype.h>
 
 #ifdef DEBUG
 #include <stdarg.h>
@@ -452,7 +454,7 @@
     if (TYPE(cur_entry) != T_STRING)
       continue;
 
-    filler(buf,STR2CSTR(cur_entry),NULL,0);
+    filler(buf,StringValuePtr(cur_entry),NULL,0);
   }
   return 0;
 }
@@ -660,7 +662,8 @@
     /* We have the body, now save it the entire contents to our
      * opened_file lists. */
     newfile = ALLOC(opened_file);
-    value = rb_str2cstr(body,&newfile->size);
+    value = RSTRING_PTR(body);
+    newfile->size = RSTRING_LEN(body);
     newfile->value = ALLOC_N(char,(newfile->size)+1);
     memcpy(newfile->value,value,newfile->size);
     newfile->value[newfile->size] = '\0';
@@ -715,7 +718,8 @@
       /* We have the body, now save it the entire contents to our
        * opened_file lists. */
       newfile = ALLOC(opened_file);
-      value = rb_str2cstr(body,&newfile->size);
+      value = RSTRING_PTR(body);
+      newfile->size = RSTRING_LEN(body);
       newfile->value = ALLOC_N(char,(newfile->size)+1);
       memcpy(newfile->value,value,newfile->size);
       newfile->writesize = newfile->size+1;
@@ -1074,7 +1078,8 @@
       rf_call(path,id_write_to,newstr);
     } else {
       long size;
-      char *str = rb_str2cstr(body,&size);
+      char *str = RSTRING_PTR(body);
+      size = RSTRING_LEN(body);
 
       /* Just in case offset is bigger than the file. */
       if (offset >= size) return 0;
@@ -1253,7 +1258,7 @@
       return 0;
     if (TYPE(ret) != T_STRING)
       return 0;
-    memcpy(buf, RSTRING_LEN(ret), RSTRING_LEN(ret));
+    memcpy(buf, RSTRING_PTR(ret), RSTRING_LEN(ret));
     return RSTRING_LEN(ret);
   }
 
@@ -1390,7 +1395,7 @@
   }
 
   rb_iv_set(cFuseFS,"@mountpoint",mountpoint);
-  fusefs_setup(STR2CSTR(mountpoint), &rf_oper, opts);
+  fusefs_setup(StringValuePtr(mountpoint), &rf_oper, opts);
   return Qtrue;
 }
 
