Simon Connah wrote:
> On 2009-07-02 20:39:54 +0100, Simon Connah <>
> said:
>
>> typedef struct user
>> {
>> char *username;
>> char *password;
>>
>> /* lots more... omitted for brevity */
>>
>> struct user *interface;
>> }
>
> Oops this should read:
>
> typedef struct user
> {
> char *username;
> char *password;
>
> /* lots more... omitted for brevity */
>
> struct user *interface;
> } user;
ITYM it should read
typedef struct user {
/* omitted for brevity */
user_interface *interface;
} user;
.... on the assumption that eventually you'll do things like
PGconn conn = ...;
user *ptr = ...;
ptr->interface->add(&conn, ptr);
See also "Poor Man's Object-Oriented C."
--
Eric Sosman
lid