Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:15:44

0001 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 // AdvApp2Var_SysBase.hxx
0015 #ifndef AdvApp2Var_SysBase_HeaderFile
0016 #define AdvApp2Var_SysBase_HeaderFile
0017 
0018 #include <Standard_TypeDef.hxx>
0019 #include <AdvApp2Var_Data_f2c.hxx>
0020 
0021 class AdvApp2Var_SysBase
0022 {
0023 public:
0024   Standard_EXPORT AdvApp2Var_SysBase();
0025   Standard_EXPORT ~AdvApp2Var_SysBase();
0026 
0027   //
0028   Standard_EXPORT int mainial_();
0029 
0030   Standard_EXPORT static int macinit_(int*, int*);
0031   //
0032   Standard_EXPORT int mcrdelt_(integer*  iunit,
0033                                integer*  isize,
0034                                void*     t,
0035                                intptr_t* iofset,
0036                                integer*  iercod);
0037 
0038   Standard_EXPORT static int mcrfill_(integer* size, void* tin, void* tout);
0039 
0040   Standard_EXPORT int            mcrrqst_(integer*  iunit,
0041                                           integer*  isize,
0042                                           void*     t,
0043                                           intptr_t* iofset,
0044                                           integer*  iercod);
0045   Standard_EXPORT static integer mnfndeb_();
0046 
0047   Standard_EXPORT static int do__fio();
0048   Standard_EXPORT static int do__lio();
0049   Standard_EXPORT int        macrai4_(integer*  nbelem,
0050                                       integer*  maxelm,
0051                                       integer*  itablo,
0052                                       intptr_t* iofset,
0053                                       integer*  iercod);
0054   Standard_EXPORT int        macrar8_(integer*    nbelem,
0055                                       integer*    maxelm,
0056                                       doublereal* xtablo,
0057                                       intptr_t*   iofset,
0058                                       integer*    iercod);
0059   Standard_EXPORT int        macrdi4_(integer*  nbelem,
0060                                       integer*  maxelm,
0061                                       integer*  itablo,
0062                                       intptr_t* iofset,
0063                                       integer*  iercod);
0064 
0065   Standard_EXPORT int        macrdr8_(integer*    nbelem,
0066                                       integer*    maxelm,
0067                                       doublereal* xtablo,
0068                                       intptr_t*   iofset,
0069                                       integer*    iercod);
0070   Standard_EXPORT static int maermsg_(const char* cnompg, integer* icoder, ftnlen cnompg_len);
0071   Standard_EXPORT static int maitbr8_(integer* itaill, doublereal* xtab, doublereal* xval);
0072   Standard_EXPORT static int maovsr8_(integer* ivalcs);
0073   Standard_EXPORT static int mgenmsg_(const char* nomprg, ftnlen nomprg_len);
0074 
0075   Standard_EXPORT static int  mgsomsg_(const char* nomprg, ftnlen nomprg_len);
0076   Standard_EXPORT static void miraz_(integer* taille, void* adt);
0077   Standard_EXPORT static int  msifill_(integer* nbintg, integer* ivecin, integer* ivecou);
0078   Standard_EXPORT static int  msrfill_(integer* nbreel, doublereal* vecent, doublereal* vecsor);
0079   Standard_EXPORT static int  mswrdbg_(const char* ctexte, ftnlen ctexte_len);
0080   Standard_EXPORT static void mvriraz_(integer* taille, void* adt);
0081 
0082 private:
0083   int macrchk_();
0084   int mcrlist_(integer* ier) const;
0085 
0086   /* Maximum number of allowed allocation requests.
0087      Currently the maximum known number of requests is 7 - see
0088      AdvApp2Var_MathBase::mmresol_(). So the current value is a safe margin and
0089      a reasonable balance to not provoke stack overflow (especially in
0090      multi-threaded execution). Previous number of 1000 was excessive but
0091      tolerable when used for static memory.
0092   */
0093   static const int MAX_ALLOC_NB = 32;
0094 
0095   enum
0096   {
0097     static_allocation = 0, /* indicates static allocation, currently not used */
0098     heap_allocation   = 1  /* indicates heap allocation */
0099   };
0100 
0101   /* Describes an individual memory allocation request.
0102      See format description in the AdvApp2Var_SysBase.cxx.
0103      The field order is preserved and the sizes are chosen to minimize
0104      memory footprint. Fields containing address have the intptr_t type
0105      for easier arithmetic and to avoid casts in the source code.
0106 
0107      No initialization constructor should be provided to avoid wasting
0108      time when allocating a field mcrgene_.
0109   */
0110   struct mitem
0111   {
0112     unsigned char prot;
0113     unsigned char unit; // unit of allocation: 1, 2, 4 or 8
0114     integer       reqsize;
0115     intptr_t      loc;
0116     intptr_t      offset;
0117     unsigned char alloctype; // static_allocation or heap_allocation
0118     integer       size;
0119     intptr_t      addr;
0120     integer       userzone; // not used
0121     intptr_t      startaddr;
0122     intptr_t      endaddr;
0123     integer       rank;
0124   };
0125 
0126   struct
0127   {
0128     mitem         icore[MAX_ALLOC_NB];
0129     integer       ncore;
0130     unsigned char lprot;
0131   } mcrgene_;
0132 
0133   /* Contains statistics on allocation requests.
0134      Index 0 corresponds to static_allocation, 1 - to heap allocation.
0135      nrqst - number of allocation requests;
0136      ndelt - number of deallocation requests;
0137      nbyte - current number of allocated bytes;
0138      mbyte - maximum number of ever allocated bytes.
0139   */
0140   struct
0141   {
0142     integer nrqst[2], ndelt[2], nbyte[2], mbyte[2];
0143   } mcrstac_;
0144 };
0145 
0146 #endif