X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=util%2Fgmime-extra.c;fp=util%2Fgmime-extra.c;h=f1538587bf5a429e0d1cedc11279ae9353f84a06;hp=0000000000000000000000000000000000000000;hb=1e7dbf7abcf58407a5171e9030056f2ff9bec15a;hpb=427fa5e6e66eb238783f6cace56cbdcafc9c648d diff --git a/util/gmime-extra.c b/util/gmime-extra.c new file mode 100644 index 00000000..f1538587 --- /dev/null +++ b/util/gmime-extra.c @@ -0,0 +1,20 @@ +#include "gmime-extra.h" + +GMimeStream * +g_mime_stream_stdout_new() +{ + GMimeStream *stream_stdout = NULL; + GMimeStream *stream_buffered = NULL; + + stream_stdout = g_mime_stream_pipe_new (STDOUT_FILENO); + if (!stream_stdout) + return NULL; + + g_mime_stream_pipe_set_owner (GMIME_STREAM_PIPE (stream_stdout), FALSE); + + stream_buffered = g_mime_stream_buffer_new (stream_stdout, GMIME_STREAM_BUFFER_BLOCK_WRITE); + + g_object_unref (stream_stdout); + + return stream_buffered; +}