You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2001/11/03 05:48:53 UTC

cvs commit: xml-xerces/perl postSource.pl

jasons      01/11/02 20:48:53

  Modified:    perl     postSource.pl
  Log:
  	* postSource.pl (Repository):
  	Added static UTF-8 transcoder (used by typemaps)
  	Added static ISO-8859-1 transcoder (unsused)
  	Added IDOM_Node::operator== and != -- these don't exist on the C++
  	   side because you only need to compare the pointers. But in perl
  	   those concealed in the SV.
  	added (char*) cast to sv_derived_from() call
  
  Revision  Changes    Path
  1.12      +92 -1     xml-xerces/perl/postSource.pl
  
  Index: postSource.pl
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/postSource.pl,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- postSource.pl	2001/10/12 04:18:45	1.11
  +++ postSource.pl	2001/11/03 04:48:52	1.12
  @@ -30,6 +30,97 @@
   
     substitute_line($_);
   
  +  # we add the two IDOM_Node operators
  +  # two transcoders
  +  if (/XS\(SWIG_init\)/) {
  +    print TEMP;
  +    while (<FILE>) {
  +      print TEMP;
  +      last if /newXS/;
  +    }
  +    print TEMP <<'TEXT';
  +    // we create the global transcoder for UTF-8 to UTF-16
  +    XMLTransService::Codes failReason;
  +    XMLPlatformUtils::Initialize(); // first we must create the transservice
  +    UTF8_ENCODING = XMLString::transcode("UTF-8");
  +    UTF8_TRANSCODER =
  +      XMLPlatformUtils::fgTransService->makeNewTranscoderFor(UTF8_ENCODING,
  +                                                             failReason,
  +                                                             1024);
  +    if (! UTF8_TRANSCODER) {
  +	croak("ERROR: XML::Xerces: INIT: Could not create UTF-8 transcoder");
  +    }
  +
  +
  +    ISO_8859_1_ENCODING = XMLString::transcode("ISO-8859-1");
  +    ISO_8859_1_TRANSCODER =
  +      XMLPlatformUtils::fgTransService->makeNewTranscoderFor(ISO_8859_1_ENCODING,
  +                                                             failReason,
  +                                                             1024);
  +    if (! ISO_8859_1_TRANSCODER) {
  +	croak("ERROR: XML::Xerces: INIT: Could not create ISO-8859-1 transcoder");
  +    }
  +
  +
  +    newXS((char *) "XML::Xercesc::IDOM_Node_operator_equal_to", _wrap_IDOM_Node_operator_equal_to, file);
  +    newXS((char *) "XML::Xercesc::IDOM_Node_operator_not_equal_to", _wrap_IDOM_Node_operator_not_equal_to, file);
  +TEXT
  +    next;
  +  }
  +
  +  # when we reach the first IDOM methods, print out the operators
  +  if (/XS\(_wrap_delete_IDOM_Node\)/) {
  +    print TEMP <<'TEXT';
  +XS(_wrap_IDOM_Node_operator_not_equal_to) {
  +    IDOM_Node *arg0 ;
  +    IDOM_Node *arg1 ;
  +    int argvi = 0;
  +    bool result ;
  +    dXSARGS;
  +    
  +    if ((items < 2) || (items > 2)) 
  +    croak("Usage: IDOM_Node_operator_not_equal_to(self,other);");
  +    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_IDOM_Node) < 0) {
  +        croak("Type error in argument 1 of IDOM_Node_operator_not_equal_to. Expected %s", SWIGTYPE_p_IDOM_Node->name);
  +        XSRETURN(1);
  +    }
  +    if (SWIG_ConvertPtr(ST(1),(void **) &arg1,SWIGTYPE_p_IDOM_Node) < 0) {
  +        croak("Type error in argument 2 of IDOM_Node_operator_not_equal_to. Expected %s", SWIGTYPE_p_IDOM_Node->name);
  +        XSRETURN(1);
  +    }
  +    result = (arg0 != arg1);
  +    ST(argvi) = sv_newmortal();
  +    sv_setiv(ST(argvi++),(IV) result);
  +    XSRETURN(argvi);
  +}
  +
  +XS(_wrap_IDOM_Node_operator_equal_to) {
  +    IDOM_Node *arg0 ;
  +    IDOM_Node *arg1 ;
  +    int argvi = 0;
  +    bool result ;
  +    dXSARGS;
  +    
  +    if ((items < 2) || (items > 2)) 
  +    croak("Usage: IDOM_Node_operator_equal_to(self,other);");
  +    if (SWIG_ConvertPtr(ST(0),(void **) &arg0,SWIGTYPE_p_IDOM_Node) < 0) {
  +        croak("Type error in argument 1 of IDOM_Node_operator_equal_to. Expected %s", SWIGTYPE_p_IDOM_Node->name);
  +        XSRETURN(1);
  +    }
  +    if (SWIG_ConvertPtr(ST(1),(void **) &arg1,SWIGTYPE_p_IDOM_Node) < 0) {
  +        croak("Type error in argument 2 of IDOM_Node_operator_equal_to. Expected %s", SWIGTYPE_p_IDOM_Node->name);
  +        XSRETURN(1);
  +    }
  +    result = (arg0 == arg1);
  +    ST(argvi) = sv_newmortal();
  +    sv_setiv(ST(argvi++),(IV) result);
  +    XSRETURN(argvi);
  +}
  +
  +TEXT
  +    print TEMP;
  +    next;
  +  }
     if (/XS\(_wrap_XMLValidator_checkContent/) {
       fix_method_source(\*FILE,
   		      \*TEMP,
  @@ -105,7 +196,7 @@
     if (!ty) return 0;        /* Void pointer */
     s = ty->next;             /* First element always just a name */
     while (s) {
  -    if (sv_derived_from(sv,s->name)) {
  +    if (sv_derived_from(sv,(char*)s->name)) {
         if (s == ty->next) return s;
         /* Move s to the top of the linked list */
         s->prev->next = s->next;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org