About ProgressReport and msn-pecan

Tim Ringenbach tim.ringenbach at gmail.com
Sat Jun 14 18:58:28 EDT 2008


On Fri, Jun 13, 2008 at 8:18 PM, Felipe Contreras
<felipe.contreras at gmail.com> wrote:
> account.h:
> typedef struct PurpleAccount PurpleAccount;
>
> account_private.h:
> struct PurpleAccount
> {
>        char *username;
>        char *alias;
>        char *password;
>        char *user_info;
>        ...
>        PurplePresence *presence;
>        ...
> }
>
> That means that if you include account.h you can't do
> account->username, because "account" is an incomplete type, just like
> a void *. Note also that PurplePresence doesn't need to be defined in
> account.h, hence you remove a header dependency for all the files that
> include account.h, and you remove all the headers that presence.h
> include, and so on.

Couldn't you do the same thing by just not including the extra files,
and adding struct _PurpleBlah; for each missing type, and changing the
prototypes to use the struct _PurpleBlah instead of PurpleBlah? (IIRC,
if you try to do the typedef more than once you get an error, which is
why I said use the struct version of the name)

What's the end goal here? Just to speed up compiling and make the
graph shorter, if technically misleading? (By misleading I mean the
account module really does use the presence module even though it
wouldn't show on the graph anymore because the header isn't including
it)

> Great! I propose an API version field, then.
Maybe I'm dumb, or just haven't been following along. But what does an
API version field do us in a struct?

--Tim




More information about the Devel mailing list