[XML-SIG] FW: pyexpat compilation errors - Python 2.0b1
Juergen Hermann
Juergen Hermann" <jhe@webde-ag.de
Tue, 04 Jul 2000 17:37:32 +0200
On Tue, 04 Jul 2000 09:54:45 -0500, Paul Prescod wrote:
>For the record, here's the structure we are predeclaring.
>
>statichere struct HandlerInfo handler_info[]=3D
>{{"StartElementHandler",
> pyxml_SetStartElementHandler,
> (void*)my_StartElementHandler},
...
>
>{NULL, NULL, NULL } /* sentinel */
>};
Wouldn't it be best to forward declare the functions (which poses no
problem), THEN define the static array as above, then define the
functions. It's certainly more work than the current way (forward declar=
e
the static array), but also less exotic. The "64" there bugs me a lot, a=
nd
creates new portability problems I bet.
Another way that imposes less work would be this:
statichere struct HandlerInfo* handler_info =3D 0;
...
statichere struct HandlerInfo handler_info_array[]=3D
{{"StartElementHandler",
...
};
void
initpyexpat(){
handler_info =3D handler_info_array;
...
}
That also resembles the code that is used to backfill the PyType_Type
pointers:
Xmlparsetype.ob_type =3D &PyType_Type;
Ciao, J=FCrgen
--
J=FCrgen Hermann (jhe@webde-ag.de)
WEB.DE AG, Amalienbadstr.41, D-76227 Karlsruhe
Tel.: 0721/94329-0, Fax: 0721/94329-22