Re: forward declaration in c

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: forward declaration in c
Date: 2009-05-25 11:53:17
Message-ID: 162867790905250453y7768b389q95e3f3770a905375@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/5/25 Martijn van Oosterhout <kleptog(at)svana(dot)org>:
> On Mon, May 25, 2009 at 01:20:05PM +0200, Pavel Stehule wrote:
>> Hello
>>
>> I can't to find fine syntax for cyclic declaration:
>
> If you mean forward declaraions of a type, just:
>
> struct ParseState
>
> will do, then:
>
>> typedef Node *(*TransformColumnRef_hook_type) (struct ParseState *pstate,
>> ColumnRef *cref);
>
> With the "struct" keyword added.
>
>> with empty declaration typedef struct ParseState;
>

yes, good advice

thank you
Pavel

> It might work with:
>
> typedef struct ParseState ParseState;
>
> But then you can't use typedef in the actual declaraion (AFAIK you can
> only forward declare structs, enums and such, but not typedefs).
>
> Have a nice day,
> --
> Martijn van Oosterhout   <kleptog(at)svana(dot)org>   http://svana.org/kleptog/
>> Please line up in a tree and maintain the heap invariant while
>> boarding. Thank you for flying nlogn airlines.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iD8DBQFKGoOMIB7bNG8LQkwRApDrAKCKLSPWKoDVu0xemsbijTef/wTo3QCgjzAM
> WPgB/FGqCXiANvrEM+rePfA=
> =nRZn
> -----END PGP SIGNATURE-----
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2009-05-25 12:10:25 Re: Synchronous replication: Promotion of Standby to Primary
Previous Message Martijn van Oosterhout 2009-05-25 11:39:56 Re: forward declaration in c