@@ -30,11 +30,11 @@ @class OFStream; @class OFDataArray; @class OFException; -#ifdef OF_HAVE_BLOCKS +#if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_BLOCKS) /*! * @brief A block which is called when data was read from the stream. * * @param stream The stream on which data was read * @param buffer A buffer with the data that has been read @@ -128,10 +128,11 @@ * The buffer *must* be *at least* this big! */ - (void)readIntoBuffer: (void*)buffer exactLength: (size_t)length; +#ifdef OF_HAVE_SOCKETS /*! * @brief Asyncronously reads *at most* size bytes from the stream into a * buffer. * * On network streams, this might read less than the specified number of bytes. @@ -184,11 +185,11 @@ - (void)asyncReadIntoBuffer: (void*)buffer exactLength: (size_t)length target: (id)target selector: (SEL)selector; -#ifdef OF_HAVE_BLOCKS +# ifdef OF_HAVE_BLOCKS /*! * @brief Asyncronously reads *at most* ref size bytes from the stream into a * buffer. * * On network streams, this might read less than the specified number of bytes. @@ -230,10 +231,11 @@ * received next, you need to return false from the block. */ - (void)asyncReadIntoBuffer: (void*)buffer exactLength: (size_t)length block: (of_stream_async_read_block_t)block; +# endif #endif /*! * @brief Reads a uint8_t from the stream. * @@ -578,10 +580,11 @@ * @return The line that was read, autoreleased, or nil if the end of the * stream has been reached. */ - (OFString*)readLineWithEncoding: (of_string_encoding_t)encoding; +#ifdef OF_HAVE_SOCKETS /*! * @brief Asyncronously reads until a newline, \\0, end of stream or an * exception occurs. * * @param target The target on which to call the selector when the data has @@ -612,11 +615,11 @@ */ - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding target: (id)target selector: (SEL)selector; -#ifdef OF_HAVE_BLOCKS +# ifdef OF_HAVE_BLOCKS /*! * @brief Asyncronously reads until a newline, \\0, end of stream or an * exception occurs. * * @param block The block to call when the data has been received. @@ -638,10 +641,11 @@ * to handle the next line, you need to return false from the * block. */ - (void)asyncReadLineWithEncoding: (of_string_encoding_t)encoding block: (of_stream_async_read_line_block_t)block; +# endif #endif /*! * @brief Tries to read a line from the stream (see readLine) and returns nil if * no complete line has been received yet. @@ -1039,14 +1043,16 @@ * * @return The file descriptor for the write end of the stream */ - (int)fileDescriptorForWriting; +#ifdef OF_HAVE_SOCKETS /*! * @brief Cancels all pending asyncronous requests on the stream. */ - (void)cancelAsyncRequests; +#endif /*! * @brief Closes the stream. */ - (void)close;