stevieb has asked for the wisdom of the Perl Monks concerning the following question:
XS related question this time.
In an XS file, I'm wrapping several functions from a C library. However, one of the functions accepts an unsigned char data[8]. My distribution exports (@EXPORT_OK) both the C functions in their original naming convention (camelCase), and more Perlish versions (snake_case, where some provide extra functionality before calling the C version).
Now, this particular function, let's call it lcdCharDef(), I need to do some trickery around before allowing it to be available to end users.
Is there a way that I can do something like an "import as" for an XS function into the Perl module's code? Here's some mock/pseudo of what I'm wondering is possible:
sub lcdCharDef { ... return XS::lcdCharDef(...); }
Because the names clash, I can't call the C function within the same named Perl function, and I can't seem to figure out if there is a workaround for this, whether it be in the XS, or Perl.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Accessing an XS function from a Perl function of the same name
by Anonymous Monk on Mar 04, 2017 at 00:16 UTC | |
by stevieb (Canon) on Mar 04, 2017 at 02:33 UTC | |
by syphilis (Archbishop) on Mar 04, 2017 at 05:54 UTC | |
by stevieb (Canon) on Mar 07, 2017 at 00:40 UTC |