Я видел два следующих стиля, объявляющих непрозрачные типы в C API. Есть ли явное преимущество в использовании одного стиля над другим?
Вариант 1
// foo.h
typedef struct foo * fooRef;
void doStuff(fooRef f);
// foo.c
struct foo {
int x;
int y;
};
Вариант 2
// foo.h
typedef struct _foo foo;
void doStuff(foo *f);
// foo.c
struct _foo {
int x;
int y;
};