Skip to content
Snippets Groups Projects
Commit f489e177 authored by rswindell's avatar rswindell
Browse files

Changed C-exported getnodedat/putnodedat to leave file open and record locked.

parent 50d1a519
No related branches found
No related tags found
No related merge requests found
...@@ -404,14 +404,15 @@ void __fastcall TNodeForm::TimerTick(TObject *Sender) ...@@ -404,14 +404,15 @@ void __fastcall TNodeForm::TimerTick(TObject *Sender)
void __fastcall TNodeForm::InterruptNodeButtonClick(TObject *Sender) void __fastcall TNodeForm::InterruptNodeButtonClick(TObject *Sender)
{ {
int i; int i;
int file;
node_t node; node_t node;
for(i=0;i<ListBox->Items->Count;i++) for(i=0;i<ListBox->Items->Count;i++)
if(ListBox->Selected[i]==true) { if(ListBox->Selected[i]==true) {
if(getnodedat(i+1,&node,true)) if(getnodedat(i+1,&node,&file))
break; break;
node.misc^=NODE_INTR; node.misc^=NODE_INTR;
if(putnodedat(i+1,&node)) if(putnodedat(i+1,&node,file))
break; break;
} }
TimerTick(Sender); TimerTick(Sender);
...@@ -421,14 +422,15 @@ void __fastcall TNodeForm::InterruptNodeButtonClick(TObject *Sender) ...@@ -421,14 +422,15 @@ void __fastcall TNodeForm::InterruptNodeButtonClick(TObject *Sender)
void __fastcall TNodeForm::LockNodeButtonClick(TObject *Sender) void __fastcall TNodeForm::LockNodeButtonClick(TObject *Sender)
{ {
int i; int i;
int file;
node_t node; node_t node;
for(i=0;i<ListBox->Items->Count;i++) for(i=0;i<ListBox->Items->Count;i++)
if(ListBox->Selected[i]==true) { if(ListBox->Selected[i]==true) {
if(getnodedat(i+1,&node,true)) if(getnodedat(i+1,&node,&file))
break; break;
node.misc^=NODE_LOCK; node.misc^=NODE_LOCK;
if(putnodedat(i+1,&node)) if(putnodedat(i+1,&node,file))
break; break;
} }
TimerTick(Sender); TimerTick(Sender);
...@@ -438,14 +440,15 @@ void __fastcall TNodeForm::LockNodeButtonClick(TObject *Sender) ...@@ -438,14 +440,15 @@ void __fastcall TNodeForm::LockNodeButtonClick(TObject *Sender)
void __fastcall TNodeForm::RerunNodeButtonClick(TObject *Sender) void __fastcall TNodeForm::RerunNodeButtonClick(TObject *Sender)
{ {
int i; int i;
int file;
node_t node; node_t node;
for(i=0;i<ListBox->Items->Count;i++) for(i=0;i<ListBox->Items->Count;i++)
if(ListBox->Selected[i]==true) { if(ListBox->Selected[i]==true) {
if(getnodedat(i+1,&node,true)) if(getnodedat(i+1,&node,&file))
break; break;
node.misc^=NODE_RRUN; node.misc^=NODE_RRUN;
if(putnodedat(i+1,&node)) if(putnodedat(i+1,&node,file))
break; break;
} }
TimerTick(Sender); TimerTick(Sender);
...@@ -467,11 +470,12 @@ void __fastcall TNodeForm::SelectAllMenuItemClick(TObject *Sender) ...@@ -467,11 +470,12 @@ void __fastcall TNodeForm::SelectAllMenuItemClick(TObject *Sender)
void __fastcall TNodeForm::DownButtonClick(TObject *Sender) void __fastcall TNodeForm::DownButtonClick(TObject *Sender)
{ {
int i; int i;
int file;
node_t node; node_t node;
for(i=0;i<ListBox->Items->Count;i++) for(i=0;i<ListBox->Items->Count;i++)
if(ListBox->Selected[i]==true) { if(ListBox->Selected[i]==true) {
if(getnodedat(i+1,&node,true)) if(getnodedat(i+1,&node,&file))
break; break;
if(node.status==NODE_WFC) if(node.status==NODE_WFC)
node.status=NODE_OFFLINE; node.status=NODE_OFFLINE;
...@@ -479,7 +483,7 @@ void __fastcall TNodeForm::DownButtonClick(TObject *Sender) ...@@ -479,7 +483,7 @@ void __fastcall TNodeForm::DownButtonClick(TObject *Sender)
node.status=NODE_WFC; node.status=NODE_WFC;
else else
node.misc^=NODE_DOWN; node.misc^=NODE_DOWN;
if(putnodedat(i+1,&node)) if(putnodedat(i+1,&node,file))
break; break;
} }
TimerTick(Sender); TimerTick(Sender);
...@@ -489,14 +493,15 @@ void __fastcall TNodeForm::DownButtonClick(TObject *Sender) ...@@ -489,14 +493,15 @@ void __fastcall TNodeForm::DownButtonClick(TObject *Sender)
void __fastcall TNodeForm::ClearErrorButtonClick(TObject *Sender) void __fastcall TNodeForm::ClearErrorButtonClick(TObject *Sender)
{ {
int i; int i;
int file;
node_t node; node_t node;
for(i=0;i<ListBox->Items->Count;i++) for(i=0;i<ListBox->Items->Count;i++)
if(ListBox->Selected[i]==true) { if(ListBox->Selected[i]==true) {
if(getnodedat(i+1,&node,true)) if(getnodedat(i+1,&node,&file))
break; break;
node.errors=0; node.errors=0;
if(putnodedat(i+1,&node)) if(putnodedat(i+1,&node,file))
break; break;
} }
TimerTick(Sender); TimerTick(Sender);
...@@ -512,7 +517,7 @@ void __fastcall TNodeForm::ChatButtonClick(TObject *Sender) ...@@ -512,7 +517,7 @@ void __fastcall TNodeForm::ChatButtonClick(TObject *Sender)
for(i=0;i<ListBox->Items->Count;i++) for(i=0;i<ListBox->Items->Count;i++)
if(ListBox->Selected[i]==true) { if(ListBox->Selected[i]==true) {
if(getnodedat(i+1,&node,false)) if(getnodedat(i+1,&node,NULL))
break; break;
if(node.status==NODE_WFC || node.status>NODE_QUIET) if(node.status==NODE_WFC || node.status>NODE_QUIET)
continue; continue;
...@@ -555,7 +560,7 @@ void __fastcall TNodeForm::UserEditButtonClick(TObject *Sender) ...@@ -555,7 +560,7 @@ void __fastcall TNodeForm::UserEditButtonClick(TObject *Sender)
for(i=0;i<ListBox->Items->Count;i++) for(i=0;i<ListBox->Items->Count;i++)
if(ListBox->Selected[i]==true) { if(ListBox->Selected[i]==true) {
if(getnodedat(i+1,&node,false)) if(getnodedat(i+1,&node,NULL))
break; break;
if(node.useron==0) if(node.useron==0)
continue; continue;
...@@ -581,7 +586,7 @@ void __fastcall TNodeForm::UserMsgButtonClick(TObject *Sender) ...@@ -581,7 +586,7 @@ void __fastcall TNodeForm::UserMsgButtonClick(TObject *Sender)
UserMsgForm->Memo->Lines->Add(""); UserMsgForm->Memo->Lines->Add("");
for(i=0;i<ListBox->Items->Count;i++) for(i=0;i<ListBox->Items->Count;i++)
if(ListBox->Selected[i]==true) { if(ListBox->Selected[i]==true) {
if(getnodedat(i+1,&node,false)) if(getnodedat(i+1,&node,NULL))
break; break;
if(node.useron==0) if(node.useron==0)
continue; continue;
......
...@@ -98,8 +98,8 @@ private: // User declarations ...@@ -98,8 +98,8 @@ private: // User declarations
public: // User declarations public: // User declarations
__fastcall TNodeForm(TComponent* Owner); __fastcall TNodeForm(TComponent* Owner);
TMainForm* MainForm; TMainForm* MainForm;
int __fastcall getnodedat(int node_num, node_t* node, bool lockit); int __fastcall getnodedat(int node_num, node_t* node, int* file);
int __fastcall putnodedat(int node_num, node_t* node); int __fastcall putnodedat(int node_num, node_t* node, int file);
}; };
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment