Forward compatibility: flex
[foam-extend-3.2.git] / applications / utilities / postProcessing / dataConversion / foamToTecplot360 / tecio / tecsrc / filestream.cpp
blob9a0e11571b0e5338c2563b782f849c430ca84c85
1 /*
2 * NOTICE and LICENSE for Tecplot Input/Output Library (TecIO) - OpenFOAM
4 * Copyright (C) 1988-2009 Tecplot, Inc. All rights reserved worldwide.
6 * Tecplot hereby grants OpenCFD limited authority to distribute without
7 * alteration the source code to the Tecplot Input/Output library, known
8 * as TecIO, as part of its distribution of OpenFOAM and the
9 * OpenFOAM_to_Tecplot converter. Users of this converter are also hereby
10 * granted access to the TecIO source code, and may redistribute it for the
11 * purpose of maintaining the converter. However, no authority is granted
12 * to alter the TecIO source code in any form or manner.
14 * This limited grant of distribution does not supersede Tecplot, Inc.'s
15 * copyright in TecIO. Contact Tecplot, Inc. for further information.
17 * Tecplot, Inc.
18 * 3535 Factoria Blvd, Ste. 550
19 * Bellevue, WA 98006, USA
20 * Phone: +1 425 653 1200
21 * http://www.tecplot.com/
24 #include "stdafx.h"
25 #include "MASTER.h"
26 #define TECPLOTENGINEMODULE
29 *****************************************************************
30 *****************************************************************
31 ******* ********
32 ****** Copyright (C) 1988-2008 Tecplot, Inc. *******
33 ******* ********
34 *****************************************************************
35 *****************************************************************
38 #define FILESTREAMMODULE
40 #include "GLOBAL.h"
41 #include "TASSERT.h"
42 #include "ALLOC.h"
43 #include "SYSTEM.h"
44 #include "FILESTREAM.h"
46 /**
48 FileStream_s *FileStreamAlloc(FILE *File,
49 Boolean_t IsByteOrderNative)
51 REQUIRE(VALID_REF(File) || File == NULL);
53 FileStream_s *Result = ALLOC_ITEM(FileStream_s, "FileStream");
54 if (Result != NULL)
56 Result->File = File;
57 Result->IsByteOrderNative = IsByteOrderNative;
60 ENSURE(VALID_REF(Result) || Result == NULL);
61 return Result;
64 /**
66 void FileStreamDealloc(FileStream_s **FileStream)
68 REQUIRE(VALID_REF(FileStream));
69 REQUIRE(VALID_REF(*FileStream) || *FileStream == NULL);
71 if (*FileStream != NULL)
73 FREE_ITEM(*FileStream, "FileStream");
74 *FileStream = NULL;
77 ENSURE(*FileStream == NULL);