Since I have upgraded to 5.8 my C perl interface won't work. I noticed that in the small print of the release it says that it is not backward compatible!?!? and the XS functions wont work. My question is how do I get my code to run??
here is the code
#include <EXTERN.h>
#include <perl.h>
#include <stdio.h>
#include <stdlib.h>
#include "GIEAsnmp.h"
#define CLIENT_ID "INTERFACE"
static PerlInterpreter *my_perl;
int count;
int counter;
char *queue;
char *tempPop;
char *temp;
int i = 0;
EXTERN_C void xs_init _((void));
EXTERN_C void boot_DynaLoader _((CV* cv));
EXTERN_C void
xs_init(void)
{
char *file = __FILE__;
dXSUB_SYS;
/* DynaLoader is a special case */
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}
struct interpreter * perlstart()
{
char *my_argv[] = { "", "dataquery.pl"};
my_perl = perl_alloc();
perl_construct(my_perl);
perl_parse(my_perl, xs_init, 2, my_argv, (char **)NULL);
return (my_perl);
}
void perlstop(struct interpreter *my_perl)
{
perl_destruct (my_perl);
perl_free(my_perl);
}
there is more but I think that should illustrate the issue. I have tried removing all the xs related stuff but constantly get the errors below when trying to compile
"struct drand48 data" is undefinded as well as "struct random_data" is undefined from reentr.h, this is all on an AIX box by the way - I wasn't even aware I was using the two structures!!!
Any help would be greatly appreciated!
Incidently the errors I am getting from my XS stuff are from the newXS line and the perl_parse line and the erros were:
"interface.c", line 32.46: 1506-280 (W) Function argument assignment b
+etween types "void(*)(struct interpreter*,struct cv*)" and
"void(*)(struct cv*)" is not allowed.
"interface.c", line 49.21: 1506-280 (W) Function argument assignment b
+etween types "void(*)(struct interpreter*)" and "void(*)(v
oid)" is not allowed.
sorry for the long post!
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.