Re: Manipulating the perl stack from within a non-XSUB function

2000-05-16 Thread Nick Ing-Simmons
Alan Burlison [EMAIL PROTECTED] writes: Nick Ing-Simmons wrote: Ah, oops sorry I missed the PPCODE vs CODE issue. (The machine-level programmer in me distrusts moving the stack back before one is finished with it so for that reason I seldom use PPCODE.) I'm pushing variably sized lists onto

Re: Manipulating the perl stack from within a non-XSUB function

2000-05-14 Thread Nick Ing-Simmons
Alan Burlison [EMAIL PROTECTED] writes: Nick Ing-Simmons wrote: if (mystp = getmystructbyid(id)) { pushret_mystruct(mystp); return; } else { XSRETURN_EMPTY; } This isn't quite right (well, actually it doesn't

Re: XS and header files

2000-11-07 Thread Nick Ing-Simmons
not. It just seems odd to me. Their placement relative to other headers can be absolutely vital. I can be essential to set things up before "perl.h" includes the known universe. -- Nick Ing-Simmons

Re: Dynamically loading the shared objects

2000-12-21 Thread Nick Ing-Simmons
ds, Soumen -- Nick Ing-Simmons

Re: Return Value comparison for const wchar_t*

2001-01-29 Thread Nick Ing-Simmons
incorrect ? You cannot use perl's string operators on wide chars like that, they will work if you tell them about the nulls. If yes, then how do I get a proper value when I print, and what could be done so that the comparison works? Unicode, perl5.6+ Thanks, Manisha -- Nick Ing-Simmons

Re: How do I include a .h file with my XS module distribution?

2001-07-13 Thread Nick Ing-Simmons
($ddir,'SomeFile.h'); } Then your .h file will get installed along with the .pm files. Thanks... - D [EMAIL PROTECTED] -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: How to pass file handles?

2001-11-30 Thread Nick Ing-Simmons
the probable repitition. I really appreciate any help I might receive. That makes two of us. I couldn't find so much as a shred of documentation on this. Even some example code would be better than nothing. Steve -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: How to pass file handles?

2001-12-01 Thread Nick Ing-Simmons
) of this topic. I really appreciate any help I might receive. Yeah, I meant that. Thanks, Nick! Forrest Cahoon not speaking for merrill corporation -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Makefile.PL, ActiveState and MSVC5.0

2001-12-21 Thread Nick Ing-Simmons
service packs) is a bit buggy - one must not use optimization. Alternately, you can try to find a replacement shell (sorry, I don't have a recommendation) or work around the several problems that you'll likely run into (usually by patching things in ExtUtils). Tye -- Nick Ing-Simmons http://www.ni

Re: Building an array of objects

2002-01-31 Thread Nick Ing-Simmons
this kind of information. Can someone please help? Thanks in advance! - m. -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: global

2002-03-25 Thread Nick Ing-Simmons
a function: #define ACCESS_XYZ() XYW and MODULE ... PREFIX = ACCESS_ int ACCESS_XYX() THis seems to be missing something. -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Basic question

2002-04-17 Thread Nick Ing-Simmons
MODULE line, then processes each paragraph according to its own syntax. There is an h2xs tool which tries to parse .h and generate .xs which would export that to perl. -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Debugging c++ shared libraries

2002-05-20 Thread Nick Ing-Simmons
Bill Moseley [EMAIL PROTECTED] writes: At 05:30 PM 05/20/02 +0100, Nick Ing-Simmons wrote: If I copy the .xs code into a main {} block and build a stand-alone C program it works fine everyplace. Static linking the extension into perl should also work. Hum, not exactly sure what you

Re: Debugging c++ shared libraries

2002-05-21 Thread Nick Ing-Simmons
Bill Moseley [EMAIL PROTECTED] writes: At 10:03 PM 05/20/02 +0100, Nick Ing-Simmons wrote: It works on linux/solaris and probably elsewhere with modern C++ systems. What it are you referring to? My module? Yes. Anything which mixes C++, exceptions and dynamic loading is not going

Re: perlcc

2002-05-23 Thread Nick Ing-Simmons
= PMOP (0x2cc640) pp_subst pmopsym = (OP*)pmop_list[50] substcont: op = LOGOP (0x2d0940) pp_substcont, pmop = PMOP (0x2cc5c0) pp_subst pmopsym = (OP*)pmop_list[51] and there's much more that this -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Problem with PUSHMARK, and call_sv in callbacks

2002-06-14 Thread Nick Ing-Simmons
Get Your Free, Private E-mail at http://mail.go.com -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: SV* reference from C to Perl

2002-09-24 Thread Nick Ing-Simmons
(args_av, i, (SV *) newSVpv(c_args[i], 0)); } } OUTPUT: argv_ptr RETVAL = -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: debugging embedded perl

2002-09-29 Thread Nick Ing-Simmons
in libperl.a (or perl5X.dll or ...) On Solaris/Linux etc. such symbols are resolved against the root executable, but not against other loadables. For some reason your C++ root is not exporting those symbols. Please show us exactly how the C++ application was linked. -- Nick Ing-Simmons http://www.ni-s.u

Re: Calling constructor with xsub

2002-10-13 Thread Nick Ing-Simmons
! ;) XS sometimes makes me feel like that guy on the cover of Extending and Embedding Perl... Thanks, -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Calling constructor with xsub

2002-10-13 Thread Nick Ing-Simmons
typemap for OUTPUT does its thing to bless the object. -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: typemaps for vector... and other STL containers

2002-10-23 Thread Nick Ing-Simmons
a way to get $elemtype in this fragment: T_VECTOR $elemtype dummy; sv_to_vector($arg,$var,dummy) By looking at the xsubpp code we _may_ be able to find a way to fish $elemtype out of vectorelemtype -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: embedded perl memory leak

2002-10-25 Thread Nick Ing-Simmons
= SvRV( pVal ); iIsOk = PerlProcessReturnValue ( my_perl, pDerefVal, ps_Result ); } break; default: iIsOk = 0; } return iIsOk; } -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: perl_call_pv - call_pv

2002-11-17 Thread Nick Ing-Simmons
. (The PERL_NO_GET_CONTEXT mentioned in another thread turns off the magical fetching and requires you to have dTHX / pTHX but still supplies the aTHX as required.) dTHX - declare THread conteXt. pTHX - prototype THread conteXt. aTHX - actual/argument THread conteXt. -- Nick Ing-Simmons http://www.ni-s.u

Re: Accessing the perl stack from C

2002-12-06 Thread Nick Ing-Simmons
Aldo Calpini [EMAIL PROTECTED] writes: Nick Ing-Simmons wrote: It is better IMHO to have void peekstack(SV **stack,int items) and pass the values in. this is how I actually do it: void peekstack( register SV **sp, register SV **mark, I32 ax

Re: Retrieval of FILE* from a glob-ref under Win32

2003-01-14 Thread Nick Ing-Simmons
and perlstdio.h to get FILE * visible. I don't have an perl5.6 source base to hand to check what that is but from memory it was something like: #define PERLIO_NOT_STDIO 0 #include perl.h Thanks for any insight, Tassilo -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Having a C function directly push onto the stack

2003-01-17 Thread Nick Ing-Simmons
pointer. I know the .h files are not as clear as we would like, but it is worth taking a look at them when you are unclear. I believe all this is covered in Simon's book ... Thanks in advance for any explanations, Tassilo -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Having a C function directly push onto the stack

2003-01-19 Thread Nick Ing-Simmons
Nicholas Clark [EMAIL PROTECTED] writes: On Fri, Jan 17, 2003 at 12:40:49PM +, Nick Ing-Simmons wrote: The other main thing you need to keep in mind is that EXTEND (or the implied one in XPUSHs) can re-allocate stack and so it may move wholesale in memory. I think the XS macro ST(n

Re: How to use fclose() with ActivePerl

2003-01-21 Thread Nick Ing-Simmons
: unresolved external symbol _PerlIO_importFILE Where is this extern PerlIO_importFILE() supposed to come from? Under perl5.6 a PerlIO * _is_ a FILE * so PerlIO_importFILE can be a no-op macro (I think this is still true under PERL_IMPLICIT_SYS). -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Namespace Issues

2003-01-26 Thread Nick Ing-Simmons
at present is to create a noembed.h and ask SWIG to include that before iostream. It would contain #undef do_open etc. John -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Enums

2003-02-06 Thread Nick Ing-Simmons
-- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Replacing values in two hashes

2003-03-05 Thread Nick Ing-Simmons
Roman Porizka -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: HV to C struct

2003-03-11 Thread Nick Ing-Simmons
in UTF-8 */ return SvPV_nolen(*svp); } else { /* undef value */ return ; } } else { /* No such member */ return NULL; } -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Returning Boolean

2003-03-11 Thread Nick Ing-Simmons
/FALSE) returned as SvIV may make more sense. Steve -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Delaying a destroy on a parent object

2003-03-17 Thread Nick Ing-Simmons
: char * CLASS = SWISH::API::Results; Where SW_RESULTS is a O_OBJECT typemap. O_OBJECT sv_setref_pv( $arg, CLASS, (void*)$var ); -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Unicode and XS

2003-03-23 Thread Nick Ing-Simmons
' encoding uses core's SvUTF8 scheme - which is just fine if it _IS_ UTF-8 What we need for Encode::* to have its _own_ UTF-8 and UTF-EBCDIC encode/decode independant of what core is using... Thanks Brian -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: sv_setpvn buffer size limit???

2003-04-02 Thread Nick Ing-Simmons
similar problems on Linux (I'm not sure the problem is exactly the same on Linux as I haven't debugged it, but the symptoms are the same). I did quite long search on the net about this issue but I haven't found any similar (but found this list :-). Any thoughts? TIA Zoltan Magyar -- Nick Ing

Re: Embedding on Linux/390 -- Segfaults.

2003-06-06 Thread Nick Ing-Simmons
show those build command lines for linux/390 for C and C++? Does g++ build report any warnings? -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Embedding on Linux/390 -- Segfaults. (environment)

2003-06-06 Thread Nick Ing-Simmons
/site_perl . $ -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Embedding problems with DynaLoader on Solaris

2003-06-01 Thread Nick Ing-Simmons
dependencies properl.o: properl.c $(CC) $(CFLAGS) properl.c dll: $(EXE_DLL) Marc -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: getenv() problems

2003-06-03 Thread Nick Ing-Simmons
are not passing NULL you are passing NULL is (char *) 0 is pointer to a byte containing '\0'. You may need a custom typemap to cause (or better undef) to be passed to your library as NULL. -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Embedding problems with DynaLoader on Solaris

2003-06-04 Thread Nick Ing-Simmons
Marc Mettes [EMAIL PROTECTED] writes: Nick Ing-Simmons wrote: The compile and link lines look like this: gcc -c -fPIC -DPRO_MACHINE=19 -DPRO_OS=3 -DSOLARIS -I. -Iincludes -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/perl/lib/5.6.1/sun4-solaris/CORE properl.c ld -G

Re: Question about embedding interfacing with C++ objects

2003-06-16 Thread Nick Ing-Simmons
to the Perl API, and that might be a good starting point, but I wanted to see if anyone else has ventured into this arena. You can embed perl in C++ using perl's C API. You just have to to C-ish housekeeping rather than C++-ish housekeeping. -- Nick Ing-Simmons http://www.ni-s.u-net.com/

Re: Error:initializer element is not constant.

2003-07-24 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: My guess is that 'mpz_add' has been #defined to something like (*FunctionTablePtr-MPXADD) which is a common trick with dynamicaly loaded code. Try just preprocessing the file (dmake GMP.i might work for this??) D:\gmp-4.1\demos\perldmake gmp.i

Re: Test::More problem

2003-07-25 Thread Nick Ing-Simmons
Billy Patton [EMAIL PROTECTED] writes: something strange happening with testing using Test::More I have a t directory with my .t files Not even sure how to ask about problem? So forgive if problem is sketchy. If you don't use Test::More you will probably not be able to help. I can run perl

Re: Where is PerlIO_isutf8()?

2003-08-10 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: Nick Ing-Simmons wrote: Most of the PerlIO_Xxxx() are handled as a group in makedef.pl Which group -- the group in @layer_syms, or the group in __DATA__? layer_syms is the one I meant. __DATA__ is a hacking region I wish I had never invented. (My defence

Re: Warnings from perlvars.h

2003-08-14 Thread Nick Ing-Simmons
[EMAIL PROTECTED] writes: On Thu, Aug 07, 2003 at 04:32:22PM +0100, Nick Ing-Simmons wrote: bash-2.03$ ldd blib/arch/auto/Text/Aspell/Aspell.so libaspell.so.15 = /home/users/w/wh/whmoseley/aspell/lib/libaspell.so.15 libucb.so.1 = (file not found) [...] Fine

Re: I need your help

2003-08-14 Thread Nick Ing-Simmons
Jane Li [EMAIL PROTECTED] writes: Dear Ms./Sir, I am working on the problem of calling C++ functions from Perl. Your clear tutorial style web page: Gluing C++ And Perl Together gave me really great help. But what I am sticking now is that I have to embed a C++ function which asks two input

Re: Safefree() an array of arrays

2003-08-14 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: Hi, I'm building an n x n 2D array. I've declared the structure: int ** aoa; I've allocated the memory: Newz(100, aoa, n, int); Observation you asked for n 'int's there but you are stuffing it with n 'int *'s That should have been Newz(100, aoa, n, int

Re: ExtUtils::MakeMaker problem

2003-08-21 Thread Nick Ing-Simmons
Billy N. Patton [EMAIL PROTECTED] writes: I looked through man pages and read about overloading colon definitions. I'm already doing that. But MakeMaker spits out : FIXIN = $(PERLRUN) -MExtUtils::MY \ -e MY-fixin(shift) So you want to over-ride PERLRUN so that it uses the perl you want to

Re: Perl stacks and caller function

2003-08-21 Thread Nick Ing-Simmons
Christian Jaeger [EMAIL PROTECTED] writes: Hello (I've just subscribed to this list) I've tried to understand pp_caller, So have I ;-) and copied most code from it into an own function (I don't like the overhead of setting up the perl stack and call into a perl function just to find out

Re: Perl stacks and caller function

2003-08-21 Thread Nick Ing-Simmons
Christian Jaeger [EMAIL PROTECTED] writes: At 10:56 Uhr +0100 21.08.2003, Nick Ing-Simmons wrote: These hashes are called 'stashes'. So comparing stash is fine. Sorry, I copy-pasted the wrong entry, I've meant cop_stashpv. pp_caller returns CopSTASHPV(), and this macro accesses cop_stashpv

Re: Resolve symbols

2003-08-28 Thread Nick Ing-Simmons
Bustamam Harun [EMAIL PROTECTED] writes: Hmm. I only see this in your reply. Is there anything else that was missing? Nick Ing-Simmons wrote: No Message Collected Odd it made to to the list for me here is what I said: Nick Ing-Simmons [EMAIL PROTECTED] writes: Bustamam Harun [EMAIL

Re: return value from XSUB mysteriously disappearing on second invocation

2003-09-07 Thread Nick Ing-Simmons
Jan Dubois [EMAIL PROTECTED] writes: On Sun, 07 Sep 2003 09:49:32 +0200, Tassilo von Parseval [EMAIL PROTECTED] wrote: Hi there, this is the strangest thing I've ever encountered so far with XS. To me it looks like a very obscure bug in perl, but hopefully it's not. The Perl examples actually

Re: return value from XSUB mysteriously disappearing on second invocation

2003-09-08 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: I was once more thinking about this PUSHMARK/PUSHBACK issue. perlapi.pod described them as opening and closing brackets for the arguments. If I leave those off altogether, shouldn't then simply the current @_ be passed on to the callback? This would be

Re: Help with variable number of args

2003-09-17 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: On Wed, Sep 17, 2003 at 11:39:54AM +1000 Dave Horsfall wrote: Pardon me if this is a FANQ (Freq. Asked Newbie Question), but I cannot find any references to what I want to do. I'm porting some legacy Perl/C code; it was originally done under Perl3

Re: Help with variable number of args

2003-09-17 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: On Wed, Sep 17, 2003 at 05:25:57PM +0100 Nick Ing-Simmons wrote: Tassilo Parseval [EMAIL PROTECTED] writes: On Wed, Sep 17, 2003 at 11:39:54AM +1000 Dave Horsfall wrote: So you can see my dilemma; I need to tell the underlying C code how many

Re: Help with variable number of args

2003-09-18 Thread Nick Ing-Simmons
Dave Horsfall [EMAIL PROTECTED] writes: if ((abuf = fill_key(numargs, args, recnum)) == NIL(char)) The fill_key() function just took the Perl args and converted them into a structure used by the database. There's a whole bunch of code that I have left out, as I didn't want to overwhelm

Re: Difference bewteen SvPV_nolen() and SvPVbyte_nolen(), and how to get SvPVbyte_nolen() used?

2003-09-18 Thread Nick Ing-Simmons
[EMAIL PROTECTED] writes: Probably a newbie question. I had to modify a SvPV_nolen() to SvPVbyte_nolen() to get some code to work properly. What is the difference between SvPV_nolen() and SvPVbyte_nolen()? SvPV_nolen() returns char * to string part of a scalar in its current encoding state.

Re: Repost: [Fwd: Returning a list from an XSUB]

2003-09-18 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: Any comments on this, anyone? - Steve Original Message Subject: Returning a list from an XSUB Date: Mon, 08 Sep 2003 15:05:20 +0100 From: Steve Hay [EMAIL PROTECTED] To:[EMAIL PROTECTED] Hi, I have an XSUB that calls a C

Re: just want to confirm something

2003-09-22 Thread Nick Ing-Simmons
[EMAIL PROTECTED] writes: if I have a function foo() and there is a XS wrapper, int foo() CODE: perl_foo() ..the perl_foo() is created automatically, it is litterally perl's version of foo()? No - perl_foo() is NOT created automatically. xsubpp could strip the prefix for you - avoiding the

Re: Specifying LIBS

2003-09-23 Thread Nick Ing-Simmons
Dave Horsfall [EMAIL PROTECTED] writes: I must be misreading the documentation or something... Perl 5.8.0, MakeMaker 6.03 I'm trying to specify a set of libraries like this in Makefile.PL: 'LIBS' = ['-L/usr/unify/lib -ld1.a -ld2.a -lx.a'] (where libd1.a etc live under /usr/unify/lib) and I get

RE: interfacing to (v)sprintf type things that expect varargs

2003-10-04 Thread Nick Ing-Simmons
Buzz Moschetti [EMAIL PROTECTED] writes: I had worked up something for HPUX and SunOS some years back. I will post if folks are interested. Thought this might be a standard in the XS arena by now. Saddly this is very hard. You say HPUX and SunOS, but you probably mean HP PA/SPARC. What C's ...

Re: Returning a pointer to local data

2003-10-30 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: What's the best way to have an XSUB return a string (char *) when the caller doesn't know how big that string will be? At a mortal string SV: void my_xsub() CODE: { ST(0) = sv_2mortal(newSVpv(string,strlen(string)); XSRETURN(1); } I like that style

Re: Returning a pointer to local data

2003-10-30 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: Is this certain that my_xsub() returns a mortal? No - but it needs to return something which something will eventually free. When looking into the generated C code, I see: { char *RETVAL; RETVAL = string; sv_setpv(TARG, RETVAL);

Re: Returning a pointer to local data

2003-10-30 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: Tassilo von Parseval wrote: On Thu, Oct 30, 2003 at 08:02:53PM +1100 Sisyphus wrote: Nick Ing-Simmons wrote: SV * my_xsub() CODE: { RETVAL = sv_2mortal(newSVpv(string,strlen(string)); } OUTPUT: RETVAL As regards that, Nick - is the 'sv_2mortal' part

Re: Returning a pointer to local data

2003-10-30 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: On Thu, Oct 30, 2003 at 11:13:47AM + Nick Ing-Simmons wrote: Sisyphus [EMAIL PROTECTED] writes: Tassilo von Parseval wrote: It is. If you have code like { my $var = my_xsub(); ... } Mortals are just

Re: Returning a pointer to local data

2003-10-30 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: Nick Ing-Simmons wrote: The sv_2mortal _IS_ needed in the void my_xsub() CODE: { ST(0) = sv_2mortal(newSVpv(string,strlen(string)); XSRETURN(1); } case. But it is inserted for you SV * return case: { RETVAL=newSV...; } #line 25 Foo.c ST(0

Re: Returning a pointer to local data

2003-10-31 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: I understand the second case there -- when the xsub is called as hello(1) -- but that leaves me wondering what ST(0) was in the case where the xsub was called without arguments. It is a stack - a hunk of memory. So if you don't have any args one it is: -

Re: Returning a pointer to local data

2003-10-31 Thread Nick Ing-Simmons
By the way what is the reason you do a PREINIT which does no init rather than CODE: { char *chartext; ... } ? I once fell foul of the problem described in the PREINIT entry in the perlxs manpage, namely: If a variable is declared inside a CODE: section it will follow any typemap code

Re: Perl XS help - XS won't return a hash of arrays

2003-11-17 Thread Nick Ing-Simmons
[EMAIL PROTECTED] writes: Hi Nick, my name is Doug Brann, and you don't know me. I'm sorry to be mailing this to you directly, but I've tried posting to the perl-xs newsgroup several times without success. It's the first time I've ever tried posting to a newsgroup, so I don't know if there is

Re: GTop: undefined symbol: glibtop_global_server

2003-11-26 Thread Nick Ing-Simmons
Eamon Daly [EMAIL PROTECTED] writes: Hi, everyone. I'm in a minor panic trying to compile GTop on a Red Hat Linux 7.2 box. When I compile, I get the error: Please specify prototyping behavior for Server.xs (see perlxs manual) That does not _need_ fixing. Subsequently, running anything with

XSRETURN(Function()) risky : Nasty segfault in Tk fixed

2003-12-09 Thread Nick Ing-Simmons
To let Tk list know a major gotcha blocking Tk release is fixed. Thanks to Steve Lide for the guest account on his G5 machine to track this! To let perl-xs list know even I am human and do dumb things ... void WidgetMethod(widget,name,...) SV *widget; SV *name; CODE: { Lang_CmdInfo

Re: XSRETURN(Function()) risky : Nasty segfault in Tk fixed

2003-12-10 Thread Nick Ing-Simmons
Marcus Holland-Moritz [EMAIL PROTECTED] writes: How about also fixing the source of the problem? Already suggested that to p5p. But that isn't going to help the folk with ActivePerl or RedHat or SuSE or ... --- XSUB.h.orig Wed Dec 10 20:39:37 2003 +++ XSUB.h Wed Dec 10 20:43:26 2003 @@

Re: catching Perl_croak

2003-12-23 Thread Nick Ing-Simmons
Marcus Holland-Moritz [EMAIL PROTECTED] writes: I am trying to debug the Zeta perl module which fails when calling a c sub by the name of Zeta::_present the call to the Zeta:_present is as follows: eval{ ($status, $reason, $howmany, @records) = Zeta::_present ($unique, $resultset,

Re: Not properly XS..

2004-01-06 Thread Nick Ing-Simmons
Alberto Manuel =?ISO-8859-1?Q?Brand=E3o_Sim=F5es?= [EMAIL PROTECTED] writes: Only to be sure, this means that when we use $/ with something other than \n Perl will slurp all the file to memory? No. It slurps till it finds $/ value. Each line you get with ends with $/ (if possible) i.e. in your

Re: extending SP disabling warnings in an XSUB

2004-01-10 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: Hi, two little questions this time. 1) When I return multiple values from an XSUB by doing a ST(0) = sv_newmortal(...); ST(1) = sv_newmortal(...); XSRETURN(2); do I have to do a prior EXTEND(SP, 2)? Currently I am not doing it and it seems

Re: Segfaults from XS code

2004-01-10 Thread Nick Ing-Simmons
Tels [EMAIL PROTECTED] writes: -BEGIN PGP SIGNED MESSAGE- Moin, I have written a (simple?) routine in XS that uses the GMP library to calculate the modular inverse. When running a small test file, it segfaults at the end of the testfile like this: ... ok 253 ok

Re: extending SP disabling warnings in an XSUB

2004-01-10 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: The risk is if what you show as '...' can croak() - then perhaps something to restore the SV would be appropriate. That fortunately can't happen in this particular case. But om the future, I might need something more generic, so... As this is an SV

Re: Segfaults from XS code

2004-01-11 Thread Nick Ing-Simmons
Tels [EMAIL PROTECTED] writes: -BEGIN PGP SIGNED MESSAGE- Moin, On Saturday 10 January 2004 19:22, Nick Ing-Simmons wrote: Tels [EMAIL PROTECTED] writes: -BEGIN PGP SIGNED MESSAGE- valgrid is complaining about XS_Math__BigInt__GMP_DESTROY can we see that please

Re: relocation error

2004-01-14 Thread Nick Ing-Simmons
Chris Masters [EMAIL PROTECTED] writes: Hi All, I'm getting the following error when running some perl code (that calls functions in my XS module) after compiling and installing my perl-xs module: perl: relocation error:

Re: relocation error

2004-01-17 Thread Nick Ing-Simmons
Chris Masters [EMAIL PROTECTED] writes: UPDATE - It's not a perl issue. 1 - I know the static (.a) C++ library works because I can compile and run programs that use it. Any chance .a file was _in_ that directory. It was. I'll check if this works otherwise. If I move the test

Re: XS code calling perl code, and storing stuff in an SV

2004-01-19 Thread Nick Ing-Simmons
Tels [EMAIL PROTECTED] writes: Now, instead of malloc() a struct like: struct BigInt { int flags; int sign; double P; double A; SV* CALC; }; and then putting a ptr to it into the PV slot, I thought I could:

Re: XS code calling perl code, and storing stuff in an SV

2004-01-19 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: On Mon, Jan 19, 2004 at 09:15:54AM + Nick Ing-Simmons wrote: Tels [EMAIL PROTECTED] writes: Now, instead of malloc() a struct like: struct BigInt { int flags; int sign; double P; double

Re: file-descriptor to Perl filehandle conversion

2004-01-19 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: On Mon, Jan 19, 2004 at 02:46:46AM -0800 Gisle Aas wrote: Tassilo von Parseval [EMAIL PROTECTED] writes: I was experimenting with something like PerlIO *io; char mode[8]; PerlIO_intmode2str(O_RDONLY|O_NONBLOCK, mode, NULL);

Re: XS code calling perl code, and storing stuff in an SV

2004-01-19 Thread Nick Ing-Simmons
Gisle Aas [EMAIL PROTECTED] writes: Take a look at the pictures at http://gisle.aas.no/perl/illguts/. They should explain how SVs are layed out. Thanks for the reminder - my bookmark was on the old laptop!

Re: XS code calling perl code, and storing stuff in an SV

2004-01-19 Thread Nick Ing-Simmons
Tels [EMAIL PROTECTED] writes: At first I thought this was due to size-considerations. However, That was the idea. I thought that a SV always has a IV, NV and PV slot, so It doesn't. See Gisle's diagrams. SV * has ONE pointer to a separately allocated something. The least memory case for an XS

Re: file-descriptor to Perl filehandle conversion

2004-01-19 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: PerlIO *io; char mode[8]; PerlIO_intmode2str(O_RDONLY|O_NONBLOCK, mode, NULL); io = PerlIO_fdopen(self-fd, mode); PerlIO_intmode2str(O_RDONLY|O_NONBLOCK, mode, NULL); The O_NONBLOCK _may_ be confusing it. And as

Re: XS code calling perl code, and storing stuff in an SV

2004-01-20 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: For me, PV has never really been for strings only. It's a pointer value so storing pointers in it seems natural to me. I am not saying it has to be a string. I am saying it MUST be allocated with the allocator perl is using - malloc() is WRONG - It

Re: file-descriptor to Perl filehandle conversion

2004-01-20 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: My concern was with PerIO_fdopen(). I didn't know whether perl would reuse the fd (and simply sort of wrap it in a PerlIO) or duplicate it. There is a pod which tells you. In case of duping, ignoring O_NONBLOCK would be bad. AFAIK a dup()ed fd

Re: file-descriptor to Perl filehandle conversion

2004-01-21 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: AFAIK a dup()ed fd inherits the non-blocking-ness along with all the other kernel level attributes like file position. As I've read in the PODs now, PerlIO_fdopen() will not dup the handle (since fdopen wont do it) and so I can't use it. As you

Re: file-descriptor to Perl filehandle conversion

2004-01-21 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: On Wed, Jan 21, 2004 at 09:20:40AM + Nick Ing-Simmons wrote: Tassilo Parseval [EMAIL PROTECTED] writes: AFAIK a dup()ed fd inherits the non-blocking-ness along with all the other kernel level attributes like file position. As I've read

Re: complex compile line into Makefile.PL

2004-01-21 Thread Nick Ing-Simmons
Chris Masters [EMAIL PROTECTED] writes: Hi All, I'm having trouble fitting the following compile line into my Makefile.PL: gcc -pipe -DNDEBUG -w -O3 -L/usr/local/BerkeleyDB.4.1/lib/ -lstlport_gcc -ldb_cxx -luuid -lpthread -lcurl -lc -lstdc++ -lz -w -pthread -fexceptions -D_GNU_SOURCE -D_MBCS

Re: Help define XS functionality for Module::Build

2004-01-23 Thread Nick Ing-Simmons
Randy W. Sims [EMAIL PROTECTED] writes: I'm also trying to figure out how best to implement nested builds. What degree of auto scanning for files should be used if any? Suggest we start small. If we have a non-auto scheme then us clever nested module authors can write our own scans. Risk

Re: Leakage in XS replacement for UNIVERSAL::VERSION

2004-01-23 Thread Nick Ing-Simmons
John Peacock [EMAIL PROTECTED] writes: upg_version() creates a temporary string copy (Safefree()'d) of the incoming SV and then calls scan_version(), which in turn does this (where rv is the incoming SV which will ultimately be returned to the top level caller): SV* sv = newSVrv(rv,

Re: PerlIO_seek() changed in 5.8.1+?

2004-01-26 Thread Nick Ing-Simmons
Dan Sully [EMAIL PROTECTED] writes: * Nick Ing-Simmons [EMAIL PROTECTED] shaped the electrons to say... I have seen weird fails like this when varying large file support and 64/32 bit IV Configure options. What happens is that 'offset' (your variable) is wrong size for Off_t

Re: T_PTROBJ and NULL Pointers

2004-01-29 Thread Nick Ing-Simmons
Bill Hails [EMAIL PROTECTED] writes: Hi, hopefully this is pretty straightforward. I'm using perl v5.6.1 and building an XS wrapper around FreeBSD's kevent/kqueue functions. The library passes around poiunters to structures, which I'm blessing into a package using the T_PTROBJ typemap entry.

Re: Controlling warnings and strict during runtime

2004-01-29 Thread Nick Ing-Simmons
; #define WARN_RESTORE \ PL_curcop-cop_warnings = oldwarn; WARN_RESTORE has to be called in the same scope of WARN_OFF, or you make 'oldwarn' a global variable. Nick Ing-Simmons mentioned that one could use save_item() to save the old value of PL_curcop-cop_warnings scope-wise. That however

Re: Unfortunate question about compiling embedded application on Perl 5.8.1 ...

2004-02-10 Thread Nick Ing-Simmons
Stanley Hopcroft [EMAIL PROTECTED] writes: Dear Folks, I am writing to thank you for encouragement and help this list has been to me, and to ask for your comments on this situation. A small application (call it a copy) based on the persistent.c example from perlembed was working quite happily

Re: Are perl_parse and perl_run thread safe?

2004-02-08 Thread Nick Ing-Simmons
Aditya Prasad [EMAIL PROTECTED] writes: Hello, I wanted to know if the functions perl_parse and perl_run are thread safe. In other words, i am using multiple perl interpreters allocated in different threads and these threads will be running parallely. I noticed that when one of the threads was

Re: Odd T_PTROBJ behaviour

2004-02-20 Thread Nick Ing-Simmons
Simon Wistow [EMAIL PROTECTED] writes: On Thu, Feb 19, 2004 at 05:53:24PM -0500, Randy W. Sims said: I'm just catching up on some of the mailing lists, and it looks like no ones answered your question, so... Much appreciated. Unfortunatelly, there is little up-to-date documentation on

  1   2   3   >