From c60f6ff0d88a1304ef2da4b62edeceabcaffb4b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rafa=C5=82=20D=C5=82ugo=C5=82=C4=99cki?= Date: Tue, 19 Jan 2016 18:52:53 +0100 Subject: [PATCH] Save temporary changes --- .gitignore | 6 + INSTALL | 4 +- Makefile.am | 11 +- configure.ac | 29 +++-- src/edit/editor.cpp | 28 ++--- src/edit/editor.h | 18 +-- src/graph/loggraph.cpp | 47 ++++---- src/help/help.cpp | 46 +++---- src/kernel/kernel.cpp | 244 ++++++++++++++++++++------------------ src/lgconfig/lgconfig.cpp | 34 +++--- src/net/lognet.cpp | 56 ++++----- src/preproc/prep.cpp | 8 +- 12 files changed, 279 insertions(+), 252 deletions(-) diff --git a/.gitignore b/.gitignore index e69de29..8c3cbf5 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1,6 @@ +.deps +Doxyfile +Makefile +Makefile.in +autom4te.cache +*.o diff --git a/INSTALL b/INSTALL index 007e939..2099840 100644 --- a/INSTALL +++ b/INSTALL @@ -12,8 +12,8 @@ without warranty of any kind. Basic Installation ================== - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented diff --git a/Makefile.am b/Makefile.am index 96d0cf9..8d97cdb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,12 +5,13 @@ MOC = ${MOCDIR}/${MOCNAME} #AM_CXXFLAGS= -Wall -pedantic -Wextra -fno-strength-reduce #AM_CXXFLAGS = -m32 -AM_CXXFLAGS = -I$(top_srcdir)/src/global -AM_LDFLAGS= -fPIC +AM_CXXFLAGS = -I$(top_srcdir)/src/global -I${QTDIR}/include/qt4 +AM_LDFLAGS= -fPIC -L$(QTDIR)/lib -lQtCore -lQtGui +# bin/loggraph + bin_PROGRAMS = \ - bin/loggraph \ bin/lognet \ bin/logker \ bin/logint \ @@ -19,8 +20,8 @@ bin_PROGRAMS = \ bin/logcomp \ bin/loghelp +# src/graph/loggraph.moc BUILT_SOURCES = \ - src/graph/loggraph.moc \ src/net/lognet.moc.cpp \ src/kernel/kernel.moc \ src/edit/editor.moc.cpp \ @@ -41,7 +42,7 @@ clean-loggraph-extra: bin_lognet_SOURCES = src/net/lognet.cpp src/net/lognet.moc.cpp bin_lognet_CPPFLAGS = $(bin_lognet_CFLAGS) -bin_lognet_LDADD = $(bin_lognet_LIBS) +bin_lognet_LDADD = $(bin_lognet_LIBS) -lconfig++ src/net/lognet.moc.cpp: $(MOC) -i src/net/lognet.cpp -o src/net/lognet.moc.cpp diff --git a/configure.ac b/configure.ac index 65e94cf..0d76b6d 100644 --- a/configure.ac +++ b/configure.ac @@ -7,20 +7,20 @@ AC_PROG_CXX AM_PROG_CC_C_O AC_CONFIG_FILES([Makefile]) - # libqt3-mt:i386 # libqt3-mt-dev:i386 # qt3-dev-tools:i386 -PKG_CHECK_MODULES([bin_loggraph], [qt-mt < 4.0]) -PKG_CHECK_MODULES([bin_lognet], [qt-mt < 4.0 libconfig]) -PKG_CHECK_MODULES([bin_logker], [qt-mt < 4.0 libconfig]) -#PKG_CHECK_MODULES([bin_logint], [qt-mt < 4.0]) -PKG_CHECK_MODULES([bin_logedit], [qt-mt < 4.0]) -PKG_CHECK_MODULES([bin_lgconfig], [qt-mt < 4.0 libconfig]) -PKG_CHECK_MODULES([bin_logcomp], [qt-mt < 4.0]) -PKG_CHECK_MODULES([bin_loghelp], [qt-mt < 4.0]) - -# Get Qt3 library and include locations + +#PKG_CHECK_MODULES([bin_loggraph], [qt-mt < 4.0]) +#PKG_CHECK_MODULES([bin_lognet], [qt-mt < 4.0 libconfig]) +#PKG_CHECK_MODULES([bin_logker], [qt-mt < 4.0 libconfig]) +##PKG_CHECK_MODULES([bin_logint], [qt-mt < 4.0]) +#PKG_CHECK_MODULES([bin_logedit], [qt-mt < 4.0]) +#PKG_CHECK_MODULES([bin_lgconfig], [qt-mt < 4.0 libconfig]) +#PKG_CHECK_MODULES([bin_logcomp], [qt-mt < 4.0]) +#PKG_CHECK_MODULES([bin_loghelp], [qt-mt < 4.0]) + +## Get Qt3 library and include locations AC_ARG_WITH([moc-compiler-name], [AS_HELP_STRING([--with-moc-compiler-name=NAME], [filename of MOC compiler, defaults to: moc])], @@ -35,6 +35,13 @@ AC_ARG_WITH([moc-compiler-dir], [MOCDIR='/usr/bin']) AC_SUBST([MOCDIR]) +AC_ARG_WITH([qt-dir], + [AS_HELP_STRING([--with-qt-dir=DIR], + [location of Qt library, defaults to: /usr])], + [QTDIR="$withval"], + [QTDIR='/usr']) +AC_SUBST([QTDIR]) + AC_CHECK_PROGS([DOXYGEN], [doxygen]) if test -z "$DOXYGEN"; then AC_MSG_WARN([Doxygen not found - continuing without Doxygen support]) diff --git a/src/edit/editor.cpp b/src/edit/editor.cpp index 381de48..0950536 100644 --- a/src/edit/editor.cpp +++ b/src/edit/editor.cpp @@ -1,25 +1,25 @@ -#include -#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include -#include +#include #include "editor.h" diff --git a/src/edit/editor.h b/src/edit/editor.h index 2a063ad..281ea81 100644 --- a/src/edit/editor.h +++ b/src/edit/editor.h @@ -2,16 +2,16 @@ #define QWERTY_H #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #define COMP_MODE 1 diff --git a/src/graph/loggraph.cpp b/src/graph/loggraph.cpp index 461669f..6053ebe 100644 --- a/src/graph/loggraph.cpp +++ b/src/graph/loggraph.cpp @@ -7,20 +7,21 @@ //#include */ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -28,14 +29,14 @@ #include "comm.h" #include "socu.h" #include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +//#include +#include #define MAXWIDTH 640 #define MAXHEIGHT 480 @@ -203,8 +204,8 @@ VGR::VGR(char *sockname) prv_font = normal_font; MakeColors(); - setCaption("graphic resource"); - setBackgroundColor(white); + setWindowTitle("graphic resource"); + //setBackgroundColor(white);//@TODO Restore? canvas = new QPixmap(640, 480); canvas->fill(backgroundColor()); @@ -966,7 +967,7 @@ void VGR::Putmap(int map) m->map->width(), m->map->height()); break; } - m = maps.next(); + m = maps.takeFirst(); } } @@ -1277,7 +1278,7 @@ void VGR::MagicGraph(G_MESSAGE *msg) maps.remove(pmap); break; } - pmap = maps.next(); + pmap = maps.takeFirst(); } break; /* Line (x1,y1,x2,y2,col) */ diff --git a/src/help/help.cpp b/src/help/help.cpp index d2cf4f0..f0b5e43 100644 --- a/src/help/help.cpp +++ b/src/help/help.cpp @@ -1,32 +1,32 @@ -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include #include -#include +#include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define TAG_TEXT 0 diff --git a/src/kernel/kernel.cpp b/src/kernel/kernel.cpp index b5e1cd1..d8320d3 100644 --- a/src/kernel/kernel.cpp +++ b/src/kernel/kernel.cpp @@ -30,36 +30,36 @@ ************************************************************/ -#include +#include //#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -131,11 +131,11 @@ QApplication *app; class QKernel : public QFrame { Q_OBJECT public: - QMultiLineEdit *desktop; + Q3MultiLineEdit *desktop; QMenuBar *bar; - QPopupMenu *p; - QPopupMenu *p1; - QPopupMenu *p2; + Q3PopupMenu *p; + Q3PopupMenu *p1; + Q3PopupMenu *p2; char progdir[256]; int NodeNumber; int ConType; @@ -171,9 +171,9 @@ protected: virtual void closeEvent (QCloseEvent * e); private: - QList Interpreters; - QList ConnectList; - QListBox *connections; + QList Interpreters; + QList ConnectList; + Q3ListBox *connections; /** * number of working interpreters @@ -188,16 +188,16 @@ private: bool synchro; bool wait_for_info; char LockPasswd[25]; - int lockid; - int unlockid; - int qid; - int cwid; - int optid; - int prid; - int mid; - int msgid; - int toolsid; - int hid; +// int lockid; +// int unlockid; +// int qid; +// int cwid; +// int optid; +// int prid; +// int mid; +// int msgid; +// int toolsid; +// int hid; int net_sock; int freeINTid; @@ -244,17 +244,29 @@ QKernel::QKernel() info_messages = TRUE; wait_for_info = FALSE; - setCaption("Virtual LOGLAN Processor"); - setBackgroundColor(white); +// setCaption("Virtual LOGLAN Processor");// @TODO: Restore? +// setBackgroundColor(white); + QAction *execute = new QAction("Execute", this); + connect(execute, SIGNAL(triggered()), this, SLOT(Run_Prog())); + QAction *kill = new QAction("Kill", this); + connect(kill, SIGNAL(triggered()), this, SLOT(KillInterpreter())); + + QMenu *program; + program = menuBar()->addMenu("&Program"); + program->addAction(execute); + program->addAction(kill); + bar = new QMenuBar(this); - bar->setFont(f); - p = new QPopupMenu(); - p->setFont(f2); - p->insertItem("Execute", this, SLOT(Run_Prog())); - p->insertItem("Kill", this, SLOT(KillInterpreter())); - prid = bar->insertItem("&Program", p); - p1 = new QPopupMenu(); +// bar->setFont(f); + + +// p = new Q3PopupMenu(); +// p->setFont(f2); +// p->insertItem("Execute", this, SLOT(Run_Prog())); +// p->insertItem("Kill", this, SLOT(KillInterpreter())); +// prid = bar->insertItem("&Program", p); + p1 = new Q3PopupMenu(); p1->insertItem("Message", this, SLOT(MessageToNode())); p1->insertSeparator(); p1->insertItem("Connect", this, SLOT(Connect())); @@ -263,7 +275,7 @@ QKernel::QKernel() p1->setFont(f); mid = bar->insertItem("&Machine", p1); - p2 = new QPopupMenu(); + p2 = new Q3PopupMenu(); cwid = p2->insertItem("Editor", this, SLOT(Edit())); hid = p2->insertItem("Help", this, SLOT(Help())); p2->insertSeparator(); @@ -282,7 +294,7 @@ QKernel::QKernel() qid = bar->insertItem("&Quit", this, SLOT(QuitProc())); p->setFont(f); - desktop = new QMultiLineEdit(this, "desktop"); + desktop = new Q3MultiLineEdit(this, "desktop"); desktop->setAutoUpdate(TRUE); desktop->setReadOnly(TRUE); desktop->setFont(f1); @@ -533,11 +545,11 @@ void QKernel::RunNetModule() */ void QKernel::Connect() { - QDialog d(this, "", TRUE); - QLabel lab(&d, "IP Address:"); + QDialog d(this); + QLabel lab("IP Address:", &d); QLineEdit ed(&d, ""); - QPushButton ob(&d, ""); - QPushButton cb(&d, ""); + QPushButton ob(&d); + QPushButton cb(&d); MESSAGE m; d.setFont(QFont("Helvetica", 12, QFont::Bold)); @@ -609,11 +621,11 @@ void QKernel::QuitProc() */ void QKernel::AddAddress() { - QDialog d(this, "", TRUE); - QLabel lab(&d, "IP Address:"); + QDialog d(this); + QLabel lab("IP Address:", &d); QLineEdit ed(&d, ""); - QPushButton ob(&d, ""); - QPushButton cb(&d, ""); + QPushButton ob(&d); + QPushButton cb(&d); if (connections) { ob.setGeometry(30, 60, 80, 30); @@ -656,34 +668,34 @@ void QKernel::MessageToNode() QLineEdit *nodenr; MESSAGE m; - dlg = new QDialog(this, "Message", TRUE); + dlg = new QDialog(this); - nodenr = new QLineEdit(dlg, "number"); + nodenr = new QLineEdit(dlg); nodenr->setGeometry(90, 10, 50, 30); nodenr->setText(""); QLabel *tmpQLabel; - tmpQLabel = new QLabel(dlg, "Label_1"); + tmpQLabel = new QLabel(dlg); tmpQLabel->setGeometry(10, 10, 77, 30); tmpQLabel->setText("Node number:"); - tmpQLabel = new QLabel(dlg, "Label_2"); + tmpQLabel = new QLabel(dlg); tmpQLabel->setGeometry(10, 50, 70, 30); tmpQLabel->setText("Message:"); QLineEdit *msg; - msg = new QLineEdit(dlg, "LineEdit_1"); + msg = new QLineEdit(dlg); msg->setGeometry(80, 60, 330, 30); msg->setText(""); QPushButton *ob; - ob = new QPushButton(dlg, "PushButton_1"); + ob = new QPushButton(dlg); ob->setGeometry(230, 10, 80, 30); ob->setText("Send"); ob->setDefault(TRUE); QPushButton *cb; - cb = new QPushButton(dlg, "PushButton_2"); + cb = new QPushButton(dlg); cb->setGeometry(330, 10, 80, 30); cb->setText("Cancel"); dlg->resize(430, 110); @@ -715,22 +727,22 @@ void QKernel::KillInterpreter() MESSAGE m; InterpEntry *pom; - dlg = new QDialog(this, "Message", TRUE); + dlg = new QDialog(this); - nodenr = new QLineEdit(dlg, "number"); + nodenr = new QLineEdit(dlg); nodenr->setGeometry(90, 10, 50, 30); nodenr->setText(""); QLabel* tmpQLabel; - tmpQLabel = new QLabel(dlg, "Label_1"); + tmpQLabel = new QLabel(dlg); tmpQLabel->setGeometry(10, 10, 77, 30); tmpQLabel->setText("Interp. ID:"); QPushButton* ob, *cb; - ob = new QPushButton(dlg, "PushButton_1"); + ob = new QPushButton(dlg); ob->setGeometry( 160, 10, 80, 30); ob->setText("Kill"); ob->setDefault(TRUE); - cb = new QPushButton(dlg, "PushButton_2"); + cb = new QPushButton(dlg); cb->setGeometry(260, 10, 80, 30); cb->setText("Cancel"); dlg->resize(360, 50); @@ -986,7 +998,7 @@ void QKernel::SetMessages() */ void QKernel::SetOptions() { - QDialog dlg(this, "Options", TRUE); + QDialog dlg(this); ConnectEntry *e; unsigned int i; @@ -996,16 +1008,16 @@ void QKernel::SetOptions() progs->setText(progdir); QLabel* tmpQLabel; - tmpQLabel = new QLabel(&dlg, "Label_1"); + tmpQLabel = new QLabel(&dlg); tmpQLabel->setGeometry(30, 20, 120, 30); tmpQLabel->setText("Programs directory"); QFrame* tmpQFrame; - tmpQFrame = new QFrame(&dlg, "Frame_2"); + tmpQFrame = new QFrame(&dlg); tmpQFrame->setGeometry(10, 60, 380, 30); tmpQFrame->setFrameStyle(52); - tmpQLabel = new QLabel(&dlg, "Label_2"); + tmpQLabel = new QLabel(&dlg); tmpQLabel->setGeometry(10, 80, 340, 30); tmpQLabel->setText("Virtual Processor properties (activated after " "restarting VLP):"); @@ -1017,30 +1029,30 @@ void QKernel::SetOptions() sprintf(nns, "%d", NodeNumber); nn->setText(nns); - tmpQLabel = new QLabel(&dlg, "Label_3"); + tmpQLabel = new QLabel(&dlg); tmpQLabel->setGeometry(20, 110, 90, 30); tmpQLabel->setText("Node number:"); QRadioButton *exp, *reg; - exp = new QRadioButton(&dlg, "RadioButton_3"); + exp = new QRadioButton(&dlg); exp->setGeometry(30, 170, 100, 30); exp->setText("Explicit"); exp->setChecked(TRUE); - reg = new QRadioButton(&dlg, "RadioButton_4"); + reg = new QRadioButton(&dlg); reg->setGeometry(30, 200, 100, 30); reg->setText("Registration"); reg->setEnabled(FALSE); - connections = new QListBox(&dlg, "ListBox_1"); + connections = new Q3ListBox(&dlg); connections->setGeometry(170, 140, 130, 100); e = ConnectList.first(); while(e != NULL) { connections->insertItem(e->addr); - e = ConnectList.next(); + e = ConnectList.takeFirst(); } - tmpQLabel = new QLabel(&dlg, "Label_5"); + tmpQLabel = new QLabel(&dlg); tmpQLabel->setGeometry(170, 110, 100, 30); tmpQLabel->setText("Connection list:"); @@ -1048,25 +1060,25 @@ void QKernel::SetOptions() QPushButton *delbtn; QPushButton *okbtn; QPushButton *cancelbtn; - addbtn = new QPushButton(&dlg, "PushButton_1"); + addbtn = new QPushButton(&dlg); addbtn->setGeometry(310, 150, 60, 30); addbtn->setText("Add"); - delbtn = new QPushButton(&dlg, "PushButton_2"); + delbtn = new QPushButton(&dlg); delbtn->setGeometry(310, 200, 60, 30); delbtn->setText("Del"); connect(addbtn, SIGNAL(clicked()), this, SLOT(AddAddress())); connect(delbtn, SIGNAL(clicked()), this, SLOT(DelAddress())); - okbtn = new QPushButton(&dlg, "PushButton_3"); + okbtn = new QPushButton(&dlg); okbtn->setGeometry(80, 260, 100, 30); okbtn->setText("Ok"); okbtn->setDefault(TRUE); - cancelbtn = new QPushButton(&dlg, "PushButton_4"); + cancelbtn = new QPushButton(&dlg); cancelbtn->setGeometry(210, 260, 100, 30); cancelbtn->setText("Cancel"); connect(okbtn, SIGNAL(clicked()), &dlg, SLOT(accept())); connect(cancelbtn, SIGNAL(clicked()), &dlg, SLOT(reject())); QButtonGroup* group; - group = new QButtonGroup(&dlg, "ButtonGroup_1"); + group = new QButtonGroup(&dlg); group->setGeometry(20, 150, 120, 90); group->setTitle("Connection type"); group->setAlignment(1); @@ -1129,11 +1141,11 @@ void QKernel::SetOptions() */ void QKernel::LockConsole() { - QDialog d(this, "Enter password", TRUE); - QLabel lab(&d, "Password"); + QDialog d(this); + QLabel lab("Password", &d); QLineEdit ed(&d, ""); - QPushButton ob(&d, ""); - QPushButton cb(&d, ""); + QPushButton ob(&d); + QPushButton cb(&d); d.setCaption("Lock console"); ob.setGeometry(30, 60, 80, 30); @@ -1156,13 +1168,13 @@ void QKernel::LockConsole() ed.setText(""); if (d.exec()) { if (strcmp(ed.text(), LockPasswd)==0) { - bar->setItemEnabled(qid, FALSE); - bar->setItemEnabled(prid, FALSE); - bar->setItemEnabled(mid, FALSE); - p2->setItemEnabled(unlockid, TRUE); - p2->setItemEnabled(lockid, FALSE); - p2->setItemEnabled(cwid, FALSE); - p2->setItemEnabled(optid, FALSE); +// bar->setItemEnabled(qid, FALSE); +// bar->setItemEnabled(prid, FALSE); +// bar->setItemEnabled(mid, FALSE); +// p2->setItemEnabled(unlockid, TRUE); +// p2->setItemEnabled(lockid, FALSE); +// p2->setItemEnabled(cwid, FALSE); +// p2->setItemEnabled(optid, FALSE); bar->repaint(); WriteMessage("CONSOLE LOCKED"); LOCKED = TRUE; @@ -1186,11 +1198,11 @@ void QKernel::LockConsole() */ void QKernel::UnlockConsole() { - QDialog d(this, "Enter password", TRUE); - QLabel lab(&d, "Password"); + QDialog d(this); + QLabel lab("Password", &d); QLineEdit ed(&d, ""); - QPushButton ob(&d, ""); - QPushButton cb(&d, ""); + QPushButton ob(&d); + QPushButton cb(&d); ob.setGeometry(30, 60, 80, 30); ob.setText("Ok"); @@ -1207,13 +1219,13 @@ void QKernel::UnlockConsole() if (d.exec()) { if (strcmp(ed.text(), LockPasswd) == 0) { - bar->setItemEnabled(qid, TRUE); - bar->setItemEnabled(prid, TRUE); - bar->setItemEnabled(mid, TRUE); - p2->setItemEnabled(unlockid, FALSE); - p2->setItemEnabled(lockid, TRUE); - p2->setItemEnabled(cwid, TRUE); - p2->setItemEnabled(optid, TRUE); +// bar->setItemEnabled(qid, TRUE); +// bar->setItemEnabled(prid, TRUE); +// bar->setItemEnabled(mid, TRUE); +// p2->setItemEnabled(unlockid, FALSE); +// p2->setItemEnabled(lockid, TRUE); +// p2->setItemEnabled(cwid, TRUE); +// p2->setItemEnabled(optid, TRUE); bar->repaint(); WriteMessage("CONSOLE UNLOCKED"); LOCKED = FALSE; @@ -1248,7 +1260,7 @@ InterpEntry *QKernel::findINTbySocket(int _id) if (pom->sock == _id) break; - pom = Interpreters.next(); + pom = Interpreters.takeFirst(); } return pom; } @@ -1265,7 +1277,7 @@ InterpEntry *QKernel::findINTbyID(int _id) while (pom != NULL) { if (pom->ID == _id) break; - pom = Interpreters.next(); + pom = Interpreters.takeFirst(); } return pom; } diff --git a/src/lgconfig/lgconfig.cpp b/src/lgconfig/lgconfig.cpp index b130153..64e2ada 100644 --- a/src/lgconfig/lgconfig.cpp +++ b/src/lgconfig/lgconfig.cpp @@ -1,22 +1,22 @@ -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/src/net/lognet.cpp b/src/net/lognet.cpp index 7a93bc0..4c00e27 100644 --- a/src/net/lognet.cpp +++ b/src/net/lognet.cpp @@ -16,10 +16,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -91,9 +91,9 @@ public: char kername[256]; /* List of the Interpeter slots */ - QList Interpreters; + QList Interpreters; /* List of the Network slots */ - QList Links; + QList Links; NETMOD(char*); @@ -385,7 +385,7 @@ void NETMOD::check_node(int n, int sc) strcpy(m.param.pstr, pomlink->addr); break; } - pomlink = Links.next(); + pomlink = Links.takeFirst(); } write(sc, &m, sizeof(MESSAGE)); } @@ -418,7 +418,7 @@ void NETMOD::get_internal() if (nrset < pomlink->sock) { nrset = pomlink->sock; } - pomlink = Interpreters.next(); + pomlink = Interpreters.takeFirst(); } if (select(nrset + 1, &readset, &writeset, 0, (struct timeval *)&tout) > @@ -450,7 +450,7 @@ void NETMOD::get_internal() } } } /* ISSET */ - pomlink=Interpreters.next(); + pomlink=Interpreters.takeFirst(); } // while /* Check internal socket */ @@ -508,7 +508,7 @@ void NETMOD::get_internal() pomlink = findINTlink(msg.param.pword[1]); if (pomlink != NULL) { close(pomlink->sock); - Interpreters.remove(pomlink); + Interpreters.removeOne(pomlink); } }; break; @@ -614,7 +614,7 @@ void NETMOD::get_message(NETlink *lnk) msg.param.pword[1]); write_at_console(pomstr); ::close(lnk->sock); - Links.remove(lnk); + Links.removeOne(lnk); delete lnk; break; case NET_PROPAGATE: @@ -652,7 +652,7 @@ void NETMOD::remote_messages() max = pomlink->sock; } } - pomlink=Links.next(); + pomlink=Links.takeFirst(); } if (select(max + 1, &rset, &wset, 0, (struct timeval *)&tout) > 0) { @@ -661,7 +661,7 @@ void NETMOD::remote_messages() if (FD_ISSET(pomlink->sock,&rset)) { get_message(pomlink); } - pomlink=Links.next(); + pomlink=Links.takeFirst(); } } } @@ -690,7 +690,7 @@ void NETMOD::doitall() { if (max < pomlink2->sock) { max=pomlink2->sock; } - pomlink2 = Interpreters.next(); + pomlink2 = Interpreters.takeFirst(); } pomlink = Links.first(); while (pomlink != NULL) { @@ -700,7 +700,7 @@ void NETMOD::doitall() { max = pomlink->sock; } } - pomlink=Links.next(); + pomlink=Links.takeFirst(); } /* odczyt */ @@ -751,7 +751,7 @@ void NETMOD::doitall() { } } }/* ISSET */ - pomlink2 = Interpreters.next(); + pomlink2 = Interpreters.takeFirst(); }/* while */ /* Check internal socket */ @@ -806,7 +806,7 @@ void NETMOD::doitall() { pomlink2 = findINTlink(msg.param.pword[1]); if (pomlink2 != NULL) { close(pomlink2->sock); - Interpreters.remove(pomlink2); + Interpreters.removeOne(pomlink2); } }; break; @@ -821,7 +821,7 @@ void NETMOD::doitall() { while (pomlink != NULL) { if (FD_ISSET(pomlink->sock, &rset)) get_message(pomlink); - pomlink=Links.next(); + pomlink=Links.takeFirst(); } } // select } @@ -858,7 +858,7 @@ void NETMOD::connect_seq(char *a) while (pom != NULL) { if (strcmp(pom->addr, a) == 0) return; - pom = Links.next(); + pom = Links.takeFirst(); } pom = new NETlink; strcpy(pom->addr, a); @@ -912,7 +912,7 @@ void NETMOD::check_links() sock_reopen(pomlink); } } /* not connected */ - pomlink = Links.next(); + pomlink = Links.takeFirst(); } /* while */ } /* if */ all_connected = TRUE; @@ -922,7 +922,7 @@ void NETMOD::check_links() all_connected = FALSE; break; } - pomlink = Links.next(); + pomlink = Links.takeFirst(); } } @@ -979,7 +979,7 @@ void NETMOD::send_to_all(MESSAGE *msg) pomlink = Links.first(); while (pomlink != NULL) { write(pomlink->sock, msg, sizeof(MESSAGE)); - pomlink = Links.next(); + pomlink = Links.takeFirst(); } } @@ -1006,7 +1006,7 @@ void NETMOD::exit_sequence() pomlink = Links.first(); while (pomlink != NULL) { ::close(pomlink->sock); - pomlink = Links.next(); + pomlink = Links.takeFirst(); } exit(0); } @@ -1024,12 +1024,12 @@ void NETMOD::disconnect_seq() p = Links.first(); while(p != NULL) { send_to_node(p, &m); - p=Links.next(); + p=Links.takeFirst(); } p = Links.first(); while(p != NULL) { ::close(p->sock); - p = Links.next(); + p = Links.takeFirst(); } Links.clear(); } @@ -1042,7 +1042,7 @@ NETlink * NETMOD::findNETlink(int node) if (pomlink->node_number == node) return pomlink; - pomlink = Links.next(); + pomlink = Links.takeFirst(); } return pomlink; } @@ -1054,7 +1054,7 @@ INTlink * NETMOD::findINTlink(int id) while(pomlink != NULL) { if (pomlink->ID == id) return pomlink; - pomlink = Interpreters.next(); + pomlink = Interpreters.takeFirst(); } return pomlink; } @@ -1215,7 +1215,7 @@ void NETMOD::conn_info(int sk) write(sk, &m, sizeof(MESSAGE)); k = 0; } - pom = Links.next(); + pom = Links.takeFirst(); } if (k > 0) { m.param.pword[1] = k; diff --git a/src/preproc/prep.cpp b/src/preproc/prep.cpp index 285b2c8..8332a1a 100644 --- a/src/preproc/prep.cpp +++ b/src/preproc/prep.cpp @@ -1,10 +1,10 @@ -#include -#include +#include +#include #include -#include +#include #include #include -#include +#include #include #include -- 2.30.2