* interface should be used only with real file descriptors, not with
* sockets. Use the SILC Socket Stream for sockets.
*
+ * SILC File Descriptor Stream is not thread-safe. If same stream must be
+ * used in multithreaded environment concurrency control must be employed.
+ *
***/
#ifndef SILCFDSTREAM_H
*
* SYNOPSIS
*
- * SilcStream silc_fd_stream_create(int fd, SilcSchedule schedule);
+ * SilcStream silc_fd_stream_create(int fd);
*
* DESCRIPTION
*
* by `fd'. The stream is closed with the silc_stream_close and destroyed
* with the silc_stream_destroy.
*
+ * The silc_stream_set_notifier must be called in order to be able to read
+ * from and write to this file descriptor stream.
+ *
***/
-SilcStream silc_fd_stream_create(int fd, SilcSchedule schedule);
+SilcStream silc_fd_stream_create(int fd);
/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_create2
*
* SYNOPSIS
*
- * SilcStream silc_fd_stream_create2(int read_fd, int write_fd,
- * SilcSchedule schedule);
+ * SilcStream silc_fd_stream_create2(int read_fd, int write_fd);
*
* DESCRIPTION
*
* and `write_fd' opened for writing. The stream is closed with the
* silc_stream_close and destroyed with the silc_stream_destroy.
*
+ * The silc_stream_set_notifier must be called in order to be able to read
+ * from and write to this file descriptor stream.
+ *
+ ***/
+SilcStream silc_fd_stream_create2(int read_fd, int write_fd);
+
+/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_file
+ *
+ * SYNOPSIS
+ *
+ * SilcStream silc_fd_stream_file(const char *filename, SilcBool reading,
+ * SilcBool writing);
+ *
+ * DESCRIPTION
+ *
+ * Same as silc_fd_stream_create but creates the stream by opening the
+ * file indicated by `filename'. If the `reading' is TRUE the file is
+ * opened for reading. If the `writing' is TRUE the file is opened
+ * for writing.
+ *
+ * The silc_stream_set_notifier must be called in order to be able to read
+ * from and write to this file descriptor stream.
+ *
***/
-SilcStream silc_fd_stream_create2(int read_fd, int write_fd,
- SilcSchedule schedule);
+SilcStream silc_fd_stream_file(const char *filename, SilcBool reading,
+ SilcBool writing);
/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_get_info
*
* SYNOPSIS
*
- * bool
+ * SilcBool
* silc_fd_stream_get_info(SilcStream stream, int *read_fd, int *write_fd);
*
* DESCRIPTION
* function.
*
***/
-bool silc_fd_stream_get_info(SilcStream stream, int *read_fd, int *write_fd);
+SilcBool silc_fd_stream_get_info(SilcStream stream,
+ int *read_fd, int *write_fd);
/****f* silcutil/SilcFDStreamAPI/silc_fd_stream_get_error
*