From a2306446c86b3333e69b082e41ae76ba71a42d9d Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 24 Mar 2011 13:57:13 -0700 Subject: Optimize common objects, and adjust other objects accordingly. Major changes still need to be made to each of the servers. --- src/common/grfio.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/common/grfio.h') 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 -- cgit v1.2.3-60-g2f50