[Expat-discuss] Any suggestion please how to transfer a struct as user data ?

Gert Cuykens gert.cuykens at gmail.com
Thu Jul 19 04:07:02 CEST 2007


On 7/19/07, Sebastian Pipping <webmaster at hartwork.org> wrote:
> Don't change the handlers' signatures - do a cast inside
> their bodies instead.

I am sorry if the following looks stupid but its my best shot ?

static void
characterData(void *userData, const XML_Char *s, int l)
{
 PAGE page=(PAGE)userData;
 char data[l];
 memcpy(data,s,l);
 page.add(&page,"test");
}

root at www:/var/www/trunk/cgi# gcc -g -o x xml.c -lexpat
xml.c: In function âcharacterDataâ:
xml.c:11: error: conversion to non-scalar type requested
xml.c: In function âendElementâ:
xml.c:20: error: conversion to non-scalar type requested
root at www:/var/www/trunk/cgi#


More information about the Expat-discuss mailing list