ScummVM API documentation
fileio.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef MADS_CORE_FILEIO_H
23#define MADS_CORE_FILEIO_H
24
25#include "common/stream.h"
26
27namespace MADS {
28
29#define fread_bufsize 1024
30
31extern bool fileio_suppress_unbuffering;
32
33
34extern void fileio_purge_trailing_spaces(char *myline);
35extern char *fileio_ffgets(char *mystring, int num, Common::SeekableReadStream *stream);
36extern int fileio_ffputs(const char *mystring, Common::WriteStream *stream);
37extern char *fileio_fix_lf_input(char *mystring);
38extern void fileio_fix_lf_output(char *mystring);
39extern int fileio_copy(const char *source, const char *dest);
40extern long fileio_setpos(Common::Stream *handle, long pos);
41extern long fileio_fread_f(void *buffer, long size, long count, Common::SeekableReadStream *stream);
42extern long fileio_fwrite_f(const void *buffer, long size, long count, Common::WriteStream *stream);
43extern long fileio_file_to_file(Common::SeekableReadStream *from, Common::WriteStream *to, long count);
44extern long fileio_get_file_size(const char *filename);
45extern bool fileio_exist(const char *inp);
46
50extern char *fileio_get_filetype(char *outp, char *inp);
51
57extern long fileio_get_file_time(char *filename);
58
59extern char *fileio_read_header(char *target, Common::SeekableReadStream *handle);
60extern void fileio_write_header(char *text, Common::WriteStream *handle);
61extern char *fileio_get_line(char *target, Common::SeekableReadStream *handle);
62extern int fileio_put_line(char *source, Common::WriteStream *handle);
63extern long fileio_get_disk_free(char drive);
64extern void fileio_add_ext(char *name, const char *ext);
65extern void fileio_new_ext(char *target, const char *name, const char *ext);
66extern int fileio_logpath(const char *path);
67extern char *fileio_parse_filename(char *target, char *filepath);
68extern char *fileio_parse_path(char *target, const char *filepath);
69extern char *fileio_swap_path(char *target, const char *base, const char *file);
70extern char *fileio_join_path(char *target, const char *path, const char *file);
71extern void fileio_get_volume_label(char *volume_label, char drive_letter);
72extern int fileio_set_file_time(char *filename, long new_time);
73extern int fileio_get_file_attributes(const char *filename, word *attributes);
74extern int fileio_set_file_attributes(const char *filename, word attributes);
75extern int fileio_read_till_null(char *target, Common::Stream *handle);
76extern char *fileio_prepend(char *target, const char *source, const char *prepend);
77extern char *fileio_chop_ext(char *target, const char *source);
78extern void fileio_purge_all_spaces(char *text);
79
80} // namespace MADS
81
82#endif
Definition: stream.h:745
Definition: stream.h:48
Definition: stream.h:77