* Copyright (C) 2007 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
+ * Copyright (C) 2007,2008 Øyvind Harboe *
+ * oyvind.harboe@zylin.com *
+ * *
* 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 *
* the Free Software Foundation; either version 2 of the License, or *
strcpy(access, "a+");
break;
default:
- ERROR("BUG: access neither read, write nor readwrite");
+ LOG_ERROR("BUG: access neither read, write nor readwrite");
return ERROR_INVALID_ARGUMENTS;
}
if (!(fileio->file = open_file_from_path (fileio->url, access)))
{
- ERROR("couldn't open %s", fileio->url);
+ LOG_ERROR("couldn't open %s", fileio->url);
return ERROR_FILEIO_OPERATION_FAILED;
}
{
if (retval == EBADF)
{
- ERROR("BUG: fileio_local->file not a valid file descriptor");
+ LOG_ERROR("BUG: fileio_local->file not a valid file descriptor");
}
else
{
- ERROR("couldn't close %s: %s", fileio->url, strerror(errno));
+ LOG_ERROR("couldn't close %s: %s", fileio->url, strerror(errno));
}
return ERROR_FILEIO_OPERATION_FAILED;
int retval;
if ((retval = fseek(fileio->file, position, SEEK_SET)) != 0)
{
- ERROR("couldn't seek file %s: %s", fileio->url, strerror(errno));
+ LOG_ERROR("couldn't seek file %s: %s", fileio->url, strerror(errno));
return ERROR_FILEIO_OPERATION_FAILED;
}
return ERROR_OK;
}
-int fileio_local_fgets(fileio_t *fileio, u32 size, u8 *buffer)
+int fileio_local_fgets(fileio_t *fileio, u32 size, char *buffer)
{
if( fgets(buffer, size, fileio->file) == NULL)
return ERROR_FILEIO_OPERATION_FAILED;
return ERROR_OK;
}
-int fileio_fgets(fileio_t *fileio, u32 size, u8 *buffer)
+int fileio_fgets(fileio_t *fileio, u32 size, char *buffer)
{
return fileio_local_fgets(fileio, size, buffer);
}