Commits

ph...@9ae0c189-cd1f-4510-a509-f4891f5cf20d  committed 0f64201

Submitted by:
Reviewed by:
PR:

Log: Modified Files:
typemap
+ added O_PARSER_CONTEXT I/O code
this is the first step on refactoring the parser interface.
since both rules will not interfere the existing code, they
are added now

  • Participants
  • Parent commits c985a83

Comments (0)

Files changed (1)

 TYPEMAP
 const char *                T_PV
-xmlParserCtxtPtr            O_OBJECT
+xmlParserCtxtPtr            O_PARSER_OBJECT
 xmlRelaxNGPtr               O_OBJECT
 xmlSchemaPtr                O_OBJECT
 xmlNodeSetPtr               O_OBJECT
                XSRETURN_UNDEF;
             }
     }
-    else{
+    else {
+            croak( \"${Package}::$func_name() -- $var is not a blessed SV reference\" );
+            XSRETURN_UNDEF;
+    }
+
+O_PARSER_OBJECT
+    if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) ) {
+            $var = PmmSvContext($arg);
+            if ( $var == NULL ) {
+               croak( \"${Package}::$func_name() -- $var contains no parse context\" );
+               XSRETURN_UNDEF;
+            }
+    }
+    else {
             croak( \"${Package}::$func_name() -- $var is not a blessed SV reference\" );
             XSRETURN_UNDEF;
     }
         sv_setref_pv( $arg, (char *)CLASS, (void*)$var );
 
 
+O_PARSER_OBJECT
+        $arg = PmmContextSv( $var );