wapoor:
all test code in our labs (including my perl code) is required to use some machine-generated C code at specified points -- no substitutions or translations are allowed.
OK, is this *C source* or a lib? If it's C source without much
dependencies, you may use plain Inline C, like
(this will reverse your nickname in C):
my $name = 'wapoor';
my $eman = reverse_by_c($name);
print "$name, $eman\n";
use Inline C => qq[
SV* reverse_by_c(SV *pname)
{
SV* retval;
STRLEN len, i;
char *eman, *name = SvPV(pname, len);
New(0, eman, len, char);
for(i=0; i<len; i++) eman[i] = name[len-i-1];
eman[len] = '\\0';
retval = newSVpv(eman, len);
Safefree(eman);
return retval;
}
];
This looks fairly simple and might be solvable for
a C programmer within a short time ... ;-)
You can include a lot of source this way, even
Win32 inline assembly will work fine.
(Or didn't I understand you correct and you
don't like plain Inline-C for some reason?)
Regards
mwa
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.