1 #include "stdafx.h"
2 #include "MASTER.h"
3 #define TECPLOTENGINEMODULE
4 
5 /*
6  *****************************************************************
7  *****************************************************************
8  *******                                                  ********
9  ******     Copyright (C) 1988-2010 Tecplot, Inc.          *******
10  *******                                                  ********
11  *****************************************************************
12  *****************************************************************
13 */
14 
15 #define FILESTREAMMODULE
16 
17 #include "GLOBAL.h"
18 #include "TASSERT.h"
19 #include "ALLOC.h"
20 #include "SYSTEM.h"
21 #include "FILESTREAM.h"
22 
23 /**
24  */
FileStreamAlloc(FILE * File,Boolean_t IsByteOrderNative)25 FileStream_s *FileStreamAlloc(FILE      *File,
26                               Boolean_t  IsByteOrderNative)
27 {
28     REQUIRE(VALID_REF(File) || File == NULL);
29 
30     FileStream_s *Result = ALLOC_ITEM(FileStream_s, "FileStream");
31     if (Result != NULL)
32     {
33         Result->File              = File;
34         Result->IsByteOrderNative = IsByteOrderNative;
35     }
36 
37     ENSURE(VALID_REF(Result) || Result == NULL);
38     return Result;
39 }
40 
41 /**
42  */
FileStreamDealloc(FileStream_s ** FileStream)43 void FileStreamDealloc(FileStream_s **FileStream)
44 {
45     REQUIRE(VALID_REF(FileStream));
46     REQUIRE(VALID_REF(*FileStream) || *FileStream == NULL);
47 
48     if (*FileStream != NULL)
49     {
50         FREE_ITEM(*FileStream, "FileStream");
51         *FileStream = NULL;
52     }
53 
54     ENSURE(*FileStream == NULL);
55 }
56