Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:53

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  public:
0023   Standard_EXPORT AdvApp2Var_SysBase();
0024   Standard_EXPORT ~AdvApp2Var_SysBase();
0025   
0026   //
0027   Standard_EXPORT int mainial_();
0028 
0029   Standard_EXPORT static int macinit_(int *, 
0030                       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, 
0039                       void *tin, 
0040                       void *tout);
0041 
0042   Standard_EXPORT int mcrrqst_(integer *iunit, 
0043                       integer *isize, 
0044                       void *t, 
0045                       intptr_t *iofset, 
0046                       integer *iercod);
0047   Standard_EXPORT static integer mnfndeb_();
0048 
0049   Standard_EXPORT static int do__fio(); 
0050   Standard_EXPORT static int do__lio ();
0051   Standard_EXPORT int macrai4_(integer *nbelem, 
0052                       integer *maxelm, 
0053                       integer *itablo,
0054                       intptr_t *iofset,
0055                       integer *iercod);
0056   Standard_EXPORT int macrar8_(integer *nbelem, 
0057                       integer *maxelm,
0058                       doublereal *xtablo, 
0059                       intptr_t *iofset, 
0060                       integer *iercod);
0061   Standard_EXPORT int macrdi4_(integer *nbelem, 
0062                       integer *maxelm, 
0063                       integer *itablo, 
0064                       intptr_t *iofset, 
0065                       integer *iercod);
0066 
0067   Standard_EXPORT int macrdr8_(integer *nbelem,
0068                       integer *maxelm, 
0069                       doublereal *xtablo, 
0070                       intptr_t *iofset, 
0071                       integer *iercod);
0072   Standard_EXPORT static int maermsg_(const char *cnompg, 
0073                       integer *icoder, 
0074                       ftnlen cnompg_len);
0075   Standard_EXPORT static int maitbr8_(integer *itaill, 
0076                       doublereal *xtab, 
0077                       doublereal *xval);
0078   Standard_EXPORT static int maovsr8_(integer *ivalcs);
0079   Standard_EXPORT static int mgenmsg_(const char *nomprg, 
0080                       ftnlen nomprg_len);
0081 
0082   Standard_EXPORT static int mgsomsg_(const char *nomprg, 
0083                       ftnlen nomprg_len);
0084   Standard_EXPORT static void miraz_(integer *taille,
0085                      void *adt);
0086   Standard_EXPORT static int msifill_(integer *nbintg, 
0087                       integer *ivecin,
0088                       integer *ivecou);
0089   Standard_EXPORT static int msrfill_(integer *nbreel, 
0090                       doublereal *vecent,
0091                       doublereal * vecsor);
0092   Standard_EXPORT static int mswrdbg_(const char *ctexte, 
0093                       ftnlen ctexte_len);
0094   Standard_EXPORT static void mvriraz_(integer *taille,
0095                        void*adt);
0096   
0097 private:
0098   int macrchk_();
0099   int mcrlist_(integer *ier) const;
0100 
0101   /* Maximum number of allowed allocation requests.
0102      Currently the maximum known number of requests is 7 - see
0103      AdvApp2Var_MathBase::mmresol_(). So the current value is a safe margin and
0104      a reasonable balance to not provoke stack overflow (especially in
0105      multi-threaded execution). Previous number of 1000 was excessive but
0106      tolerable when used for static memory.
0107   */
0108   static const int MAX_ALLOC_NB = 32;
0109   
0110   enum {
0111     static_allocation = 0, /* indicates static allocation, currently not used */
0112     heap_allocation   = 1  /* indicates heap allocation */
0113   };
0114   
0115   /* Describes an individual memory allocation request.
0116      See format description in the AdvApp2Var_SysBase.cxx.
0117      The field order is preserved and the sizes are chosen to minimize
0118      memory footprint. Fields containing address have the intptr_t type
0119      for easier arithmetic and to avoid casts in the source code.
0120 
0121      No initialization constructor should be provided to avoid wasting
0122      time when allocating a field mcrgene_.
0123   */
0124   struct mitem {
0125     unsigned char   prot;
0126     unsigned char   unit; //unit of allocation: 1, 2, 4 or 8
0127     integer         reqsize;
0128     intptr_t        loc;
0129     intptr_t        offset;
0130     unsigned char   alloctype; // static_allocation or heap_allocation
0131     integer         size;
0132     intptr_t        addr;
0133     integer         userzone; //not used
0134     intptr_t        startaddr;
0135     intptr_t        endaddr;
0136     integer         rank;
0137   };
0138   
0139   struct {
0140     mitem           icore[MAX_ALLOC_NB];
0141     integer         ncore;
0142     unsigned char   lprot;
0143   } mcrgene_;
0144 
0145   /* Contains statistics on allocation requests.
0146      Index 0 corresponds to static_allocation, 1 - to heap allocation.
0147      nrqst - number of allocation requests;
0148      ndelt - number of deallocation requests;
0149      nbyte - current number of allocated bytes;
0150      mbyte - maximum number of ever allocated bytes.
0151   */
0152   struct {
0153     integer nrqst[2], ndelt[2], nbyte[2], mbyte[2];
0154   } mcrstac_; 
0155 };
0156 
0157 #endif