develooper Front page | perl.perl5.porters | Postings from August 2008

B, B::Utils and friends - export c functions for other xs modules

Thread Next
Chia-liang Kao
August 14, 2008 00:53
B, B::Utils and friends - export c functions for other xs modules
Message ID:

As some of you might have known, yuval and I have been hacking some B  
related stuff.  One of the problems is that we need to copy and paste  
a lot of static function scattered around from B, B::Generate.  This  
is bad.  I found ExtUtils::Depends kind of solves this problem.

I chatted with jjore on irc a while ago, about putting some of the  
useful c functions into B::Utils, so we can reuse them.

currently it has 3 functions:

extern char *BUtils_cc_opclassname(pTHX_ const OP *o);
extern SV *BUtils_make_sv_object(pTHX_ SV *arg, SV *sv);
extern I32 BUtils_op_name_to_num(SV * name);

The current use of it are B::OP::Util and B::OPCheck, which can be  
found in the same repository.

I plan to put some more useful stuff in, such as upcontext from  
Want.xs (which actually comes from B.xs), so this comes to if we  
should just patch B that way and export those functions.

another thing is that currently the B ext in the perl tree is actually  
a mix of everything.  Things like B-Deparse, B-C, are not really tied  
to B, but just uses it.  should it (and can it) be splited into  
different dist under ext/ ? I think we just need to make sure the test  
ordering and INC when running tests.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About