summaryrefslogtreecommitdiff
path: root/src/common/grfio.h
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2011-03-24 13:57:13 -0700
committerBen Longbons <b.r.longbons@gmail.com>2011-03-24 13:57:13 -0700
commita2306446c86b3333e69b082e41ae76ba71a42d9d (patch)
treeac032fc4566d2ae3091a0dc95329ac86d50b9a23 /src/common/grfio.h
parentb6fa80d4c17994771cb796317c52cb8fb7a38a16 (diff)
downloadtmwa-a2306446c86b3333e69b082e41ae76ba71a42d9d.tar.gz
tmwa-a2306446c86b3333e69b082e41ae76ba71a42d9d.tar.bz2
tmwa-a2306446c86b3333e69b082e41ae76ba71a42d9d.tar.xz
tmwa-a2306446c86b3333e69b082e41ae76ba71a42d9d.zip
Optimize common objects, and adjust other objects accordingly.
Major changes still need to be made to each of the servers.
Diffstat (limited to 'src/common/grfio.h')
-rw-r--r--src/common/grfio.h29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/common/grfio.h b/src/common/grfio.h
index 5d3f69c..4919a7b 100644
--- a/src/common/grfio.h
+++ b/src/common/grfio.h
@@ -1,16 +1,17 @@
-// $Id: grfio.h,v 1.1.1.1 2004/09/10 17:44:49 MagicalTux Exp $
-#ifndef _GRFIO_H_
-#define _GRFIO_H_
+/// Accessor to the .gat map virtual files
+// Note .gat files are mapped to .wlk files by data/resnametable.txt
+// Note that there currently is a 1-1 correlation between them,
+// but it is possible for a single .wlk to have multiple .gats reference it
+#ifndef GRFIO_H
+#define GRFIO_H
-void grfio_init (char *); // GRFIO Initialize
-int grfio_add (char *); // GRFIO Resource file add
-void *grfio_read (char *); // GRFIO data file read
-void *grfio_reads (char *, int *); // GRFIO data file read & size get
-int grfio_size (char *); // GRFIO data file size get
+/// Load file into memory
+# define grfio_read(resourcename) grfio_reads (resourcename, NULL)
+/// Load file into memory and possibly record length
+// For some reason, this allocates an extra 1024 bytes at the end
+void *grfio_reads (const char *resourcename, size_t *size);
+/// Get size of file
+// This is only called once, and that is to check the existence of a file.
+size_t grfio_size (const char *resourcename) __attribute__((deprecated));
-// Accessor to GRF filenames
-char *grfio_setdatafile (const char *str);
-char *grfio_setadatafile (const char *str);
-char *grfio_setsdatafile (const char *str);
-
-#endif // _GRFIO_H_
+#endif // GRFIO_H