1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 // AdvApp2Var_SysBase.cxx
22 #include <AdvApp2Var_Data_f2c.hxx>
23 #include <AdvApp2Var_SysBase.hxx>
24 #include <AdvApp2Var_Data.hxx>
25 #include <Standard.hxx>
41 int macrclw_(intptr_t *iadfld,
45 int macrerr_(intptr_t *iad,
48 int macrgfl_(intptr_t *iadfld,
53 int macrmsg_(const char *crout,
62 int macrstw_(intptr_t *iadfld,
67 int madbtbk_(integer *indice);
70 int magtlog_(const char *cnmlog,
79 int mamdlng_(char *cmdlng,
89 int maoverf_(integer *nbentr,
93 int matrlog_(const char *cnmlog,
101 int matrsym_(const char *cnmsym,
109 int mcrcomm_(integer *kop,
115 int mcrfree_(integer *ibyte,
120 int mcrgetv_(integer *sz,
125 int mcrlist_(integer *ier);
128 int mcrlocv_(void* t,
134 intptr_t icore[12000];
135 integer ncore, lprot;
139 integer nrqst[2], ndelt[2], nbyte[2], mbyte[2];
143 integer lec, imp, keyb, mae, jscrn, itblt, ibb;
146 #define mcrfill_ABS(a) (((a)<0)?(-(a)):(a))
149 //=======================================================================
150 //function : macinit_
152 //=======================================================================
153 int AdvApp2Var_SysBase::macinit_(integer *imode,
158 /* Fortran I/O blocks */
159 static cilist io______1 = { 0, 0, 0, (char*) "(' --- Debug-mode : ',I10,' ---')", 0 };
161 /* ************************************************************************/
164 /* INITIALIZATION OF READING WRITING UNITS AND 'IBB' */
168 /* MANAGEMENT, CONFIGURATION, UNITS, INITIALIZATION */
170 /* INPUT ARGUMENTS : */
171 /* -------------------- */
172 /* IMODE : MODE of INITIALIZATION :
173 0= DEFAULT, IMP IS 6, IBB 0 and LEC 5 */
174 /* 1= FORCE VALUE OF IMP */
175 /* 2= FORCE VALUE OF IBB */
176 /* 3= FORCE VALUE OF LEC */
178 /* ARGUMENT USED ONLY WHEN IMODE IS 1 OR 2 : */
179 /* IVAL : VALUE OF IMP WHEN IMODE IS 1 */
180 /* VALUE OF IBB WHEN IMODE IS 2 */
181 /* VALUE OF LEC WHEN IMODE IS 3 */
182 /* THERE IS NO CONTROL OF VALIDITY OF VALUE OF IVAL . */
184 /* OUTPUT ARGUMENTS : */
185 /* -------------------- */
190 /* REFERENCES CALLED : */
191 /* ------------------- */
192 /* DESCRIPTION/NOTES/LIMITATIONS : */
193 /* ------------------------------- */
195 /* THIS IS ONLY INITIALIZATION OF THE COMMON BLANK FOR ALL */
196 /* MODULES THAT A PRIORI DO NOT NEED TO KNOW THE COMMONS OF T . */
197 /* WHEN A MODIFICATION OF IBB IS REQUIRED (IMODE=2) AN INFO MESSAGE */
198 /* IS SUBMITTED ON IMP, WITH THE NEW VALUE OF IBB. */
200 /* IBB : MODE DEBUG OF STRIM T : RULES OF USE : */
201 /* 0 RESTRAINED VERSION */
202 /* >0 THE GREATER IS IBB THE MORE COMMENTS THE VERSION HAS. */
203 /* FOR EXAMPLE FOR IBB=1 THE ROUTINES CALLED */
204 /* INFORM ON IMP ('INPUT IN TOTO', */
205 /* AND 'OUTPUT FROM TOTO'), AND THE ROUTINES THAT RETURN */
206 /* NON NULL ERROR CODE INFORM IT AS WELL. */
207 /* (BUT IT IS NOT TRUE FOR ALL ROUTINES OF T) */
209 /* ***********************************************************************
216 } else if (*imode == 1) {
217 mblank__.imp = *ival;
218 } else if (*imode == 2) {
219 mblank__.ibb = *ival;
220 io______1.ciunit = mblank__.imp;
225 do__fio(&c____1, (char *)&mblank__.ibb, (ftnlen)sizeof(integer));
227 AdvApp2Var_SysBase::e__wsfe();
228 } else if (*imode == 3) {
229 mblank__.lec = *ival;
232 /* ----------------------------------------------------------------------*
238 //=======================================================================
239 //function : macrai4_
241 //=======================================================================
242 int AdvApp2Var_SysBase::macrai4_(integer *nbelem,
250 /* ***********************************************************************
255 /* Require dynamic allocation of type INTEGER */
259 /* SYSTEM, ALLOCATION, MEMORY, REALISATION */
261 /* INPUT ARGUMENTS : */
262 /* ----------------- */
263 /* NBELEM : Number of required units */
264 /* MAXELM : Max number of units available in ITABLO */
265 /* ITABLO : Reference Address of the rented zone */
267 /* OUTPUT ARGUMENTS : */
268 /* ------------------- */
269 /* IOFSET : Offset */
270 /* IERCOD : Error code */
272 /* = 1 : Max nb of allocations attained */
273 /* = 2 : Incorrect arguments */
274 /* = 3 : Refused dynamic allocation */
277 /* ------------------ */
279 /* REFERENCES CALLED : */
280 /* --------------------- */
283 /* DESCRIPTION/NOTES/LIMITATIONS : */
284 /* ----------------------------------- */
285 /* (Cf description in the heading of MCRRQST) */
287 /* Table ITABLO should be dimensioned to MAXELM by the caller. */
288 /* If the request is lower or equal to MAXELM, IOFSET becomes = 0. */
289 /* Otherwise the demand of allocation is valid and IOFSET > 0. */
291 /* ***********************************************************************
295 /* Parameter adjustments */
299 iunit = sizeof(integer);
301 if (*nbelem > *maxelm) {
302 AdvApp2Var_SysBase::mcrrqst_(&iunit, nbelem, &itablo[1], iofset, iercod);
310 //=======================================================================
311 //function : AdvApp2Var_SysBase::macrar8_
313 //=======================================================================
314 int AdvApp2Var_SysBase::macrar8_(integer *nbelem,
321 static integer c__8 = 8;
323 /* ***********************************************************************
328 /* Demand of dynamic allocation of type DOUBLE PRECISION */
332 /* SYSTEM, ALLOCATION, MEMORY, REALISATION */
334 /* INPUT ARGUMENTS : */
335 /* ------------------ */
336 /* NBELEM : Nb of units required */
337 /* MAXELM : Max Nb of units available in XTABLO */
338 /* XTABLO : Reference address of the rented zone */
340 /* OUTPUT ARGUMENTS : */
341 /* ------------------ */
342 /* IOFSET : Offset */
343 /* IERCOD : Error code */
345 /* = 1 : Max Nb of allocations reached */
346 /* = 2 : Arguments incorrect */
347 /* = 3 : Refuse of dynamic allocation */
350 /* ------------------ */
352 /* REFERENCES CALLED : */
353 /* --------------------- */
356 /* DESCRIPTION/NOTES/LIMITATIONS : */
357 /* ----------------------------------- */
358 /* (Cf description in the heading of MCRRQST) */
360 /* Table XTABLO should be dimensioned to MAXELM by the caller. */
361 /* If the request is less or equal to MAXELM, IOFSET becomes = 0. */
362 /* Otherwise the demand of allocation is valid and IOFSET > 0. */
365 /* ***********************************************************************
369 /* Parameter adjustments */
373 if (*nbelem > *maxelm) {
374 AdvApp2Var_SysBase::mcrrqst_(&c__8, nbelem, &xtablo[1], iofset, iercod);
382 //=======================================================================
383 //function : macrbrk_
385 //=======================================================================
391 //=======================================================================
392 //function : macrchk_
394 //=======================================================================
397 /* System generated locals */
400 /* Local variables */
401 static integer i__, j;
402 static intptr_t ioff;
403 static doublereal t[1];
406 /* ***********************************************************************
411 /* CONTROL OF EXCESSES OF ALLOCATED MEMORY ZONE */
415 /* SYSTEM, ALLOCATION, MEMORY, CONTROL, EXCESS */
417 /* INPUT ARGUMENTS : */
418 /* ----------------- */
421 /* OUTPUT ARGUMENTS : */
422 /* ------------------- */
426 /* ------------------ */
429 /* REFERENCES CALLED : */
430 /* --------------------- */
431 /* MACRERR, MAOSTRD */
433 /* DESCRIPTION/NOTES/LIMITATIONS : */
434 /* ----------------------------------- */
437 /* ***********************************************************************
440 /* ***********************************************************************
445 /* TABLE OF MANAGEMENT OF DYNAMIC MEMOTY ALLOCATIONS */
449 /* SYSTEM, MEMORY, ALLOCATION */
451 /* DEMSCRIPTION/NOTES/LIMITATIONS : */
452 /* ----------------------------------- */
456 /* ***********************************************************************
459 /* ICORE : TABLE OF EXISTING ALLOCATIONS, EACH HAVING : */
460 /* 1 : LEVEL OF PROTECTION (0=NOT PROTECTED, OTHER=PROTECTED) */
461 /* (PROTECTED MEANS NOT DESTROYED BY CRRSET .) */
462 /* 2 : UNIT OF ALLOCATION */
463 /* 3 : NB OF ALLOCATED UNITS */
464 /* 4 : REFERENCE ADDRESS OF THE TABLE */
466 /* 6 : STATIC ALLOCATION NUMBER */
467 /* 7 : Required allocation size */
468 /* 8 : address of the beginning of allocation */
469 /* 9 : Size of the USER ZONE */
470 /* 10 : ADDRESS of the START FLAG */
471 /* 11 : ADDRESS of the END FLAG */
472 /* 12 : Rank of creation of the allocation */
474 /* NDIMCR : NB OF DATA OF EACH ALLOC IN ICORE */
475 /* NCORE : NB OF CURRENT ALLOCS */
476 /* LPROT : COMMUNICATION BETWEEN CRPROT AND MCRRQST, SET TO 0 BY MCRRQST */
477 /* FLAG : VALUE OF THE FLAG USED FOR EXCESSES */
481 /* ----------------------------------------------------------------------*
485 /* ----------------------------------------------------------------------*
488 /* CALCULATE ADDRESS OF T */
490 /* CONTROL OF FLAGS IN THE TABLE */
491 i__1 = mcrgene_.ncore;
492 for (i__ = 1; i__ <= i__1; ++i__) {
494 for (j = 10; j <= 11; ++j) {
496 if (mcrgene_.icore[j + i__ * 12 - 13] != -1) {
498 ioff = (mcrgene_.icore[j + i__ * 12 - 13] - loc) / 8;
500 if (t[ioff] != -134744073.) {
502 /* MSG : '*** ERREUR : REMOVAL FROM MEMORY OF ADDRESS
504 /* AND OF RANK ICORE(12,I) */
505 macrerr_(&mcrgene_.icore[j + i__ * 12 - 13],
506 &mcrgene_.icore[i__ * 12 - 1]);
508 /* BACK-PARCING IN PHASE OF PRODUCTION */
511 /* REMOVAL OF THE ADDRESS OF FLAG TO AVOID REMAKING ITS CONTROL */
512 mcrgene_.icore[j + i__ * 12 - 13] = -1;
526 //=======================================================================
527 //function : macrclw_
529 //=======================================================================
530 int macrclw_(intptr_t *,//iadfld,
538 //=======================================================================
539 //function : AdvApp2Var_SysBase::macrdi4_
541 //=======================================================================
542 int AdvApp2Var_SysBase::macrdi4_(integer *nbelem,
545 intptr_t *iofset, /* Offset long (pmn) */
550 /* ***********************************************************************
555 /* Destruction of dynamic allocation of type INTEGER */
559 /* SYSTEM, ALLOCATION, MEMORY, DESTRUCTION */
561 /* INPUT ARGUMENTS : */
562 /* ------------------ */
563 /* NBELEM : Nb of units required */
564 /* MAXELM : Max Nb of units available in ITABLO */
565 /* ITABLO : Reference Address of the allocated zone */
566 /* IOFSET : Offset */
568 /* OUTPUT ARGUMENTS : */
569 /* --------------------- */
570 /* IERCOD : Error Code */
572 /* = 1 : Pb of de-allocation of a zone allocated in table */
573 /* = 2 : The system refuses the demand of de-allocation */
576 /* ------------------ */
578 /* REFERENCES CALLED : */
579 /* --------------------- */
582 /* DESCRIPTION/NOTES/LIMITATIONS : */
583 /* ----------------------------------- */
584 /* (Cf description in the heading of MCRDELT) */
586 /* ***********************************************************************
590 /* Parameter adjustments */
592 iunit = sizeof(integer);
595 AdvApp2Var_SysBase::mcrdelt_(&iunit,
606 //=======================================================================
607 //function : AdvApp2Var_SysBase::macrdr8_
609 //=======================================================================
610 int AdvApp2Var_SysBase::macrdr8_(integer *nbelem,
617 static integer c__8 = 8;
619 /* ***********************************************************************
624 /* Destruction of dynamic allocation of type DOUBLE PRECISION
629 /* SYSTEM, ALLOCATION, MEMORY, DESTRUCTION */
631 /* INPUT ARGUMENTS : */
632 /* -------------------- */
633 /* NBELEM : Nb of units required */
634 /* MAXELM : Max nb of units available in XTABLO */
635 /* XTABLO : Reference Address of the allocated zone */
636 /* IOFSET : Offset */
638 /* OUTPUT ARGUMENTS : */
639 /* ------------------- */
640 /* IERCOD : Error Code */
642 /* = 1 : Pb of de-allocation of a zone allocated on table */
643 /* = 2 : The system refuses the demand of de-allocation */
648 /* REFERENCES CALLEDS : */
649 /* -------------------- */
652 /* DESCRIPTION/NOTES/LIMITATIONS : */
653 /* ----------------------------------- */
654 /* (Cf description in the heading of MCRDELT) */
657 /* ***********************************************************************
661 /* Parameter adjustments */
666 AdvApp2Var_SysBase::mcrdelt_(&c__8, nbelem, &xtablo[1], iofset, iercod);
673 //=======================================================================
674 //function : macrerr_
676 //=======================================================================
677 int macrerr_(intptr_t *,//iad,
681 //static integer c__1 = 1;
682 /* Builtin functions */
683 //integer /*s__wsfe(),*/ /*do__fio(),*/ e__wsfe();
685 /* Fortran I/O blocks */
686 //static cilist io___1 = { 0, 6, 0, "(X,A,I9,A,I3)", 0 };
688 /* ***********************************************************************
693 /* WRITING OF ADDRESS REMOVED IN ALLOCS . */
699 /* INPUT ARGUMENTS : */
700 /* ------------------ */
701 /* IAD : ADDRESS TO INFORM OF REMOVAL */
702 /* NALLOC : NUMBER OF ALLOCATION */
704 /* OUTPUT ARGUMENTS : */
705 /* --------------------- */
711 /* REFERENCES CALLED : */
712 /* ------------------- */
714 /* DESCRIPTION/NOTES/LIMITATIONS : */
715 /* ----------------------------------- */
717 /* ***********************************************************************
723 do__fio(&c__1, "*** ERREUR : Ecrasement de la memoire d'adresse ", 48L);
724 do__fio(&c__1, (char *)&(*iad), (ftnlen)sizeof(long int));
725 do__fio(&c__1, " sur l'allocation ", 18L);
726 do__fio(&c__1, (char *)&(*nalloc), (ftnlen)sizeof(integer));
728 AdvApp2Var_SysBase::e__wsfe();
734 //=======================================================================
735 //function : macrgfl_
737 //=======================================================================
738 int macrgfl_(intptr_t *iadfld,
744 /* Initialized data */
746 static integer ifois = 0;
749 static integer ibid, ienr;
750 static doublereal t[1];
751 static integer novfl;
752 static intptr_t ioff,iadrfl, iadt;
755 /* ***********************************************************************
760 /* IMPLEMENTATION OF TWO FLAGS START AND END OF THE ALLOCATED ZONE */
761 /* AND SETTING TO OVERFLOW OF THE USER SPACE IN PHASE OF PRODUCTION. */
765 /* ALLOCATION, CONTROL, EXCESS */
767 /* INPUT ARGUMENTS : */
768 /* ------------------ */
769 /* IADFLD : ADDRESS OF THE START FLAG */
770 /* IADFLF : ADDRESS OF THE END FLAG */
771 /* IPHASE : TYPE OF SOFTWARE VERSION : */
772 /* 0 = OFFICIAL VERSION */
773 /* 1 = PRODUCTION VERSION */
774 /* IZNUTI : SIZE OF THE USER ZONE IN OCTETS */
776 /* OUTPUT ARGUMENTS : */
777 /* ------------------ */
781 /* ------------------ */
783 /* REFERENCES CALLED : */
784 /* ------------------- */
787 /* DESCRIPTION/NOTES/LIMITATIONS : */
788 /* ------------------------------- */
791 /* ***********************************************************************
796 /* ***********************************************************************
801 /* TABLE FOR MANAGEMENT OF DYNAMIC ALLOCATIONS OF MEMORY */
805 /* SYSTEM, MEMORY, ALLOCATION */
807 /* DEMSCRIPTION/NOTES/LIMITATIONS : */
808 /* ----------------------------------- */
812 /* ***********************************************************************
814 /* ICORE : TABLE OF EXISTING ALLOCATIONS, EACH HAVING : */
815 /* 1 : LEVEL OF PROTECTION (0=NOT PROTECTED, OTHER=PROTECTED) */
816 /* (PROTECTED MEANS NOT DESTROYED BY CRRSET .) */
817 /* 2 : UNIT OF ALLOCATION */
818 /* 3 : NB OF ALLOCATED UNITS */
819 /* 4 : REFERENCE ADDRESS OF THE TABLE */
821 /* 6 : STATIC ALLOCATION NUMBER */
822 /* 7 : Required allocation size */
823 /* 8 : address of the beginning of allocation */
824 /* 9 : Size of the USER ZONE */
825 /* 10 : ADDRESS of the START FLAG */
826 /* 11 : ADDRESS of the END FLAG */
827 /* 12 : Rank of creation of the allocation */
829 /* NDIMCR : NB OF DATA OF EACH ALLOC IN ICORE */
830 /* NCORE : NB OF CURRENT ALLOCS */
831 /* LPROT : COMMUNICATION BETWEEN CRPROT AND MCRRQST, SET TO 0 BY MCRRQST */
832 /* FLAG : VALUE OF THE FLAG USED FOR EXCESSES */
838 /* ----------------------------------------------------------------------*
843 matrsym_("NO_OVERFLOW", cbid, &novfl, &ibid, 11L, 1L);
847 /* CALCULATE THE ADDRESS OF T */
850 /* CALCULATE THE OFFSET */
851 ioff = (*iadfld - iadt) / 8;
853 /* SET TO OVERFLOW OF THE USER ZONE IN CASE OF PRODUCTION VERSION */
854 if (*iphase == 1 && novfl == 0) {
856 maoverf_(&ienr, &t[ioff + 1]);
859 /* UPDATE THE START FLAG */
860 t[ioff] = -134744073.;
862 /* FAKE CALL TO STOP THE DEBUGGER : */
866 /* UPDATE THE START FLAG */
867 ioff = (*iadflf - iadt) / 8;
868 t[ioff] = -134744073.;
870 /* FAKE CALL TO STOP THE DEBUGGER : */
877 //=======================================================================
878 //function : macrmsg_
880 //=======================================================================
881 int macrmsg_(const char *,//crout,
891 /* Local variables */
892 static integer inum, iunite;
893 static char cfm[80], cln[3];
895 /* Fortran I/O blocks */
896 static cilist io___5 = { 0, 0, 0, cfm, 0 };
897 static cilist io___6 = { 0, 0, 0, cfm, 0 };
898 static cilist io___7 = { 0, 0, 0, cfm, 0 };
901 /* ***********************************************************************
906 /* MESSAGING OF ROUTINES OF ALLOCATION */
912 /* INPUT ARGUMENTSEE : */
913 /* ------------------- */
914 /* CROUT : NAME OF THE CALLING ROUTINE : MCRRQST, MCRDELT, MCRLIST
916 /* ,CRINCR OR CRPROT */
917 /* NUM : MESSAGE NUMBER */
918 /* IT : TABLE OF INTEGER DATA */
919 /* XT : TABLE OF REAL DATA */
920 /* CT : ------------------ CHARACTER */
922 /* OUTPUT ARGUMENTS : */
923 /* --------------------- */
927 /* ------------------ */
929 /* REFERENCES CALLED : */
930 /* --------------------- */
932 /* DESCRIPTION/NOTES/LIMITATIONS : */
933 /* ----------------------------------- */
935 /* ROUTINE FOR TEMPORARY USE, WAITING FOR THE 'NEW' MESSAGE */
936 /* (STRIM 3.3 ?), TO MAKE THE ROUTINES OF ALLOC USABLE */
939 /* DEPENDING ON THE LANGUAGE, WRITING OF THE REQUIRED MESSAGE ON */
941 /* (REUSE OF SPECIFS OF VFORMA) */
943 /* THE MESSAGE IS INITIALIZED AT 'MESSAGE MISSING', AND IT IS */
944 /* REPLACED BY THE REQUIRED MESSAGE IF EXISTS. */
946 /* ***********************************************************************
951 /* ----------------------------------------------------------------------*
953 /* FIND MESSAGE DEPENDING ON THE LANGUAGE , THE ROUTINE */
954 /* AND THE MESSAGE NUMBER */
956 /* READING OF THE LANGUAGE : */
957 /* Parameter adjustments */
965 /* INUM : TYPE OF MESSAGE : 0 AS TEXT, 1 1 INTEGER TO BE WRITTEN */
966 /* -1 MESSAGE INEXISTING (1 INTEGER AND 1 CHAIN) */
970 if (__s__cmp(cln, "FRA", 3L, 3L) == 0) {
971 __s__copy(cfm, "(' Il manque le message numero ',I5' pour le programm\
972 e de nom : ',A8)", 80L, 71L);
973 if (__s__cmp(crout, "MCRLIST", crout_len, 7L) == 0) {
976 __s__copy(cfm, "(/,' Nombre d''allocation(s) de memoire effectu\
977 ee(s) : ',I6,/)", 80L, 62L);
978 } else if (*num == 2) {
980 __s__copy(cfm, "(' Taille de l''allocation = ',I12)", 80L, 35L);
981 } else if (*num == 3) {
983 __s__copy(cfm, "(' Taille totale allouee = ',I12 /)", 80L, 36L);
985 } else if (__s__cmp(crout, "MCRDELT", crout_len, 7L) == 0) {
988 __s__copy(cfm, "(' L''allocation de memoire a detruire n''exist\
989 e pas ')", 80L, 56L);
990 } else if (*num == 2) {
992 __s__copy(cfm, "(' Le systeme refuse une destruction d''allocat\
993 ion de memoire ')", 80L, 65L);
995 } else if (__s__cmp(crout, "MCRRQST", crout_len, 7L) == 0) {
998 __s__copy(cfm, "(' Le nombre maxi d''allocations de memoire est\
999 atteint :',I6)", 80L, 62L);
1000 } else if (*num == 2) {
1002 __s__copy(cfm, "(' Unite d''allocation invalide : ',I12)", 80L,
1004 } else if (*num == 3) {
1006 __s__copy(cfm, "(' Le systeme refuse une allocation de memoire \
1007 de ',I12,' octets')", 80L, 66L);
1009 } else if (__s__cmp(crout, "CRINCR", crout_len, 6L) == 0) {
1012 __s__copy(cfm, "(' L''allocation de memoire a incrementer n''ex\
1013 iste pas')", 80L, 57L);
1015 } else if (__s__cmp(crout, "CRPROT", crout_len, 6L) == 0) {
1018 __s__copy(cfm, "(' Le niveau de protection est invalide ( =< 0 \
1019 ) : ',I12)", 80L, 57L);
1023 } else if (__s__cmp(cln, "DEU", 3L, 3L) == 0) {
1024 __s__copy(cfm, "(' Es fehlt die Meldung Nummer ',I5,' fuer das Progra\
1025 mm des Namens : ',A8)", 80L, 76L);
1026 if (__s__cmp(crout, "MCRLIST", crout_len, 7L) == 0) {
1029 __s__copy(cfm, "(/,' Anzahl der ausgefuehrten dynamischen Anwei\
1030 sung(en) : ',I6,/)", 80L, 65L);
1031 } else if (*num == 2) {
1033 __s__copy(cfm, "(' Groesse der Zuweisung = ',I12)", 80L, 33L);
1034 } else if (*num == 3) {
1036 __s__copy(cfm, "(' Gesamtgroesse der Zuweisung = ',I12,/)", 80L,
1039 } else if (__s__cmp(crout, "MCRDELT", crout_len, 7L) == 0) {
1042 __s__copy(cfm, "(' Zu loeschende dynamische Zuweisung existiert\
1043 nicht !! ')", 80L, 59L);
1044 } else if (*num == 2) {
1046 __s__copy(cfm, "(' System verweigert Loeschung der dynamischen \
1047 Zuweisung !!')", 80L, 61L);
1049 } else if (__s__cmp(crout, "MCRRQST", crout_len, 7L) == 0) {
1052 __s__copy(cfm, "(' Hoechstzahl dynamischer Zuweisungen ist erre\
1053 icht :',I6)", 80L, 58L);
1054 } else if (*num == 2) {
1056 __s__copy(cfm, "(' Falsche Zuweisungseinheit : ',I12)", 80L, 37L)
1058 } else if (*num == 3) {
1060 __s__copy(cfm, "(' System verweigert dynamische Zuweisung von '\
1061 ,I12,' Bytes')", 80L, 61L);
1063 } else if (__s__cmp(crout, "CRINCR", crout_len, 6L) == 0) {
1066 __s__copy(cfm, "(' Zu inkrementierende dynamische Zuweisung exi\
1067 stiert nicht !! ')", 80L, 65L);
1069 } else if (__s__cmp(crout, "CRPROT", crout_len, 6L) == 0) {
1072 __s__copy(cfm, "(' Sicherungsniveau ist nicht richtig ( =< 0 ) \
1073 : ',I12)", 80L, 55L);
1078 __s__copy(cfm, "(' Message number ',I5,' is missing ' \
1079 ,'for program named: ',A8)", 80L, 93L);
1080 if (__s__cmp(crout, "MCRLIST", crout_len, 7L) == 0) {
1083 __s__copy(cfm, "(/,' number of memory allocations carried out: \
1084 ',I6,/)", 80L, 54L);
1085 } else if (*num == 2) {
1087 __s__copy(cfm, "(' size of allocation = ',I12)", 80L, 30L);
1088 } else if (*num == 3) {
1090 __s__copy(cfm, "(' total size allocated = ',I12,/)", 80L, 34L);
1092 } else if (__s__cmp(crout, "MCRDELT", crout_len, 7L) == 0) {
1095 __s__copy(cfm, "(' Memory allocation to delete does not exist !\
1097 } else if (*num == 2) {
1099 __s__copy(cfm, "(' System refuses deletion of memory allocation\
1102 } else if (__s__cmp(crout, "MCRRQST", crout_len, 7L) == 0) {
1105 __s__copy(cfm, "(' max number of memory allocations reached :',\
1107 } else if (*num == 2) {
1109 __s__copy(cfm, "(' incorrect unit of allocation : ',I12)", 80L,
1111 } else if (*num == 3) {
1113 __s__copy(cfm, "(' system refuses a memory allocation of ',I12,\
1114 ' bytes ')", 80L, 57L);
1116 } else if (__s__cmp(crout, "CRINCR", crout_len, 6L) == 0) {
1119 __s__copy(cfm, "(' Memory allocation to increment does not exis\
1120 t !! ')", 80L, 54L);
1122 } else if (__s__cmp(crout, "CRPROT", crout_len, 6L) == 0) {
1125 __s__copy(cfm, "(' level of protection is incorrect ( =< 0 ) : \
1131 /* ----------------------------------------------------------------------*
1133 /* iMPLEMENTATION OF WRITE , WITH OR WITHOUT DATA : */
1135 iunite = AdvApp2Var_SysBase::mnfnimp_();
1137 io___5.ciunit = iunite;
1141 AdvApp2Var_SysBase::e__wsfe();
1142 } else if (inum == 1) {
1143 io___6.ciunit = iunite;
1148 do__fio(&c__1, (char *)&it[1], (ftnlen)sizeof(integer));
1150 AdvApp2Var_SysBase::e__wsfe();
1152 /* MESSAGE DOES NOT EXIST ... */
1153 io___7.ciunit = iunite;
1158 do__fio(&c__1, (char *)&(*num), (ftnlen)sizeof(integer));
1159 do__fio(&c__1, crout, crout_len);
1161 AdvApp2Var_SysBase::e__wsfe();
1166 //=======================================================================
1167 //function : macrstw_
1169 //=======================================================================
1170 int macrstw_(intptr_t *,//iadfld,
1171 intptr_t *,//iadflf,
1178 //=======================================================================
1179 //function : madbtbk_
1181 //=======================================================================
1182 int madbtbk_(integer *indice)
1188 //=======================================================================
1189 //function : AdvApp2Var_SysBase::maermsg_
1191 //=======================================================================
1192 int AdvApp2Var_SysBase::maermsg_(const char *,//cnompg,
1194 ftnlen )//cnompg_len)
1200 //=======================================================================
1201 //function : magtlog_
1203 //=======================================================================
1204 int magtlog_(const char *cnmlog,
1205 const char *,//chaine,
1209 ftnlen )//chaine_len)
1213 /* Local variables */
1214 static char cbid[255];
1215 static integer ibid, ier;
1218 /* **********************************************************************
1223 /* RETURN TRANSLATION OF "NAME LOGIC STRIM" IN */
1224 /* "INTERNAL SYNTAX" CORRESPONDING TO "PLACE OF RANKING" */
1228 /* NOM LOGIQUE STRIM , TRADUCTION */
1230 /* INPUT ARGUMENTS : */
1231 /* ------------------ */
1232 /* CNMLOG : NAME OF "NAME LOGIC STRIM" TO TRANSLATE */
1234 /* OUTPUT ARGUMENTS : */
1235 /* ------------------- */
1236 /* CHAINE : ADDRESS OF "PLACE OF RANKING" */
1237 /* LONG : USEFUL LENGTH OF "PLACE OF RANKING" */
1238 /* IERCOD : ERROR CODE */
1239 /* IERCOD = 0 : OK */
1240 /* IERCOD = 5 : PLACE OF RANKING CORRESPONDING TO INEXISTING LOGIC NAME */
1242 /* IERCOD = 6 : TRANSLATION TOO LONG FOR THE 'CHAIN' VARIABLE */
1243 /* IERCOD = 7 : CRITICAL ERROR */
1245 /* COMMONS USED : */
1246 /* ---------------- */
1249 /* REFERENCES CALLED : */
1250 /* --------------------- */
1251 /* GNMLOG, MACHDIM */
1253 /* DESCRIPTION/NOTES/LIMITATIONS : */
1254 /* ------------------------------- */
1256 /* SPECIFIC SGI ROUTINE */
1258 /* IN ALL CASES WHEN IERCOD IS >0, NO RESULT IS RETURNED*/
1259 /* NOTION OF "USER SYNTAX' AND "INTERNAL SYNTAX" */
1260 /* --------------------------------------------------- */
1262 /* THE "USER SYNTAX" IS THE SYNTAX WHERE THE USER*/
1263 /* VISUALIZES OR INDICATES THE FILE OR DIRECTORY NAME */
1264 /* DURING A SESSION OF STRIM100 */
1266 /* "INTERNAL SYNTAX" IS SYNTAX USED TO CARRY OUT */
1267 /* OPERATIONS OF FILE PROCESSING INSIDE THE CODE */
1268 /* (OPEN,INQUIRE,...ETC) */
1271 /* ***********************************************************************
1274 /* ***********************************************************************
1278 /* ***********************************************************************
1281 /* ***********************************************************************
1287 /* CONTROL OF EXISTENCE OF THE LOGIC NAME */
1289 matrlog_(cnmlog, cbid, &ibid, &ier, cnmlog_len, 255L);
1297 /* CONTROL OF THE LENGTH OF CHAIN */
1299 if (ibid > __i__len()/*chaine, chaine_len)*/) {
1303 //__s__copy(chaine, cbid, chaine_len, ibid);
1308 /* ***********************************************************************
1310 /* ERROR PROCESSING */
1311 /* ***********************************************************************
1316 //__s__copy(chaine, " ", chaine_len, 1L);
1321 //__s__copy(chaine, " ", chaine_len, 1L);
1326 //__s__copy(chaine, " ", chaine_len, 1L);
1328 /* ***********************************************************************
1330 /* RETURN TO THE CALLING PROGRAM */
1331 /* ***********************************************************************
1338 //=======================================================================
1339 //function : mainial_
1341 //=======================================================================
1342 int AdvApp2Var_SysBase::mainial_()
1348 //=======================================================================
1349 //function : AdvApp2Var_SysBase::maitbr8_
1351 //=======================================================================
1352 int AdvApp2Var_SysBase::maitbr8_(integer *itaill,
1357 static integer c__504 = 504;
1359 /* Initialized data */
1361 static doublereal buff0[63] = {
1362 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
1363 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
1364 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,
1368 /* System generated locals */
1371 /* Local variables */
1373 static doublereal buffx[63];
1374 static integer nbfois, noffst, nreste, nufois;
1376 /* ***********************************************************************
1381 /* INITIALIZATION TO A GIVEN VALUE OF A TABLE OF REAL *8 */
1385 /* MANIPULATIONS, MEMORY, INITIALIZATION, DOUBLE-PRECISION */
1387 /* INPUT ARGUMENTS : */
1388 /* ----------------- */
1389 /* ITAILL : SIZE OF THE TABLE */
1390 /* XTAB : TABLE TO INITIALIZE WITH XVAL */
1391 /* XVAL : VALUE TO SET IN XTAB(FROM 1 TO ITAILL) */
1393 /* OUTPUT ARGUMENTS : */
1394 /* ------------------ */
1395 /* XTAB : INITIALIZED TABLE */
1397 /* COMMONS USED : */
1398 /* -------------- */
1400 /* REFERENCES CALLED : */
1401 /* ------------------- */
1403 /* DESCRIPTION/NOTES/LIMITATIONS : */
1404 /* ----------------------------------- */
1406 /* ONE CALLS MCRFILL WHICH MOVES BY PACKS OF 63 REALS */
1408 /* THE INITIAL PACK IS BUFF0 INITIATED BY DATA IF THE VALUE IS 0 */
1409 /* OR OTHERWISE BUFFX INITIATED BY XVAL (LOOP). */
1412 /* PORTABILITY : YES */
1417 /* ***********************************************************************
1421 /* Parameter adjustments */
1426 /* ----------------------------------------------------------------------*
1429 nbfois = *itaill / 63;
1430 noffst = nbfois * 63;
1431 nreste = *itaill - noffst;
1436 for (nufois = 1; nufois <= i__1; ++nufois) {
1437 AdvApp2Var_SysBase::mcrfill_(&c__504, buff0, &xtab[(nufois - 1) * 63 + 1]);
1444 AdvApp2Var_SysBase::mcrfill_(&i__1, buff0, &xtab[noffst + 1]);
1447 for (i__ = 1; i__ <= 63; ++i__) {
1448 buffx[i__ - 1] = *xval;
1453 for (nufois = 1; nufois <= i__1; ++nufois) {
1454 AdvApp2Var_SysBase::mcrfill_(&c__504, buffx, &xtab[(nufois - 1) * 63 + 1]);
1461 AdvApp2Var_SysBase::mcrfill_(&i__1, buffx, &xtab[noffst + 1]);
1465 /* ----------------------------------------------------------------------*
1471 //=======================================================================
1472 //function : mamdlng_
1474 //=======================================================================
1475 int mamdlng_(char *,//cmdlng,
1476 ftnlen )//cmdlng_len)
1481 /* ***********************************************************************
1486 /* RETURN THE CURRENT LANGUAGE */
1490 /* MANAGEMENT, CONFIGURATION, LANGUAGE, READING */
1492 /* INPUT ARGUMENTS : */
1493 /* -------------------- */
1494 /* CMDLNG : LANGUAGE */
1496 /* OUTPUT ARGUMENTS : */
1497 /* ------------------- */
1500 /* COMMONS USED : */
1501 /* ------------------ */
1504 /* REFERENCES CALLED : */
1505 /* --------------------- */
1508 /* DESCRIPTION/NOTES/LIMITATIONS : */
1509 /* ----------------------------------- */
1510 /* RIGHT OF USAGE : ANY APPLICATION */
1512 /* ATTENTION : THIS ROUTINE DEPENDS ON PRELIMINARY INITIALISATION */
1513 /* ---------- WITH AMDGEN. */
1514 /* SO IT IS ENOUGH TO PROVIDE THAT THIS INIT IS */
1515 /* CORRECTLY IMPLEMENTED IN THE RESPECTIVE PROGRAMS */
1517 /* ***********************************************************************
1521 /* INCLUDE MACETAT */
1524 /* ***********************************************************************
1529 /* CONTAINS INFORMATIONS ABOUT THE COMPOSITION OF */
1530 /* THE EXECUTABLE AND ITS ENVIRONMENT : */
1532 /* - PRESENT APPLICATIONS */
1533 /* - AUTHORIZED TYPES OF ENTITIES (NON USED) */
1534 /* AND INFORMATION DESCRIBING THE CURRENT STATE : */
1535 /* - CURRENT APPLICATION */
1536 /* - MODE OF USAGE (NOT USED) */
1540 /* APPLICATION, LANGUAGE */
1542 /* DEMSCRIPTION/NOTES/LIMITATIONS : */
1543 /* ----------------------------------- */
1545 /* A) CHLANG*4 : LIST OF POSSIBLE VALUES OF THE LANGUAGE : */
1546 /* 'FRA ','DEU ','ENG ' */
1548 /* CHL10N*4 : LIST OF POSSIBLE VALUES OF THE LOCALIZATION : */
1549 /* 'FRA ','DEU ','ENG ', 'JIS ' */
1551 /* B) CHCOUR*4, CHPREC*4, CHSUIV*4 : CURRENT, PREVIOUS AND NEXT APPLICATION
1553 /* C) CHMODE*4 : CURRENT MODE (NOT USED) */
1555 /* D) CHPRES*2 (1:NBRMOD) : LIST OF APPLICATIONS TAKEN INTO ACCOUNT */
1557 /* Rang ! Code interne ! Application */
1558 /* ---------------------------------------------------------- */
1559 /* 1 ! CD ! Modeling 2D */
1560 /* 2 ! CA ! Modeling 2D by learning */
1561 /* 3 ! CP ! Parameterized 2D modelization */
1562 /* 4 ! PC ! Rheological 2D modelization */
1563 /* 5 ! CU ! Milling 2 Axes 1/2 */
1564 /* 6 ! CT ! Turning */
1565 /* 7 ! TS ! 3D surface modeling */
1566 /* 8 ! TV ! 3D volume modeling */
1567 /* 9 ! MC ! Surface Meshing */
1568 /* 10 ! MV ! Volume Meshing */
1569 /* 11 ! TU ! Machining by 3 axes */
1570 /* 12 ! T5 ! Machining by 3-5 axes */
1571 /* 13 ! TR ! Machinning by 5 axes of regular surfaces */
1572 /* 14 ! IG ! Interface IGES */
1573 /* 15 ! ST ! Interface SET */
1574 /* 16 ! VD ! Interface VDA */
1575 /* 17 ! IM ! Interface of modeling */
1576 /* 18 ! GA ! Generator APT/IFAPT */
1577 /* 19 ! GC ! Generator COMPACT II */
1578 /* 20 ! GP ! Generator PROMO */
1579 /* 21 ! TN ! Machining by numerical copying */
1580 /* 22 ! GM ! Management of models */
1581 /* 23 ! GT ! Management of trace */
1582 /* ---------------------------------------------------------- */
1587 /* ***********************************************************************
1590 /* NUMBER OF APPLICATIONS TAKEN INTO ACCOUNT */
1593 /* NUMBER OF ENTITY TYPES MANAGED BY STRIM 100 */
1594 //__s__copy(cmdlng, macetat_.chlang, cmdlng_len, 4L);
1599 //=======================================================================
1600 //function : maostrb_
1602 //=======================================================================
1608 //=======================================================================
1609 //function : maostrd_
1611 //=======================================================================
1614 static integer imod;
1616 /* ***********************************************************************
1621 /* REFINE TRACE-BACK IN PRODUCTION PHASE */
1625 /* FUNCTION, SYSTEM, TRACE-BACK, REFINING, DEBUG */
1627 /* INPUT ARGUMENTS : */
1628 /* ----------------- */
1631 /* OUTPUT ARGUMENTS E : */
1632 /* -------------------- */
1635 /* COMMONS USED : */
1636 /* -------------- */
1639 /* REFERENCES CALLED : */
1640 /* ------------------- */
1643 /* DESCRIPTION/NOTES/LIMITATIONS : */
1644 /* ----------------------------------- */
1645 /* THIS ROUTINE SHOULD BE CALLED TO REFINE */
1646 /* TRACE-BACK IN PRODUCTION PHASE AND LEAVE TO TESTERS THE */
1647 /* POSSIBILITY TO GET TRACE-BACK IN */
1648 /* CLIENT VERSIONS IF ONE OF THE FOLLOWING CONDITIONS IS */
1650 /* - EXISTENCE OF SYMBOL 'STRMTRBK' */
1651 /* - EXISTENCE OF FILE 'STRMINIT:STRMTRBK.DAT' */
1655 /* ***********************************************************************
1664 //=======================================================================
1665 //function : maoverf_
1667 //=======================================================================
1668 int maoverf_(integer *nbentr,
1672 /* Initialized data */
1674 static integer ifois = 0;
1676 /* System generated locals */
1679 /* Local variables */
1680 static integer ibid;
1681 static doublereal buff[63];
1682 static integer ioct, indic, nrest, icompt;
1684 /* ***********************************************************************
1689 /* Initialisation in overflow of a tableau with DOUBLE PRECISION */
1693 /* MANIPULATION, MEMORY, INITIALISATION, OVERFLOW */
1695 /* INPUT ARGUMENTS : */
1696 /* ----------------- */
1697 /* NBENTR : Number of entries in the table */
1699 /* OUTPUT ARGUMENTS : */
1700 /* ------------------ */
1701 /* DATBLE : Table double precision initialized in overflow */
1703 /* COMMONS USED : */
1704 /* ------------------ */
1705 /* R8OVR contained in the include MAOVPAR.INC */
1707 /* REFERENCES CALLED : */
1708 /* --------------------- */
1711 /* DESCRIPTION/NOTES/LIMITATIONS : */
1712 /* ----------------------------------- */
1713 /* 1) Doc. programmer : */
1715 /* This routine initialized to positive overflow a table with */
1716 /* DOUBLE PRECISION. */
1718 /* Other types of tables (INTEGER*2, INTEGER, REAL, ...) */
1719 /* are not managed by the routine. */
1721 /* It is usable in phase of developpement to detect the */
1722 /* errors of initialization. */
1724 /* In official version, these calls will be inactive. */
1726 /* ACCESs : Agreed with AC. */
1728 /* The routine does not return error code. */
1730 /* Argument NBELEM should be positive. */
1731 /* If it is negative or null, display message "MAOVERF : NBELEM = */
1732 /* valeur_de_NBELEM" and a Trace Back by the call of routine MAOSTRB. */
1735 /* 2) Doc. designer : */
1737 /* The idea is to minimize the number of calls */
1738 /* to the routine of transfer of numeric zones, */
1739 /* ---------- for the reason of performance. */
1740 /* ! buffer ! For this a table of NLONGR
1741 /* !__________! DOUBLE PRECISIONs is reserved. This buffer is initialized by */
1742 /* <----------> the instruction DATA. The overflow is accessed in a */
1743 /* NLONGR*8 specific COMMON not by a routine as */
1744 /* the initialisation is done by DATA. */
1746 /* * If NBENTR<NLONGR, a part of the buffer is transfered*/
1747 /* DTABLE in DTABLE. */
1749 /* ! amorce ! * Otherwise, the entire buffer is transfered in DTABLE. */
1750 /* !__________! This initiates it. Then a loop is execute, which at each
1752 /* ! temps 1 ! iteration transfers the part of the already initialized table */
1753 /* !__________! in the one that was not yet initialized. */
1754 /* ! ! The size of the zone transfered by each call to MCRFILL
1756 /* ! temps 2 ! is NLONGR*2**(numero_de_l'iteration). When
1758 /* ! ! the size of the table to be initialized is */
1759 /* !__________! less than the already initialized size, the loop is */
1760 /* ! ! abandoned and thev last transfer is carried out to */
1761 /* ! ! initialize the remaining table, except for the case when the size */
1762 /* ! ! of the table is of type NLONGR*2**K. */
1764 /* ! ! * NLONGR will be equal to 19200. */
1773 /* ***********************************************************************
1776 /* Inclusion of MAOVPAR.INC */
1779 /* INCLUDE MAOVPAR */
1780 /* ***********************************************************************
1785 /* DEFINES SPECIFIC LIMITED VALUES. */
1789 /* SYSTEM, LIMITS, VALUES, SPECIFIC */
1791 /* DEMSCRIPTION/NOTES/LIMITATIONS : */
1792 /* ----------------------------------- */
1793 /* *** THEY CAN'T BE REMOVED DURING EXECUTION. */
1795 /* *** THE VALUES OF UNDERFLOW AND OVERFLOW CAN'T BE */
1796 /* DEFINED IN DECIMAL VALUES (ERROR OF COMPILATION D_FLOAT) */
1797 /* THEY ARE DEFINED AS HEXADECIMAL VALUES */
1801 /* ***********************************************************************
1805 /* DECLARATION OF THE COMMON FOR NUMERIC TYPES */
1808 /* DECLARATION OF THE COMMON FOR CHARACTER TYPES*/
1812 /* LOCAL VARIABLES */
1817 /* Parameter adjustments */
1822 /* vJMB R8OVR IS NOT YET initialized, so impossible to use DATA
1824 /* DATA BUFF / NLONGR * R8OVR / */
1826 /* init of BUFF is done only once */
1829 for (icompt = 1; icompt <= 63; ++icompt) {
1830 buff[icompt - 1] = maovpar_.r8ovr;
1839 nrest = *nbentr << 3;
1840 AdvApp2Var_SysBase::mcrfill_(&nrest, buff, &dtable[1]);
1843 /* Start & initialization */
1845 AdvApp2Var_SysBase::mcrfill_(&ioct, buff, &dtable[1]);
1848 /* Loop. The upper limit is the integer value of the logarithm of base 2
1850 /* of NBENTR/NLONGR. */
1851 i__1 = (integer) (log((real) (*nbentr) / (float)63.) / log((float)2.))
1853 for (ibid = 1; ibid <= i__1; ++ibid) {
1855 AdvApp2Var_SysBase::mcrfill_(&ioct, &dtable[1], &dtable[indic + 1]);
1862 nrest = ( *nbentr - indic ) << 3;
1865 AdvApp2Var_SysBase::mcrfill_(&nrest, &dtable[1], &dtable[indic + 1]);
1872 //=======================================================================
1873 //function : AdvApp2Var_SysBase::maovsr8_
1875 //=======================================================================
1876 int AdvApp2Var_SysBase::maovsr8_(integer *ivalcs)
1878 *ivalcs = maovpar_.r8ncs;
1882 //=======================================================================
1883 //function : matrlog_
1885 //=======================================================================
1886 int matrlog_(const char *,//cnmlog,
1887 const char *,//chaine,
1890 ftnlen ,//cnmlog_len,
1891 ftnlen )//chaine_len)
1900 //=======================================================================
1901 //function : matrsym_
1903 //=======================================================================
1904 int matrsym_(const char *cnmsym,
1905 const char *,//chaine,
1909 ftnlen )//chaine_len)
1912 /* Local variables */
1913 static char chainx[255];
1915 /* ***********************************************************************
1920 /* RETURN THE VALUE OF A SYMBOL DEFINED DURING THE */
1921 /* INITIALISATION OF A USER */
1925 /* TRANSLATION, SYMBOL */
1927 /* INPUT ARGUMENTS : */
1928 /* -------------------- */
1929 /* CNMSYM : NAME OF THE SYMBOL */
1931 /* OUTPUT ARGUMENTS : */
1932 /* ------------------ */
1933 /* CHAINE : TRANSLATION OF THE SYMBOL */
1934 /* LENGTH : USEFUL LENGTH OF THE CHAIN */
1935 /* IERCOD : ERROR CODE */
1937 /* = 1 : INEXISTING SYMBOL */
1938 /* = 2 : OTHER ERROR */
1940 /* COMMONS USED : */
1941 /* ------------------ */
1944 /* REFERENCES CALLED : */
1945 /* --------------------- */
1946 /* LIB$GET_SYMBOL,MACHDIM */
1948 /* DESCRIPTION/NOTES/LIMITATIONS : */
1949 /* ----------------------------------- */
1950 /* - THIS ROUTINE IS VAX SPECIFIC */
1951 /* - IN CASE OF ERROR (IERCOD>0), CHAIN = ' ' AND LENGTH = 0 */
1952 /* - IF THE INPUT VARIABLE CNMSYM IS EMPTY, THE ROUTINE RETURNS IERCOD=1*/
1954 /* ***********************************************************************
1960 /* SGI CALL MAGTLOG (CNMSYM,CHAINE,LENGTH,IERCOD) */
1961 magtlog_(cnmsym, chainx, length, iercod, cnmsym_len, 255L);
1970 //if (__s__cmp(chainx, "NONE", 255L, 4L) == 0) {
1971 if (__s__cmp() == 0) {
1972 //__s__copy(chainx, " ", 255L, 1L);
1975 //__s__copy(chaine, chainx, chaine_len, 255L);
1979 /* ***********************************************************************
1981 /* ERROR PROCESSING */
1982 /* ***********************************************************************
1990 //=======================================================================
1991 //function : mcrcomm_
1993 //=======================================================================
1994 int mcrcomm_(integer *kop,
2000 /* Initialized data */
2002 static integer ntab = 0;
2004 /* System generated locals */
2007 /* Local variables */
2008 static intptr_t ideb;
2009 static doublereal dtab[32000];
2010 static intptr_t itab[160] /* was [4][40] */;
2011 static intptr_t ipre;
2012 static integer i__, j, k;
2015 /************************************************************************
2020 /* DYNAMIC ALLOCATION ON COMMON */
2024 /* . ALLOCDYNAMIQUE, MEMORY, COMMON, ALLOC */
2026 /* INPUT ARGUMENTS : */
2027 /* ------------------ */
2028 /* KOP : (1,2) = (ALLOCATION,DESTRUCTION) */
2029 /* NOCT : NUMBER OF OCTETS */
2031 /* OUTPUT ARGUMENTS : */
2032 /* ------------------- */
2033 /* IADR : ADDRESS IN MEMORY OF THE FIRST OCTET */
2036 /* IERCOD : ERROR CODE */
2038 /* IERCOD = 0 : OK */
2039 /* IERCOD > 0 : CRITICAL ERROR */
2040 /* IERCOD < 0 : WARNING */
2041 /* IERCOD = 1 : ERROR DESCRIPTION */
2042 /* IERCOD = 2 : ERROR DESCRIPTION */
2044 /* COMMONS USED : */
2045 /* ---------------- */
2049 /* REFERENCES CALLED : */
2050 /* ---------------------- */
2055 /* DESCRIPTION/NOTES/LIMITATIONS : */
2056 /* ----------------------------------- */
2058 /* ATTENTION .... ITAB ARE NTAB NOT SAVED BETWEEN 2 CALLS..
2062 /* ***********************************************************************
2065 /* JPF PARAMETER ( MAXNUM = 40 , MAXCOM = 500 * 1024 ) */
2067 /* ITAB : TABLE OF MANAGEMENT OF DTAB, ALLOCATED MEMORY ZONE . */
2068 /* NTAB : NUMBER OF COMPLETED ALLOCATIONS. */
2069 /* FORMAT OF ITAB : NUMBER OF ALLOCATED REAL*8, ADDRESS OF THE 1ST REAL*8
2071 /* , NOCT , VIRTUAL ADDRESS */
2073 /* PP COMMON / CRGEN2 / DTAB */
2076 /* ----------------------------------------------------------------------*
2081 /* ALLOCATION : FIND A HOLE */
2095 for (i__ = 1; i__ <= i__1; ++i__) {
2099 ipre = itab[((i__ - 1) << 2) - 3] + itab[((i__ - 1) << 2) - 4];
2102 ideb = itab[(i__ << 2) - 3];
2106 if ((ideb - ipre) << 3 >= *noct) {
2107 /* A HOLE WAS FOUND */
2109 for (j = ntab; j >= i__2; --j) {
2110 for (k = 1; k <= 4; ++k) {
2111 itab[k + ((j + 1) << 2) - 5] = itab[k + (j << 2) - 5];
2117 itab[(i__ << 2) - 4] = *noct / 8 + 1;
2118 itab[(i__ << 2) - 3] = ipre;
2119 itab[(i__ << 2) - 2] = *noct;
2120 mcrlocv_(&dtab[ipre - 1], iadr);
2121 itab[(i__ << 2) - 1] = *iadr;
2132 /* ----------------------------------- */
2133 /* DESTRUCTION OF THE ALLOCATION NUM : */
2137 for (i__ = 1; i__ <= i__1; ++i__) {
2138 if (*noct != itab[(i__ << 2) - 2]) {
2141 if (*iadr != itab[(i__ << 2) - 1]) {
2144 /* THE ALLOCATION TO BE REMOVED WAS FOUND */
2146 for (j = i__ + 1; j <= i__2; ++j) {
2147 for (k = 1; k <= 4; ++k) {
2148 itab[k + ((j - 1) << 2) - 5] = itab[k + (j << 2) - 5];
2159 /* THE ALLOCATION DOES NOT EXIST */
2169 //=======================================================================
2170 //function : AdvApp2Var_SysBase::mcrdelt_
2172 //=======================================================================
2173 int AdvApp2Var_SysBase::mcrdelt_(integer *iunit,
2180 static integer ibid;
2181 static doublereal xbid;
2182 static integer noct, iver, ksys, i__, n, nrang,
2184 static intptr_t iadfd, iadff, iaddr, loc; /* Les adrresses en long*/
2187 /* ***********************************************************************
2192 /* DESTRUCTION OF A DYNAMIC ALLOCATION */
2196 /* SYSTEM, ALLOCATION, MEMORY, DESTRUCTION */
2198 /* INPUT ARGUMENTS : */
2199 /* ------------------ */
2200 /* IUNIT : NUMBER OF OCTETS OF THE ALLOCATION UNIT */
2201 /* ISIZE : NUMBER OF UNITS REQUIRED */
2202 /* T : REFERENCE ADDRESS */
2203 /* IOFSET : OFFSET */
2205 /* OUTPUT ARGUMENTS : */
2206 /* ------------------- */
2207 /* IERCOD : ERROR CODE */
2209 /* = 1 : PB OF DE-ALLOCATION OF A ZONE ALLOCATED IN COMMON */
2210 /* = 2 : THE SYSTEM REFUSES TO DEMAND DE-ALLOCATION */
2211 /* = 3 : THE ALLOCATION TO BE DESTROYED DOES NOT EXIST. */
2213 /* COMMONS USED : */
2214 /* ---------------- */
2217 /* REFERENCES CALLED : */
2218 /* --------------------- */
2221 /* DESCRIPTION/NOTES/LIMITATIONS : */
2222 /* ----------------------------------- */
2224 /* 1) UTILISATEUR */
2227 /* MCRDELT FREES ALLOCATED MEMORY ZONE */
2228 /* BY ROUTINE MCRRQST (OR CRINCR) */
2230 /* THE MEANING OF ARGUMENTS IS THE SAME AS MCRRQST */
2232 /* *** ATTENTION : */
2234 /* IERCOD=2 : CASE WHEN THE SYSTEM CANNOT FREE THE ALLOCATED MEMORY, */
2235 /* THE FOLLOWING MESSAGE APPEARS SYSTEMATICALLY ON CONSOLE ALPHA : */
2236 /* "THe system refuseS destruction of memory allocation" */
2238 /* IERCOD=3 CORRESPONDS TO THE CASE WHEN THE ARGUMENTS ARE NOT CORRECT */
2239 /* (THEY DO NOT ALLOW TO RECOGNIZE THE ALLOCATION IN THE TABLE)
2242 /* When the allocation is destroyed, the corresponding IOFSET is set to */
2243 /* 2 147 483 647. So, if one gets access to the table via IOFSET, there is */
2244 /* a trap. This allows to check that the freed memory zone is not usede. This verification is */
2245 /* valid only if the same sub-program uses and destroys the allocation. */
2248 /* ***********************************************************************
2251 /* COMMON OF PARAMETERS */
2253 /* COMMON OF STATISTICS */
2254 /* INCLUDE MCRGENE */
2256 /* ***********************************************************************
2261 /* TABLE OF MANAGEMENT OF DYNAMIC ALLOCATIONS IN MEMORY */
2265 /* SYSTEM, MEMORY, ALLOCATION */
2267 /* DEMSCRIPTION/NOTES/LIMITATIONS : */
2268 /* ----------------------------------- */
2272 /* ***********************************************************************
2274 /* ICORE : TABLE OF EXISTING ALLOCATIONS, EACH HAVING : */
2275 /* 1 : LEVEL OF PROTECTION (0=NOT PROTECTED, OTHER=PROTECTED) */
2276 /* (PROTECTED MEANS NOT DESTROYED BY CRRSET .) */
2277 /* 2 : UNIT OF ALLOCATION */
2278 /* 3 : NB OF ALLOCATED UNITS */
2279 /* 4 : REFERENCE ADDRESS OF THE TABLE */
2281 /* 6 : STATIC ALLOCATION NUMBER */
2282 /* 7 : Required allocation size */
2283 /* 8 : address of the beginning of allocation */
2284 /* 9 : Size of the USER ZONE */
2285 /* 10 : ADDRESS of the START FLAG */
2286 /* 11 : ADDRESS of the END FLAG */
2287 /* 12 : Rank of creation of the allocation */
2289 /* NDIMCR : NB OF DATA OF EACH ALLOC IN ICORE */
2290 /* NCORE : NB OF CURRENT ALLOCS */
2291 /* LPROT : COMMUNICATION BETWEEN CRPROT AND MCRRQST, SET TO 0 BY MCRRQST */
2292 /* FLAG : VALUE OF THE FLAG USED FOR EXCESSES */
2296 /* ----------------------------------------------------------------------*
2300 /* 20-10-86 : BF ; INITIAL VERSION */
2303 /* NRQST : NUMBER OF ALLOCATIONS */
2304 /* NDELT : NUMBER OF LIBERATIONS */
2305 /* NBYTE : TOTAL NUMBER OF OCTETS OF ALLOCATIONS */
2306 /* MBYTE : MAX NUMBER OF OCTETS */
2311 /* SEARCH IN MCRGENE */
2316 for (i__ = mcrgene_.ncore; i__ >= 1; --i__) {
2317 if (*iunit == mcrgene_.icore[i__ * 12 - 11] && *isize ==
2318 mcrgene_.icore[i__ * 12 - 10] && loc == mcrgene_.icore[i__ *
2319 12 - 9] && *iofset == mcrgene_.icore[i__ * 12 - 8]) {
2327 /* IF THE ALLOCATION DOES NOT EXIST, LEAVE */
2333 /* ALLOCATION RECOGNIZED : RETURN OTHER INFOS */
2335 ksys = static_cast<integer> (mcrgene_.icore[n * 12 - 7]);
2336 ibyte = static_cast<integer> (mcrgene_.icore[n * 12 - 6]);
2337 iaddr = mcrgene_.icore[n * 12 - 5];
2338 iadfd = mcrgene_.icore[n * 12 - 3];
2339 iadff = mcrgene_.icore[n * 12 - 2];
2340 nrang = static_cast<integer> (mcrgene_.icore[n * 12 - 1]);
2342 /* Control of flags */
2350 /* DE-ALLOCATION ON COMMON */
2352 mcrcomm_(&kop, &ibyte, &iaddr, &ier);
2357 /* DE-ALLOCATION SYSTEM */
2358 mcrfree_(&ibyte, reinterpret_cast<void**> (&iaddr), &ier);
2364 /* CALL ALLOWING TO CANCEL AUTOMATIC WATCH BY THE DEBUGGER */
2366 macrclw_(&iadfd, &iadff, &nrang);
2368 /* UPDATE OF STATISTICS */
2374 ++mcrstac_.ndelt[i__ - 1];
2375 mcrstac_.nbyte[i__ - 1] -= static_cast<integer> (mcrgene_.icore[n * 12 - 11] *
2376 mcrgene_.icore[n * 12 - 10]);
2378 /* REMOVAL OF PARAMETERS IN MCRGENE */
2380 /* noct = (mcrgene_1.ncore - n) * 48; */
2381 noct = (mcrgene_.ncore - n) * 12 * sizeof(mcrgene_.icore[0]);
2382 AdvApp2Var_SysBase::mcrfill_(&noct,
2383 &mcrgene_.icore[(n + 1) * 12 - 12],
2384 &mcrgene_.icore[n * 12 - 12]);
2388 /* *** Set to overflow of IOFSET */
2390 /* nested scope needed to avoid gcc compilation error crossing
2391 initialization with goto*/
2392 /* assign max positive integer to *iofset */
2393 const size_t shift = sizeof (*iofset) * 8 - 1;
2394 *iofset = (uintptr_t(1) << shift) - 1 /*2147483647 for 32bit*/;
2398 /* ----------------------------------------------------------------------*
2400 /* ERROR PROCESSING */
2403 /* REFUSE DE-ALLOCATION BY ROUTINE 'MCRCOMM' (ALLOC DS COMMON) */
2405 AdvApp2Var_SysBase::maermsg_("MCRDELT", iercod, 7L);
2409 /* REFUSE DE-ALLOCATION BY THE SYSTEM */
2412 AdvApp2Var_SysBase::maermsg_("MCRDELT", iercod, 7L);
2413 macrmsg_("MCRDELT", iercod, &ibid, &xbid, " ", 7L, 1L);
2417 /* ALLOCATION DOES NOT EXIST */
2420 AdvApp2Var_SysBase::maermsg_("MCRDELT", iercod, 7L);
2432 C*********************************************************************
2436 C Transfer a memory zone in another by managing intersections
2440 C MANIPULATION, MEMORY, TRANSFER, CHARACTER
2444 C nb_car : integer*4 number of characters to transfer.
2445 C source : source memory zone.
2447 C OUTPUT ARGUMENTS :
2448 C -------------------
2449 C dest : zone memory destination.
2454 C REFERENCES CALLED :
2455 C -------------------
2457 C DEMSCRIPTION/NOTES/LIMITATIONS :
2458 C -----------------------------------
2459 C Routine portable UNIX (SGI, ULTRIX, BULL)
2463 C**********************************************************************
2466 //=======================================================================
2467 //function : AdvApp2Var_SysBase::mcrfill_
2469 //=======================================================================
2470 int AdvApp2Var_SysBase::mcrfill_(integer *size,
2475 register char *jmin=static_cast<char*> (tin);
2476 register char *jmout=static_cast<char*> (tout);
2477 if (mcrfill_ABS(jmout-jmin) >= *size)
2478 memcpy( tout, tin, *size);
2479 else if (tin > tout)
2481 register integer n = *size;
2482 while (n-- > 0) *jmout++ = *jmin++;
2486 register integer n = *size;
2489 while (n-- > 0) *--jmout = *--jmin;
2495 /*........................................................................*/
2499 /* Routines for management of the dynamic memory. */
2501 /* Routine mcrfree */
2502 /* -------------- */
2504 /* Desallocation of a memory zone . */
2506 /* CALL MCRFREE (IBYTE,IADR,IER) */
2508 /* IBYTE INTEGER*4 : Nb of Octets to free */
2510 /* IADR POINTEUR : Start Address */
2512 /* IER INTEGER*4 : Return Code */
2515 /*........................................................................*/
2518 //=======================================================================
2519 //function : mcrfree_
2521 //=======================================================================
2522 int mcrfree_(integer *,//ibyte,
2528 Standard::Free(*iadr);
2529 //Standard::Free always nullifies address, so check becomes incorrect
2530 //if ( !*iadr ) *ier = 1;
2534 /*........................................................................*/
2538 /* Routines for management of the dynamic memory. */
2540 /* Routine mcrgetv */
2541 /* -------------- */
2543 /* Demand of memory allocation. */
2545 /* CALL MCRGETV(IBYTE,IADR,IER) */
2547 /* IBYTE (INTEGER*4) Nb of Bytes of allocation required */
2549 /* IADR (INTEGER*4) : Result. */
2551 /* IER (INTEGER*4) : Error Code : */
2554 /* = 1 ==> Allocation impossible */
2555 /* = -1 ==> Ofset > 2**31 - 1 */
2559 /*........................................................................*/
2561 //=======================================================================
2562 //function : mcrgetv_
2564 //=======================================================================
2565 int mcrgetv_(integer *sz,
2572 *iad = Standard::Allocate(*sz);
2573 if ( !*iad ) *ier = 1;
2578 //=======================================================================
2579 //function : mcrlist_
2581 //=======================================================================
2582 int mcrlist_(integer *ier)
2585 /* System generated locals */
2588 /* Builtin functions */
2590 /* Local variables */
2591 static char cfmt[1];
2592 static doublereal dfmt;
2593 static integer ifmt, i__, nufmt, ntotal;
2594 static char subrou[7];
2597 /************************************************************************
2602 /* PRINT TABLE OF CURRENT DYNAMIC ALLOCATIONS */
2606 /* SYSTEM, ALLOCATION, MEMORY, LIST */
2608 /* INPUT ARGUMENTS : */
2609 /* ------------------ */
2612 /* OUTPUT ARGUMENTS : */
2613 /* ------------------- */
2616 /* IERCOD : ERROR CODE */
2618 /* IERCOD = 0 : OK */
2619 /* IERCOD > 0 : SERIOUS ERROR */
2620 /* IERCOD < 0 : WARNING */
2621 /* IERCOD = 1 : ERROR DESCRIPTION */
2622 /* IERCOD = 2 : ERROR DESCRIPTION */
2624 /* COMMONS USED : */
2625 /* ---------------- */
2627 /* MCRGENE VFORMT */
2629 /* REFERENCES CALLED : */
2630 /* ---------------------- */
2635 /* DESCRIPTION/NOTES/LIMITATIONS : */
2636 /* ----------------------------------- */
2642 /* ***********************************************************************
2645 /* INCLUDE MCRGENE */
2646 /* ***********************************************************************
2651 /* TABLE FOR MANAGEMENT OF DYNAMIC MEMORY ALLOCATIONS */
2655 /* SYSTEM, MEMORY, ALLOCATION */
2657 /* DEMSCRIPTION/NOTES/LIMITATIONS : */
2658 /* ----------------------------------- */
2662 /* ***********************************************************************
2665 /* ICORE : TABLE OF EXISTING ALLOCATIONS, EACH HAVING : */
2666 /* 1 : LEVEL OF PROTECTION (0=NOT PROTECTED, OTHER=PROTECTED) */
2667 /* (PROTECTED MEANS NOT DESTROYED BY CRRSET .) */
2668 /* 2 : UNIT OF ALLOCATION */
2669 /* 3 : NB OF ALLOCATED UNITS */
2670 /* 4 : REFERENCE ADDRESS OF THE TABLE */
2672 /* 6 : STATIC ALLOCATION NUMBER */
2673 /* 7 : Required allocation size */
2674 /* 8 : address of the beginning of allocation */
2675 /* 9 : Size of the USER ZONE */
2676 /* 10 : ADDRESS of the START FLAG */
2677 /* 11 : ADDRESS of the END FLAG */
2678 /* 12 : Rank of creation of the allocation */
2680 /* NDIMCR : NB OF DATA OF EACH ALLOC IN ICORE */
2681 /* NCORE : NB OF CURRENT ALLOCS */
2682 /* LPROT : COMMUNICATION BETWEEN CRPROT AND MCRRQST, SET TO 0 BY MCRRQST */
2683 /* FLAG : VALUE OF THE FLAG USED FOR EXCESSES */
2687 /* ----------------------------------------------------------------------*
2691 /* ----------------------------------------------------------------------*
2695 //__s__copy(subrou, "MCRLIST", 7L, 7L);
2700 ifmt = mcrgene_.ncore;
2701 macrmsg_(subrou, &nufmt, &ifmt, &dfmt, cfmt, 7L, 1L);
2705 i__1 = mcrgene_.ncore;
2706 for (i__ = 1; i__ <= i__1; ++i__) {
2708 ifmt = static_cast<integer> (mcrgene_.icore[i__ * 12 - 11] * mcrgene_.icore[i__ * 12 - 10])
2710 macrmsg_(subrou, &nufmt, &ifmt, &dfmt, cfmt, 7L, 1L);
2717 macrmsg_(subrou, &nufmt, &ifmt, &dfmt, cfmt, 7L, 1L);
2723 //=======================================================================
2724 //function : mcrlocv_
2726 //=======================================================================
2727 int mcrlocv_(void* t,
2731 *l = reinterpret_cast<intptr_t> (t);
2735 //=======================================================================
2736 //function : AdvApp2Var_SysBase::mcrrqst_
2738 //=======================================================================
2739 int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
2749 /* Local variables */
2750 static doublereal dfmt;
2751 static integer ifmt, iver;
2752 static char subr[7];
2753 static integer ksys , ibyte, irest, isyst, ier;
2754 static intptr_t iadfd, iadff, iaddr,lofset, loc;
2758 /* **********************************************************************
2763 /* IMPLEMENTATION OF DYNAMIC MEMORY ALLOCATION */
2767 /* SYSTEM, ALLOCATION, MEMORY, REALISATION */
2769 /* INPUT ARGUMENTS : */
2770 /* ------------------ */
2771 /* IUNIT : NUMBER OF OCTET OF THE UNIT OF ALLOCATION */
2772 /* ISIZE : NUMBER OF UNITS REQUIRED */
2773 /* T : REFERENCE ADDRESS */
2775 /* OUTPUT ARGUMENTS : */
2776 /* ------------------- */
2777 /* IOFSET : OFFSET */
2778 /* IERCOD : ERROR CODE, */
2780 /* = 1 : MAX NB OF ALLOCS REACHED */
2781 /* = 2 : ARGUMENTS INCORRECT */
2782 /* = 3 : REFUSED DYNAMIC ALLOCATION */
2784 /* COMMONS USED : */
2785 /* ---------------- */
2786 /* MCRGENE, MCRSTAC */
2788 /* REFERENCES CALLED : */
2789 /* ----------------------- */
2790 /* MACRCHK, MACRGFL, MACRMSG, MCRLOCV,MCRCOMM, MCRGETV */
2792 /* DESCRIPTION/NOTES/LIMITATIONS : */
2793 /* ----------------------------------- */
2796 /* -------------- */
2798 /* T IS THE ADDRESS OF A TABLE, IOFSET REPRESENTS THE DEPLACEMENT IN */
2799 /* UNITS OF IUNIT OCTETS BETWEEN THE ALLOCATED ZONE AND TABLE T */
2800 /* IERCOD=0 SIGNALS THAT THE ALLOCATION WORKS WELL, ANY OTHER */
2801 /* VALUE INDICATES A BUG. */
2804 /* LET THE DECLARATION REAL*4 T(1), SO IUNIT=4 . */
2805 /* CALL TO MCRRQST PORODUCES DYNAMIC ALLOCATION */
2806 /* AND GIVES VALUE TO VARIABLE IOFSET, */
2807 /* IF IT IS REQUIRED TO WRITE 1. IN THE 5TH ZONE REAL*4 */
2808 /* ALLOCATED IN THIS WAY, MAKE: */
2809 /* T(5+IOFSET)=1. */
2811 /* CASE OF ERRORS : */
2812 /* --------------- */
2814 /* IERCOD=1 : MAX NB OF ALLOCATION REACHED (ACTUALLY 200) */
2815 /* AND THE FOLLOWING MESSAGE APPEARS IN THE CONSOLE ALPHA : */
2816 /* "The max number of memory allocation is reached : ,N" */
2818 /* IERCOD=2 : ARGUMENT IUNIT INCORRECT AS IT IS DIFFERENT FROM 1,2,4 OR 8 */
2819 /* AND THE FOLLOWING MESSAGE APPEARS IN THE CONSOLE ALPHA : */
2820 /* "Unit OF allocation invalid : ,IUNIT" */
2822 /* IERCOD=3 : REFUSED DYNAMIC ALLOCATION (MORE PLACE IN MEMORY) */
2823 /* AND THE FOLLOWING MESSAGE APPEARS IN THE CONSOLE ALPHA : */
2824 /* "The system refuses dynamic allocation of memory of N octets"
2826 /* with completev display of all allocations carried out till now */
2830 /* -------------- */
2832 /* MCRRQST MAKES DYNAMIC ALLOCATION OF VIRTUAL MEMORY ON THE BASE */
2833 /* OF ENTITIES OF 8 OCTETS (QUADWORDS), WHILE THE ALLOCATION IS REQUIRED BY */
2834 /* UNITS OF IUNIT OCTETS (1,2,4,8). */
2836 /* THE REQUIRED QUANTITY IS IUNIT*ISIZE OCTETS, THIS VALUE IS ROUNDED */
2837 /* SO THAT THE ALLOCATION WAS AN INTEGER NUMBER OF QUADWORDS. */
2842 /* ***********************************************************************
2845 /* COMMON OF PARAMETRES */
2846 /* COMMON OF INFORMATION ON STATISTICS */
2847 /* INCLUDE MCRGENE */
2849 /* ***********************************************************************
2853 /* TABLE FOR MANAGEMENT OF DYNAMIC MEMORY ALLOCATIONS */
2857 /* SYSTEM, MEMORY, ALLOCATION */
2859 /* DEMSCRIPTION/NOTES/LIMITATIONS : */
2860 /* ----------------------------------- */
2864 /* ***********************************************************************
2867 /* ICORE : TABLE OF EXISTING ALLOCATIONS, EACH HAVING : */
2868 /* 1 : LEVEL OF PROTECTION (0=NOT PROTECTED, OTHER=PROTECTED) */
2869 /* (PROTECTED MEANS NOT DESTROYED BY CRRSET .) */
2870 /* 2 : UNIT OF ALLOCATION */
2871 /* 3 : NB OF ALLOCATED UNITS */
2872 /* 4 : REFERENCE ADDRESS OF THE TABLE */
2874 /* 6 : STATIC ALLOCATION NUMBER */
2875 /* 7 : Required allocation size */
2876 /* 8 : address of the beginning of allocation */
2877 /* 9 : Size of the USER ZONE */
2878 /* 10 : ADDRESS of the START FLAG */
2879 /* 11 : ADDRESS of the END FLAG */
2880 /* 12 : Rank of creation of the allocation */
2882 /* NDIMCR : NB OF DATA OF EACH ALLOC IN ICORE */
2883 /* NCORE : NB OF CURRENT ALLOCS */
2884 /* LPROT : COMMUNICATION BETWEEN CRPROT AND MCRRQST, SET TO 0 BY MCRRQST */
2885 /* FLAG : VALUE OF THE FLAG USED FOR EXCESSES */
2890 /* ----------------------------------------------------------------------*
2892 /* 20-10-86 : BF ; INITIAL VERSION */
2895 /* NRQST : NUMBER OF ALLOCATIONS */
2896 /* NDELT : NUMBER OF LIBERATIONS */
2897 /* NBYTE : TOTAL NUMBER OF OCTETS OF ALLOCATIONS */
2898 /* MBYTE : MAX NUMBER OF OCTETS */
2901 /* ----------------------------------------------------------------------*
2907 if (mcrgene_.ncore >= 1000) {
2910 if (*iunit != 1 && *iunit != 2 && *iunit != 4 && *iunit != 8) {
2914 /* Calculate the size required by the user */
2915 ibyte = *iunit * *isize;
2917 /* Find the type of version (Phase of Production or Version Client) */
2920 /* Control allocated size in Production phase */
2926 //do__lio(&c__9, &c__1, "Require zero allocation", 26L);
2927 AdvApp2Var_SysBase::e__wsle();
2929 } else if (ibyte >= 4096000) {
2931 //do__lio(&c__9, &c__1, "Require allocation above 4 Mega-Octets : ", 50L);
2932 //do__lio(&c__3, &c__1, (char *)&ibyte, (ftnlen)sizeof(integer));
2933 AdvApp2Var_SysBase::e__wsle();
2939 /* CALCULATE THE SIZE OF THE USER ZONE (IZU) */
2940 /* . add size required by the user (IBYTE) */
2941 /* . add delta for alinement with the base */
2942 /* . round to multiple of 8 above */
2945 izu = ibyte + loc % *iunit;
2948 izu = izu + 8 - irest;
2951 /* CALCULATE THE SIZE REQUIRED FROM THE PRIMITIVE OF ALLOC */
2952 /* . add size of the user zone */
2953 /* . add 8 for alinement of start address of */
2954 /* allocation on multiple of 8 so that to be able to */
2955 /* set flags with Double Precision without other pb than alignement */
2956 /* . add 16 octets for two flags */
2960 /* DEMAND OF ALLOCATION */
2964 /* IF ( ISYST.EQ.0.AND.IBYTE .LE. 100 * 1024 ) THEN */
2965 /* ALLOCATION SUR TABLE */
2968 /* CALL MCRCOMM ( KOP , IBYTE , IADDR , IER ) */
2969 /* IF ( IER .NE. 0 ) THEN */
2974 /* ALLOCATION SYSTEME */
2976 mcrgetv_(&ibyte, reinterpret_cast<void**> (&iaddr), &ier);
2982 /* CALCULATE THE ADDRESSES OF FLAGS */
2984 iadfd = iaddr + 8 - iaddr % 8;
2985 iadff = iadfd + 8 + izu;
2987 /* CALCULATE USER OFFSET : */
2988 /* . difference between the user start address and the */
2990 /* . converts this difference in the user unit */
2992 lofset = iadfd + 8 + loc % *iunit - loc;
2993 *iofset = lofset / *iunit;
2995 /* If phase of production control flags */
3001 /* . the first flag is set by IADFD and the second by IADFF */
3002 /* . if phase of production, set to overflow the ZU */
3003 macrgfl_(&iadfd, &iadff, &iver, &izu);
3005 /* RANGING OF PARAMETERS IN MCRGENE */
3008 mcrgene_.icore[mcrgene_.ncore * 12 - 12] = mcrgene_.lprot;
3009 mcrgene_.icore[mcrgene_.ncore * 12 - 11] = *iunit;
3010 mcrgene_.icore[mcrgene_.ncore * 12 - 10] = *isize;
3011 mcrgene_.icore[mcrgene_.ncore * 12 - 9] = loc;
3012 mcrgene_.icore[mcrgene_.ncore * 12 - 8] = *iofset;
3013 mcrgene_.icore[mcrgene_.ncore * 12 - 7] = ksys;
3014 mcrgene_.icore[mcrgene_.ncore * 12 - 6] = ibyte;
3015 mcrgene_.icore[mcrgene_.ncore * 12 - 5] = iaddr;
3016 mcrgene_.icore[mcrgene_.ncore * 12 - 4] = mcrgene_.ncore;
3017 mcrgene_.icore[mcrgene_.ncore * 12 - 3] = iadfd;
3018 mcrgene_.icore[mcrgene_.ncore * 12 - 2] = iadff;
3019 mcrgene_.icore[mcrgene_.ncore * 12 - 1] = mcrgene_.ncore;
3023 /* CALL ALLOWING AUTOIMPLEMENTATION OF THE SET WATCH BY THE DEBUGGER */
3025 macrstw_(&iadfd, &iadff, &mcrgene_.ncore);
3029 ++mcrstac_.nrqst[ksys - 1];
3030 mcrstac_.nbyte[ksys - 1] += static_cast<integer> (mcrgene_.icore[mcrgene_.ncore * 12 - 11] *
3031 mcrgene_.icore[mcrgene_.ncore * 12 - 10]);
3033 i__1 = mcrstac_.mbyte[ksys - 1], i__2 = mcrstac_.nbyte[ksys - 1];
3034 mcrstac_.mbyte[ksys - 1] = advapp_max(i__1,i__2);
3038 /* ----------------------------------------------------------------------*
3040 /* ERROR PROCESSING */
3042 /* MAX NB OF ALLOC REACHED : */
3046 //__s__copy(subr, "MCRRQST", 7L, 7L);
3047 macrmsg_(subr, iercod, &ifmt, &dfmt, " ", 7L, 1L);
3051 /* INCORRECT ARGUMENTS */
3055 //__s__copy(subr, "MCRRQST", 7L, 7L);
3056 macrmsg_(subr, iercod, &ifmt, &dfmt, " ", 7L, 1L);
3059 /* SYSTEM REFUSES ALLOCATION */
3063 //__s__copy(subr, "MCRRQST", 7L, 7L);
3064 macrmsg_(subr, iercod, &ifmt, &dfmt, " ", 7L, 1L);
3069 /* ----------------------------------------------------------------------*
3077 //=======================================================================
3078 //function : AdvApp2Var_SysBase::mgenmsg_
3080 //=======================================================================
3081 int AdvApp2Var_SysBase::mgenmsg_(const char *,//nomprg,
3082 ftnlen )//nomprg_len)
3088 //=======================================================================
3089 //function : AdvApp2Var_SysBase::mgsomsg_
3091 //=======================================================================
3092 int AdvApp2Var_SysBase::mgsomsg_(const char *,//nomprg,
3093 ftnlen )//nomprg_len)
3102 C*****************************************************************************
3104 C FUNCTION : CALL MIRAZ(LENGTH,ITAB)
3107 C RESET TO ZERO A TABLE OF LOGIC OR INTEGER.
3114 C ------------------
3115 C LENGTH : NUMBER OF OCTETS TO TRANSFER
3116 C ITAB : NAME OF THE TABLE
3118 C OUTPUT ARGUMENTS :
3119 C -------------------
3120 C ITAB : NAME OF THE TABLE SET TO ZERO
3125 C REFERENCES CALLED :
3126 C ---------------------
3128 C DEMSCRIPTION/NOTES/LIMITATIONS :
3129 C -----------------------------------
3134 C***********************************************************************
3136 //=======================================================================
3137 //function : AdvApp2Var_SysBase::miraz_
3139 //=======================================================================
3140 void AdvApp2Var_SysBase::miraz_(integer *taille,
3146 memset(adt , '\0' , *taille) ;
3148 //=======================================================================
3149 //function : AdvApp2Var_SysBase::mnfndeb_
3151 //=======================================================================
3152 integer AdvApp2Var_SysBase::mnfndeb_()
3159 //=======================================================================
3160 //function : AdvApp2Var_SysBase::mnfnimp_
3162 //=======================================================================
3163 integer AdvApp2Var_SysBase::mnfnimp_()
3170 //=======================================================================
3171 //function : AdvApp2Var_SysBase::msifill_
3173 //=======================================================================
3174 int AdvApp2Var_SysBase::msifill_(integer *nbintg,
3178 static integer nocte;
3180 /* ***********************************************************************
3185 /* transfer Integer from one zone to another */
3189 /* TRANSFER , INTEGER , MEMORY */
3191 /* INPUT ARGUMENTS : */
3192 /* ------------------ */
3193 /* NBINTG : Nb of integers */
3194 /* IVECIN : Input vector */
3196 /* OUTPUT ARGUMENTS : */
3197 /* ------------------- */
3198 /* IVECOU : Output vector */
3200 /* COMMONS USED : */
3201 /* ---------------- */
3203 /* REFERENCES CALLED : */
3204 /* --------------------- */
3206 /* DESCRIPTION/NOTES/LIMITATIONS : */
3207 /* ----------------------------------- */
3210 /* ***********************************************************************
3213 /* ___ NOCTE : Number of octets to transfer */
3215 /* Parameter adjustments */
3220 nocte = *nbintg * sizeof(integer);
3221 AdvApp2Var_SysBase::mcrfill_(&nocte, &ivecin[1], &ivecou[1]);
3225 //=======================================================================
3226 //function : AdvApp2Var_SysBase::msrfill_
3228 //=======================================================================
3229 int AdvApp2Var_SysBase::msrfill_(integer *nbreel,
3231 doublereal * vecsor)
3233 static integer nocte;
3236 /* ***********************************************************************
3241 /* Transfer real from one zone to another */
3245 /* TRANSFER , REAL , MEMORY */
3247 /* INPUT ARGUMENTS : */
3248 /* ----------------- */
3249 /* NBREEL : Number of reals */
3250 /* VECENT : Input vector */
3252 /* OUTPUT ARGUMENTS : */
3253 /* ------------------- */
3254 /* VECSOR : Output vector */
3256 /* COMMONS USED : */
3257 /* ---------------- */
3259 /* REFERENCES CALLED : */
3260 /* ----------------------- */
3262 /* DESCRIPTION/NOTES/LIMITATIONS : */
3263 /* ----------------------------------- */
3266 /* ***********************************************************************
3269 /* ___ NOCTE : Nb of octets to transfer */
3271 /* Parameter adjustments */
3276 nocte = *nbreel * sizeof (doublereal);
3277 AdvApp2Var_SysBase::mcrfill_(&nocte, &vecent[1], &vecsor[1]);
3281 //=======================================================================
3282 //function : AdvApp2Var_SysBase::mswrdbg_
3284 //=======================================================================
3285 int AdvApp2Var_SysBase::mswrdbg_(const char *,//ctexte,
3286 ftnlen )//ctexte_len)
3290 static cilist io___1 = { 0, 0, 0, 0, 0 };
3293 /* ***********************************************************************
3298 /* Write message on console alpha if IBB>0 */
3302 /* MESSAGE, DEBUG */
3304 /* INPUT ARGUMENTS : */
3305 /* ----------------- */
3306 /* CTEXTE : Text to be written */
3308 /* OUTPUT ARGUMENTS : */
3309 /* ------------------- */
3312 /* COMMONS USED : */
3313 /* ---------------- */
3315 /* REFERENCES CALLED : */
3316 /* ----------------------- */
3318 /* DESCRIPTION/NOTES/LIMITATIONS : */
3319 /* ----------------------------------- */
3323 /* ***********************************************************************
3326 /* ***********************************************************************
3330 /* ***********************************************************************
3333 /* ***********************************************************************
3336 if (AdvApp2Var_SysBase::mnfndeb_() >= 1) {
3337 io___1.ciunit = AdvApp2Var_SysBase::mnfnimp_();
3339 //do__lio(&c__9, &c__1, "Dbg ", 4L);
3340 //do__lio(&c__9, &c__1, ctexte, ctexte_len);
3341 AdvApp2Var_SysBase::e__wsle();
3358 //=======================================================================
3359 //function : do__fio
3361 //=======================================================================
3362 int AdvApp2Var_SysBase::do__fio()
3366 //=======================================================================
3367 //function : do__lio
3369 //=======================================================================
3370 int AdvApp2Var_SysBase::do__lio ()
3374 //=======================================================================
3375 //function : e__wsfe
3377 //=======================================================================
3378 int AdvApp2Var_SysBase::e__wsfe ()
3382 //=======================================================================
3383 //function : e__wsle
3385 //=======================================================================
3386 int AdvApp2Var_SysBase::e__wsle ()
3390 //=======================================================================
3391 //function : s__wsfe
3393 //=======================================================================
3394 int AdvApp2Var_SysBase::s__wsfe ()
3398 //=======================================================================
3399 //function : s__wsle
3401 //=======================================================================
3402 int AdvApp2Var_SysBase::s__wsle ()
3409 C*****************************************************************************
3411 C FUNCTION : CALL MVRIRAZ(NBELT,DTAB)
3413 C Reset to zero a table with DOUBLE PRECISION
3420 C ------------------
3421 C NBELT : Number of elements of the table
3422 C DTAB : Table to initializer to zero
3424 C OUTPUT ARGUMENTS :
3425 C --------------------
3426 C DTAB : Table reset to zero
3431 C REFERENCES CALLED :
3432 C -----------------------
3434 C DEMSCRIPTION/NOTES/LIMITATIONS :
3435 C -----------------------------------
3439 C***********************************************************************
3441 //=======================================================================
3442 //function : AdvApp2Var_SysBase::mvriraz_
3444 //=======================================================================
3445 void AdvApp2Var_SysBase::mvriraz_(integer *taille,
3450 offset = *taille * 8 ;
3451 /* printf(" adt %d long %d\n",adt,offset); */
3452 memset(adt , '\0' , offset) ;