[Gtk-sharp-list] Interop

Rui Barreiros rbarreiros@evoluta.pt
Sun, 08 Feb 2004 13:13:22 +0000


Sorry i'm writing to this list, it's not gtksharp related but it's the
list i'm subscribed right now and it a kind of urgent.

I'm trying to write a GUI from clamav but i have some troubles with the
struct's defined in clamav.h one is:

struct cl_node
{
  char islast;
  struct cli_patt *list;
  struct cl_node *trans[CL_NUM_CHILDS], *fail;
  unsigned int maxpatlen, partsigs;
  unsigned int nodes;
  struct cl_node **nodetable;
}

How can i use this struct in mono?

i tried this, i always get compile errors about the loop reference in
the struct, and probably there are other things not right:

[StructLayout(LayoutKind.Sequential)]
public struct cl_node
{
  public short islast;
  public cli_patt list; // I already have struct cli_patt defined above
  private cl_node trans;
  private cl_node fail;
  public uint partsigs;
  public uint maxpatlen;
  public uint nodes;
  private cl_node nodetable;

  [DllImport("libclamav")]
  public static extern void PassByValue(cl_node n);

  [DllImport("libclamav")]
  public static extern void PassByReference(cl_node n);
}

I really appreciate some help, as my knowledge about interop on mono is
really null!! 

Thanks to everybody in advance!

-- 
Rui Barreiros

Evoluta - Tecnologias de Informação
Rua do Padrão nº 58 2º Andar Sala 25
4415-284 Carvalhos
Tel: 227839464 Fax: 227839465
http://www.evoluta.pt