summaryrefslogtreecommitdiff
path: root/compiler/aslfiles.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2010-04-28 21:50:57 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2010-04-28 21:50:57 +0000
commit5b663f0c698a9ecf7e562f7f7f730d056e499b5f (patch)
tree8e0094680041ac8d48075e0787478ffeb5d61682 /compiler/aslfiles.c
parent9a8b5e6355e39ba0602a7f9484dca40f429fe6b0 (diff)
Notes
Diffstat (limited to 'compiler/aslfiles.c')
-rw-r--r--compiler/aslfiles.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/compiler/aslfiles.c b/compiler/aslfiles.c
index ebf59a408e8bc..8f498a1b9df7e 100644
--- a/compiler/aslfiles.c
+++ b/compiler/aslfiles.c
@@ -236,6 +236,36 @@ FlOpenFile (
/*******************************************************************************
*
+ * FUNCTION: FlGetFileSize
+ *
+ * PARAMETERS: FileId - Index into file info array
+ *
+ * RETURN: File Size
+ *
+ * DESCRIPTION: Get current file size. Uses seek-to-EOF. File must be open.
+ *
+ ******************************************************************************/
+
+UINT32
+FlGetFileSize (
+ UINT32 FileId)
+{
+ FILE *fp;
+ UINT32 FileSize;
+
+
+ fp = Gbl_Files[FileId].Handle;
+
+ fseek (fp, 0, SEEK_END);
+ FileSize = (UINT32) ftell (fp);
+ fseek (fp, 0, SEEK_SET);
+
+ return (FileSize);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: FlReadFile
*
* PARAMETERS: FileId - Index into file info array