You are viewing a plain text version of this content. The canonical link for it is here.
Posted to p-dev@xerces.apache.org by "Harmon S. Nine" <hn...@netarx.com> on 2001/03/02 20:51:47 UTC

xerces-perl 1.3 and uploading to download page

Hi everyone.  Some time ago I was voted a developer.  Jason Stewart et. 
al. has since
taken the position of coordinating xerces-perl development.  However, as 
far as I know,
I still have an account at apache.  Unfortunately I have forgotten my 
password.

Could someone at apache please reset my password and email it to me?  I'll
change it as soon as I am able to log in.  My account name is "hnine".

I have xerces-perl-1.3.  Actually, I sent it to this list about a week 
ago.  So far, I have gotten
only one (albeit very good) response.  Has anyone else had a chance to 
evaluate it?

Anyway, if overwhelming schedules, etc., prevent others from doing so, I 
would like to
upload it to the xerces-perl download page.  But first, I'll need my 
password.

-- Harmon


Re: xerces-perl 1.3 and uploading to download page

Posted by "Harmon S. Nine" <hn...@netarx.com>.
Jason:

In providing for SWIG 1.3, should I be converting the "SWIG_GetPtr" call to
a "SWIG_ConvertPtr" call, or the other way around?

Here's whtat I'm thinking.  In the XERCES.i file, I'm going to put 
something like:
#if SWIG_VERSION == 1.3
... // use SWIG_ConvertPtr
#else
...// use SWIG_GetPtr
#endif

The SWIG version will be determined by the build, and placed in the g++ 
command-line
via  a -DSWIG_VERSION=1.3

-- Harmon

Jason E. Stewart wrote:

> "Jason E. Stewart" <ja...@openinformatics.com> writes:
> 
> 
>> "Jason E. Stewart" <ja...@openinformatics.com> writes:
>> 
>> 
>>> "Harmon S. Nine" <hn...@netarx.com> writes:
>>> 
>>> 
>>>> I have xerces-perl-1.3.  Actually, I sent it to this list about a
>>>> week ago.  So far, I have gotten only one (albeit very good)
>>>> response.  Has anyone else had a chance to evaluate it?
>>> 
>>> Hey Harmon,
>>> 
>>> Which version of SWIG are you using?
>> 
>> I just grabbed the debian swig-1.1.p5-6 package and it worked fine:
>> 
> 
> I have been able to get it to compile with SWIG-1.3a5. It required a
> modification in Xerces.i to use the new pointer mechanism instead of
> SWIG_GetPtr(), and a slightly different patch to Xerces_wrap.C.
> 
> However, the tests all fail due to different naming conventions used
> by SWIG 1.3 :-(
> 
> I was hoping that the new 1.3 development branch of SWIG would fix
> some of the outstanding problems, such as being able to run Xerces in
> the debugger.
> 
> In any case here are the patches...
> 
> jas.
> 
> --
> 
> --- ./XERCES.i	Fri Mar  2 18:38:41 2001
> +++ ./XERCES.i~	Fri Feb 23 19:07:27 2001
> @@ -38,7 +38,7 @@
>      char *ptr = (char *)SvPV( $source, na );
>      temp = DOMString(ptr);
>      $target = &temp;
> -  } else if (SWIG_ConvertPtr($source,(void **) &$target,SWIGTYPE_p_DOMString)) {
> +  } else if (SWIG_GetPtr($source,(void **) &$target,"DOMString")) {
>      croak("Type error in argument 2 of $name, Expected perl-string or DOMString.");
>      XSRETURN(1);
>    }
> 
> 
> --- ./XERCES_wrap.C~	Fri Mar  2 18:41:54 2001
> +++ ./XERCES_wrap.C	Fri Mar  2 20:58:26 2001
> @@ -5095,7 +5095,7 @@
>          croak("Type error in argument 1 of DOM_Range_getCommonAncestorContainer. Expected %s", SWIGTYPE_p_DOM_Range->name);
>          XSRETURN(1);
>      }
> -    result = new DOM_Node const (arg0->getCommonAncestorContainer());    ST(argvi) = sv_newmortal();
> +    result = new DOM_Node (arg0->getCommonAncestorContainer());    ST(argvi) = sv_newmortal();
>      SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_DOM_Node);
>      XSRETURN(argvi);
>  }
> @@ -6075,20 +6075,22 @@
>  
>  
>  XS(_wrap_new_FileInputSource) {
> -    char *arg0 ;
>      int argvi = 0;
> +    int _arg0_int;
> +    char * _arg0_charPtr;
>      FileInputSource *result ;
>      dXSARGS;
>      
> -    if ((items < 1) || (items > 1)) 
> -    croak("Usage: new_FileInputSource(filename);");
> -    if (! SvOK((SV*) ST(0))) {
> -        arg0 = 0; 
> -    }
> -    else {
> -        arg0 = (char *) SvPV(ST(0),PL_na); 
> +    if (  SvIOKp( ST(0) )  ) {
> +        _arg0_int = (int) SvIV( ST(0) );
> +        result = (FileInputSource *)new FileInputSource(_arg0_int);
> +    } else if (  SvPOKp( ST(0) )  ) {
> +        _arg0_charPtr = (char *) SvPV(ST(0),PL_na);
> +        result = (FileInputSource *)new FileInputSource(_arg0_charPtr);
> +    } else {
> +        croak("Type error in argument 1 of new FileInputSource. Expected integer or string.");
> +        XSRETURN(1);
>      }
> -    result = (FileInputSource *)new FileInputSource((char const *)arg0);
>      ST(argvi) = sv_newmortal();
>      SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_FileInputSource);
>      XSRETURN(argvi);
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-p-dev-help@xml.apache.org
> 
> 




Re: xerces-perl 1.3 and uploading to download page

Posted by "Harmon S. Nine" <hn...@netarx.com>.
Jason --

It looks as though SWIG_ConvertPtr is being taken out and replaced with 
SWIG_GetPtr in
this diff-file snippet.  Is the mod is actually opposite to this (just 
making sure :-)?

-- Harmon

> --- ./XERCES.i	Fri Mar  2 18:38:41 2001
> +++ ./XERCES.i~	Fri Feb 23 19:07:27 2001
> @@ -38,7 +38,7 @@
>      char *ptr = (char *)SvPV( $source, na );
>      temp = DOMString(ptr);
>      $target = &temp;
> -  } else if (SWIG_ConvertPtr($source,(void **) &$target,SWIGTYPE_p_DOMString)) {
> +  } else if (SWIG_GetPtr($source,(void **) &$target,"DOMString")) {
>      croak("Type error in argument 2 of $name, Expected perl-string or DOMString.");
>      XSRETURN(1);
>    }
> 



Re: xerces-perl 1.3 and uploading to download page

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Jason E. Stewart" <ja...@openinformatics.com> writes:

> "Jason E. Stewart" <ja...@openinformatics.com> writes:
> 
> > "Harmon S. Nine" <hn...@netarx.com> writes:
> > 
> > > I have xerces-perl-1.3.  Actually, I sent it to this list about a
> > > week ago.  So far, I have gotten only one (albeit very good)
> > > response.  Has anyone else had a chance to evaluate it?
> > 
> > Hey Harmon,
> > 
> > Which version of SWIG are you using?
> 
> I just grabbed the debian swig-1.1.p5-6 package and it worked fine:
> 

I have been able to get it to compile with SWIG-1.3a5. It required a
modification in Xerces.i to use the new pointer mechanism instead of
SWIG_GetPtr(), and a slightly different patch to Xerces_wrap.C.

However, the tests all fail due to different naming conventions used
by SWIG 1.3 :-(

I was hoping that the new 1.3 development branch of SWIG would fix
some of the outstanding problems, such as being able to run Xerces in
the debugger.

In any case here are the patches...

jas.

--

--- ./XERCES.i	Fri Mar  2 18:38:41 2001
+++ ./XERCES.i~	Fri Feb 23 19:07:27 2001
@@ -38,7 +38,7 @@
     char *ptr = (char *)SvPV( $source, na );
     temp = DOMString(ptr);
     $target = &temp;
-  } else if (SWIG_ConvertPtr($source,(void **) &$target,SWIGTYPE_p_DOMString)) {
+  } else if (SWIG_GetPtr($source,(void **) &$target,"DOMString")) {
     croak("Type error in argument 2 of $name, Expected perl-string or DOMString.");
     XSRETURN(1);
   }


--- ./XERCES_wrap.C~	Fri Mar  2 18:41:54 2001
+++ ./XERCES_wrap.C	Fri Mar  2 20:58:26 2001
@@ -5095,7 +5095,7 @@
         croak("Type error in argument 1 of DOM_Range_getCommonAncestorContainer. Expected %s", SWIGTYPE_p_DOM_Range->name);
         XSRETURN(1);
     }
-    result = new DOM_Node const (arg0->getCommonAncestorContainer());    ST(argvi) = sv_newmortal();
+    result = new DOM_Node (arg0->getCommonAncestorContainer());    ST(argvi) = sv_newmortal();
     SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_DOM_Node);
     XSRETURN(argvi);
 }
@@ -6075,20 +6075,22 @@
 
 
 XS(_wrap_new_FileInputSource) {
-    char *arg0 ;
     int argvi = 0;
+    int _arg0_int;
+    char * _arg0_charPtr;
     FileInputSource *result ;
     dXSARGS;
     
-    if ((items < 1) || (items > 1)) 
-    croak("Usage: new_FileInputSource(filename);");
-    if (! SvOK((SV*) ST(0))) {
-        arg0 = 0; 
-    }
-    else {
-        arg0 = (char *) SvPV(ST(0),PL_na); 
+    if (  SvIOKp( ST(0) )  ) {
+        _arg0_int = (int) SvIV( ST(0) );
+        result = (FileInputSource *)new FileInputSource(_arg0_int);
+    } else if (  SvPOKp( ST(0) )  ) {
+        _arg0_charPtr = (char *) SvPV(ST(0),PL_na);
+        result = (FileInputSource *)new FileInputSource(_arg0_charPtr);
+    } else {
+        croak("Type error in argument 1 of new FileInputSource. Expected integer or string.");
+        XSRETURN(1);
     }
-    result = (FileInputSource *)new FileInputSource((char const *)arg0);
     ST(argvi) = sv_newmortal();
     SWIG_MakePtr(ST(argvi++), (void *) result, SWIGTYPE_p_FileInputSource);
     XSRETURN(argvi);



Re: xerces-perl 1.3 and uploading to download page

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Jason E. Stewart" <ja...@openinformatics.com> writes:

> "Harmon S. Nine" <hn...@netarx.com> writes:
> 
> > I have xerces-perl-1.3.  Actually, I sent it to this list about a
> > week ago.  So far, I have gotten only one (albeit very good)
> > response.  Has anyone else had a chance to evaluate it?
> 
> Hey Harmon,
> 
> Which version of SWIG are you using?

I just grabbed the debian swig-1.1.p5-6 package and it worked fine:

All tests successful.
Files=9, Tests=11,  6 wallclock secs ( 3.05 cusr +  0.67 csys =  3.72 CPU)

I had to modify Makefile.PL to accept $XERCESCROOT:
--- ./Makefile.PL	Fri Feb 23 19:07:26 2001
+++ /xerces-perl-1.3.0/Makefile.PL	Fri Mar  2 17:43:47 2001
@@ -1,11 +1,13 @@
 use ExtUtils::MakeMaker;
+use Env qw(XERCESCROOT);
 
+print STDERR "Using XERCESCROOT = $XERCESCROOT\n";
 sub MY::postamble {
   chomp(my @header_files = `find Xerces_headers -name "*.hpp"`);
   local $" = ' ';
 <<TERMINUS;
 XERCES_wrap.C XERCES.pm: XERCES.i @header_files 
-	swig \$(INC) -perl5 -c++ -shadow -o XERCES_wrap.C XERCES.i
+	/usr/bin/swig \$(INC) -perl5 -c++ -shadow -o XERCES_wrap.C XERCES.i
 	perl postSource.pl XERCES_wrap.C
 	perl postModule.pl XERCES.pm
 	patch XERCES_wrap.C XERCES_wrap.diff
@@ -30,8 +32,8 @@
     'XERCES.pm' => '$(INST_ARCHLIB)/XERCES.pm',
     'RTTI.pm'   => '$(INST_LIB)/RTTI.pm',
   },
-  'INC'         => '-I. -INew_classes_perl',
-  'LIBS'        => '-lxerces-c -lpthread',
+  'INC'         => "-I. -INew_classes_perl -I$XERCESCROOT/include",
+  'LIBS'        => "-L/usr/local/lib -L$XERCESCROOT/lib -lxerces-c1_3 -lpthread",
   'NAME'        => 'XERCES',
   'OBJECT'      => $OBJECTS,

jas.

Re: xerces-perl 1.3 and uploading to download page

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Jason E. Stewart" <ja...@openinformatics.com> writes:

> Just got back from a two week vacation. I have been unable to get your
> 1.3 to compile to do SWIG incompatibility. 

uhh... that would be 'due to' SWIG incompatibility.

jas.

Re: xerces-perl 1.3 and uploading to download page

Posted by "Harmon S. Nine" <hn...@netarx.com>.
Hi, Jason.  Hope the vacation was indeed a vacation :-) (I always seem 
to come back from
them more tired than when I left).

Anyway, here's the output of "swig -version":

#===================================
$ swig -version

SWIG Version 1.1 (Patch 5)
Copyright (c) 1995-98
University of Utah and the Regents of the University of California

Compiled with c++
#===================================

What would a developers "XERCES.i" have that a non-developers version 
wouldn't?

Good suggestion about the end-users.  Perhaps we could extend the 
developers XERCES.i
idea to xerces-perl as a whole.  That is, there could be two xerces-perl 
distributions,
xerces-perl-1.3.0.tar.bz2 for the end user, which includes only 
XERCES_wrap.C and
XERCES.pm, etc., and xerces-perl-dev-1.3.0.tar.bz2 which has the whole 
sh-bang.

-- Harmon

Jason E. Stewart wrote:

> "Harmon S. Nine" <hn...@netarx.com> writes:
> 
> 
>> I have xerces-perl-1.3.  Actually, I sent it to this list about a
>> week ago.  So far, I have gotten only one (albeit very good)
>> response.  Has anyone else had a chance to evaluate it?
> 
> Hey Harmon,
> 
> Just got back from a two week vacation. I have been unable to get your
> 1.3 to compile to do SWIG incompatibility. What version of SWIG was it
> written for? I grabbed a5 off www.swig.org, and had all sorts of
> trouble. 
> 
> My thoughts:
> * having Xerces.i for developers is necessary
> * having end users use SWIG is probably a bad idea, we probably want
>   to include the already SWIG'ed Xerces.C and Xerces.pm
> 
> Which version of SWIG are you using?
> 
> jas.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-p-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-p-dev-help@xml.apache.org
> 
> 




Re: xerces-perl 1.3 and uploading to download page

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Harmon S. Nine" <hn...@netarx.com> writes:

> I have xerces-perl-1.3.  Actually, I sent it to this list about a
> week ago.  So far, I have gotten only one (albeit very good)
> response.  Has anyone else had a chance to evaluate it?

Hey Harmon,

Just got back from a two week vacation. I have been unable to get your
1.3 to compile to do SWIG incompatibility. What version of SWIG was it
written for? I grabbed a5 off www.swig.org, and had all sorts of
trouble. 

My thoughts:
* having Xerces.i for developers is necessary
* having end users use SWIG is probably a bad idea, we probably want
  to include the already SWIG'ed Xerces.C and Xerces.pm

Which version of SWIG are you using?

jas.