Make struct impls private (opaque pointers)

This gives us flexibility to change sizeof(wuffs_foo__bar__struct)
across Wuffs versions, while retaining ABI / API compatibility.

In particular, this lets us add and remove fields.
This commit is contained in:
Nigel Tao committed 2018-10-06 10:33:47 +10:00
1 parent 26a448450e
commit 8b1ffec576
4 files changed
+86 -8

No files matched your search

+63
View File
@@ -2226,6 +2226,13 @@ wuffs_adler32__hasher__update(wuffs_adler32__hasher* self,
// ---------------- Struct Definitions
// These structs' fields, and the sizeof them, are private implementation
// details that aren't guaranteed to be stable across Wuffs versions.
//
// See https://en.wikipedia.org/wiki/Opaque_pointer#C
#ifdef WUFFS_IMPLEMENTATION
struct wuffs_adler32__hasher__struct {
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so. Instead, use the
@@ -2259,6 +2266,8 @@ struct wuffs_adler32__hasher__struct {
}; // struct wuffs_adler32__hasher__struct
#endif // WUFFS_IMPLEMENTATION
#ifdef __cplusplus
} // extern "C"
#endif
@@ -2302,6 +2311,13 @@ wuffs_crc32__ieee_hasher__update(wuffs_crc32__ieee_hasher* self,
// ---------------- Struct Definitions
// These structs' fields, and the sizeof them, are private implementation
// details that aren't guaranteed to be stable across Wuffs versions.
//
// See https://en.wikipedia.org/wiki/Opaque_pointer#C
#ifdef WUFFS_IMPLEMENTATION
struct wuffs_crc32__ieee_hasher__struct {
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so. Instead, use the
@@ -2334,6 +2350,8 @@ struct wuffs_crc32__ieee_hasher__struct {
}; // struct wuffs_crc32__ieee_hasher__struct
#endif // WUFFS_IMPLEMENTATION
#ifdef __cplusplus
} // extern "C"
#endif
@@ -2392,6 +2410,13 @@ wuffs_deflate__decoder__decode(wuffs_deflate__decoder* self,
// ---------------- Struct Definitions
// These structs' fields, and the sizeof them, are private implementation
// details that aren't guaranteed to be stable across Wuffs versions.
//
// See https://en.wikipedia.org/wiki/Opaque_pointer#C
#ifdef WUFFS_IMPLEMENTATION
struct wuffs_deflate__decoder__struct {
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so. Instead, use the
@@ -2483,6 +2508,8 @@ struct wuffs_deflate__decoder__struct {
}; // struct wuffs_deflate__decoder__struct
#endif // WUFFS_IMPLEMENTATION
#ifdef __cplusplus
} // extern "C"
#endif
@@ -2539,6 +2566,13 @@ wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
// ---------------- Struct Definitions
// These structs' fields, and the sizeof them, are private implementation
// details that aren't guaranteed to be stable across Wuffs versions.
//
// See https://en.wikipedia.org/wiki/Opaque_pointer#C
#ifdef WUFFS_IMPLEMENTATION
struct wuffs_lzw__decoder__struct {
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so. Instead, use the
@@ -2594,6 +2628,8 @@ struct wuffs_lzw__decoder__struct {
}; // struct wuffs_lzw__decoder__struct
#endif // WUFFS_IMPLEMENTATION
#ifdef __cplusplus
} // extern "C"
#endif
@@ -2670,6 +2706,13 @@ wuffs_gif__decoder__decode_frame(wuffs_gif__decoder* self,
// ---------------- Struct Definitions
// These structs' fields, and the sizeof them, are private implementation
// details that aren't guaranteed to be stable across Wuffs versions.
//
// See https://en.wikipedia.org/wiki/Opaque_pointer#C
#ifdef WUFFS_IMPLEMENTATION
struct wuffs_gif__decoder__struct {
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so. Instead, use the
@@ -2840,6 +2883,8 @@ struct wuffs_gif__decoder__struct {
}; // struct wuffs_gif__decoder__struct
#endif // WUFFS_IMPLEMENTATION
#ifdef __cplusplus
} // extern "C"
#endif
@@ -2900,6 +2945,13 @@ wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
// ---------------- Struct Definitions
// These structs' fields, and the sizeof them, are private implementation
// details that aren't guaranteed to be stable across Wuffs versions.
//
// See https://en.wikipedia.org/wiki/Opaque_pointer#C
#ifdef WUFFS_IMPLEMENTATION
struct wuffs_gzip__decoder__struct {
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so. Instead, use the
@@ -2951,6 +3003,8 @@ struct wuffs_gzip__decoder__struct {
}; // struct wuffs_gzip__decoder__struct
#endif // WUFFS_IMPLEMENTATION
#ifdef __cplusplus
} // extern "C"
#endif
@@ -3011,6 +3065,13 @@ wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
// ---------------- Struct Definitions
// These structs' fields, and the sizeof them, are private implementation
// details that aren't guaranteed to be stable across Wuffs versions.
//
// See https://en.wikipedia.org/wiki/Opaque_pointer#C
#ifdef WUFFS_IMPLEMENTATION
struct wuffs_zlib__decoder__struct {
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so. Instead, use the
@@ -3058,6 +3119,8 @@ struct wuffs_zlib__decoder__struct {
}; // struct wuffs_zlib__decoder__struct
#endif // WUFFS_IMPLEMENTATION
#ifdef __cplusplus
} // extern "C"
#endif