0024510: Remove unused local variables
[occt.git] / src / AdvApp2Var / AdvApp2Var_SysBase.hxx
CommitLineData
973c2be1 1// Copyright (c) 1999-2014 OPEN CASCADE SAS
7fd59977 2//
973c2be1 3// This file is part of Open CASCADE Technology software library.
b311480e 4//
973c2be1 5// This library is free software; you can redistribute it and / or modify it
6// under the terms of the GNU Lesser General Public version 2.1 as published
7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
7fd59977 10//
973c2be1 11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
b311480e 13
14// AdvApp2Var_SysBase.hxx
7fd59977 15#ifndef AdvApp2Var_SysBase_HeaderFile
16#define AdvApp2Var_SysBase_HeaderFile
17
18#include <Standard_Macro.hxx>
19#include <AdvApp2Var_Data_f2c.hxx>
fadcea2c
RL
20#if _MSC_VER
21#include <stddef.h>
22#else
23#include <stdint.h>
24#endif
7fd59977 25
7fd59977 26class AdvApp2Var_SysBase {
1ef32e96
RL
27 public:
28 Standard_EXPORT AdvApp2Var_SysBase();
29 Standard_EXPORT ~AdvApp2Var_SysBase();
30
7fd59977 31 //
1ef32e96 32 Standard_EXPORT int mainial_();
7fd59977 33
34 Standard_EXPORT static int macinit_(int *,
35 int *);
36 //
1ef32e96 37 Standard_EXPORT int mcrdelt_(integer *iunit,
7fd59977 38 integer *isize,
fadcea2c
RL
39 void *t,
40 intptr_t *iofset,
7fd59977 41 integer *iercod);
42
43 Standard_EXPORT static int mcrfill_(integer *size,
fadcea2c
RL
44 void *tin,
45 void *tout);
7fd59977 46
1ef32e96 47 Standard_EXPORT int mcrrqst_(integer *iunit,
7fd59977 48 integer *isize,
fadcea2c
RL
49 void *t,
50 intptr_t *iofset,
7fd59977 51 integer *iercod);
52 Standard_EXPORT static integer mnfndeb_();
53
7fd59977 54 Standard_EXPORT static int do__fio();
55 Standard_EXPORT static int do__lio ();
1ef32e96 56 Standard_EXPORT int macrai4_(integer *nbelem,
7fd59977 57 integer *maxelm,
58 integer *itablo,
fadcea2c 59 intptr_t *iofset,
7fd59977 60 integer *iercod);
1ef32e96 61 Standard_EXPORT int macrar8_(integer *nbelem,
7fd59977 62 integer *maxelm,
63 doublereal *xtablo,
fadcea2c 64 intptr_t *iofset,
7fd59977 65 integer *iercod);
1ef32e96 66 Standard_EXPORT int macrdi4_(integer *nbelem,
7fd59977 67 integer *maxelm,
68 integer *itablo,
fadcea2c 69 intptr_t *iofset,
7fd59977 70 integer *iercod);
71
1ef32e96 72 Standard_EXPORT int macrdr8_(integer *nbelem,
7fd59977 73 integer *maxelm,
74 doublereal *xtablo,
fadcea2c 75 intptr_t *iofset,
7fd59977 76 integer *iercod);
77 Standard_EXPORT static int maermsg_(const char *cnompg,
78 integer *icoder,
79 ftnlen cnompg_len);
80 Standard_EXPORT static int maitbr8_(integer *itaill,
81 doublereal *xtab,
82 doublereal *xval);
83 Standard_EXPORT static int maovsr8_(integer *ivalcs);
84 Standard_EXPORT static int mgenmsg_(const char *nomprg,
85 ftnlen nomprg_len);
86
87 Standard_EXPORT static int mgsomsg_(const char *nomprg,
88 ftnlen nomprg_len);
89 Standard_EXPORT static void miraz_(integer *taille,
fadcea2c 90 void *adt);
7fd59977 91 Standard_EXPORT static int msifill_(integer *nbintg,
92 integer *ivecin,
93 integer *ivecou);
94 Standard_EXPORT static int msrfill_(integer *nbreel,
95 doublereal *vecent,
96 doublereal * vecsor);
97 Standard_EXPORT static int mswrdbg_(const char *ctexte,
98 ftnlen ctexte_len);
99 Standard_EXPORT static void mvriraz_(integer *taille,
fadcea2c 100 void*adt);
7fd59977 101
1ef32e96
RL
102private:
103 int macrchk_();
104 int mcrlist_(integer *ier) const;
105
106 /* Maximum number of allowed allocation requests.
107 Currently the maximum known number of requests is 7 - see
108 AdvApp2Var_MathBase::mmresol_(). So the current value is a safe margin and
109 a reasonable balance to not provoke stack overflow (especially in
110 multi-threaded execution). Previous number of 1000 was excessive but
111 tolerable when used for static memory.
112 */
113 static const int MAX_ALLOC_NB = 32;
114
115 enum {
116 static_allocation = 0, /* indicates static allocation, currently not used */
117 heap_allocation = 1 /* indicates heap allocation */
118 };
119
120 /* Describes an individual memory allocation request.
121 See format description in the AdvApp2Var_SysBase.cxx.
122 The field order is preserved and the sizes are chosen to minimize
123 memory footprint. Fields containing address have the intptr_t type
124 for easier arithmetic and to avoid casts in the source code.
125
126 No initialization constructor should be provided to avoid wasting
127 time when allocating a field mcrgene_.
128 */
129 struct mitem {
130 unsigned char prot;
131 unsigned char unit; //unit of allocation: 1, 2, 4 or 8
132 integer reqsize;
133 intptr_t loc;
134 intptr_t offset;
135 unsigned char alloctype; // static_allocation or heap_allocation
136 integer size;
137 intptr_t addr;
138 integer userzone; //not used
139 intptr_t startaddr;
140 intptr_t endaddr;
141 integer rank;
142 };
143
144 struct {
145 mitem icore[MAX_ALLOC_NB];
146 integer ncore;
147 unsigned char lprot;
148 } mcrgene_;
149
150 /* Contains statistics on allocation requests.
151 Index 0 corresponds to static_allocation, 1 - to heap allocation.
152 nrqst - number of allocation requests;
153 ndelt - number of deallocation requests;
154 nbyte - current number of allocated bytes;
155 mbyte - maximum number of ever allocated bytes.
156 */
157 struct {
158 integer nrqst[2], ndelt[2], nbyte[2], mbyte[2];
159 } mcrstac_;
7fd59977 160};
161
162#endif