Follow the pkg__type__method convention for base.

This commit is contained in:
Nigel Tao committed 2017-10-21 15:59:08 +11:00
1 parent 362bb94e68
commit f29c4e278f
19 files changed
+747 -734

No files matched your search

+15 -15
View File
@@ -45,15 +45,15 @@
// TODO: don't hard code this in base-header.h.
#define PUFFS_VERSION (0x00001)
// puffs_base_slice_u8 is a 1-dimensional buffer (a pointer and length).
// puffs_base__slice_u8 is a 1-dimensional buffer (a pointer and length).
//
// A value with all fields NULL or zero is a valid, empty slice.
typedef struct {
uint8_t* ptr;
size_t len;
} puffs_base_slice_u8;
} puffs_base__slice_u8;
// puffs_base_buf1 is a 1-dimensional buffer (a pointer and length), plus
// puffs_base__buf1 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.
@@ -63,27 +63,27 @@ 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.
} puffs_base_buf1;
} puffs_base__buf1;
// puffs_base_limit1 provides a limited view of a 1-dimensional byte stream:
// puffs_base__limit1 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 puffs_base_limit1 {
uint64_t* ptr_to_len; // Pointer to N.
struct puffs_base_limit1* next; // Linked list of limits.
} puffs_base_limit1;
typedef struct puffs_base__limit1 {
uint64_t* ptr_to_len; // Pointer to N.
struct puffs_base__limit1* next; // Linked list of limits.
} puffs_base__limit1;
typedef struct {
puffs_base_buf1* buf;
puffs_base_limit1 limit;
} puffs_base_reader1;
puffs_base__buf1* buf;
puffs_base__limit1 limit;
} puffs_base__reader1;
typedef struct {
puffs_base_buf1* buf;
puffs_base_limit1 limit;
} puffs_base_writer1;
puffs_base__buf1* buf;
puffs_base__limit1 limit;
} puffs_base__writer1;
#endif // PUFFS_BASE_HEADER_H