Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2002 Pekka Riikonen
+ Copyright (C) 1997 - 2007 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
* DESCRIPTION
*
* Opens a file indicated by the filename `filename' with flags indicated
- * by `flags'. The opening permission defaults to 0600.
+ * by `flags'. The opening permission defaults to 0600. The `flags'
+ * are defined in open(2).
*
***/
int silc_file_open(const char *filename, int flags);
*
* Opens a file indicated by the filename `filename' with flags indicated
* by `flags'. The argument `mode' specifies the permissions to use in
- * case a new file is created.
+ * case a new file is created. The `flags' are defined in open(2).
*
***/
int silc_file_open_mode(const char *filename, int flags, int mode);
***/
int silc_file_close(int fd);
+/****f* silcutil/SilcFileUtilAPI/silc_file_set_nonblock
+ *
+ * SYNOPSIS
+ *
+ * int silc_file_set_nonblock(int fd);
+ *
+ * DESCRIPTION
+ *
+ * Sets the file descriptor to non-blocking mode.
+ *
+ ***/
+int silc_file_set_nonblock(int fd);
+
/****f* silcutil/SilcFileUtilAPI/silc_file_readfile
*
* SYNOPSIS
*
- * char *silc_file_readfile(const char *filename, SilcUInt32 *return_len);
+ * char *silc_file_readfile(const char *filename, SilcUInt32 *return_len,
+ * SilcStack stack);
*
* DESCRIPTION
*
* If the `return_len' pointer is not NULL, it's filled with the length of
* the file.
*
+ * If `stack' is non-NULL the returned buffer is allocated from `stack'.
+ * The allocation consumes `stack' so caller should push the stack before
+ * calling this function and pop it later.
+ *
***/
-char *silc_file_readfile(const char *filename, SilcUInt32 *return_len);
+char *silc_file_readfile(const char *filename, SilcUInt32 *return_len,
+ SilcStack stack);
/****f* silcutil/SilcFileUtilAPI/silc_file_writefile
*