diff options
| author | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-03-30 06:39:44 +1100 |
|---|---|---|
| committer | TazyFoundSoup <gardendistrict0x0@outlook.com> | 2026-03-30 06:39:44 +1100 |
| commit | a7a9b34b832042f94813a1e325d22051a99dd633 (patch) | |
| tree | b8d93d844cdd971197fbac35e774518bc4d1cfee | |
| parent | ba77f399274da516c09e40035016ed870487edd2 (diff) | |
fix(bridges): Move stream source to src/
| -rw-r--r-- | include/bridges/stdio/stream_bridge.h (renamed from include/bridges/stdio/stream.h) | 2 | ||||
| -rw-r--r-- | src/bridges/stdio/stream_bridge.c (renamed from src/bridges/stdio/stream.c) | 16 |
2 files changed, 16 insertions, 2 deletions
diff --git a/include/bridges/stdio/stream.h b/include/bridges/stdio/stream_bridge.h index 1ae2dbc..561fa8a 100644 --- a/include/bridges/stdio/stream.h +++ b/include/bridges/stdio/stream_bridge.h @@ -1,8 +1,10 @@ +#include <stddef.h> #include <stdio.h> #include <tinyff/stream.h> // Default reads for common types (just FILE for now, memory later) size_t ff_file_read(void *ptr, size_t size, void *user); +size_t ff_file_write(const void *ptr, size_t size, void *user); // Stream creation helpers ff_stream ff_create_file_stream(FILE *f);
\ No newline at end of file diff --git a/src/bridges/stdio/stream.c b/src/bridges/stdio/stream_bridge.c index d942fa4..115f50d 100644 --- a/src/bridges/stdio/stream.c +++ b/src/bridges/stdio/stream_bridge.c @@ -1,4 +1,7 @@ -#include <bridges/stdio/stream.h> +#include <tinyff/stream.h> +#ifdef USE_HOSTED +#include <bridges/stdio/stream_bridge.h> + size_t ff_file_read(void *ptr, size_t size, void *user) { @@ -6,6 +9,12 @@ size_t ff_file_read(void *ptr, size_t size, void *user) return fread(ptr, size, 1, f); } +size_t ff_file_write(const void *ptr, size_t size, void *user) +{ + FILE *f = (FILE *)user; + return fwrite(ptr, 1, size, f); +} + ff_stream ff_create_file_stream(FILE *f) { ff_stream stream; @@ -14,4 +23,7 @@ ff_stream ff_create_file_stream(FILE *f) return stream; } -// Memory stream coming soon
\ No newline at end of file +// Memory stream coming soon + + +#endif
\ No newline at end of file |
