### Includes for QT library
-QINC=/usr/lib/qt-1.45/include
+QINC=/usr/include/qt3
### QT library directory
-QLIB=/usr/lib/qt-1.45/lib
+QLIB=/usr/lib3/
### moc compiler directory
-MOCDIR=/usr/lib/qt-1.45/bin
+MOCDIR=/usr/bin
### Install directory
-INSTALLDIR=/usr/local/vlp
+INSTALLDIR=/home/andrzej/vlp3binD
+
+### QT Library linking phrase
+QLINK=-lqt-mt
### Includes for QT library
-QINC=/usr/lib/qt-1.45/include
+QINC=/usr/include/qt3
### QT library directory
-QLIB=/usr/lib/qt-1.45/lib
+QLIB=/usr/lib3/
### moc compiler directory
-MOCDIR=/usr/lib/qt-1.45/bin
+MOCDIR=/usr/bin
### Install directory
-INSTALLDIR=/usr/local/vlp
+INSTALLDIR=/home/andrzej/vlp3binD
+
+### QT Library linking phrase
+QLINK=-lqt-mt
all:
cat Dir graph/mfile > graph/Makefile
cat Dir net/mfile > net/Makefile
-
cat Dir kernel/mfile > kernel/Makefile
cat Dir lgconfig/mfile > lgconfig/Makefile
cat Dir edit/mfile > edit/Makefile
cat Dir preproc/mfile > preproc/Makefile
cat Dir help/mfile > help/Makefile
+cat Dir int/mfile > int/Makefile
cat Dir ./mfile > ./Makefile
+
### Includes for QT library
-QINC=/usr/lib/qt-1.45/include
+QINC=/usr/include/qt3
### QT library directory
-QLIB=/usr/lib/qt-1.45/lib
+QLIB=/usr/lib3/
### moc compiler directory
-MOCDIR=/usr/lib/qt-1.45/bin
+MOCDIR=/usr/bin
### Install directory
-INSTALLDIR=/usr/local/vlp
+INSTALLDIR=/home/andrzej/vlp3binD
+
+### QT Library linking phrase
+QLINK=-lqt-mt
#######
####### Change the INCDIR, LFLAGS and MOC
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
char *UnitTypes[5] = {"CLASS","PROCEDURE","FUNCTION","PROCESS","COROUTINE"};
-My_Edit::My_Edit(QWidget *parent=0,const char *name=0)
+
+
+My_Edit::My_Edit(QWidget *parent,const char *name)
: QMultiLineEdit(parent,name)
{
+ parent = NULL;
+ name = NULL;
}
void My_Edit::keyPressEvent(QKeyEvent *ev)
}
+void Editor::closeEvent ( QCloseEvent * e ) {
+ e->ignore();
+}
+
Editor::Editor( char *hdir,QWidget * parent , const char * name)
: QWidget( parent, name )
{
- QFont f1("Helvetica",12,QFont::Bold);
+ QFont f1("Helvetica",10,QFont::Bold);
strcpy(HomeDir,hdir);
e = new My_Edit( this, "editor" );
connect(e,SIGNAL(cursorMove()),this,SLOT(updateline()));
- medit->insertItem("Copy ",e,SLOT(copyText()),CTRL+Key_Insert);
+ medit->insertItem("Copy ",e,SLOT(copy()),CTRL+Key_Insert);
medit->insertItem("Paste ",e,SLOT(paste()), SHIFT+Key_Insert);
medit->insertItem("Cut ",e,SLOT(cut()), CTRL+Key_Delete);
medit->insertItem("Clear All ",e,SLOT(clear()));
QFile f(fileName);
if (!f.open(IO_WriteOnly)) return;
f.reset();
- f.writeBlock( e->text().data(),e->text().size() );
+ f.writeBlock( e->text().data(),e->text().length() );
f.close();
if (dlg.exec())
{
- compiler_path.sprintf("%s",compp->text());
+ compiler_path.sprintf("%s",compp->text().ascii());
// gen_path.sprintf("%s",genp->text());
- file_path.sprintf("%s",files->text());
+ file_path.sprintf("%s",files->text().ascii());
};
}
e->getCursorPosition(&cx,&cy);
txt.sprintf("UNIT %s : %s( <params> );\nBEGIN\n\nEND %s;",uname,
- lst.text(lst.currentItem()), uname);
+ lst.text(lst.currentItem()).ascii(), uname);
e->insertAt(txt,cx,cy);
};
}
{
QFont font( "helvetica", 12, 75, 0 );
font.setStyleHint( (QFont::StyleHint)0 );
- font.setCharSet( (QFont::CharSet)0 );
+ //font.setCharSet( (QFont::CharSet)0 );
tmpQLabel->setFont( font );
}
tmpQLabel->setText( "Text:" );
int main( int argc, char **argv )
{
QApplication a( argc, argv );
- a.setStyle(WindowsStyle);
+ //a.setStyle(WindowsStyle);
e = new Editor(argv[1]);
e->resize( 600, 400 );
e->show();
-typedef struct FuncEntry
+typedef struct
{
char name[255],filename[255];
-};
+} FuncEntry;
-typedef struct CategoryEntry
+typedef struct
{
QList<FuncEntry> dictionary;
QStrList names;
char name[255];
-};
+} CategoryEntry;
protected:
void resizeEvent( QResizeEvent * );
+ virtual void closeEvent ( QCloseEvent * e );
private:
QMenuBar *m;
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
--- /dev/null
+/****************************************************************************
+** My_Edit meta object code from reading C++ file 'editor.h'
+**
+** Created: Fri Mar 4 12:26:17 2011
+** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#undef QT_NO_COMPAT
+#include "editor.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+#include <private/qucomextra_p.h>
+#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
+#error "This file was generated using the moc from 3.3.8b. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+const char *My_Edit::className() const
+{
+ return "My_Edit";
+}
+
+QMetaObject *My_Edit::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_My_Edit( "My_Edit", &My_Edit::staticMetaObject );
+
+#ifndef QT_NO_TRANSLATION
+QString My_Edit::tr( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "My_Edit", s, c, QApplication::DefaultCodec );
+ else
+ return QString::fromLatin1( s );
+}
+#ifndef QT_NO_TRANSLATION_UTF8
+QString My_Edit::trUtf8( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "My_Edit", s, c, QApplication::UnicodeUTF8 );
+ else
+ return QString::fromUtf8( s );
+}
+#endif // QT_NO_TRANSLATION_UTF8
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* My_Edit::staticMetaObject()
+{
+ if ( metaObj )
+ return metaObj;
+ QMetaObject* parentObject = QMultiLineEdit::staticMetaObject();
+ static const QUMethod signal_0 = {"cursorMove", 0, 0 };
+ static const QMetaData signal_tbl[] = {
+ { "cursorMove()", &signal_0, QMetaData::Public }
+ };
+ metaObj = QMetaObject::new_metaobject(
+ "My_Edit", parentObject,
+ 0, 0,
+ signal_tbl, 1,
+#ifndef QT_NO_PROPERTIES
+ 0, 0,
+ 0, 0,
+#endif // QT_NO_PROPERTIES
+ 0, 0 );
+ cleanUp_My_Edit.setMetaObject( metaObj );
+ return metaObj;
+}
+
+void* My_Edit::qt_cast( const char* clname )
+{
+ if ( !qstrcmp( clname, "My_Edit" ) )
+ return this;
+ return QMultiLineEdit::qt_cast( clname );
+}
+
+// SIGNAL cursorMove
+void My_Edit::cursorMove()
+{
+ activate_signal( staticMetaObject()->signalOffset() + 0 );
+}
+
+bool My_Edit::qt_invoke( int _id, QUObject* _o )
+{
+ return QMultiLineEdit::qt_invoke(_id,_o);
+}
+
+bool My_Edit::qt_emit( int _id, QUObject* _o )
+{
+ switch ( _id - staticMetaObject()->signalOffset() ) {
+ case 0: cursorMove(); break;
+ default:
+ return QMultiLineEdit::qt_emit(_id,_o);
+ }
+ return TRUE;
+}
+#ifndef QT_NO_PROPERTIES
+
+bool My_Edit::qt_property( int id, int f, QVariant* v)
+{
+ return QMultiLineEdit::qt_property( id, f, v);
+}
+
+bool My_Edit::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+#endif // QT_NO_PROPERTIES
+
+
+const char *Editor::className() const
+{
+ return "Editor";
+}
+
+QMetaObject *Editor::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_Editor( "Editor", &Editor::staticMetaObject );
+
+#ifndef QT_NO_TRANSLATION
+QString Editor::tr( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "Editor", s, c, QApplication::DefaultCodec );
+ else
+ return QString::fromLatin1( s );
+}
+#ifndef QT_NO_TRANSLATION_UTF8
+QString Editor::trUtf8( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "Editor", s, c, QApplication::UnicodeUTF8 );
+ else
+ return QString::fromUtf8( s );
+}
+#endif // QT_NO_TRANSLATION_UTF8
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* Editor::staticMetaObject()
+{
+ if ( metaObj )
+ return metaObj;
+ QMetaObject* parentObject = QWidget::staticMetaObject();
+ static const QUMethod slot_0 = {"load", 0, 0 };
+ static const QUParameter param_slot_1[] = {
+ { "fileName", &static_QUType_charstar, 0, QUParameter::In }
+ };
+ static const QUMethod slot_1 = {"load", 1, param_slot_1 };
+ static const QUMethod slot_2 = {"save", 0, 0 };
+ static const QUParameter param_slot_3[] = {
+ { "fileName", &static_QUType_charstar, 0, QUParameter::In }
+ };
+ static const QUMethod slot_3 = {"save", 1, param_slot_3 };
+ static const QUMethod slot_4 = {"save_as", 0, 0 };
+ static const QUMethod slot_5 = {"create", 0, 0 };
+ static const QUMethod slot_6 = {"props", 0, 0 };
+ static const QUMethod slot_7 = {"print", 0, 0 };
+ static const QUMethod slot_8 = {"cmp", 0, 0 };
+ static const QUMethod slot_9 = {"gen", 0, 0 };
+ static const QUMethod slot_10 = {"comp_all", 0, 0 };
+ static const QUMethod slot_11 = {"log_unit", 0, 0 };
+ static const QUMethod slot_12 = {"log_prog", 0, 0 };
+ static const QUMethod slot_13 = {"findText", 0, 0 };
+ static const QUMethod slot_14 = {"find_next", 0, 0 };
+ static const QUMethod slot_15 = {"updateline", 0, 0 };
+ static const QMetaData slot_tbl[] = {
+ { "load()", &slot_0, QMetaData::Public },
+ { "load(const char*)", &slot_1, QMetaData::Public },
+ { "save()", &slot_2, QMetaData::Public },
+ { "save(const char*)", &slot_3, QMetaData::Public },
+ { "save_as()", &slot_4, QMetaData::Public },
+ { "create()", &slot_5, QMetaData::Public },
+ { "props()", &slot_6, QMetaData::Public },
+ { "print()", &slot_7, QMetaData::Public },
+ { "cmp()", &slot_8, QMetaData::Public },
+ { "gen()", &slot_9, QMetaData::Public },
+ { "comp_all()", &slot_10, QMetaData::Public },
+ { "log_unit()", &slot_11, QMetaData::Public },
+ { "log_prog()", &slot_12, QMetaData::Public },
+ { "findText()", &slot_13, QMetaData::Public },
+ { "find_next()", &slot_14, QMetaData::Public },
+ { "updateline()", &slot_15, QMetaData::Public }
+ };
+ metaObj = QMetaObject::new_metaobject(
+ "Editor", parentObject,
+ slot_tbl, 16,
+ 0, 0,
+#ifndef QT_NO_PROPERTIES
+ 0, 0,
+ 0, 0,
+#endif // QT_NO_PROPERTIES
+ 0, 0 );
+ cleanUp_Editor.setMetaObject( metaObj );
+ return metaObj;
+}
+
+void* Editor::qt_cast( const char* clname )
+{
+ if ( !qstrcmp( clname, "Editor" ) )
+ return this;
+ return QWidget::qt_cast( clname );
+}
+
+bool Editor::qt_invoke( int _id, QUObject* _o )
+{
+ switch ( _id - staticMetaObject()->slotOffset() ) {
+ case 0: load(); break;
+ case 1: load((const char*)static_QUType_charstar.get(_o+1)); break;
+ case 2: save(); break;
+ case 3: save((const char*)static_QUType_charstar.get(_o+1)); break;
+ case 4: save_as(); break;
+ case 5: create(); break;
+ case 6: props(); break;
+ case 7: print(); break;
+ case 8: cmp(); break;
+ case 9: gen(); break;
+ case 10: comp_all(); break;
+ case 11: log_unit(); break;
+ case 12: log_prog(); break;
+ case 13: findText(); break;
+ case 14: find_next(); break;
+ case 15: updateline(); break;
+ default:
+ return QWidget::qt_invoke( _id, _o );
+ }
+ return TRUE;
+}
+
+bool Editor::qt_emit( int _id, QUObject* _o )
+{
+ return QWidget::qt_emit(_id,_o);
+}
+#ifndef QT_NO_PROPERTIES
+
+bool Editor::qt_property( int id, int f, QVariant* v)
+{
+ return QWidget::qt_property( id, f, v);
+}
+
+bool Editor::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+#endif // QT_NO_PROPERTIES
### Includes for QT library
-QINC=/usr/lib/qt-1.45/include
+QINC=/usr/include/qt3
### QT library directory
-QLIB=/usr/lib/qt-1.45/lib
+QLIB=/usr/lib3/
### moc compiler directory
-MOCDIR=/usr/lib/qt-1.45/bin
+MOCDIR=/usr/bin
### Install directory
-INSTALLDIR=/usr/local/vlp
+INSTALLDIR=/home/andrzej/vlp3binD
+
+### QT Library linking phrase
+QLINK=-lqt-mt
INCDIR = $(QINC)
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
// Demonstrates the painter and the printer.
//
-#include <qwindow.h>
+//#include <qwindow.h>
#include <qpainter.h>
#include <qprinter.h>
#include <qpushbt.h>
- normal_font = new QFont("lucidatypewriter",12,QFont::Normal);
+ normal_font = new QFont("lucidatypewriter",10,QFont::Normal);
normal_font->setFixedPitch(TRUE);
- bold_font = new QFont("lucidatypewriter",12,QFont::Bold);
+ bold_font = new QFont("lucidatypewriter",10,QFont::Bold);
bold_font->setFixedPitch(TRUE);
- italic_font = new QFont("lucidatypewriter",12,QFont::Normal,TRUE);
+ italic_font = new QFont("lucidatypewriter",10,QFont::Normal,TRUE);
italic_font->setFixedPitch(TRUE);
prv_font = normal_font;
--- /dev/null
+/****************************************************************************
+** VGR meta object code from reading C++ file 'loggraph.cpp'
+**
+** Created: Fri Mar 4 12:25:17 2011
+** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+#include <private/qucomextra_p.h>
+#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
+#error "This file was generated using the moc from 3.3.8b. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+const char *VGR::className() const
+{
+ return "VGR";
+}
+
+QMetaObject *VGR::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_VGR( "VGR", &VGR::staticMetaObject );
+
+#ifndef QT_NO_TRANSLATION
+QString VGR::tr( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "VGR", s, c, QApplication::DefaultCodec );
+ else
+ return QString::fromLatin1( s );
+}
+#ifndef QT_NO_TRANSLATION_UTF8
+QString VGR::trUtf8( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "VGR", s, c, QApplication::UnicodeUTF8 );
+ else
+ return QString::fromUtf8( s );
+}
+#endif // QT_NO_TRANSLATION_UTF8
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* VGR::staticMetaObject()
+{
+ if ( metaObj )
+ return metaObj;
+ QMetaObject* parentObject = QFrame::staticMetaObject();
+ static const QUParameter param_slot_0[] = {
+ { 0, &static_QUType_int, 0, QUParameter::In }
+ };
+ static const QUMethod slot_0 = {"vscrolled", 1, param_slot_0 };
+ static const QUParameter param_slot_1[] = {
+ { 0, &static_QUType_int, 0, QUParameter::In }
+ };
+ static const QUMethod slot_1 = {"hscrolled", 1, param_slot_1 };
+ static const QUMethod slot_2 = {"CloseMe", 0, 0 };
+ static const QUMethod slot_3 = {"RequestMessage", 0, 0 };
+ static const QMetaData slot_tbl[] = {
+ { "vscrolled(int)", &slot_0, QMetaData::Public },
+ { "hscrolled(int)", &slot_1, QMetaData::Public },
+ { "CloseMe()", &slot_2, QMetaData::Public },
+ { "RequestMessage()", &slot_3, QMetaData::Public }
+ };
+ metaObj = QMetaObject::new_metaobject(
+ "VGR", parentObject,
+ slot_tbl, 4,
+ 0, 0,
+#ifndef QT_NO_PROPERTIES
+ 0, 0,
+ 0, 0,
+#endif // QT_NO_PROPERTIES
+ 0, 0 );
+ cleanUp_VGR.setMetaObject( metaObj );
+ return metaObj;
+}
+
+void* VGR::qt_cast( const char* clname )
+{
+ if ( !qstrcmp( clname, "VGR" ) )
+ return this;
+ return QFrame::qt_cast( clname );
+}
+
+bool VGR::qt_invoke( int _id, QUObject* _o )
+{
+ switch ( _id - staticMetaObject()->slotOffset() ) {
+ case 0: vscrolled((int)static_QUType_int.get(_o+1)); break;
+ case 1: hscrolled((int)static_QUType_int.get(_o+1)); break;
+ case 2: CloseMe(); break;
+ case 3: RequestMessage(); break;
+ default:
+ return QFrame::qt_invoke( _id, _o );
+ }
+ return TRUE;
+}
+
+bool VGR::qt_emit( int _id, QUObject* _o )
+{
+ return QFrame::qt_emit(_id,_o);
+}
+#ifndef QT_NO_PROPERTIES
+
+bool VGR::qt_property( int id, int f, QVariant* v)
+{
+ return QFrame::qt_property( id, f, v);
+}
+
+bool VGR::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+#endif // QT_NO_PROPERTIES
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
int mark;
} paddr;
-struct ctrl_msg
+typedef struct
{
paddr sender; /* address of the sender and */
paddr receiver; /* receiver of the message */
int type; /* message type */
int par; /* prototype or error signal number */
-};
+} ctrl_msg;
typedef struct
{
- struct ctrl_msg control;
- char params[ 256-sizeof(struct ctrl_msg) ];
+ ctrl_msg control;
+ char params[ 256-sizeof(ctrl_msg) ];
} messg;
### Includes for QT library
-QINC=/usr/lib/qt-1.45/include
+QINC=/usr/include/qt3
### QT library directory
-QLIB=/usr/lib/qt-1.45/lib
+QLIB=/usr/lib3/
### moc compiler directory
-MOCDIR=/usr/lib/qt-1.45/bin
+MOCDIR=/usr/bin
### Install directory
-INSTALLDIR=/usr/local/vlp
+INSTALLDIR=/home/andrzej/vlp3binD
+
+### QT Library linking phrase
+QLINK=-lqt-mt
INCDIR = $(QINC)
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
pp->insertItem("User Guide",this,SLOT(user_guide()));
pp->insertItem("Language reference",this,SLOT(lang_guide()));
pp->setFont(f);
- pp->setStyle(WindowsStyle);
+ //pp->setStyle(WindowsStyle);
bar->insertItem("File",this,SLOT(load()));
bar->insertItem("Contents",pp);
bar->insertItem("Quit",app,SLOT(quit()));
if ( !s.isNull())
{
vscroll->setValue(0);
- analyzer->LoadFile(s.data());
+ analyzer->LoadFile((char*)s.ascii());
analyzer->PackLinks();
DrawList();
}
if (poms.data()[0]=='#')
{
poms=poms.right(poms.length()-1);
- pom1=analyzer->FindAnchor(poms.data());
+ pom1=analyzer->FindAnchor((char*)poms.ascii());
if (pom1!=NULL)
{
vscroll->setValue(pom1->y);
app = new QApplication(argc,argv);
if (argc==2) ps.sprintf(argv[1]);
else ps.sprintf(".");
- QHTML cfg(ps.data());
- app->setStyle(WindowsStyle);
+ QHTML cfg((char*)ps.ascii());
+ //app->setStyle(WindowsStyle);
app->setMainWidget(&cfg);
cfg.show();
return app->exec();
--- /dev/null
+/****************************************************************************
+** QHTML meta object code from reading C++ file 'help.cpp'
+**
+** Created: Fri Mar 4 12:26:20 2011
+** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+#include <private/qucomextra_p.h>
+#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
+#error "This file was generated using the moc from 3.3.8b. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+const char *QHTML::className() const
+{
+ return "QHTML";
+}
+
+QMetaObject *QHTML::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_QHTML( "QHTML", &QHTML::staticMetaObject );
+
+#ifndef QT_NO_TRANSLATION
+QString QHTML::tr( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "QHTML", s, c, QApplication::DefaultCodec );
+ else
+ return QString::fromLatin1( s );
+}
+#ifndef QT_NO_TRANSLATION_UTF8
+QString QHTML::trUtf8( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "QHTML", s, c, QApplication::UnicodeUTF8 );
+ else
+ return QString::fromUtf8( s );
+}
+#endif // QT_NO_TRANSLATION_UTF8
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* QHTML::staticMetaObject()
+{
+ if ( metaObj )
+ return metaObj;
+ QMetaObject* parentObject = QFrame::staticMetaObject();
+ static const QUMethod slot_0 = {"load", 0, 0 };
+ static const QUMethod slot_1 = {"back", 0, 0 };
+ static const QUParameter param_slot_2[] = {
+ { 0, &static_QUType_int, 0, QUParameter::In }
+ };
+ static const QUMethod slot_2 = {"vscrolled", 1, param_slot_2 };
+ static const QUMethod slot_3 = {"contents", 0, 0 };
+ static const QUMethod slot_4 = {"user_guide", 0, 0 };
+ static const QUMethod slot_5 = {"lang_guide", 0, 0 };
+ static const QMetaData slot_tbl[] = {
+ { "load()", &slot_0, QMetaData::Public },
+ { "back()", &slot_1, QMetaData::Public },
+ { "vscrolled(int)", &slot_2, QMetaData::Public },
+ { "contents()", &slot_3, QMetaData::Public },
+ { "user_guide()", &slot_4, QMetaData::Public },
+ { "lang_guide()", &slot_5, QMetaData::Public }
+ };
+ metaObj = QMetaObject::new_metaobject(
+ "QHTML", parentObject,
+ slot_tbl, 6,
+ 0, 0,
+#ifndef QT_NO_PROPERTIES
+ 0, 0,
+ 0, 0,
+#endif // QT_NO_PROPERTIES
+ 0, 0 );
+ cleanUp_QHTML.setMetaObject( metaObj );
+ return metaObj;
+}
+
+void* QHTML::qt_cast( const char* clname )
+{
+ if ( !qstrcmp( clname, "QHTML" ) )
+ return this;
+ return QFrame::qt_cast( clname );
+}
+
+bool QHTML::qt_invoke( int _id, QUObject* _o )
+{
+ switch ( _id - staticMetaObject()->slotOffset() ) {
+ case 0: load(); break;
+ case 1: back(); break;
+ case 2: vscrolled((int)static_QUType_int.get(_o+1)); break;
+ case 3: contents(); break;
+ case 4: user_guide(); break;
+ case 5: lang_guide(); break;
+ default:
+ return QFrame::qt_invoke( _id, _o );
+ }
+ return TRUE;
+}
+
+bool QHTML::qt_emit( int _id, QUObject* _o )
+{
+ return QFrame::qt_emit(_id,_o);
+}
+#ifndef QT_NO_PROPERTIES
+
+bool QHTML::qt_property( int id, int f, QVariant* v)
+{
+ return QFrame::qt_property( id, f, v);
+}
+
+bool QHTML::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+#endif // QT_NO_PROPERTIES
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
+### Includes for QT library
+QINC=/usr/include/qt3
+
+### QT library directory
+QLIB=/usr/lib3/
+
+### moc compiler directory
+MOCDIR=/usr/bin
+
+### Install directory
+INSTALLDIR=/home/andrzej/vlp3binD
+
+### QT Library linking phrase
+QLINK=-lqt-mt
SHELL=/bin/bash
#.SUFFIXES: .o .c
#
-UNIXPARS=-DUNIX -DWORD_32BIT -DUSE_ALARM -Dpascal=
+UNIXPARS=-DUNIX -DWORD_32BIT -DUSE_CLOCK -Dpascal=
UNIXPARSNG=$(UNIXPARS)
#CC=cc $(UNIXPARSNG) -DNO_PROTOTYPES # SUN,HP
#CC=cc -W1 $(UNIXPARSNG) # SCO
#CC=cc -W1 $(UNIXPARSNG) -DOBJECTADDR # SCO
#CC=cc -W1 $(UNIXPARSNG) -DOBJECTADDR -DTCPIP # SCO TCPIP
-CC=gcc $(UNIXPARSNG) -DOBJECTADDR -DSYSV # GNU C++ TCPIP
+CC=gcc $(UNIXPARSNG) -DOBJECTADDR -DSYSV -I$(QINC) # GNU C++ TCPIP
#CC=cc -W1 $(UNIXPARS) -DSYSV -DXSIGHT # SCO with X11 graphics
#CC=gcc -g $(UNIXPARS) -DSYSV -DXSIGHT # SCO GCC with X11 graphics
#############################################################################
#ADDOPT = -lsocket # sun
-ADDOPT = # Linux
+ADDOPT = $(QLINK) # Linux
OBJ= cint.o compact.o control.o util.o handler.o intdt.o \
#include <arpa/inet.h>
#include <errno.h>
#include <netdb.h>
-
+#include <qthread.h>
#ifndef NO_PROTOTYPES
static void load(char *);
#endif
+
int internal_sock,graph_sock,net_sock,connected=0;
struct sockaddr_un svr;
int GraphRes=-1;
}
/* send message to net */
-void send_to_net(MESSAGE *msg)
+/* 2010 returns 1 if ok and 0 if node desn't exists */
+int send_to_net(MESSAGE *msg)
{
int k,len;
MESSAGE m;
struct sockaddr_in svr;
+ char addr[256];
-
+
k = msg->int_msg.control.receiver.node;
+
+ /* 2010 check if node exists */
+ m.msg_type = MSG_NET;
+ m.param.pword[0] = NET_NODE_EXIST;
+ m.param.pword[1] = k;
+ m.param.pword[2] = my_ctx.program_id;
+ write(net_sock,&m,sizeof(MESSAGE));
+ bzero(&m,sizeof(MESSAGE));
+ while( (m.msg_type!=MSG_NET) && (m.param.pword[0]!=NET_NODE_EXIST) )
+ read(net_sock,&m,sizeof(MESSAGE));
+ if (m.param.pword[1]!=1) return 0;
+ strcpy(addr,m.param.pstr);
+
if (RInstance[k]==-1)
{
bzero(&m,sizeof(MESSAGE));
m.param.pword[2] = k;
send_to_kernel(&m);
bzero(&m,sizeof(MESSAGE));
+
while(1)
{
read(internal_sock,&m,sizeof(MESSAGE));
if ( (m.msg_type == MSG_VLP) && (m.param.pword[0]==VLP_REMOTE_INSTANCE_HERE)) break;
}
-
+
+ /*printf("DEBUG: remote instance made with id: %d addr %s port %d\n",m.param.pword[1],addr, htons(m.param.pword[8]));*/
RInstance[k] = m.param.pword[1];
/* Make direct connection */
DirConn[k] = socket(AF_INET,SOCK_STREAM,0);
svr.sin_family = AF_INET;
- svr.sin_addr.s_addr = inet_addr(m.param.pstr);
+ svr.sin_addr.s_addr = inet_addr(addr);
svr.sin_port = htons(m.param.pword[8]);
len = connect(DirConn[k],(struct sockaddr*)&svr,sizeof(svr));
if (len!=0)
{
RInstance[k]=-1;
+
writeln_str("Cannot connect remote instance!");
}
else
{
fcntl(DirConn[k], F_SETFL,O_NONBLOCK | fcntl(DirConn[k], F_GETFL,0));
-
- }
+ }
}
-if (RInstance[k]!=-1)
-{
- write(DirConn[k],&(msg->int_msg),sizeof(message));
-}
+ if (RInstance[k]!=-1)
+ {
+
+ write(DirConn[k],&(msg->int_msg),sizeof(message));
+ }
+ return 1;
}
int r,max,i;
char s[80];
- fd_set rset,wset;
+ fd_set rset;
struct timeval tout={0,0};
-
- /* ----------- Direct connection messages -----*/
+
+ /* 2010 */
+ /* ----------- Direct connection messages -----
FD_ZERO(&DirSet);
maxDirSet=0;
for(i=0;i<255;i++)
}
}
}
- /*-----------------------------------------*/
+ -----------------------------------------*/
- FD_ZERO(&rset);FD_ZERO(&wset);
+ FD_ZERO(&rset);
FD_SET(net_sock,&rset);
- FD_SET(internal_sock,&rset);
-
+ FD_SET(internal_sock,&rset);
if (net_sock>internal_sock) max = net_sock; else max = internal_sock;
+ /* 2010 */
+ for(i=0;i<255;i++) {
+ if (DirConn[i]!=-1)
+ {
+ FD_SET(DirConn[i],&rset);
+ if (max<DirConn[i]) max=DirConn[i];
+ }
+ } /* for */
- if (select(max+1,&rset,&wset,0,(struct timeval *)&tout)>0)
+ if (select(max+1,&rset,0,0,(struct timeval *)&tout)>0)
{
+ /* 2010 */
+ for(i=0;i<255;i++)
+ {
+ if ( (DirConn[i]!=-1) && (FD_ISSET(DirConn[i],&rset)) )
+ {
+ /*printf("DEBUG: Interp has message on direct connection: type %d par %d\n",mx.control.type,mx.control.par); */
+ r=read(DirConn[i],&mx,sizeof(mx));
+ if (r>0 && r==sizeof(mx))
+ {
+ memcpy(globmsgqueue+msgtail,&mx,sizeof(message));
+ msgtail = (msgtail+1) % MAXMSGQUEUE;
+ msgready++;
+ }
+ }
+ }
+
+
+
+
if (FD_ISSET(net_sock,&rset))
{
r = read(net_sock, &m, sizeof(MESSAGE));
switch(m.param.pword[0])
{
case NET_PROPAGATE:
+ /*printf("DEBUG: cint net_sock MSG_NET NET_PROPAGATE cmd %d\n",m.param.pword[6]);*/
memcpy(globmsgqueue+msgtail,&m.int_msg,sizeof(message));
msgtail = (msgtail+1) % MAXMSGQUEUE;
msgready++;
case MSG_NET:
if (m.param.pword[0] == NET_PROPAGATE)
{
+ /*printf("DEBUG: cint internal_sock MSG_NET NET_PROPAGATE cmd %d\n",m.param.pword[6]);*/
memcpy(globmsgqueue+msgtail,&m.int_msg,sizeof(message));
msgtail = (msgtail+1) % MAXMSGQUEUE;
msgready++;
}
} /* FD_ISSET */
} /* select */
+
}
bzero(&svr,sizeof(svr));
DirConn[parent_ctx.node] = accept(sock,(struct sockaddr*)&svr,&len);
- fcntl(DirConn[parent_ctx.node], F_SETFL,O_NONBLOCK |
- fcntl(DirConn[parent_ctx.node], F_GETFL,0));
+ fcntl(DirConn[parent_ctx.node], F_SETFL,O_NONBLOCK | fcntl(DirConn[parent_ctx.node], F_GETFL,0));
}
int main(argc, argv)
setjmp(contenv); /* set label for continue long jump */
while (TRUE) /* repeat until exit() is called */
{
- get_internal();
+ get_internal();
schedule(); /* reschedule current process */
- if (ready != 0)
- {
+ if (ready != 0)
+ {
decode(); /* fetch instruction */
execute(); /* and execute it */
- }
+ }
}
return 0;
--- /dev/null
+SHELL=/bin/bash
+#.SUFFIXES: .o .c
+
+#############################################################################
+# switches :
+# OBJECTADDR - switch on special process addressing - object simulates
+# process pointer
+# CDBG - turn on debugging of compactifier, compactifier appends to file
+# 'trace' state of memory before & after the compactification,
+# also a history of compactification & process number is dumped
+# RPCDBG - debugging of alien call, all actions : alien call, acknowledges,
+# passivations and returns are written to stderr
+# NO_GRAPH - nonstand.c defines only INKEY grom IIUWGRAPH
+# DLINK - DLINK network version
+# TCPIP - TCPIP network version - needs also OBJECTADDR
+#
+# switches depending on environment :
+# TURBOC - if using BORLAND TURBO-C compiler
+# MSDOS/OS2/UNIX - choose operating system
+# USE_CLOCK - scheduler should use clock() function to measure time
+# USE_ALARM - scheduler should use alarm() function to measure time
+# WORD_16BIT/DWORD_16BIT/WORD_32BIT - choose memory model :
+# small 16-bit / large 16-bit / small 32-bit
+#
+
+
+UNIXPARS=-DUNIX -DWORD_32BIT -DUSE_CLOCK -Dpascal=
+UNIXPARSNG=$(UNIXPARS)
+
+#CC=cc $(UNIXPARSNG) -DNO_PROTOTYPES # SUN,HP
+#CC=rcc $(UNIXPARSNG) -O # SCO - AT&T C compiler
+#CC=cc -W1 $(UNIXPARSNG) # SCO
+#CC=cc -W1 $(UNIXPARSNG) -DOBJECTADDR # SCO
+#CC=cc -W1 $(UNIXPARSNG) -DOBJECTADDR -DTCPIP # SCO TCPIP
+CC=gcc $(UNIXPARSNG) -DOBJECTADDR -DSYSV -I$(QINC) # GNU C++ TCPIP
+#CC=cc -W1 $(UNIXPARS) -DSYSV -DXSIGHT # SCO with X11 graphics
+#CC=gcc -g $(UNIXPARS) -DSYSV -DXSIGHT # SCO GCC with X11 graphics
+
+CCc=$(CC) # common version
+#CCc=$(CC) -Fo$*.o # MSDOS MSC version
+
+target : int
+
+#############################################################################
+#ADDOPT = -lsocket # sun
+ADDOPT = $(QLINK) # Linux
+
+
+OBJ= cint.o compact.o control.o util.o handler.o intdt.o \
+ memory.o object.o runsys.o standard.o \
+ execute.o fileio.o nonstand.o process.o procaddr.o queue.o \
+ rpcall.o typchk.o
+
+.c.o :
+ $(CCc) -c $*.c
+.s.o:
+ as -o $*.o $*.s
+
+
+int: $(OBJ)
+# $(CC) $(OBJ) inkeyux.o -lm -lX11 -lmalloc -lsocket -ggdb -o int
+ $(CC) $(OBJ) -lm $(ADDOPT) -o logint
+# strip logint
+# mv int $(HOME)/LOGLAN.PAU/bin
+
+nonstand.o : nonstand.c
+
+clean :
+ rm -f *.o *.bak logint
message *msg;
{
MESSAGE m;
+ int result=1;
msg->control.sender.node = ournode;
msg->control.sender.pix = thispix;
m.param.pword[2] = my_ctx.node;
m.param.pword[3] = my_ctx.program_id;
memcpy(&m.int_msg,msg,sizeof(message));
- send_to_net(&m);
-
+ result = send_to_net(&m);
+ if (result == 0) {
+ /* 2010 local allocation */
+ msg->control.receiver.node == ournode;
+ msginterrupt(msg); /* call directly interrupt handler */
+ }
}
}
### Includes for QT library
-QINC=/usr/lib/qt-1.45/include
+QINC=/usr/include/qt3
### QT library directory
-QLIB=/usr/lib/qt-1.45/lib
+QLIB=/usr/lib3/
### moc compiler directory
-MOCDIR=/usr/lib/qt-1.45/bin
+MOCDIR=/usr/bin
### Install directory
-INSTALLDIR=/usr/local/vlp
+INSTALLDIR=/home/andrzej/vlp3binD
+
+### QT Library linking phrase
+QLINK=-lqt-mt
INCDIR = $(QINC)
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
#include <qpixmap.h>
-#include <qwindow.h>
+//#include <qwindow.h>
#include <qapp.h>
#include <qframe.h>
#include <qmlined.h>
#include <qcombo.h>
#include <qsocknot.h>
#include <qdir.h>
+#include <qwindowsstyle.h>
#include <stdio.h>
#include <stdlib.h>
void Connect();
void Info();
-
+protected:
+ virtual void closeEvent ( QCloseEvent * e );
private:
QList<InterpEntry> Interpreters;
};
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+void QKernel::closeEvent ( QCloseEvent * e ) {
+ e->ignore();
+}
+
QKernel::QKernel()
{
- QFont f("Helvetica",12,QFont::Bold);
- QFont f1("Helvetica",12,QFont::Normal);
- QFont f2("Times Roman",12,QFont::Normal);
+ QFont f("Helvetica",10,QFont::Bold);
+ QFont f1("Helvetica",10,QFont::Normal);
+ QFont f2("Times Roman",10,QFont::Normal);
QDir q(REMOTE_PATH);
char ss[255];
void QKernel::n_impl()
{
- QMessageBox::information(this,"Function info","This function is not implemented
- yet...","Ok");
+ QMessageBox::information(this,"Function info","This function is not implemented yet...","Ok");
}
void QKernel::LoadConfig()
{
- QFile f("vlp.cfg");
- char line[256],val[255];
+QFile f("vlp.cfg");
+ QString line;
+ QString val;
+ int br=0;
if (!f.exists())
{
WriteMessage("Cannot load configuration file!");sleep(2);exit(3);
}
f.open(IO_ReadOnly);
- f.readLine(line,256);
- while (!f.atEnd())
+ br = f.readLine(line,256);
+ while (br>0)
{
- if (line[strlen(line)-1]=='\n') line[strlen(line)-1]='\0';
- strcpy(line,strtok(line,"="));
- strcpy(val, strtok(NULL,"="));
- if (strcmp(line,"node_number")==0) {NodeNumber = atoi(val);};
- if (strcmp(line,"type")==0) {if (strcmp(val,"explicit")==0) ConType=1; else
+ QStringList l = QStringList::split("=",line,FALSE);
+ QStringList::Iterator it = l.begin();
+ line = *it;
+ ++it;
+ val = *it;
+ val = val.stripWhiteSpace();
+ if (line == "node_number") {NodeNumber = val.toInt();};
+ if (line == "type") {if (val=="explicit") ConType=1; else
ConType = 2; };
- if (strcmp(line,"host")==0) {ConnectList.append(new ConnectEntry(val));};
- if (strcmp(line,"progdir")==0) {strcpy(progdir,val);};
- if (strcmp(line,"homedir")==0) {strcpy(HomeDir,val);};
- f.readLine(line,256);
+ if (line == "host" ) {ConnectList.append(new ConnectEntry((char*)val.ascii()));};
+ if (line == "progdir") { strcpy(progdir,val.ascii());};
+ if (line == "homedir") { strcpy(HomeDir,val.ascii());};
+ br = f.readLine(line,256);
}
f.close();
}
{
i = s.find(".log");
if (i>0) s.remove(i,4);
- RunIntModule(s.data(),0);
+ RunIntModule((char*)s.ascii(),0);
}
}
{
MESSAGE msg;
+if ( QMessageBox::question(this,"Close VLP","Terminate VLP ?",QMessageBox::Yes,QMessageBox::No,0) == QMessageBox::No ) return;
if (!LOCKED)
{
/*
{
QMessageBox msg(this);
msg.setText("Not matching!");
- msg.setButtonText("Close");
+ msg.setButtonText(0,"Close");
msg.show();
}
{
QMessageBox msg(this);
msg.setText("Wrong password!");
- msg.setButtonText("Close");
+ msg.setButtonText(0,"Close");
msg.show();
}
for(i=1;i<argc;i++) strcpy(myargs[i-1],argv[i]);
app = new QApplication(argc,argv);
- app->setStyle(WindowsStyle);
+ app->setStyle(new QWindowsStyle());
QKernel draw;
app->setMainWidget( &draw);
draw.show();
--- /dev/null
+/****************************************************************************
+** QKernel meta object code from reading C++ file 'kernel.cpp'
+**
+** Created: Fri Mar 4 12:26:12 2011
+** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+#include <private/qucomextra_p.h>
+#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
+#error "This file was generated using the moc from 3.3.8b. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+const char *QKernel::className() const
+{
+ return "QKernel";
+}
+
+QMetaObject *QKernel::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_QKernel( "QKernel", &QKernel::staticMetaObject );
+
+#ifndef QT_NO_TRANSLATION
+QString QKernel::tr( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "QKernel", s, c, QApplication::DefaultCodec );
+ else
+ return QString::fromLatin1( s );
+}
+#ifndef QT_NO_TRANSLATION_UTF8
+QString QKernel::trUtf8( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "QKernel", s, c, QApplication::UnicodeUTF8 );
+ else
+ return QString::fromUtf8( s );
+}
+#endif // QT_NO_TRANSLATION_UTF8
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* QKernel::staticMetaObject()
+{
+ if ( metaObj )
+ return metaObj;
+ QMetaObject* parentObject = QFrame::staticMetaObject();
+ static const QUMethod slot_0 = {"n_impl", 0, 0 };
+ static const QUMethod slot_1 = {"Run_Prog", 0, 0 };
+ static const QUMethod slot_2 = {"Edit", 0, 0 };
+ static const QUMethod slot_3 = {"Help", 0, 0 };
+ static const QUMethod slot_4 = {"SetOptions", 0, 0 };
+ static const QUMethod slot_5 = {"AddAddress", 0, 0 };
+ static const QUMethod slot_6 = {"DelAddress", 0, 0 };
+ static const QUMethod slot_7 = {"LockConsole", 0, 0 };
+ static const QUMethod slot_8 = {"UnlockConsole", 0, 0 };
+ static const QUMethod slot_9 = {"MessageToNode", 0, 0 };
+ static const QUMethod slot_10 = {"QuitProc", 0, 0 };
+ static const QUMethod slot_11 = {"NetMessage", 0, 0 };
+ static const QUParameter param_slot_12[] = {
+ { 0, &static_QUType_int, 0, QUParameter::In }
+ };
+ static const QUMethod slot_12 = {"IntMessage", 1, param_slot_12 };
+ static const QUMethod slot_13 = {"KillInterpreter", 0, 0 };
+ static const QUMethod slot_14 = {"Disconnect", 0, 0 };
+ static const QUMethod slot_15 = {"SetMessages", 0, 0 };
+ static const QUMethod slot_16 = {"Connect", 0, 0 };
+ static const QUMethod slot_17 = {"Info", 0, 0 };
+ static const QMetaData slot_tbl[] = {
+ { "n_impl()", &slot_0, QMetaData::Public },
+ { "Run_Prog()", &slot_1, QMetaData::Public },
+ { "Edit()", &slot_2, QMetaData::Public },
+ { "Help()", &slot_3, QMetaData::Public },
+ { "SetOptions()", &slot_4, QMetaData::Public },
+ { "AddAddress()", &slot_5, QMetaData::Public },
+ { "DelAddress()", &slot_6, QMetaData::Public },
+ { "LockConsole()", &slot_7, QMetaData::Public },
+ { "UnlockConsole()", &slot_8, QMetaData::Public },
+ { "MessageToNode()", &slot_9, QMetaData::Public },
+ { "QuitProc()", &slot_10, QMetaData::Public },
+ { "NetMessage()", &slot_11, QMetaData::Public },
+ { "IntMessage(int)", &slot_12, QMetaData::Public },
+ { "KillInterpreter()", &slot_13, QMetaData::Public },
+ { "Disconnect()", &slot_14, QMetaData::Public },
+ { "SetMessages()", &slot_15, QMetaData::Public },
+ { "Connect()", &slot_16, QMetaData::Public },
+ { "Info()", &slot_17, QMetaData::Public }
+ };
+ metaObj = QMetaObject::new_metaobject(
+ "QKernel", parentObject,
+ slot_tbl, 18,
+ 0, 0,
+#ifndef QT_NO_PROPERTIES
+ 0, 0,
+ 0, 0,
+#endif // QT_NO_PROPERTIES
+ 0, 0 );
+ cleanUp_QKernel.setMetaObject( metaObj );
+ return metaObj;
+}
+
+void* QKernel::qt_cast( const char* clname )
+{
+ if ( !qstrcmp( clname, "QKernel" ) )
+ return this;
+ return QFrame::qt_cast( clname );
+}
+
+bool QKernel::qt_invoke( int _id, QUObject* _o )
+{
+ switch ( _id - staticMetaObject()->slotOffset() ) {
+ case 0: n_impl(); break;
+ case 1: Run_Prog(); break;
+ case 2: Edit(); break;
+ case 3: Help(); break;
+ case 4: SetOptions(); break;
+ case 5: AddAddress(); break;
+ case 6: DelAddress(); break;
+ case 7: LockConsole(); break;
+ case 8: UnlockConsole(); break;
+ case 9: MessageToNode(); break;
+ case 10: QuitProc(); break;
+ case 11: NetMessage(); break;
+ case 12: IntMessage((int)static_QUType_int.get(_o+1)); break;
+ case 13: KillInterpreter(); break;
+ case 14: Disconnect(); break;
+ case 15: SetMessages(); break;
+ case 16: Connect(); break;
+ case 17: Info(); break;
+ default:
+ return QFrame::qt_invoke( _id, _o );
+ }
+ return TRUE;
+}
+
+bool QKernel::qt_emit( int _id, QUObject* _o )
+{
+ return QFrame::qt_emit(_id,_o);
+}
+#ifndef QT_NO_PROPERTIES
+
+bool QKernel::qt_property( int id, int f, QVariant* v)
+{
+ return QFrame::qt_property( id, f, v);
+}
+
+bool QKernel::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+#endif // QT_NO_PROPERTIES
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
### Includes for QT library
-QINC=/usr/lib/qt-1.45/include
+QINC=/usr/include/qt3
### QT library directory
-QLIB=/usr/lib/qt-1.45/lib
+QLIB=/usr/lib3/
### moc compiler directory
-MOCDIR=/usr/lib/qt-1.45/bin
+MOCDIR=/usr/bin
### Install directory
-INSTALLDIR=/usr/local/vlp
+INSTALLDIR=/home/andrzej/vlp3binD
+
+### QT Library linking phrase
+QLINK=-lqt-mt
##### Change INCDIR, LFLAGS and MOC
INCDIR = $(QINC)
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
int i,j;
char pomstr[255],line[255];
- dlg.setStyle(WindowsStyle);
+ //dlg.setStyle(WindowsStyle);
nodelist = new QListBox( &dlg, "ListBox_1" );
nodelist->setGeometry( 20, 40, 480, 160 );
app = new QApplication(argc,argv);
QInstall cfg;
- app->setStyle(WindowsStyle);
+ //app->setStyle(WindowsStyle);
app->setMainWidget(&cfg);
cfg.show();
return app->exec();
--- /dev/null
+/****************************************************************************
+** QInstall meta object code from reading C++ file 'lgconfig.cpp'
+**
+** Created: Fri Mar 4 12:26:18 2011
+** by: The Qt MOC ($Id: qt/moc_yacc.cpp 3.3.8 edited Feb 2 14:59 $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+#include <private/qucomextra_p.h>
+#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
+#error "This file was generated using the moc from 3.3.8b. It"
+#error "cannot be used with the include files from this version of Qt."
+#error "(The moc has changed too much.)"
+#endif
+
+const char *QInstall::className() const
+{
+ return "QInstall";
+}
+
+QMetaObject *QInstall::metaObj = 0;
+static QMetaObjectCleanUp cleanUp_QInstall( "QInstall", &QInstall::staticMetaObject );
+
+#ifndef QT_NO_TRANSLATION
+QString QInstall::tr( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "QInstall", s, c, QApplication::DefaultCodec );
+ else
+ return QString::fromLatin1( s );
+}
+#ifndef QT_NO_TRANSLATION_UTF8
+QString QInstall::trUtf8( const char *s, const char *c )
+{
+ if ( qApp )
+ return qApp->translate( "QInstall", s, c, QApplication::UnicodeUTF8 );
+ else
+ return QString::fromUtf8( s );
+}
+#endif // QT_NO_TRANSLATION_UTF8
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* QInstall::staticMetaObject()
+{
+ if ( metaObj )
+ return metaObj;
+ QMetaObject* parentObject = QFrame::staticMetaObject();
+ static const QUMethod slot_0 = {"SetOptions", 0, 0 };
+ static const QUMethod slot_1 = {"AddNode", 0, 0 };
+ static const QUMethod slot_2 = {"DelNode", 0, 0 };
+ static const QUMethod slot_3 = {"Info", 0, 0 };
+ static const QMetaData slot_tbl[] = {
+ { "SetOptions()", &slot_0, QMetaData::Public },
+ { "AddNode()", &slot_1, QMetaData::Public },
+ { "DelNode()", &slot_2, QMetaData::Public },
+ { "Info()", &slot_3, QMetaData::Public }
+ };
+ metaObj = QMetaObject::new_metaobject(
+ "QInstall", parentObject,
+ slot_tbl, 4,
+ 0, 0,
+#ifndef QT_NO_PROPERTIES
+ 0, 0,
+ 0, 0,
+#endif // QT_NO_PROPERTIES
+ 0, 0 );
+ cleanUp_QInstall.setMetaObject( metaObj );
+ return metaObj;
+}
+
+void* QInstall::qt_cast( const char* clname )
+{
+ if ( !qstrcmp( clname, "QInstall" ) )
+ return this;
+ return QFrame::qt_cast( clname );
+}
+
+bool QInstall::qt_invoke( int _id, QUObject* _o )
+{
+ switch ( _id - staticMetaObject()->slotOffset() ) {
+ case 0: SetOptions(); break;
+ case 1: AddNode(); break;
+ case 2: DelNode(); break;
+ case 3: Info(); break;
+ default:
+ return QFrame::qt_invoke( _id, _o );
+ }
+ return TRUE;
+}
+
+bool QInstall::qt_emit( int _id, QUObject* _o )
+{
+ return QFrame::qt_emit(_id,_o);
+}
+#ifndef QT_NO_PROPERTIES
+
+bool QInstall::qt_property( int id, int f, QVariant* v)
+{
+ return QFrame::qt_property( id, f, v);
+}
+
+bool QInstall::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
+#endif // QT_NO_PROPERTIES
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
### Includes for QT library
-QINC=/usr/lib/qt-1.45/include
+QINC=/usr/include/qt3
### QT library directory
-QLIB=/usr/lib/qt-1.45/lib
+QLIB=/usr/lib3/
### moc compiler directory
-MOCDIR=/usr/lib/qt-1.45/bin
+MOCDIR=/usr/bin
### Install directory
-INSTALLDIR=/usr/local/vlp
+INSTALLDIR=/home/andrzej/vlp3binD
+
+### QT Library linking phrase
+QLINK=-lqt-mt
INCDIR = $(QINC)
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
#include <sys/stat.h>
#include <string.h>
#include <qlist.h>
+#include <qfile.h>
+#include <qstring.h>
+#include <qstringlist.h>
#include <unistd.h>
#define REMOTE_PATH "REMOTE"
void check_links();
void get_message(NETlink*);
void conn_info(int);
+
+ void doitall(); // 2010
};
void NETMOD::load_config(char *fname)
{
- FILE *f;
- char line1[80],*line2;
- int k=0,on;
+ QFile f(fname);
+ QString line;
+ QString val;
+ int br=0,on,k=0;
NETlink *pomlink;
- f = fopen(fname,"r");
- if (f!=NULL)
+ if (!f.exists())
{
- while (!feof(f))
-{
- fscanf(f,"%s\n",line1);
- line2 = strtok(line1,"=");
- if (line2==NULL) { write_at_console("Bad config file\n");exit(1);}
-
- if (strcmp(line2,"node_number")==0)
- {
- line2 = strtok(NULL,"=");
- MyNode = atoi(line2);
- }
- else
- if (strcmp(line2,"host")==0)
- {
- line2 = strtok(NULL,"=");if (line2==NULL) {exit(1);}
- k++;
+ write_at_console("Cannot load configuration file!");sleep(2);exit(3);
+ }
+ f.open(IO_ReadOnly);
+ br = f.readLine(line,256);
+ while (br>0)
+ {
+ QStringList l = QStringList::split("=",line,FALSE);
+ QStringList::Iterator it = l.begin();
+ line = *it;
+ ++it;
+ val = *it;
+ val = val.stripWhiteSpace();
+ if (line == "node_number") {MyNode = val.toInt();};
+ if (line == "host" ) {
+ k++;
pomlink = new NETlink;
- strcpy(pomlink->addr,line2);
+ strcpy(pomlink->addr,val.ascii());
pomlink->connected = FALSE;
pomlink->sock = socket(AF_INET, SOCK_STREAM, 0);
- fcntl(pomlink->sock, F_SETFL,O_NONBLOCK | fcntl(pomlink->sock,
- F_GETFL,0));
+ fcntl(pomlink->sock, F_SETFL,O_NONBLOCK | fcntl(pomlink->sock,F_GETFL,0));
on=1;
setsockopt(pomlink->sock,IPPROTO_TCP,TCP_NODELAY,(char*)&on,sizeof(on));
Links.append(pomlink);
- to_connect++;
-
- }
- else
- if (strcmp(line2,"type")==0)
- {
- }
-
- } /* feof */
-
- fclose(f);
- if (k==0) all_connected=TRUE;
+ to_connect++;
+ };
+ br = f.readLine(line,256);
}
- if (MyNode==-1) {write_at_console("Node number must be specified");exit(1);};
+ f.close();
+ if (k==0) all_connected=TRUE;
+ if (MyNode==-1) {write_at_console("Node number must be specified");exit(1);};
}
{
if ( pomlink->node_number==n )
{
- m.param.pword[1] = 1;break;
+ m.param.pword[1] = 1;
+ strcpy(m.param.pstr,pomlink->addr);
+ break;
}
pomlink = Links.next();
}
switch(msg.param.pword[0])
{
case NET_CCD_START:
+
lnk->code_transmit = TRUE;
sprintf(pomstr,"%s/%s",REMOTE_PATH,msg.param.pstr);
strcat(pomstr,".ccd");
close(psock);
fclose(lnk->CodeFile);
}
+
break;
case NET_PCD_START:
+
lnk->code_transmit = TRUE;
sprintf(pomstr,"%s/%s",REMOTE_PATH,msg.param.pstr);
strcat(pomstr,".pcd");
close(psock);
fclose(lnk->CodeFile);
}
+
break;
case NET_CONNECT:
+
sprintf(pomstr,"Node: %d Addr: %s",msg.param.pword[1],
lnk->addr);
lnk->node_number = msg.param.pword[1];
send_accept_info(lnk);
break;
case NET_ACCEPT:
+
sprintf(pomstr,"Node: %d Addr: %s",msg.param.pword[1],
lnk->addr);
lnk->node_number = msg.param.pword[1];
write_at_console(pomstr);
break;
case NET_DISCONNECT:
+
sprintf(pomstr,"Node: %d disconnected",msg.param.pword[1]);
write_at_console(pomstr);
::close(lnk->sock);
delete(lnk);
break;
case NET_PROPAGATE:
+
if (msg.param.pword[1] == MSG_VLP) send_to_kernel(&msg);
else if (msg.param.pword[1] == MSG_INT) send_to_int(&msg);
break;
}
+
+/****************************** 2010 ********************************************/
+void NETMOD::doitall() {
+ unsigned int sz;
+ int nsock,max=0,on, nr, si, sj;
+ struct sockaddr_in svr;
+ fd_set rset;
+ NETlink *pomlink;
+ INTlink *pomlink2;
+ struct sockaddr_un svr2;
+ MESSAGE msg;
+
+
+ FD_ZERO(&rset);
+ FD_SET(listen_sock,&rset);
+ max = listen_sock;
+ FD_SET(kernel_sock,&rset);
+ if (max<kernel_sock) { max=kernel_sock;}
+ pomlink2 = Interpreters.first();
+ while (pomlink2!=NULL)
+ {
+ FD_SET(pomlink2->sock,&rset);
+ if (max<pomlink2->sock) max=pomlink2->sock;
+ pomlink2=Interpreters.next();
+ }
+ pomlink = Links.first();
+ while (pomlink!=NULL)
+ {
+ if (pomlink->connected)
+ {
+ FD_SET(pomlink->sock,&rset);
+ if (max<pomlink->sock) max=pomlink->sock;
+ }
+ pomlink=Links.next();
+ }
+
+ // odczyt
+ if (select(max+1,&rset,0,0,NULL) > 0) {
+ // accept connection
+ if (FD_ISSET(listen_sock,&rset))
+ {
+ /* accept connection on listen socket */
+ sz = sizeof(svr);
+ bzero(&svr, sizeof(svr));
+ nsock = accept(listen_sock, (struct sockaddr*)&svr, &sz);
+ if (nsock>0)
+ {
+ pomlink = new NETlink;
+ strcpy(pomlink->addr,inet_ntoa(svr.sin_addr));
+ pomlink->sock = nsock;
+ pomlink->connected = TRUE;
+ fcntl(pomlink->sock, F_SETFL,O_NONBLOCK | fcntl(pomlink->sock,F_GETFL,0));
+ on=1;
+ setsockopt(pomlink->sock,IPPROTO_TCP,TCP_NODELAY,(char*)&on,sizeof(on));
+ Links.append(pomlink);
+ } /* nsock > 0 */
+ } /* ISSET */
+
+ // get internal message
+ /* Check request sockets */
+ pomlink2 = Interpreters.first();
+ while (pomlink2!=NULL)
+ {
+ if (FD_ISSET(pomlink2->sock,&rset))
+ {
+ nr = read(pomlink2->sock,&msg,sizeof(MESSAGE));
+ if (nr>0)
+ {
+ if (msg.msg_type == MSG_NET)
+ switch(msg.param.pword[0])
+ {
+ case NET_PROPAGATE:propagate_msg(&msg); break;
+ case NET_NODE_EXIST:check_node(msg.param.pword[1],pomlink2->sock);break;
+ case NET_GET_INFO: conn_info(pomlink2->sock);break;
+ case NET_NODES_NUM: msg.param.pword[0]=NET_NODES_NUM_RESPONSE;
+ msg.param.pword[1]=Links.count();
+ write(pomlink2->sock,&msg,sizeof(MESSAGE));
+ break;
+ }/* switch */
+ }
+ } /* ISSET */
+ pomlink2=Interpreters.next();
+ } // while
+ /* Check internal socket */
+ if (FD_ISSET(kernel_sock,&rset))
+ {
+ nr = read(kernel_sock, &msg, sizeof(MESSAGE));
+ if (nr>0)
+ {
+ if (msg.msg_type == MSG_NET)
+ {
+ switch(msg.param.pword[0])
+ {
+ case NET_TRANSMIT_CODE:
+
+ transmit_file(msg.param.pword[2],msg.param.pstr,msg.param.pword[1]);
+
+ break;
+ case NET_EXIT: { disconnect_seq();exit_sequence();}
+ break;
+ case NET_GET_INFO: conn_info(kernel_sock);break;
+ case NET_PROPAGATE:propagate_msg(&msg);break;
+ case NET_DISCONNECT:disconnect_seq();
+ break;
+ case NET_NODE_EXIST: check_node(msg.param.pword[1],kernel_sock);break;
+ case NET_CONNECT_TO: connect_seq(msg.param.pstr);
+ } /* end switch */
+ } /* MSG_NET */
+ if (msg.msg_type == MSG_VLP)
+ switch(msg.param.pword[0])
+ {
+ case VLP_REGINT:
+ {
+
+ pomlink2 = new INTlink;
+ pomlink2->sock = socket(AF_UNIX,SOCK_STREAM,0);
+ bzero(&svr2,sizeof(svr2));
+ svr2.sun_family = AF_UNIX;
+ strcpy(svr2.sun_path,msg.param.pstr);
+ si = strlen(svr2.sun_path)+sizeof(svr2.sun_family);
+ sj = connect(pomlink2->sock,(struct sockaddr*)&svr2,si);
+ if (sj==0)
+ fcntl(pomlink2->sock,F_SETFL, O_NONBLOCK|fcntl(pomlink2->sock,F_GETFL,0));
+ int on=1;
+ setsockopt(pomlink2->sock,IPPROTO_TCP,TCP_NODELAY,(char*)&on,sizeof(on));
+ pomlink2->ID = msg.param.pword[1];
+ pomlink2->connected=TRUE;
+ Interpreters.append(pomlink2);
+
+ };break;
+ case VLP_INTERPRETER_DOWN:
+ {
+
+ pomlink2 = findINTlink(msg.param.pword[1]);
+ if (pomlink2!=NULL)
+ {
+ close(pomlink2->sock);
+ Interpreters.remove(pomlink2);
+ }
+ };break;
+ } /* MSg_VLP */
+ } // nr > 0
+ }/* ISSET */
+
+ // get remote message
+
+ pomlink=Links.first();
+ while (pomlink!=NULL)
+ {
+ if (FD_ISSET(pomlink->sock,&rset)) get_message(pomlink);
+ pomlink=Links.next();
+ }
+ } // select
+
+
+}
+/****************************** END 2010 ********************************************/
+
+
+
void NETMOD::propagate_msg(MESSAGE *msg)
{
char ss[255];
{
while(1)
{
- accept_connection();
+ /*accept_connection();
get_internal();
- remote_messages();
+ remote_messages(); */
+ // 2010
+ doitall();
}
}
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
### Includes for QT library
-QINC=/usr/lib/qt-1.45/include
+QINC=/usr/include/qt3
### QT library directory
-QLIB=/usr/lib/qt-1.45/lib
+QLIB=/usr/lib3/
### moc compiler directory
-MOCDIR=/usr/lib/qt-1.45/bin
+MOCDIR=/usr/bin
### Install directory
-INSTALLDIR=/usr/local/vlp
+INSTALLDIR=/home/andrzej/vlp3binD
+
+### QT Library linking phrase
+QLINK=-lqt-mt
INCDIR = $(QINC)
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
CFLAGS = -O2 -fno-strength-reduce -Wall -W -I/usr/X11R6/include
LIBCFLAGS = -fPIC
YACCCFLAGS = -Wno-unused -Wno-parentheses
-LFLAGS = -L$(QLIB) -lqt
+LFLAGS = -L$(QLIB) $(QLINK)
CC = g++
MOC = $(MOCDIR)/moc
SHELL = /bin/sh
{
IncFile *p;
poms1=poms.mid(i+1,j-i-1);
- p=new IncFile(poms1.data(),currentline);
+ p=new IncFile((char*)poms1.ascii(),currentline);
poms2.sprintf("%s%s",homedir,poms1.data());
QFile pomf(poms2.data());
if (!pomf.open(IO_ReadOnly))