nuttx/libs/libc/stdio
Michal Lenc 0a107ca6d9 libc: add support for custom streams with fopencookie()
This commit adds support for custom stream via fopencookie function.
The function allows the programmer the create his own custom stream
for IO operations and hook his custom functions to it.

This is a non POSIX interface defined in Standard C library and implemented
according to it. The only difference is in usage of off_t instead of
off64_t. Programmer can use 64 bits offset if CONFIG_FS_LARGEFILE is
enabled. In that case off_t is defined as int64_t (int32_t otherwise).

Field fs_fd is removed from file_struct and fs_cookie is used instead
as a shared variable for file descriptor or user defined cookie.

The interface will be useful for future fmemopen implementation.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2023-10-18 21:13:01 +08:00
..
CMakeLists.txt libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
Kconfig libc/stdio: changed LIBC_NL_ARGMAX default value to 9 2023-08-03 19:07:22 -07:00
lib_asprintf.c
lib_clearerr.c
lib_dprintf.c
lib_dtoa_data.c
lib_dtoa_engine.c nuttx: Use MIN/MAX definitions from "sys/param.h" 2023-02-01 23:47:44 +08:00
lib_dtoa_engine.h
lib_fclose.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_feof.c
lib_ferror.c
lib_fflush.c
lib_fgetc.c libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
lib_fgetpos.c
lib_fgets.c libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
lib_fileno.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_fopen.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_fopencookie.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_fprintf.c
lib_fputc.c libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
lib_fputs.c libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
lib_fputwc.c libs/libc/wchar: add fputwc implementation 2023-09-22 08:51:07 +08:00
lib_fputws.c libs/libc/wchar: add fputws implementation 2023-09-22 08:51:07 +08:00
lib_fread.c libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
lib_freopen.c libs/libc: remove unnecessary flockfile to improve performance 2023-09-06 15:08:24 +03:00
lib_fscanf.c
lib_fseek.c
lib_fseeko.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_fsetpos.c
lib_ftell.c
lib_ftello.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_fwrite.c libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
lib_getc.c libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
lib_getchar.c libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
lib_getdelim.c stdio: Remove CONFIG_EOL_IS_XXX 2023-02-24 00:35:19 +08:00
lib_gets_s.c libc/stdio: Make gets/gets_s work without CONFIG_FILE_STREAM 2023-02-24 10:39:48 +08:00
lib_gets.c libc/stdio: Make gets/gets_s work without CONFIG_FILE_STREAM 2023-02-24 10:39:48 +08:00
lib_libdgets.c libc/stdio: Make gets/gets_s work without CONFIG_FILE_STREAM 2023-02-24 10:39:48 +08:00
lib_libdtoa.c nuttx: Use MIN/MAX definitions from "sys/param.h" 2023-02-01 23:47:44 +08:00
lib_libfflush.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_libfgets.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_libfilelock.c semantic/parser: fix compile warning found by sparse 2023-05-30 23:00:00 +08:00
lib_libflushall.c
lib_libfread_unlocked.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_libfwrite.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_libgetstreams.c nxstyle: covert utf-8 to ascii 2023-07-14 01:24:50 +08:00
lib_libsprintf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_libvscanf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_libvsprintf.c libc: export lib_sprintf_internal function 2023-07-14 00:22:11 +03:00
lib_perror.c Indent the define statement by two spaces 2023-05-21 09:52:08 -03:00
lib_printf.c
lib_putc.c
lib_putchar.c libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
lib_puts.c libs/libc: support unlock version for fread/fwrite/fputc/fgetc/... 2023-09-06 15:08:24 +03:00
lib_putwc.c libs/libc/wchar: add putwc implementation 2023-09-22 08:51:07 +08:00
lib_putwchar.c libs/libc/wchar: add putwchar implementation 2023-09-22 08:51:07 +08:00
lib_rdflush_unlocked.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_remove.c libc/lib_remove: fix TOCTOU race condition 2023-06-29 18:15:06 +08:00
lib_renameat.c libc: Add a new argument(size_t fulllen) to lib_getfullpath 2023-05-08 09:57:01 +02:00
lib_rewind.c
lib_scanf.c
lib_setbuf.c
lib_setbuffer.c libc: Add setbuffer to stdio. 2023-05-01 11:24:41 +03:00
lib_setvbuf.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_snprintf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_sprintf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_sscanf.c
lib_tempnam.c Fixes in asprintf usage. 2023-04-19 02:48:39 +08:00
lib_tmpfile.c
lib_tmpnam.c
lib_ultoa_invert.c
lib_ultoa_invert.h
lib_ungetc.c libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00
lib_vasprintf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_vdprintf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_vfprintf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_vfscanf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_vprintf.c
lib_vscanf.c
lib_vsnprintf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_vsprintf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_vsscanf.c c++ compatibility: rename reserved c++ keywords 'public' and 'this' 2023-09-16 19:45:02 +08:00
lib_wrflush_unlocked.c libs/libc: remove unnecessary flockfile to improve performance 2023-09-06 15:08:24 +03:00
Make.defs libc: add support for custom streams with fopencookie() 2023-10-18 21:13:01 +08:00