Re: [gdome]translation gdome.h to pascal



On Thu, 20 Sep 2001, Uwe Fechner wrote:
> Now I don't find a way to translate the following struct to pascal:
> 
> struct GdomeNode{
>         const GdomeNodeVTAB *VTAB;
>         gpointer user_data;
>        };
> 
> I tried:
>      GdomeNode = record
>           vtab : PGdomeNodeVtab;
>           user_data : gpointer;
>        end;
> 
> When I compile gdome.pas with delphi 6, I get:
> [Error] gdome.pas(271): Undeclared identifier: 'PGdomeNodeVtab'
> 
> I don't find a place, where GdomeNodeVtab or
> PGdomeNodeVtab are defiened.

IIRC GdomeNodeVTAB is not declared in any user visible include files. You
can find it in libgdome/gdomecore/gdome_xml_node.{h,x} (or similar file
name).

However, there should be no need for declaring a translated pascal record
type. The VTAB member is just a pointer to a constant struct inside the
library. It is never touched by application code.

My last turbo pascal experience is years ago, but I think you can declare
a pointer type in pascal without declaring the type of objects that are
being pointed to, something like

type PGdomeNodeVtab = ^GdomeNodeVtab

If that's possible, you might try this. But I think you can also simply
replace the type of the VTAB with gpointer, or any other data type that
has the same size in bytes as a pointer.

> 
> Any idea?

A tip: since you have cygwin installed, you could have used the "grep"
command to find the definition of GdomeNodeVTAB. The result may have been
discouraging, though: a bunch of function pointers.

Bye, Tobias






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]