Re: XS and DESTROY

2006-08-31 Thread Nick Ing-Simmons
Steven N. Hirsch [EMAIL PROTECTED] writes: DESTROY is not necessarily called at the time the refcount hits zero. Yes it is. Perl cleans up objects without references only when leaving a scope. i.e. that is when it decrements the REFCOUNT (in the FREETMPS/LEAVE). D'oh. Sorry, I

Re: perl_parse problem

2006-08-31 Thread Nick Ing-Simmons
[EMAIL PROTECTED] writes: Hello all, I have a question regarding the perl_parse function. I have a multi threaded application. Each thread is running a function that creates a perl interpreter and uses it to parse and then run a perl function from an arbitrary file. I'm running this application

Re: XS and DESTROY

2006-08-10 Thread Nick Ing-Simmons
Florian Ragwitz [EMAIL PROTECTED] writes: Hello there, I wrote bindings for a small C library using XS. In those bindings I map some c structures to a perl objects, which are blesed into Audio::XMMSClient. The new() method allocates a new c structure structure and my bindings wrap it into an

Re: XS and DESTROY

2006-08-10 Thread Nick Ing-Simmons
Florian Ragwitz [EMAIL PROTECTED] writes: On Tue, Aug 08, 2006 at 12:37:03PM +, Jeremy White wrote: There should be no difference between a Perl or XS DESTROY method (in terms of when it's called). How are you creating the object? I wrote a function which packs the c data structure into a

Re: Perl, SWIG and multi threading

2006-08-07 Thread Nick Ing-Simmons
[EMAIL PROTECTED] writes: Hello, I would very much appreciate your answers on the following issue. I have a multi threaded application. Each thread is running a function that creates a perl interpreter and uses it to parse and then run a perl function from an arbitrary file. After running this

Re: Problems with the new constructor in a GD-derived module

2006-07-24 Thread Nick Ing-Simmons
Shlomi Fish [EMAIL PROTECTED] writes: Hi all! This is my first message to this list. To cut to the chase, I'm trying to write a derived class from the GD distribution in CPAN ( http://search.cpan.org/dist/GD/ ). The code I have now is here:

Re: use DBI fails and exits in some cases (embedded)

2006-07-21 Thread Nick Ing-Simmons
Pierre Chifflier [EMAIL PROTECTED] writes: [please CC me, I'm not subscribed] For ex, the code 'use DBI;' results in an error: jui 19 12:14:39 thread -1225401424 - 'SITE test' /home/pollux/DEL/sbin/wzdftpd: symbol lookup error: /usr/lib/perl5/auto/DBI/DBI.so: undefined symbol: Perl_Tstack_sp_ptr

Re: Using PerlIO to add an encryption layer

2006-06-26 Thread Nick Ing-Simmons
Florian Weimer [EMAIL PROTECTED] writes: I'm trying to implement an encryption layer using PerlIO (in C, not using PerlIO::via). Is it correct that I shouldn't provide yet another line discipline like PerlIO::encoding, but a completely new lowest layer (like the unix layer) which happens to use

Re: Embedding: load_module(), stack frames and Carp

2006-05-28 Thread Nick Ing-Simmons
Steve [EMAIL PROTECTED] writes: Argh!! Ok, I seem to be muddying the waters more and more with each post! The *first* frame is indeed the one I'm interested in (whole point of using Carp in the first place!). But it's got no useful data in it all. So, while I've misstated the situation, my

Re: Embedding: load_module(), stack frames and Carp

2006-05-26 Thread Nick Ing-Simmons
Steve [EMAIL PROTECTED] writes: Hullo, I'm calling code in a perl module from C. The problem is that since I'm loading the module via load_module() my Carp calls all break -- apparently because there's no caller to reference back to. If you are geting errors in the call_method() I think adding

Re: croaking without leaking resources

2006-05-05 Thread Nick Ing-Simmons
Vaclav Barta [EMAIL PROTECTED] writes: On Monday 01 May 2006 10:34, Nick Ing-Simmons wrote: the second one croaks, it doesn't get a chance to release the first... Is there some equivalent of try/catch in XS, or a way to register the compiled regexp as a Perl object, to be released

Re: croaking without leaking resources

2006-05-05 Thread Nick Ing-Simmons
Marcus Holland-Moritz [EMAIL PROTECTED] writes: try/catch (i.e. eval {} in perl speak) is a little tricky to do from pure XS. I usually call (a trivial) perl sub and use G_EVAL on the call. There's a way to do try/catch (under certain circumstances) in XS. If you use a recent ppport.h, it's

Re: Using a faster version of sv_derived_from?

2006-04-18 Thread Nick Ing-Simmons
Marvin Humphrey [EMAIL PROTECTED] writes: On Apr 13, 2006, at 10:42 AM, Jeremy White wrote: There's sv_isa, which should be cheaper than sv_derived_from at the expense of not testing inheritance relationships. I dunno if the overload affects impacts the ability to use it. Yeah, it's

Re: FILE* to PerlIO*

2006-04-04 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: Hi, I guess the succinct way of asking the question is how do I convert from a FILE* to a PerlIO* ?. I can't remember where I put it, but there is some POD somewhere which relates to this. If PerlIO happens to be using :stdio layer you can find the FILE *.

Re: accessing global variables in .xs wrapped libraries

2006-02-02 Thread Nick Ing-Simmons
Muppet [EMAIL PROTECTED] writes: Dirk Koopman said: So how do I find them and then set them (probably thru DynaLoader)? They are (at least for now) just simple ints. You could use tie'd scalars for this. Create your perl-level variables from perl, passing the c names to your tie, and tie them

Re: xs and ifdef

2005-12-15 Thread Nick Ing-Simmons
Yannick Bergeron [EMAIL PROTECTED] writes: Hi Nick, thanx for your help. This code is really more clear than the one I was about to used. But I've a compiling error from the autogenerate procsinfo.c Would be great if you could give me a hand with it thanx :) procsinfo.c, line 32.28: 1506-117

Re: Help in running perl script with arguments within a C code

2005-12-15 Thread Nick Ing-Simmons
Viresh Kumar [EMAIL PROTECTED] writes: Hello, I am facing a problem while running a perl script with arguments within a C program. The code is as below: Now the problem comes is regarding the loading of Digest::MD5 module which is used in the coverage module. The following error came: *Can't

Re: limits.h for XS data types

2005-12-15 Thread Nick Ing-Simmons
Marvin Humphrey [EMAIL PROTECTED] writes: Greets, Some of the algorithms I'm working on need to use sentinel values, which I'd typically get from limits.h. Can I get away with this? U32 aU32 = ULONG_MAX; while (aU32 == ULONG_MAX) { /* try to change aU32... * ...

Re: xs and ifdef

2005-12-10 Thread Nick Ing-Simmons
Yannick Bergeron [EMAIL PROTECTED] writes: I'm trying to write a module for an AIX structure named procinfo. This structure is different if we run AIX with a 32bit kernel or with a 64bit kernel the xs parser doesn't seem to like ifdef. How can I declarer the same subroutine for 32 bits and 64

Re: call_pv built-in

2005-07-28 Thread Nick Ing-Simmons
William Ahern [EMAIL PROTECTED] writes: Is it not possible to directly call built-in functions like caller? It is _possible_ to call perl ops from XS but is far from easy - I have never bothered to finish working out all the hoops you have to jump through. You can of course do what caller()

Re: constructive criticism of Module::Build for xs

2005-06-30 Thread Nick Ing-Simmons
Rob Janes [EMAIL PROTECTED] writes: Can anyone add to this? I posted this list of reasons why I don't use Module::Build, to the Module::Build list, not to cheese anybody off, but mostly cause somebody there asked me to. Then somebody there said I should get off the pot and submit some code.

Re: Converting long longs to SVs

2005-05-26 Thread Nick Ing-Simmons
Nicholas Clark [EMAIL PROTECTED] writes: On Tue, May 24, 2005 at 11:00:35PM +0200, Torsten Schoenfeld wrote: Aloha, is there any way to reliably convert long longs (64bit integers) to SVs (and back) on 32bit platforms without losing information, and without compiling with -Duse64bitint?

Re: Is there a warnings::enabled() equivalent in XS?

2005-04-11 Thread Nick Ing-Simmons
Sherm Pendley [EMAIL PROTECTED] writes: Is there a more direct XS equivalent to warnings::enabled(), Not that I am aware of, but this isn't an area I am very familiar with. Looking at the perl code for enabled and its helper __chk I doubt something that complicated has been also implemented in C

Re: .pm new and .xs new

2005-04-11 Thread Nick Ing-Simmons
Reinhard Pagitsch [EMAIL PROTECTED] writes: Hello, What I want is that in my .pm I use the sub new method to make some initialation. But in my XS module I have also the new for the C++ class constructor. Now I found out that if I call in my test.pl MyPackage-new($file) the method in the XS will

Re: Perl Newbie - looking for info on xs

2005-04-11 Thread Nick Ing-Simmons
Tassilo von Parseval [EMAIL PROTECTED] writes: On Wed, Feb 23, 2005 at 09:37:01PM +0100 Tommy Nordgren wrote: I wan't to find recommendations on a suitable book about writing External Perl Modules In particular, I wan't to know how to do this in C++, with a lot of static/global variables

Re: speed

2005-02-26 Thread Nick Ing-Simmons
Dirk Koopman [EMAIL PROTECTED] writes: On Sun, 2005-02-20 at 16:20 +, Nick Ing-Simmons wrote: Dirk Koopman [EMAIL PROTECTED] writes: In my interfacing to my library I am starting hit performance issues related to extracting values from the library and passing to perl. snip Questions

Re: av_undef

2005-02-26 Thread Nick Ing-Simmons
Steven N. Hirsch [EMAIL PROTECTED] writes: On Wed, 23 Feb 2005, William Ahern wrote: Has anyone run into the issue of av_undef not doing what is advertized in perlguts, namely freeing the object? That isn't what it does. av_undef is like @array = (); i.e. it frees the contents (REFCNTs

Re: av_undef

2005-02-26 Thread Nick Ing-Simmons
Steven N. Hirsch [EMAIL PROTECTED] writes: This, I think, is the crux of my problem. I suppose I could contrive to always wrap the XS call in a do-nothing set of braces. However, I'm curious as to whether a better approach would be to establish a new perl calling context on entry:

Re: speed

2005-02-20 Thread Nick Ing-Simmons
Dirk Koopman [EMAIL PROTECTED] writes: In my interfacing to my library I am starting hit performance issues related to extracting values from the library and passing to perl. Before I start profiling I thought I would look at the code, so in XS (for a very simple function call): double fffixr(d)

Re: Extending an embedded Perl interpreter without a .pm file

2005-02-20 Thread Nick Ing-Simmons
David Southern [EMAIL PROTECTED] writes: So, the question: Is there a way that I can make XSUBs availiable to my perl interpreter without having to have the .pm file around at all? Of course. If you look at what your DynTrans.pm file does it probably does something like use XSLoader qw(load);

Re: Confusion with stricmp on Win32

2005-02-02 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: Given that the following C program outputs -1 on my Win32 system: #include stdio.h #include string.h void main(void) { printf(%d\n, stricmp(a, z)); } why is it that the following XS code outputs -25: #include string.h #include EXTERN.h #include perl.h

Re: wchar_t *

2005-01-24 Thread Nick Ing-Simmons
Reinhard Pagitsch [EMAIL PROTECTED] writes: Hello, I have an other problem: I pass a file name to my XS code which have to be of type wchar_t *. I tryed it in the .XS as follow int properties::ReadProperty(File); wchar_t * File We would need to see what that expands to. But

Re: XS and C++

2005-01-22 Thread Nick Ing-Simmons
Reinhard Pagitsch [EMAIL PROTECTED] writes: Reinhard Pagitsch wrote: Hello, I try to use C++ code in my perl XS module, but allways I get the following errors from cl: Prop.c(49) : warning C4518: 'void ' : storage-class or type specifier(s) unexpected here; ignored Prop.c(49) : error

Re: XS and C++

2005-01-22 Thread Nick Ing-Simmons
Reinhard Pagitsch [EMAIL PROTECTED] writes: Hello Paul, Am 21.01.2005 17:51 schrieb Paul Johnson: On Fri, Jan 21, 2005 at 10:41:52AM +0100, Reinhard Pagitsch wrote: The code in the prop.c where the error is looks XS(XS_Win32__File__Prop_ReadProperty) { dXSARGS; if (items != 1)

Re: Loss of stdout and stderr in embedded Perl

2005-01-15 Thread Nick Ing-Simmons
Jeremy Redburn [EMAIL PROTECTED] writes: Hello, I have some code which maintains a pool of Perl interpreters in C and allocates an interpreter as requests come in. It works well enough, but I have run into an issue that my embedded Perl code cannot print to STDOUT or STDERR. What happens -

Re: wide characters

2005-01-15 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: Nick Ing-Simmons wrote: Sisyphus [EMAIL PROTECTED] writes: and the Inline C function: void pass_wide_string(SV * w) { wchar_t * widestring = SvPV_nolen(w); . . Is that a correct way for pass_wide_string() to grab the argument

Re: Describing green to the blind .. embedded Perl leak rate muchgreater with 5.8.5 than 5.005.

2005-01-15 Thread Nick Ing-Simmons
Stanley Hopcroft [EMAIL PROTECTED] writes: Dear Folks, I am writing to ask for some clues dealing with an intolerable memory leak of an application that embeds Perl. The application is Nagios 2.0b1 (http://www.Nagios.ORG), a GPL availability monitor (like Big Brother or Mon). Nagios 1.2 would

Re: wide characters

2005-01-10 Thread Nick Ing-Simmons
Resend - I did not seen this on perl-xs list Sisyphus [EMAIL PROTECTED] writes: Hi, In an Inline C script I'm trying to pass a wide character string from perl. The perl side would look like (eg): $s =3D chr(12345) . chr(54321); SvPV of s now has two chars utf8 encoded. pass_wide_string($s);

Re: wide characters

2005-01-08 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: Hi, In an Inline C script I'm trying to pass a wide character string from perl. The perl side would look like (eg): $s = chr(12345) . chr(54321); SvPV of s now has two chars utf8 encoded. pass_wide_string($s); and the Inline C function: void

Re: debugging XS code with Visual C

2005-01-07 Thread Nick Ing-Simmons
Reinhard Pagitsch [EMAIL PROTECTED] writes: Hello, == First I want to whish all a Happy New Year. == I got the VC 2005 beta 1. And now I try to debug my XS code I written last year. But I can not find informations how to debug XS code with

Re: Catching Perl_croak() from XS

2005-01-02 Thread Nick Ing-Simmons
Marcus Holland-Moritz [EMAIL PROTECTED] writes: I'm wondering if someone else ever wanted to do this... Deep inside my XS module I create an object and pass it to a function (which may pass it to other functions and so on). However, any of these functions may call Perl_croak(), and if they do, I

Re: getter and mortal results

2005-01-02 Thread Nick Ing-Simmons
Sergey Skvortsov [EMAIL PROTECTED] writes: Hi. I can't fully understand why there is need to mark values returned from XS-method as mortal if they are referenced (owned) by object itself. There is no such need. Marking things as mortal just arranges for an SvREFCNT_dec() on the FREETMPS that is

Re: repeatedly doing call_sv and gathering return values on the stack

2005-01-02 Thread Nick Ing-Simmons
Tassilo von Parseval [EMAIL PROTECTED] writes: Hi, for a pairwise-map, thusly: my @c = pairwise { $a + $b } @a, @b; I have written an XSUB that I think is doing dangerous stuff with the Perl stack. Here's the gist of it: PROTOTYPE: [EMAIL PROTECTED]@ SV *code; /* codeblock

Re: Determine if sv == PL_sv_yes

2004-12-15 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: How does it get done in perl-space ? For variables $foo you can't as $foo has its own SV and it isn't sv_yes. For args to things something like !!$foo should work unless optimizer clobbers !! It seems that overload.pm does it reliably, though I can't see

Re: Determine if sv == PL_sv_yes

2004-12-15 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: Tassilo von Parseval wrote: Where did it work? Further above you said that the comparison 'a == PL_sv_yes' was never true. Yeah . confusing :-) I have a module that has: use overload '-' = \mysub; where mysub() is an XS subroutine. (Actually,

Re: XSRETURN_*

2004-12-06 Thread Nick Ing-Simmons
Muppet [EMAIL PROTECTED] writes: Muppet wrote: third, that's not a very perlish failure. wouldn't it make more sense to croak() on that error? e.g.: if (! foo (x)) croak (Wrong parameter %d, x); /* does not return */ Hmm, on my understanding is that croak writes only to the

Re: XS to perl callback, followed recipe, cake fell

2004-11-22 Thread Nick Ing-Simmons
Jim Cromie [EMAIL PROTECTED] writes: folks, I just tried to modify Devel::Size to teach it to compute the size of subroutines. Since B::Concise can walk an optree, Im trying to call it (perl code) from Devel::Size::thing_size (XS code). Ive followed the recipe in perldoc perlcall (1 arg, 1

Re: Getting __PACKAGE__ in an XSUB

2004-10-12 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: Nick Ing-Simmons wrote: Steve Hay [EMAIL PROTECTED] writes: How does an XSUB find out what package it is compiled into? An XSUB isn't compiled into a package ;-) Remember that. Its CV is entered into a stash but its body (which is what __PACKAGE__ refrers

Re: Getting __PACKAGE__ in an XSUB

2004-10-11 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: How does an XSUB find out what package it is compiled into? An XSUB isn't compiled into a package ;-) Its CV is entered into a stash but its body (which is what __PACKAGE__ refrers to) doesn't really have any meaning. That is to say current package (i.e.

Re: Destructors and magic [was: Re: Leaking memory with sv_usepvn()]

2004-10-08 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: Nick Ing-Simmons wrote: If you use the MAGIC * as the signature it can't fail ;-) An excellent idea. So attached is hopefully my final take. Which looks fine - I see there is another mail though so will study that. Using sv_magic(), I've dropped the re-use

Re: Returning a magical SV to Perl

2004-10-08 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: Why is it that when I create an SV and assign magic to it in an XSUB, and then return the magical SV to Perl code, I find that the scalar in the Perl code no longer seems to have magic? If you print something the FooFree() you will see what is happening. You

Re: THX usage and implications

2004-09-24 Thread Nick Ing-Simmons
Bjoern Hoehrmann [EMAIL PROTECTED] writes: * Nick Ing-Simmons wrote: http://search.cpan.org/src/BJOERN/SGML-Parser-OpenSP-0.02/OpenSP.xs is a C++ XS extension. I am trying to figure out what is needed, if anything, to make it play nicely in the context of multiple threads. The MOST important

Re: XS_unpack_ptrptr undefined.

2004-09-23 Thread Nick Ing-Simmons
Scott T. Hildreth [EMAIL PROTECTED] writes: Hello Nick, Sorry to send this to you directly, but I hopping to get a explanation soon. I sent this to the perl-xs list, but my post is not showing up. This happens with the DBI-users as well, I will post a question or reply and it will show up

Re: make dist and tar?

2004-09-20 Thread Nick Ing-Simmons
Reinhard Pagitsch [EMAIL PROTECTED] writes: If I want to do a make dist Perl allways try to use tar.exe and gzip from my Windows home directory. Ok, I had installed a tar.exe and gzip.exe, but they didn't worked so I removed them. Where can I tell Perl to use his Archive::Tar again to make the

Re: Q: av_push

2004-09-17 Thread Nick Ing-Simmons
Reinhard Pagitsch [EMAIL PROTECTED] writes: Whats about the REFCNT? Can you please explain or give me a link where I can read it? Best I can suggest in perl docs is Reference Counts and Mortality in perlguts.pod But I agree that isn't a tutorial. I can't recommend a book off hand. BTW is

Re: beginner with PERLXS,Mingw32,dmake.

2004-09-15 Thread Nick Ing-Simmons
PerlDiscuss - Perl Newsgroups and mailing lists [EMAIL PROTECTED] writes: Sisyphus wrote: PerlDiscuss - Perl Newsgroups and mailing lists wrote: Hello , I am new in using PERLXS facility. I am trying example 4 of perlxstut on win32(nt4) with Perl 5.8.3 build from activestate

Re: Newbe question(s)

2004-09-04 Thread Nick Ing-Simmons
Reinhard Pagitsch [EMAIL PROTECTED] writes: Thank you for your informations, it seems to me I have to do the same way. The most interesting things to me is where perl stores XS _return_ values and how to capture it from the .pm module. XS return values go on the stack in the same way that

Re: ::can() before call_method()?

2004-08-23 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: Right, I looked at it in the context of optional event handlers where it is common that specific methods do not exist. In Perl, if $o-x is called even though there is no method x, Perl would die; so my question is rather whether call_method for a

Re: Is it sane to embed a non-threaded Perl in a threaded app ?

2004-08-19 Thread Nick Ing-Simmons
Stanley Hopcroft [EMAIL PROTECTED] writes: Dear Ladies and Gentlemen, For many years, the network monitor named Netsaint and latterly Nagios has happily embedded Perl and reaped the same sorts of benefits from Perl 'service checks' as Apache does with Perl CGIs from mod_perl (although the

Re: Resolving .pl/.pm path dependency from perl_parse?

2004-08-18 Thread Nick Ing-Simmons
Gopakumar Ambat [EMAIL PROTECTED] writes: Hello, I have a PERL script being launched from my C++ code; the .pl file exists in C:\myperl\script, the .pm it uses is in C:\myperl\perl\modules. To resolve the .pm path, I have use lib../perl/modules #resolves path to C:\myperl\perl\modules The

Re: Warning about unused var RETVAL

2004-08-16 Thread Nick Ing-Simmons
Muppet [EMAIL PROTECTED] writes: but the idiom of XS is to use PPCODE when you're returning more than one value. when people read your xsubs and see CODE they're going to be surprised when they find multiple values returned. s/suprised/educated/ ;-) Most of the time, my XSUBs follow

Re: Warning about unused var RETVAL

2004-08-16 Thread Nick Ing-Simmons
Tels [EMAIL PROTECTED] writes: The last lines of my original routine, with a void return type: temp = *av_fetch(a, 0, 0); /* fetch first element */ ST(0) = boolSV((SvIV(temp) == 0)); #line 554 FastCalc.c } XSRETURN(1); } The same with RETVAL and OUTPUT: section:

Re: Warning about unused var RETVAL

2004-08-16 Thread Nick Ing-Simmons
Muppet [EMAIL PROTECTED] writes: of course, this is subject to subtleties like scratchpads and different treatment of simple values and such, so i won't dare to say your code is leaking, but in my own experience, i needed the sv_2mortal() to avoid leaking scalars, especially references.

Re: How to redirect STDERR under WIN32

2004-08-10 Thread Nick Ing-Simmons
Nicholas Clark [EMAIL PROTECTED] writes: On Mon, Aug 09, 2004 at 07:55:18PM +0100, Nick Ing-Simmons wrote: Hmm, that is a pipe interface and possibly fork. If I remember my history it is possible that :win32 layer's Dup() hook isn't up to final spec of that entry point. You wanted a pipe

Re: How to redirect STDERR under WIN32

2004-08-09 Thread Nick Ing-Simmons
Nicholas Clark [EMAIL PROTECTED] writes: On Sun, Aug 08, 2004 at 09:50:49PM +0100, Nick Ing-Simmons wrote: I suspect is one of mine, but I don't remember what it does exactly. I was about 80% done on a native Win32 layer (which is still there) when the NTFS partition on that machine became

Re: How to redirect STDERR under WIN32

2004-08-09 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: Nick Ing-Simmons wrote: The source for the native Win32 layer is in perforce. I think the layer even gets built one can do set PERLIO=:win32:crlf dmake test I just tried this (using VC++ / nmake) with bleadperl (normally all tests OK). Seemingly every

RE: How to redirect STDERR under WIN32

2004-08-08 Thread Nick Ing-Simmons
never used NetWare, but from mail on p5p it seems to be a similar port to the Win32 one. -Original Message- From: Nick Ing-Simmons [mailto:[EMAIL PROTECTED] Sent: Thursday, August 05, 2004 10:03 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; 'Nick Ing-Simmons' Subject: RE: How to redirect

Re: Can't find 'boot_Akf' symbol...

2004-08-08 Thread Nick Ing-Simmons
Dmitriyk [EMAIL PROTECTED] writes: Good day all!! At first sight I can't see what is wrong, questions below... I have $string=\x00\xff\xf1..., and I want it rebuild into a massiv of values (like unpack C*,$string). i write this xs code: = begin Akf.xs = #include EXTERN.h #include

RE: How to redirect STDERR under WIN32

2004-08-05 Thread Nick Ing-Simmons
Gopakumar Ambat [EMAIL PROTECTED] writes: From the Perl source code, I gathered that Perl_debug_log is set to stderr; all calls to perl_printf etc.. are sent to Perl_debug_log. Tried #defining this to a new FILE* / PerlIO* Which - they are NOT the same thing? - now the error info does not come

RE: How to redirect STDERR under WIN32

2004-08-05 Thread Nick Ing-Simmons
Gopakumar Ambat [EMAIL PROTECTED] writes: Thanks for your response. I have got around the problem doing this (checked on Win32): //first close the stderr opened by PERL //open it again, and dup it... int code = PerlIO_close(PerlIO_stderr()); if(code == 0) { PerlIO* newprlIO =

Re: looks_like_number()

2004-07-21 Thread Nick Ing-Simmons
Muppet [EMAIL PROTECTED] writes: On Jul 21, 2004, at 3:16 AM, Sisyphus wrote: Why does 'looks_like_number()' report that an SvRV looks like a number ? i'm going to make a wild guess and say that it's probably something like RV's hold the address of something else, which is like a number.

Re: Sharing double with C and Perl?

2004-07-19 Thread Nick Ing-Simmons
Tim Pushor [EMAIL PROTECTED] writes: Hi Nick, Nick Ing-Simmons wrote: Sorry for delay in reply... I can see your point. The tie scheme looks like a clean way to implement what I was trying to do in the first place. For now, what I am doing is taking a reference to a scalar, then in the C

Re: Autoflush and XS

2004-07-14 Thread Nick Ing-Simmons
Sisyphus [EMAIL PROTECTED] writes: I now find that, on the Linux box, if I write func_1() as: void func_1() { PerlIO_printf(PerlIO_stdout(),SOMETHING); } As I said PerlIO_stdoutf(SOMETHING); does that... then there's no need to do a PerlIO_flush(PerlIO_stdout()). It's

Re: Autoflush and XS

2004-07-13 Thread Nick Ing-Simmons
Tassilo Parseval [EMAIL PROTECTED] writes: On Tue, Jul 13, 2004 at 03:06:11PM +1000 Sisyphus wrote: Consider the following Inline C script: use warnings; use Inline C = 'EOC'; void func_1() { printf(SOMETHING); Depending on a whole mess of #define options printf is either the

Re: OO Style XSUBS

2004-07-11 Thread Nick Ing-Simmons
Tim Pushor [EMAIL PROTECTED] writes: (Muppet...) however, unless your methods really are class static methods (e.g. constructors and helpers), don't make them OO style just to get the - syntax. Why not? - that seems a little backwards to me. In my mind it is static methods which may make

Re: h2xs with C++

2004-06-29 Thread Nick Ing-Simmons
Bjoern Hoehrmann [EMAIL PROTECTED] writes: * Nick Ing-Simmons wrote: ask for C compilation, which do not find iostream, string, and other standard C++ headers. That bit is faily easy. You need to override CC as g++ (or whatever your C++ compiler is called - WriteMakefile( 'CC

Re: h2xs with C++

2004-06-29 Thread Nick Ing-Simmons
SilvioCVdeAlmeida [EMAIL PROTECTED] writes: Things are walking here. Now I worry about this: Nick Ing-Simmons wrote: It it really fails at make test stage then you probably need LD=g++ or similar to link in the iostream etc. Note that not all C++ implementations are dynamic loading friendly

Re: How do I get file named .cxx

2004-06-28 Thread Nick Ing-Simmons
Billy N. Patton [EMAIL PROTECTED] writes: Here's a copy of my Makefile.PL use 5.008; use ExtUtils::MakeMaker; $CC = 'g++'; $LD = 'g++'; $s = `uname`; $PLATFORM = ($s eq 'Linux') ? 'lnx86' : 'sun' ; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that

Re: h2xs with C++

2004-06-28 Thread Nick Ing-Simmons
SilvioCVdeAlmeida [EMAIL PROTECTED] writes: Hello, How suitable is h2xs for generating C++Perl bindings? Not very. A typical C++ .h file has all kinds of constructs h2xs isn't expecting. (namespaces, and overloaded functions, inline members,...) I couldn't manage it to work as I expected.

Re: h2xs with C++

2004-06-28 Thread Nick Ing-Simmons
Billy N. Patton [EMAIL PROTECTED] writes: Silvo, This group chooses to help only other experts. Beginners are not welcome here. I've ask several questions about C++ and have recieved no response. Guess my questions were too trivial. Too obvious to an expert. Too far below them to answer.

Re: h2xs with C++

2004-06-28 Thread Nick Ing-Simmons
SilvioCVdeAlmeida [EMAIL PROTECTED] writes: 4. archive and test: cd Pack perl Makefile.PL The normal thing to do at this point is make make test make dist That is just creating a tar ball which isn't useful till it works. make make test It breaks in make test, because

Re: h2xs with C++

2004-06-28 Thread Nick Ing-Simmons
Billy N. Patton [EMAIL PROTECTED] writes: Here is my Makefile.PL. use 5.008; use ExtUtils::MakeMaker; $CC = 'g++'; $LD = 'g++'; $s = `uname`; $PLATFORM = ($s eq 'Linux') ? 'lnx86' : 'sun' ; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is

Re: The behavior of eval_pv

2004-06-25 Thread Nick Ing-Simmons
SilvioCVdeAlmeida [EMAIL PROTECTED] writes: Hello, I have some obscure points around C function eval_pv. I don't understand the question yet ... Specifically, I don't understand why eval_pv cannot access a pre-defined main::subroutine as it does for a packaged one, eg. pack::subroutine. In

Re: Swig interface b/w C and Perl run time error on File pointer

2004-06-15 Thread Nick Ing-Simmons
PerlDiscuss - Perl Newsgroups and mailing lists [EMAIL PROTECTED] writes: Hi, I am using Swig to create a wrapper between C and Perl communication. It generates run time error when I try to access file pointer in C opened in Perl. The message shown at run time is The instruction at 0x77f88216

Re: Embedded Perl MQSeries

2004-06-08 Thread Nick Ing-Simmons
/lib/perl5/site_perl/5.8.4 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/site_perl/5.005/aix /usr/local/lib/perl5/site_perl/5.005 . Thanks, Salman On Fri, 04 Jun 2004 14:17:56 +0100, Nick Ing-Simmons [EMAIL PROTECTED] wrote: Salman Mohsin [EMAIL PROTECTED] writes

Re: Embedded Perl MQSeries

2004-06-04 Thread Nick Ing-Simmons
Salman Mohsin [EMAIL PROTECTED] writes: That's where the problem started. When I changed my code, compiled/linked it, and then tried to run it, it core dumped at MQCONN(). Somehow even if you don't have any Perl related code embedded in your code but still you linked it with embedded perl,

Re: Embedded Perl and C++

2004-06-04 Thread Nick Ing-Simmons
SilvioCVdeAlmeida [EMAIL PROTECTED] writes: Hello, Another ExtUtils::Embed question: Last weekend I've posted a question about embedding Perl in a C++ library. The compiling error is easily reproduced by just: $ g++ `perl -MExtUtils::Embed -e ccopts -e ldopts` a.cc // a.cc #include EXTERN.h

Re: SvREADONLY?

2004-05-24 Thread Nick Ing-Simmons
Erland Sommarskog [EMAIL PROTECTED] writes: Tassilo Von Parseval ([EMAIL PROTECTED]) writes: No, SvREADONLY is totally ok. Agreed - SvREADONLY() is always going to be there. But when using perl's originally-for-internals macros like this you need to realise that things may be more complex than

Re: Getting a pointer on another XSUB

2004-05-11 Thread Nick Ing-Simmons
Rafael Garcia-Suarez [EMAIL PROTECTED] writes: In an XS module Bar I want to get a pointer on a C function defined in an XS module Foo, and preferably at BOOT-time. I can't make it work; the problem I have is that at run time DynaLoader always answers with a undefined symbol error, although the

Re: unused fields == user-defined?

2004-05-10 Thread Nick Ing-Simmons
Sergey Skvortsov [EMAIL PROTECTED] writes: Hi. Can I use: * IVX, NVX fields in AV * NVX field in HV for own purposes without any conflicts in the future? (Like mg_private in struct magic and so on). Which hints at the right way to do things - add a PERL_MAGIC_ext record to the thing and put

Re: How to use PUSHi(), PUSHp(), etc?

2004-05-04 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: Once upon a time sv_dump() didn't exist unless you had -DDEBUGGING. So perhaps #ifndef sv_dump #define sv_dump... #endif would be better? Yes. You/we would have to build a new macro heirachy: #define PUSHmortal PUSHs(sv_newmortal()) #define mPUSHi(i)

Re: How to use PUSHi(), PUSHp(), etc?

2004-04-26 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: I have an XSUB that returns a list of things like this: void foo() PPCODE: { EXTEND(SP, 2); PUSHs(sv_2mortal(newSViv(42))); PUSHs(sv_2mortal(newSVpvn(Forty-two, 9))); XSRETURN(2); } It works fine as it is, but I

Re: How to use PUSHi(), PUSHp(), etc?

2004-04-26 Thread Nick Ing-Simmons
Steve Hay [EMAIL PROTECTED] writes: PUSHi et. al. are core perl utils and (most) perl ops have a TARG SV I was puzzled by the difference with PUSHs(), that's all. Are you implying that PUSHs() is not a core Perl util, or just that it happens to be one that doesn' t have a targ SV? Well

Re: stash caching

2004-04-26 Thread Nick Ing-Simmons
Rafael Garcia-Suarez [EMAIL PROTECTED] writes: Sergey Skvortsov wrote: Situation: There is a class with no childs (class can't be inherited by design). Question: Is it safe to cache stash address in the static var? And using this var in consequent blesses? As long as the stash is not

Re: catching undefined global variables

2004-04-19 Thread Nick Ing-Simmons
Dirk Koopman [EMAIL PROTECTED] writes: I am interfacing to an ancient 4(ish)GL library. It defines a number of tied (global) variables which are defined internally to the library but are not (necessarily) yet defined in perl. So we have some code that looks like this:- use FF; $SBOL::ACCNO =

Re: catching undefined global variables

2004-04-19 Thread Nick Ing-Simmons
Dirk Koopman [EMAIL PROTECTED] writes: $SBOL::ACCNO = $SYUS::LOGNAME; What doesn't exist? You have two packages and a variable in each package there which of the four exist to perl. I express myself badly (not unusual). Yes, the variables exist and, even with strict on, cause no errors. I

Re: Lstring and wchar_t support in XS

2004-03-08 Thread Nick Ing-Simmons
Tels [EMAIL PROTECTED] writes: I am on linux, but the same source (that uses wchar) is also compiled under Windows. Since it apparently works on both, I need to emulate both. From C++ constant strings are passed in as LSomeString. How do I emulate that froma Perl e.g. convert a Perl scalar to

Re: Lstring and wchar_t support in XS

2004-03-08 Thread Nick Ing-Simmons
Randy W. Sims [EMAIL PROTECTED] writes: On 03/08/04 12:26, Tels wrote: Good news: I asked on the Irrlicht board, and their very helpfull answer was, use some obsucre conversation function: void setWindowCaption(SV* classname, char* caption) PREINIT: wchar_t mytitle[512]; CODE:

Re: Creating new instance of Perl-Class in XS

2004-03-05 Thread Nick Ing-Simmons
Tom Schindl [EMAIL PROTECTED] writes: Hi, how can I create an instance of a Perl-class in XS. 1. Both defined in XS: == Soccer.xs: ---8--- MODULE = SoccerPACKAGE = Soccer::Team Team * new(CLASS) char *CLASS

Re: Creating new instance of Perl-Class in XS

2004-03-05 Thread Nick Ing-Simmons
Tels [EMAIL PROTECTED] writes: -BEGIN PGP SIGNED MESSAGE- Moin, On Friday 05 March 2004 11:23, Tom Schindl wrote: Hi, how can I create an instance of a Perl-class in XS. I don't know (dont even understand the question properly). However, I could not define a C++ class in XS because

  1   2   3   >