gcc 15 and C23 force some union trickery on buffer.h :-(

add a few buffer_init*_forread variants to pretend we have type safety
  make sure buffer_init_staticcontents handles flushing attempts
This commit is contained in:
leitner
2025-04-22 09:32:03 +00:00
parent 9bf6db9a02
commit b7b8a0efc1
37 changed files with 325 additions and 64 deletions

View File

@@ -7,8 +7,15 @@ buffer_init_free \- initialize buffer structure
void \fBbuffer_init_free\fR(buffer &\fIb\fR,
ssize_t (*\fIop\fR)(int,char*,size_t),
int \fIfd\fR, char* \fIy\fR, size_t \fIylen\fR);
void \fBbuffer_init_free_forread\fR(buffer &\fIb\fR,
ssize_t (*\fIop\fR)(int,char*,size_t),
int \fIfd\fR, char* \fIy\fR, size_t \fIylen\fR);
.SH DESCRIPTION
buffer_init_free is like buffer_init except that the memory (\fIy\fR is
marked to be freed by buffer_close().
marked to be freed by buffer_close).
buffer_init_free_forread is like buffer_init_forread except that the memory (\fIy\fR is
marked to be freed by buffer_close).
.SH "SEE ALSO"
buffer_init(3), buffer_mmap_read(3), buffer(3)