Rename buf1, reader1, etc to io_buffer, io_reader

Also remove the unused Buf1, Buf2 and Usize tokens.
This commit is contained in:
Nigel Tao committed 2018-04-05 20:49:48 +10:00
1 parent 82a48796c8
commit 97aab37462
46 files changed
+823 -847

No files matched your search

+13 -15
View File
@@ -99,9 +99,7 @@ typedef struct {
// ---------------- I/O
// TODO: rename buf1 to io_buffer, writer1 to io_writer, etc.
// wuffs_base__buf1 is a 1-dimensional buffer (a pointer and length), plus
// wuffs_base__io_buffer is a 1-dimensional buffer (a pointer and length), plus
// additional indexes into that buffer, plus an opened / closed flag.
//
// A value with all fields NULL or zero is a valid, empty buffer.
@@ -111,44 +109,44 @@ typedef struct {
size_t wi; // Write index. Invariant: wi <= len.
size_t ri; // Read index. Invariant: ri <= wi.
bool closed; // No further writes are expected.
} wuffs_base__buf1;
} wuffs_base__io_buffer;
// wuffs_base__limit1 provides a limited view of a 1-dimensional byte stream:
// wuffs_base__io_limit provides a limited view of a 1-dimensional byte stream:
// its first N bytes. That N can be greater than a buffer's current read or
// write capacity. N decreases naturally over time as bytes are read from or
// written to the stream.
//
// A value with all fields NULL or zero is a valid, unlimited view.
typedef struct wuffs_base__limit1 {
uint64_t* ptr_to_len; // Pointer to N.
struct wuffs_base__limit1* next; // Linked list of limits.
} wuffs_base__limit1;
typedef struct wuffs_base__io_limit {
uint64_t* ptr_to_len; // Pointer to N.
struct wuffs_base__io_limit* next; // Linked list of limits.
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__buf1* buf;
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__limit1 limit;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__reader1;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__buf1* buf;
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__limit1 limit;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__writer1;
} wuffs_base__io_writer;
// ---------------- Images
+15 -17
View File
@@ -99,9 +99,7 @@ typedef struct {
// ---------------- I/O
// TODO: rename buf1 to io_buffer, writer1 to io_writer, etc.
// wuffs_base__buf1 is a 1-dimensional buffer (a pointer and length), plus
// wuffs_base__io_buffer is a 1-dimensional buffer (a pointer and length), plus
// additional indexes into that buffer, plus an opened / closed flag.
//
// A value with all fields NULL or zero is a valid, empty buffer.
@@ -111,44 +109,44 @@ typedef struct {
size_t wi; // Write index. Invariant: wi <= len.
size_t ri; // Read index. Invariant: ri <= wi.
bool closed; // No further writes are expected.
} wuffs_base__buf1;
} wuffs_base__io_buffer;
// wuffs_base__limit1 provides a limited view of a 1-dimensional byte stream:
// wuffs_base__io_limit provides a limited view of a 1-dimensional byte stream:
// its first N bytes. That N can be greater than a buffer's current read or
// write capacity. N decreases naturally over time as bytes are read from or
// written to the stream.
//
// A value with all fields NULL or zero is a valid, unlimited view.
typedef struct wuffs_base__limit1 {
uint64_t* ptr_to_len; // Pointer to N.
struct wuffs_base__limit1* next; // Linked list of limits.
} wuffs_base__limit1;
typedef struct wuffs_base__io_limit {
uint64_t* ptr_to_len; // Pointer to N.
struct wuffs_base__io_limit* next; // Linked list of limits.
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__buf1* buf;
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__limit1 limit;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__reader1;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__buf1* buf;
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__limit1 limit;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__writer1;
} wuffs_base__io_writer;
// ---------------- Images
@@ -740,8 +738,8 @@ void wuffs_deflate__decoder__initialize(wuffs_deflate__decoder* self,
wuffs_deflate__status wuffs_deflate__decoder__decode(
wuffs_deflate__decoder* self,
wuffs_base__writer1 a_dst,
wuffs_base__reader1 a_src);
wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src);
#ifdef __cplusplus
} // extern "C"
+16 -18
View File
@@ -99,9 +99,7 @@ typedef struct {
// ---------------- I/O
// TODO: rename buf1 to io_buffer, writer1 to io_writer, etc.
// wuffs_base__buf1 is a 1-dimensional buffer (a pointer and length), plus
// wuffs_base__io_buffer is a 1-dimensional buffer (a pointer and length), plus
// additional indexes into that buffer, plus an opened / closed flag.
//
// A value with all fields NULL or zero is a valid, empty buffer.
@@ -111,44 +109,44 @@ typedef struct {
size_t wi; // Write index. Invariant: wi <= len.
size_t ri; // Read index. Invariant: ri <= wi.
bool closed; // No further writes are expected.
} wuffs_base__buf1;
} wuffs_base__io_buffer;
// wuffs_base__limit1 provides a limited view of a 1-dimensional byte stream:
// wuffs_base__io_limit provides a limited view of a 1-dimensional byte stream:
// its first N bytes. That N can be greater than a buffer's current read or
// write capacity. N decreases naturally over time as bytes are read from or
// written to the stream.
//
// A value with all fields NULL or zero is a valid, unlimited view.
typedef struct wuffs_base__limit1 {
uint64_t* ptr_to_len; // Pointer to N.
struct wuffs_base__limit1* next; // Linked list of limits.
} wuffs_base__limit1;
typedef struct wuffs_base__io_limit {
uint64_t* ptr_to_len; // Pointer to N.
struct wuffs_base__io_limit* next; // Linked list of limits.
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__buf1* buf;
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__limit1 limit;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__reader1;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__buf1* buf;
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__limit1 limit;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__writer1;
} wuffs_base__io_writer;
// ---------------- Images
@@ -755,11 +753,11 @@ void wuffs_gif__decoder__initialize(wuffs_gif__decoder* self,
wuffs_gif__status wuffs_gif__decoder__decode_config(
wuffs_gif__decoder* self,
wuffs_base__image_config* a_dst,
wuffs_base__reader1 a_src);
wuffs_base__io_reader a_src);
wuffs_gif__status wuffs_gif__decoder__decode_frame(wuffs_gif__decoder* self,
wuffs_base__writer1 a_dst,
wuffs_base__reader1 a_src);
wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src);
#ifdef __cplusplus
} // extern "C"
+17 -19
View File
@@ -99,9 +99,7 @@ typedef struct {
// ---------------- I/O
// TODO: rename buf1 to io_buffer, writer1 to io_writer, etc.
// wuffs_base__buf1 is a 1-dimensional buffer (a pointer and length), plus
// wuffs_base__io_buffer is a 1-dimensional buffer (a pointer and length), plus
// additional indexes into that buffer, plus an opened / closed flag.
//
// A value with all fields NULL or zero is a valid, empty buffer.
@@ -111,44 +109,44 @@ typedef struct {
size_t wi; // Write index. Invariant: wi <= len.
size_t ri; // Read index. Invariant: ri <= wi.
bool closed; // No further writes are expected.
} wuffs_base__buf1;
} wuffs_base__io_buffer;
// wuffs_base__limit1 provides a limited view of a 1-dimensional byte stream:
// wuffs_base__io_limit provides a limited view of a 1-dimensional byte stream:
// its first N bytes. That N can be greater than a buffer's current read or
// write capacity. N decreases naturally over time as bytes are read from or
// written to the stream.
//
// A value with all fields NULL or zero is a valid, unlimited view.
typedef struct wuffs_base__limit1 {
uint64_t* ptr_to_len; // Pointer to N.
struct wuffs_base__limit1* next; // Linked list of limits.
} wuffs_base__limit1;
typedef struct wuffs_base__io_limit {
uint64_t* ptr_to_len; // Pointer to N.
struct wuffs_base__io_limit* next; // Linked list of limits.
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__buf1* buf;
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__limit1 limit;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__reader1;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__buf1* buf;
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__limit1 limit;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__writer1;
} wuffs_base__io_writer;
// ---------------- Images
@@ -839,8 +837,8 @@ void wuffs_deflate__decoder__initialize(wuffs_deflate__decoder* self,
wuffs_deflate__status wuffs_deflate__decoder__decode(
wuffs_deflate__decoder* self,
wuffs_base__writer1 a_dst,
wuffs_base__reader1 a_src);
wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src);
#ifdef __cplusplus
} // extern "C"
@@ -944,8 +942,8 @@ void wuffs_gzip__decoder__set_ignore_checksum(wuffs_gzip__decoder* self,
bool a_ic);
wuffs_gzip__status wuffs_gzip__decoder__decode(wuffs_gzip__decoder* self,
wuffs_base__writer1 a_dst,
wuffs_base__reader1 a_src);
wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src);
#ifdef __cplusplus
} // extern "C"
+17 -19
View File
@@ -99,9 +99,7 @@ typedef struct {
// ---------------- I/O
// TODO: rename buf1 to io_buffer, writer1 to io_writer, etc.
// wuffs_base__buf1 is a 1-dimensional buffer (a pointer and length), plus
// wuffs_base__io_buffer is a 1-dimensional buffer (a pointer and length), plus
// additional indexes into that buffer, plus an opened / closed flag.
//
// A value with all fields NULL or zero is a valid, empty buffer.
@@ -111,44 +109,44 @@ typedef struct {
size_t wi; // Write index. Invariant: wi <= len.
size_t ri; // Read index. Invariant: ri <= wi.
bool closed; // No further writes are expected.
} wuffs_base__buf1;
} wuffs_base__io_buffer;
// wuffs_base__limit1 provides a limited view of a 1-dimensional byte stream:
// wuffs_base__io_limit provides a limited view of a 1-dimensional byte stream:
// its first N bytes. That N can be greater than a buffer's current read or
// write capacity. N decreases naturally over time as bytes are read from or
// written to the stream.
//
// A value with all fields NULL or zero is a valid, unlimited view.
typedef struct wuffs_base__limit1 {
uint64_t* ptr_to_len; // Pointer to N.
struct wuffs_base__limit1* next; // Linked list of limits.
} wuffs_base__limit1;
typedef struct wuffs_base__io_limit {
uint64_t* ptr_to_len; // Pointer to N.
struct wuffs_base__io_limit* next; // Linked list of limits.
} wuffs_base__io_limit;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__buf1* buf;
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__limit1 limit;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__reader1;
} wuffs_base__io_reader;
typedef struct {
// TODO: move buf into private_impl? As it is, it looks like users can modify
// the buf field to point to a different buffer, which can turn the limit and
// mark fields into dangling pointers.
wuffs_base__buf1* buf;
wuffs_base__io_buffer* buf;
// Do not access the private_impl's fields directly. There is no API/ABI
// compatibility or safety guarantee if you do so.
struct {
wuffs_base__limit1 limit;
wuffs_base__io_limit limit;
uint8_t* mark;
} private_impl;
} wuffs_base__writer1;
} wuffs_base__io_writer;
// ---------------- Images
@@ -749,8 +747,8 @@ void wuffs_deflate__decoder__initialize(wuffs_deflate__decoder* self,
wuffs_deflate__status wuffs_deflate__decoder__decode(
wuffs_deflate__decoder* self,
wuffs_base__writer1 a_dst,
wuffs_base__reader1 a_src);
wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src);
#ifdef __cplusplus
} // extern "C"
@@ -870,8 +868,8 @@ void wuffs_zlib__decoder__set_ignore_checksum(wuffs_zlib__decoder* self,
bool a_ic);
wuffs_zlib__status wuffs_zlib__decoder__decode(wuffs_zlib__decoder* self,
wuffs_base__writer1 a_dst,
wuffs_base__reader1 a_src);
wuffs_base__io_writer a_dst,
wuffs_base__io_reader a_src);
#ifdef __cplusplus
} // extern "C"