News for hackers. Stuff that matters.
Re:ICQ: 20 Years Is No Limit by _wmd on Tuesday November 15, 2016 @09:52PM (#12964161)
Around the turn of the century people stopped going crazy with macros, globals and exposing struct definitions in header files, at least this is where I draw the line between old and new school
Re:ICQ: 20 Years Is No Limit by sebcat on Wednesday November 16, 2016 @12:48AM (#12964823)
> exposing struct definitions in header files

Hiding the struct like:

    typedef struct foo_t foo_t;
    /* ... */
    foo_t *foo_new();
kinda forces heap allocs. There are times when you want to allocate on the stack, and not use alloca.

Most of the time, I still keep struct definitions in header files, but API wise I always write functions or macros for anything that touches them and discourage direct access to struct members. Depending on the use case of course. Abstract types have their uses too.

Re:ICQ: 20 Years Is No Limit by asmdev on Wednesday November 16, 2016 @12:40AM (#12964791)
I expose struck definitions in header files too. What is a better or alternative way to do it?