dev-serveez
[Top][All Lists]
Advanced

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

[dev-serveez] portcfg cleanup


From: stefan
Subject: [dev-serveez] portcfg cleanup
Date: Thu, 15 Mar 2001 20:26:31 +0100 (CET)

On Thu, 15 Mar 2001, Raimi 'Raimi' Jacob wrote:

> On Thu, 15 Mar 2001, Martin Grabmueller wrote:
> 
> hi!
> 
> > Yes, it compiles. But have you tried to run it?  The members `type',
> > `port' and `in' or overlaid, for example, so do `name', `localaddr'
> > and `out'.
> 
> right. damn. all glory to the hypno-toad. umh. how about an array of
> structs which 'type' is always the first member.
> (if you wonder: ela doesnt want that structname.union.unifiedstruct.member
> thing...)

A port configuration will have the following layout:

typedef struct portcfg
{
  int type;
  ...
  union protocol_t
  {
    struct tcp_t
    {
      int port;
      ...
    } tcp;
    struct pipe_t
    {
      char *recv;
      ...
    } pipe;
  } protocol;
}
portcfg_t;

#define tcp.port protocol.tcp.port
#define pipe.recv protocol.pipe.recv

Can you live with that ?

Cheers,
        address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]