summaryrefslogtreecommitdiff
path: root/src/fileio.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2011-05-14 18:38:54 +0000
committeralberth <alberth@openttd.org>2011-05-14 18:38:54 +0000
commit990ec6f0a91038dabde458d6aa28a608ba3c52f5 (patch)
treefcf64c9fd4357c51798b7895a6adc3c081276ac0 /src/fileio.cpp
parent28092366ec8aaf953b6e8bb92d745ee2c32fad1e (diff)
downloadopenttd-990ec6f0a91038dabde458d6aa28a608ba3c52f5.tar.xz
(svn r22460) -Doc: Semantic documentation fixes, and doxygen additions (partly by planetmaker).
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r--src/fileio.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index c56640579..8ecf8138c 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -33,8 +33,10 @@
/* FILE IO ROUTINES ******************************/
/*************************************************/
+/** Size of the #Fio data buffer. */
#define FIO_BUFFER_SIZE 512
+/** Structure for keeping several open files with just one data buffer. */
struct Fio {
byte *buffer, *buffer_end; ///< position pointer in local buffer and last valid byte of buffer
size_t pos; ///< current (system) position in file
@@ -50,7 +52,7 @@ struct Fio {
#endif /* LIMITED_FDS */
};
-static Fio _fio;
+static Fio _fio; ///< #Fio instance.
/** Whether the working directory should be scanned. */
static bool _do_scan_working_directory = true;
@@ -58,12 +60,17 @@ static bool _do_scan_working_directory = true;
extern char *_config_file;
extern char *_highscore_file;
-/* Get current position in file */
+/** Get current position in file. */
size_t FioGetPos()
{
return _fio.pos + (_fio.buffer - _fio.buffer_end);
}
+/**
+ * Get the filename associated with a slot.
+ * @param slot Index of queried file.
+ * @return Name of the file.
+ */
const char *FioGetFilename(uint8 slot)
{
return _fio.shortnames[slot];