For example:
stdin=(FILE *)freopen("test.txt","r",stdin); correctly redirects stdin
to a file "test.txt".
However, since there is no reopen function for memory buffers, I am
forced to use;
fclose(stdin);
stdin=(FILE *)fmemopen(buffer,strlen(buffer),"r");
According to the GNU man GLIBC web pages, this should redirect stdin to
read input from the buffer. Unfortunately, this does not seem to work.
It simply returns an EOF character indicating an error condition. Oh,
fmemopen is a very new function recently introduced in the standard GNU
C libraries (glibc 2.2).
Please help,
Bob Steele
email: rst...@1stlink.net