mailing list of musl libc
 help / color / mirror / code / Atom feed
* SoX & pipe rewinding
@ 2012-12-14 13:35 ojab
  2012-12-14 13:40 ` Rich Felker
  0 siblings, 1 reply; 10+ messages in thread
From: ojab @ 2012-12-14 13:35 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]

Hi list,
SoX use some kind of hackery for pipe rewinding (see the attached file). 
So I have two questions:
1. If something like that possible using musl?
2. Is there any musl specific #define?

//wbr ojab


[-- Attachment #2: rewind_pipe.txt --]
[-- Type: text/plain, Size: 854 bytes --]


/* Hack to rewind pipes (a small amount).
 * Works by resetting the FILE buffer pointer */
static void UNUSED rewind_pipe(FILE * fp)
{
/* _FSTDIO is for Torek stdio (i.e. most BSD-derived libc's)
 * In theory, we no longer need to check _NEWLIB_VERSION or __APPLE__ */
#if defined _FSTDIO || defined _NEWLIB_VERSION || defined __APPLE__
  fp->_p -= AUTO_DETECT_SIZE;
  fp->_r += AUTO_DETECT_SIZE;
#elif defined __GLIBC__
  fp->_IO_read_ptr = fp->_IO_read_base;
#elif defined _MSC_VER || defined __MINGW_H || defined _ISO_STDIO_ISO_H
  fp->_ptr = fp->_base;
#else
  /* To fix this #error, either simply remove the #error line and live without
   * file-type detection with pipes, or add support for your compiler in the
   * lines above.  Test with cat monkey.au | ./sox --info - */
  #error FIX NEEDED HERE
  #define NO_REWIND_PIPE
  (void)fp;
#endif
}

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-12-15  0:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-14 13:35 SoX & pipe rewinding ojab
2012-12-14 13:40 ` Rich Felker
2012-12-14 13:51   ` ojab
2012-12-14 16:47     ` John Spencer
2012-12-14 17:57       ` ojab
2012-12-14 19:09     ` Rich Felker
2012-12-14 21:11       ` ojab
2012-12-14 21:21         ` Rich Felker
2012-12-14 22:17   ` Rob Landley
2012-12-15  0:05     ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).