mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 18:27:56 +08:00
libc: add support for memory buffer stream with fmemopen()
Add support for POSIX interface fmemopen(). This interface open a memory buffer as a stream and permits access to this buffer specified by mode. This allows I/O operations to be performed on the memory buffer. The implementation uses fopencookie() for custom stream operations and callbacks. Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit is contained in:
@@ -249,6 +249,10 @@ int vdprintf(int fd, FAR const IPTR char *fmt, va_list ap)
|
||||
FAR FILE *fopencookie(FAR void *cookie, FAR const char *mode,
|
||||
cookie_io_functions_t io_funcs);
|
||||
|
||||
/* Memory buffer stream */
|
||||
|
||||
FAR FILE *fmemopen(FAR void *buf, size_t size, FAR const char *mode);
|
||||
|
||||
/* Operations on paths */
|
||||
|
||||
FAR FILE *tmpfile(void) fopen_like;
|
||||
|
||||
Reference in New Issue
Block a user