int tsmStreamToBuffer ( FILE *stream, char *buffer, int bufferSize )

Copies a stream to an area of memory

Documentation

Copies a stream to an area of memory.

Once you have opened an http or localdisk stream using tsmOpenStream, you can use this function to copy data from the stream into a pre-allocated buffer. Data is copied until there is no more room in the buffer, or there is no more data to be read (EOF). The filename must be a localdisk filename, e.g. "/tmp/foo.html".

Returns:
Returns the number of bytes read into the buffer, or -1 if failed
Parameters:
stream - a valid stream as returned by tsmOpenStream
buffer - a pointer to the start of the memory block to copy into
bufferSize - the size in bytes of the buffer
Author:
Martin Reddy
Version:
1 May 1998
See Also:
tsmOpenStream, tsmCloseStream, tsmStreamToFile, tsmStreamToStdout


TSMAPI_RELEASE 2.1 - Release Date: 2001/01/10 19:01:12

Back to tsmApi Home Page