@@ -25,7 +25,7 @@ extern "C" {
25
25
* Structure representing a file stream.
26
26
*/
27
27
typedef struct {
28
- FILE *file; // Pointer to the FILE structure for the stream
28
+ FILE *file; // Pointer to the FILE structure for the stream
29
29
char filename[500 ]; // Array to store the filename
30
30
} fossil_fstream_t ;
31
31
@@ -71,6 +71,16 @@ int32_t fossil_fstream_open(fossil_fstream_t *stream, const char *filename, cons
71
71
*/
72
72
void fossil_fstream_close (fossil_fstream_t *stream);
73
73
74
+ /* *
75
+ * Redirect a stream to /dev/null.
76
+ *
77
+ * This function redirects the given stream to /dev/null, effectively discarding any data written to it.
78
+ *
79
+ * @param stream Pointer to the fossil_fstream_t structure to redirect.
80
+ * @return 0 on success, non-zero on failure.
81
+ */
82
+ int32_t fossil_fstream_redirect_to_devnull (fossil_fstream_t *stream);
83
+
74
84
/* *
75
85
* Check if a stream is open.
76
86
*
@@ -418,6 +428,18 @@ namespace fossil {
418
428
fossil_fstream_close (stream);
419
429
}
420
430
431
+ /* *
432
+ * Redirect a stream to /dev/null.
433
+ *
434
+ * This function redirects the given stream to /dev/null, effectively discarding any data written to it.
435
+ *
436
+ * @param stream Pointer to the fossil_fstream_t structure to redirect.
437
+ * @return 0 on success, non-zero on failure.
438
+ */
439
+ static int32_t redirect_to_devnull (fossil_fstream_t *stream) {
440
+ return fossil_fstream_redirect_to_devnull (stream);
441
+ }
442
+
421
443
/* *
422
444
* Check if a stream is open.
423
445
*
0 commit comments