aboutsummaryrefslogtreecommitdiff
path: root/backends/ps2/fileio.h
diff options
context:
space:
mode:
authorRobert Göffringmann2005-03-31 05:35:04 +0000
committerRobert Göffringmann2005-03-31 05:35:04 +0000
commitbd81feb9969f434e538f44ad2c82ea8e9e8821c9 (patch)
treec2fc75f7bc071afd7eda51e5a076edf5e8f7c009 /backends/ps2/fileio.h
parent5a890eedd3eeebc0ab1c37d4150cba11bb9d6138 (diff)
downloadscummvm-rg350-bd81feb9969f434e538f44ad2c82ea8e9e8821c9.tar.gz
scummvm-rg350-bd81feb9969f434e538f44ad2c82ea8e9e8821c9.tar.bz2
scummvm-rg350-bd81feb9969f434e538f44ad2c82ea8e9e8821c9.zip
Playstation2 Port: initial import
svn-id: r17305
Diffstat (limited to 'backends/ps2/fileio.h')
-rw-r--r--backends/ps2/fileio.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/backends/ps2/fileio.h b/backends/ps2/fileio.h
new file mode 100644
index 0000000000..6b3c006515
--- /dev/null
+++ b/backends/ps2/fileio.h
@@ -0,0 +1,63 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2004-2005 The ScummVM project
+ *
+ * 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 (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ *
+ */
+
+#ifndef __PS2FILE_IO__
+#define __PS2FILE_IO__
+
+#include "scummsys.h"
+
+class AccessFio {
+public:
+ AccessFio(void);
+ virtual ~AccessFio(void);
+ virtual bool open(const char *name, int mode);
+ virtual void read(void *dest, uint32 size);
+ virtual void write(const void *src, uint32 size);
+ virtual int seek(int32 offset, int whence);
+ virtual int32 sync(void);
+ virtual bool poll(void);
+ virtual bool fioAvail(void);
+protected:
+ int _handle;
+};
+
+class File;
+
+FILE *ps2_fopen(const char *fname, const char *mode);
+int ps2_fclose(FILE *stream);
+int ps2_fflush(FILE *stream);
+int ps2_fseek(FILE *stream, long offset, int origin);
+long ps2_ftell(FILE *stream);
+int ps2_feof(FILE *stream);
+long ps2_fsize(FILE *stream);
+
+size_t ps2_fread(void *buf, size_t r, size_t n, FILE *stream);
+int ps2_fgetc(FILE *stream);
+char *ps2_fgets(char *buf, int n, FILE *stream);
+
+size_t ps2_fwrite(const void *buf, size_t r, size_t n, FILE *stream);
+int ps2_fputc(int c, FILE *stream);
+int ps2_fputs(const char *s, FILE *stream);
+int ps2_fprintf(FILE *pOut, const char *zFormat, ...);
+
+AccessFio *fetchHandle(File *file);
+
+#endif // __PS2FILE_IO__