// ============================================================== //#+ This module generated by Mumps Compiler @VERSION@ Jan 17 2022 //#+ //#+ Portions of this code are part of the Mumps Compiler //#+ //#+ Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2010, 2017, 2020 by Kevin C. O'Kane //#+ //#+ Kevin C. O'Kane, Ph.D. //#+ Professor Emeritus //#+ Computer Science Department //#+ University of Northern Iowa //#+ Cedar Falls, IA 50614-0507 //#+ kc.okane@gmail.com //#+ http://www.cs.uni.edu/~okane //#+ http://threadsafebooks.com///#+ ----------------------------------- //#+ //#+ Consult individual modules for copyright details //#+ The runtime libraries are covered by the following license: //#+ //#+ This library is free software; you can redistribute it and/or //#+ modify it under the terms of the GNU Lesser General Public //#+ License as published by the Free Software Foundation; either //#+ version 2.1 of the License, or (at your option) any later version. //#+ //#+ This library is distributed in the hope that it will be useful, //#+ but WITHOUT ANY WARRANTY; without even the implied warranty of //#+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //#+ Lesser General Public License for more details. //#+ //#+ You should have received a copy of the GNU Lesser General Public //#+ License along with this library; if not, write to the Free Software //#+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //#+ //#+ This code is unverified - use at your own risk //#+============================================================== #undef _MDH_ #include #include #include #include #include #include #include #include #include #include #include #include #include #define FORPARM STR_MAX /* Size of For loop parameter */ #define CSTR (char *) #define USTR (unsigned char *) #include #include #include #include int (*__label_lookup)(char *); char * (*__text_function)(int); void fcn(MSV *); void zfcn(unsigned char *, unsigned char *, struct MSV *); /* z functions */ char * sym_(int, unsigned char *, unsigned char *, struct MSV *); /* symbol table */ char * makeLock(char *, char *, char *, char, char *); /* global array lock service */ char * cleanLocks(char *); /* global array lock service */ char * releaseLock(char *, char *, char *); /* global array lock service */ char * eraseLocks(char *); /* global array lock service */ void add(const char *a,const char *b,char *c); /* math function */ void sub(const char *a,const char *b,char *c); /* math function */ void mult(const char *a,const char *b,char *c); /* math function */ void divx(const char *a,const char *b,char *c); /* math function */ void divi(const char *a,const char *b,char *c); /* math function */ void _fnumber(unsigned char *,unsigned char *, unsigned char *,unsigned char *, MSV *); /* math function */ int DBSem = 0; /* deadlock prevention */ void SyncClock() { DBSem = 1; } unsigned int set_alarm (unsigned int seconds) { struct itimerval old, xnew; xnew.it_interval.tv_usec = 0; xnew.it_interval.tv_sec = 0 ; // interval between alarms xnew.it_value.tv_usec = 0; xnew.it_value.tv_sec = (long int) 0; if (setitimer (ITIMER_REAL, &xnew, &old) < 0) return 0; else return old.it_value.tv_sec; } #include /* Global array definitions */ /* Interface to Mglobal(): */ /* g = command */ /* key = key sought or stored */ /* bd = value returned or stored */ /* svPtr = address of state vector */ #ifndef SUB #include /* System support functions */ #include /* Many common global variables */ #endif // !/usr/bin/mumps // Jan 9, 2021 #include "gtk1.h" /*=================================================================================*/ // zmain /*=================================================================================*/ int main(int argc, char *argv[]) { //#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //#+ Intermediate temporary variables used during execution of string expressions //#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ char *_ftmp = new char[STR_MAX]; /* intermediate temp */ /*** Temporary variables */ jmp_buf for0J; jmp_buf Efor0J; int tpx0; unsigned char *tmp0 = new unsigned char[STR_MAX]; unsigned char *tmp1 = new unsigned char[STR_MAX]; unsigned char *tmp2 = new unsigned char[STR_MAX]; unsigned char *tmp3 = new unsigned char[STR_MAX]; unsigned char *tmp4 = new unsigned char[STR_MAX]; unsigned char *_dummy = new unsigned char[STR_MAX]; /* temporary variable */ unsigned char *atmp =new unsigned char[STR_MAX]; /* temporary variable */ unsigned char *xgtmp = new unsigned char [STR_MAX]; /* temporary variable */ unsigned char *gtmpL = new unsigned char[STR_MAX]; /* temporary variable */ unsigned char *tmp = new unsigned char[STR_MAX]; /* temporary variable */ unsigned char *gtmp = new unsigned char [2*STR_MAX]; /* temporary variable */ int _label_lookup(char *); /* resolution of labels */ char * _text_function(int); static unsigned char _ReturnVal[STR_MAX]; /* function returns */ int _ArgCount=0; /* Nbr of args to extrinsic */ long _i,_jj,_j,_k,_new; int _SymPush=0,f=0; int g=0; jmp_buf _doStack[128]; /* return stack mechanism */ short _doStackN[128]={0}; /* return stack mechanism */ static int _doStx=0; /* return stack mechanism */ char _Refs[10][32]; int _Refsx=0; if (svPtr == NULL) svPtr = AllocSV(); _SymPush=0; // zap pushed tables svPtr->in_file[5]=stdin; /* console default */ svPtr->out_file[5]=stdout; /* console default */ strcpy(svPtr->UDAT,"data.dat"); strcpy(svPtr->UKEY,"key.dat"); if ( 0) { // no alarm if slice is zero signal(SIGALRM, SyncClock); set_alarm(1); } __label_lookup=_label_lookup; __text_function=_text_function; $SymPut("%",argv[0]); if (argc>0) { for (int i=0; iLineNumber=11; // do ^gtk4.h /*=================================================================================*/ _ArgCount=0; //section D1000 svPtr->Rargsx=0; { _ArgCount=0; _jj=Interpret("x \"do ^gtk4.h\"",svPtr); svPtr->ERROR=_jj; if (!svPtr->NOERR && _jj<0) ErrorMessage("Indirection error",svPtr->LineNumber); } /*=================================================================================*/ svPtr->LineNumber=13; // do ^BuildMeshTree.mps /*=================================================================================*/ _ArgCount=0; //section D1000 svPtr->Rargsx=0; { _ArgCount=0; _jj=Interpret("x \"do ^BuildMeshTree.mps\"",svPtr); svPtr->ERROR=_jj; if (!svPtr->NOERR && _jj<0) ErrorMessage("Indirection error",svPtr->LineNumber); } /*=================================================================================*/ svPtr->LineNumber=15; // set x="This is a test message"_$c(10)_"If it had been an actual message, it" /*=================================================================================*/ _j=0; strmove((unsigned char *) tmp1,(unsigned char *) "10"); _i=atol((char *) tmp1); if (_i>0) tmp2[_j++]=_i; tmp2[_j]=0; if (strlen((const char *) "This is a test message")+strlen((const char *) tmp2)+1>STR_MAX) ErrorMessage("String too long",svPtr->LineNumber); strmove((unsigned char *) tmp3,(unsigned char *) "This is a test message"); strcat((char *) tmp3,(char *) tmp2); if (strlen((const char *) tmp3)+strlen((const char *) "If it had been an actual message, it")+1>STR_MAX) ErrorMessage("String too long",svPtr->LineNumber); strmove((unsigned char *) tmp4,(unsigned char *) tmp3); strcat((char *) tmp4,(char *) "If it had been an actual message, it"); sym_(0,(unsigned char *)"x",(unsigned char *)tmp4,svPtr); // Store result /*=================================================================================*/ svPtr->LineNumber=16; // set x=x_"would have said something important" /*=================================================================================*/ if (sym_(SYMGET,(unsigned char *) "x",(unsigned char *) tmp1,svPtr)==NULL) VariableNotFound1(svPtr->LineNumber,(unsigned char *) "x"); if (strlen((const char *) tmp1)+strlen((const char *) "would have said something important")+1>STR_MAX) ErrorMessage("String too long",svPtr->LineNumber); strmove((unsigned char *) tmp2,(unsigned char *) tmp1); strcat((char *) tmp2,(char *) "would have said something important"); sym_(0,(unsigned char *)"x",(unsigned char *)tmp2,svPtr); // Store result /*=================================================================================*/ svPtr->LineNumber=17; // set %=$z~gtk~text~buffer~set~text(textbuffer1,x) /*=================================================================================*/ strmove((unsigned char *) >mp[1],(unsigned char *) ""); strcat((char *) >mp[1],"$z~gtk~text~buffer~set~text\xce"); if (sym_(SYMGET,(unsigned char *) "textbuffer1",(unsigned char *) tmp1,svPtr)==NULL) VariableNotFound1(svPtr->LineNumber,(unsigned char *) "textbuffer1"); strcat((char *) >mp[1],(char *) tmp1); strcat((char *) >mp[1],"\xd0"); if (sym_(SYMGET,(unsigned char *) "x",(unsigned char *) tmp2,svPtr)==NULL) VariableNotFound1(svPtr->LineNumber,(unsigned char *) "x"); strcat((char *) >mp[1],(char *) tmp2); strcat((char *) >mp[1],"\xcf"); zfcn(gtmp,tmp3,svPtr); sym_(0,(unsigned char *)"%",(unsigned char *)tmp3,svPtr); // Store result gtk_main(); /*=================================================================================*/ svPtr->LineNumber=22; // write "Goodbye!",! /*=================================================================================*/ if (svPtr->out_file[svPtr->io]==NULL) ErrorMessage("Write to input file",svPtr->LineNumber); // W1001 svPtr->hor[svPtr->io]+=fprintf(svPtr->out_file[svPtr->io],"%s","Goodbye!"); fprintf(svPtr->out_file[svPtr->io],"\n"); svPtr->hor[svPtr->io]=0; svPtr->ver[svPtr->io]++; /*=================================================================================*/ svPtr->LineNumber=23; // zexit /*=================================================================================*/ //================================================================================= _epilogue: tmp0[0]=0; tmp1[0]=0; /* Function Epilogue */ Mltoa(getpid(),atmp); if (svPtr->LockDone) cleanLocks((char *) atmp); Mglobal(CLOSE,tmp0,tmp1,svPtr); /* Close Globals */ } // end of try block catch(...) { cout << "Uncaught error in or near line " << svPtr->LineNumber << endl; Mglobal(CLOSE,tmp0,tmp1,svPtr); /* Close Globals */ } return EXIT_SUCCESS; } /* Terminate */ //================================================================================= int _label_lookup(char *label) { return -1; } char * _text_function(int disp) { return NULL; } #include "gtk3.h"