No semicolons after blocks.
[p5sagit/p5-mst-13.2.git] / ext / Encode / Encode.xs
index c208af0..886fb89 100644 (file)
@@ -1,5 +1,5 @@
 /*
- $Id: Encode.xs,v 1.31 2002/04/20 23:43:47 dankogai Exp dankogai $
+ $Id: Encode.xs,v 1.33 2002/04/22 03:43:05 dankogai Exp $
  */
 
 #define PERL_NO_GET_CONTEXT
@@ -8,6 +8,7 @@
 #include "XSUB.h"
 #define U8 U8
 #include "encode.h"
+# define PERLIO_FILENAME "PerlIO/encoding.pm"
 
 /* set 1 or more to profile.  t/encoding.t dumps core because of
    Perl_warner and PerlIO don't work well */
@@ -22,8 +23,8 @@
                         return (y)0; /* fool picky compilers */ \
                          }
 /**/
-UNIMPLEMENTED(_encoded_utf8_to_bytes, I32);
-UNIMPLEMENTED(_encoded_bytes_to_utf8, I32);
+UNIMPLEMENTED(_encoded_utf8_to_bytes, I32)
+UNIMPLEMENTED(_encoded_bytes_to_utf8, I32)
 
 void
 Encode_XSEncoding(pTHX_ encode_t * enc)
@@ -263,6 +264,32 @@ CODE:
     XSRETURN(1);
 }
 
+void
+Method_needs_lines(obj)
+SV *   obj
+CODE:
+{
+    encode_t *enc = INT2PTR(encode_t *, SvIV(SvRV(obj)));
+    ST(0) = &PL_sv_no;
+    XSRETURN(1);
+}
+
+void
+Method_perlio_ok(obj)
+SV *   obj
+CODE:
+{
+    encode_t *enc = INT2PTR(encode_t *, SvIV(SvRV(obj)));
+    if (hv_exists(get_hv("INC", 0), 
+                 PERLIO_FILENAME, strlen(PERLIO_FILENAME)))
+    {
+       ST(0) = &PL_sv_yes;
+    }else{
+       ST(0) = &PL_sv_no;
+    }
+    XSRETURN(1);
+}
+
 MODULE = Encode         PACKAGE = Encode
 
 PROTOTYPES: ENABLE