/*-------------------------------------------------------------*/
typedef enum {
NETWIB_FILE_INITTYPE_READ = 1, /* open the file for reading */
NETWIB_FILE_INITTYPE_WRITE, /* open the file for writing */
NETWIB_FILE_INITTYPE_APPEND /* open the file for appending */
} netwib_file_inittype;
/*-------------------------------------------------------------*/
/* Name : netwib_io_init_file
Description :
Open a file.
Input parameter(s) :
*pfilename : file name
textmode : (useful under Windows and ignored under Unix)
if file has to be opened in text mode ("\n" are
converted to "\r\n" for output; "\r\n" are
converted to "\n" for input)
Input/output parameter(s) :
Output parameter(s) :
**ppio : io created
Normal return values :
NETWIB_ERR_OK : ok
*/
netwib_err netwib_io_init_file(netwib_constbuf *pfilename,
netwib_file_inittype type,
netwib_bool textmode,
netwib_io **ppio);
#define netwib_io_init_file_read(filename,ppio) netwib_io_init_file(filename,NETWIB_FILE_INITTYPE_READ,NETWIB_FALSE,ppio)
#define netwib_io_init_file_write(filename,ppio) netwib_io_init_file(filename,NETWIB_FILE_INITTYPE_WRITE,NETWIB_FALSE,ppio)
#define netwib_io_init_file_append(filename,ppio) netwib_io_init_file(filename,NETWIB_FILE_INITTYPE_APPEND,NETWIB_FALSE,ppio)
#define netwib_io_init_file_textread(filename,ppio) netwib_io_init_file(filename,NETWIB_FILE_INITTYPE_READ,NETWIB_TRUE,ppio)
#define netwib_io_init_file_textwrite(filename,ppio) netwib_io_init_file(filename,NETWIB_FILE_INITTYPE_WRITE,NETWIB_TRUE,ppio)
#define netwib_io_init_file_textappend(filename,ppio) netwib_io_init_file(filename,NETWIB_FILE_INITTYPE_APPEND,NETWIB_TRUE,ppio)