Hi all,
I'm writing a PHP module for repat, a C-based RDF parser, very similar to expat, in
fact it uses expat
but for RDF statements.
Maybe some of you with a lot of experience in writing modules can help me with my
problem
I have a C variable, a pointer with say X and when I pass the pointer to a function it
receives not X but
something else.
This is a dump of a silly gdb session showing the problem (using the binary php)
See how report_start_element receies an rdf_parser and that rdf_parser->user_data is
0x81970c
Then this code is executed:
if( rdf_parser->start_element_handler )
{
( *rdf_parser->start_element_handler )(
rdf_parser->user_data,
name,
attributes );
}
and parser_my_start_element (the function acting as start_element_handler) receives
0x1cd (???!!)
This is the dump
Breakpoint 1, report_start_element (rdf_parser=0x81f9a58, name=0x81fa714 "html",
attributes=0x81f9ce0) at rdfparse.c:1292
1292 if( rdf_parser->start_element_handler )
(gdb) s
1294 ( *rdf_parser->start_element_handler )(
(gdb) p rdf_parser->user_data
$12 = (void *) 0x81f970c
(gdb) s
Breakpoint 2, parser_my_start_element_handler (user_data=0x1cd, name=0x81fa714 "html",
attributes=0x81f9ce0) at repat.c:653
If someone can give me a tip about what may be happening then I'd get back to continue
the module, after this problem it should be
ready next week since everything was on wheels until now.
Thanks for your help!
Garland
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.362 / Virus Database: 199 - Release Date: 5/8/02