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

Updated to comply with new C get/putnodedat API.

parent c2e891d2
No related branches found
No related tags found
No related merge requests found
...@@ -62,8 +62,8 @@ int togglechat(scfg_t *cfg, int node_num, node_t *node, int on) ...@@ -62,8 +62,8 @@ int togglechat(scfg_t *cfg, int node_num, node_t *node, int on)
{ {
static int org_act; static int org_act;
int nodefile; int nodefile = -1;
if(getnodedat(cfg,node_num,node,&nodefile)) { if(getnodedat(cfg,node_num,node,TRUE,&nodefile)) {
return(FALSE); return(FALSE);
} }
if(on) { if(on) {
...@@ -75,7 +75,7 @@ int togglechat(scfg_t *cfg, int node_num, node_t *node, int on) ...@@ -75,7 +75,7 @@ int togglechat(scfg_t *cfg, int node_num, node_t *node, int on)
node->action=org_act; node->action=org_act;
node->misc&=~NODE_LCHAT; node->misc&=~NODE_LCHAT;
} }
putnodedat(cfg,node_num,node,nodefile); putnodedat(cfg,node_num,node,TRUE,nodefile);
return(TRUE); return(TRUE);
} }
...@@ -142,7 +142,7 @@ int chat(scfg_t *cfg, int nodenum, node_t *node, box_t *boxch, void(*timecallbac ...@@ -142,7 +142,7 @@ int chat(scfg_t *cfg, int nodenum, node_t *node, box_t *boxch, void(*timecallbac
return(-1); return(-1);
} }
if(getnodedat(cfg,nodenum,node,NULL)) if(getnodedat(cfg,nodenum,node,FALSE,NULL))
return(-1); return(-1);
username(cfg,node->useron,usrname); username(cfg,node->useron,usrname);
...@@ -183,7 +183,7 @@ int chat(scfg_t *cfg, int nodenum, node_t *node, box_t *boxch, void(*timecallbac ...@@ -183,7 +183,7 @@ int chat(scfg_t *cfg, int nodenum, node_t *node, box_t *boxch, void(*timecallbac
if(timecallback != NULL) if(timecallback != NULL)
timecallback(); timecallback();
if(getnodedat(cfg,nodenum,node,NULL)!=0) if(getnodedat(cfg,nodenum,node,FALSE,NULL)!=0)
break; break;
last_nodechk=now; last_nodechk=now;
} }
......
...@@ -99,7 +99,7 @@ void allocfail(uint size) ...@@ -99,7 +99,7 @@ void allocfail(uint size)
} }
void node_toggles(scfg_t *cfg,int nodenum) { void node_toggles(scfg_t *cfg,int nodenum) {
int nodefile; int nodefile = -1;
char** opt; char** opt;
int i,j; int i,j;
node_t node; node_t node;
...@@ -126,7 +126,7 @@ void node_toggles(scfg_t *cfg,int nodenum) { ...@@ -126,7 +126,7 @@ void node_toggles(scfg_t *cfg,int nodenum) {
" off.\n\n" " off.\n\n"
"`[Note] `These toggles take effect immediately."; "`[Note] `These toggles take effect immediately.";
while(save==0) { while(save==0) {
if(getnodedat(cfg,nodenum,&node,&nodefile)) { if(getnodedat(cfg,nodenum,&node,FALSE,&nodefile)) {
uifc.msg("Error reading node data!"); uifc.msg("Error reading node data!");
break; break;
} }
...@@ -170,7 +170,7 @@ void node_toggles(scfg_t *cfg,int nodenum) { ...@@ -170,7 +170,7 @@ void node_toggles(scfg_t *cfg,int nodenum) {
uifc.msg("Option not implemented"); uifc.msg("Option not implemented");
continue; continue;
} }
putnodedat(cfg,nodenum,&node,nodefile); putnodedat(cfg,nodenum,&node,FALSE,nodefile);
} }
} }
...@@ -221,7 +221,7 @@ int sendmessage(scfg_t *cfg, int nodenum,node_t *node) { ...@@ -221,7 +221,7 @@ int sendmessage(scfg_t *cfg, int nodenum,node_t *node) {
uifc.input(WIN_MID|WIN_SAV,0,0,"Telegram",str2,58,K_WRAP|K_MSG); uifc.input(WIN_MID|WIN_SAV,0,0,"Telegram",str2,58,K_WRAP|K_MSG);
sprintf(str,"\1n\1y\1hMessage From Sysop:\1w %s\r\n",str2); sprintf(str,"\1n\1y\1hMessage From Sysop:\1w %s\r\n",str2);
if(getnodedat(cfg,nodenum,node,NULL)) if(getnodedat(cfg,nodenum,node,FALSE,NULL))
return(-1); return(-1);
if(node->useron==0) if(node->useron==0)
return(-1); return(-1);
...@@ -230,13 +230,13 @@ int sendmessage(scfg_t *cfg, int nodenum,node_t *node) { ...@@ -230,13 +230,13 @@ int sendmessage(scfg_t *cfg, int nodenum,node_t *node) {
} }
int clearerrors(scfg_t *cfg, int nodenum, node_t *node) { int clearerrors(scfg_t *cfg, int nodenum, node_t *node) {
int nodefile; int nodefile = -1;
if(getnodedat(cfg,nodenum,node,&nodefile)) { if(getnodedat(cfg,nodenum,node,TRUE,&nodefile)) {
uifc.msg("getnodedat() failed! (Nothing done)"); uifc.msg("getnodedat() failed! (Nothing done)");
return(-1); return(-1);
} }
node->errors=0; node->errors=0;
putnodedat(cfg,nodenum,node,nodefile); putnodedat(cfg,nodenum,node,TRUE,nodefile);
uifc.msg("Error count cleared for this node."); uifc.msg("Error count cleared for this node.");
return(0); return(0);
} }
...@@ -327,7 +327,7 @@ int drawstats(scfg_t *cfg, int nodenum, node_t *node, int *curp, int *barp) { ...@@ -327,7 +327,7 @@ int drawstats(scfg_t *cfg, int nodenum, node_t *node, int *curp, int *barp) {
time_t t; time_t t;
int shownode=1; int shownode=1;
if(getnodedat(cfg,nodenum,node,NULL)) { if(getnodedat(cfg,nodenum,node,FALSE,NULL)) {
shownode=0; shownode=0;
} }
else { else {
...@@ -790,7 +790,7 @@ int main(int argc, char** argv) { ...@@ -790,7 +790,7 @@ int main(int argc, char** argv) {
char title[256]; char title[256];
int i,j; int i,j;
node_t node; node_t node;
int nodefile; int nodefile = -1;
box_t boxch; box_t boxch;
scfg_t cfg; scfg_t cfg;
int done; int done;
...@@ -975,7 +975,7 @@ USAGE: ...@@ -975,7 +975,7 @@ USAGE:
while(1) { while(1) {
strcpy(mopt[0],"System Options"); strcpy(mopt[0],"System Options");
for(i=1;i<=cfg.sys_nodes;i++) { for(i=1;i<=cfg.sys_nodes;i++) {
if((j=getnodedat(&cfg,i,&node,NULL))) if((j=getnodedat(&cfg,i,&node,FALSE,NULL)))
sprintf(mopt[i],"Error reading node data (%d)!",j); sprintf(mopt[i],"Error reading node data (%d)!",j);
else { else {
nodestatus(&cfg, &node, str, 71); nodestatus(&cfg, &node, str, 71);
...@@ -1156,7 +1156,7 @@ USAGE: ...@@ -1156,7 +1156,7 @@ USAGE:
} }
if(j==-2-CIO_KEY_F(10)) { /* Chat */ if(j==-2-CIO_KEY_F(10)) { /* Chat */
if(getnodedat(&cfg,main_dflt,&node,NULL)) { if(getnodedat(&cfg,main_dflt,&node,FALSE,NULL)) {
uifc.msg("Error reading node data!"); uifc.msg("Error reading node data!");
continue; continue;
} }
...@@ -1176,27 +1176,27 @@ USAGE: ...@@ -1176,27 +1176,27 @@ USAGE:
} }
if(j==-2-CTRL('l')) { /* Lock node */ if(j==-2-CTRL('l')) { /* Lock node */
if(getnodedat(&cfg,main_dflt,&node,&nodefile)) { if(getnodedat(&cfg,main_dflt,&node,TRUE,&nodefile)) {
uifc.msg("Error reading node data!"); uifc.msg("Error reading node data!");
continue; continue;
} }
node.misc^=NODE_LOCK; node.misc^=NODE_LOCK;
putnodedat(&cfg,main_dflt,&node,nodefile); putnodedat(&cfg,main_dflt,&node,FALSE,nodefile);
continue; continue;
} }
if(j==-2-CTRL('r')) { /* Rerun node */ if(j==-2-CTRL('r')) { /* Rerun node */
if(getnodedat(&cfg,main_dflt,&node,&nodefile)) { if(getnodedat(&cfg,main_dflt,&node,TRUE,&nodefile)) {
uifc.msg("Error reading node data!"); uifc.msg("Error reading node data!");
continue; continue;
} }
node.misc^=NODE_RRUN; node.misc^=NODE_RRUN;
putnodedat(&cfg,main_dflt,&node,nodefile); putnodedat(&cfg,main_dflt,&node,FALSE,nodefile);
continue; continue;
} }
if(j==-2-CTRL('d')) { /* Down node */ if(j==-2-CTRL('d')) { /* Down node */
if(getnodedat(&cfg,main_dflt,&node,&nodefile)) { if(getnodedat(&cfg,main_dflt,&node,TRUE,&nodefile)) {
uifc.msg("Error reading node data!"); uifc.msg("Error reading node data!");
continue; continue;
} }
...@@ -1208,17 +1208,17 @@ USAGE: ...@@ -1208,17 +1208,17 @@ USAGE:
else else
node.status=NODE_WFC; node.status=NODE_WFC;
} }
putnodedat(&cfg,main_dflt,&node,nodefile); putnodedat(&cfg,main_dflt,&node,FALSE,nodefile);
continue; continue;
} }
if(j==-2-CTRL('i')) { /* Interrupt node */ if(j==-2-CTRL('i')) { /* Interrupt node */
if(getnodedat(&cfg,main_dflt,&node,&nodefile)) { if(getnodedat(&cfg,main_dflt,&node,TRUE,&nodefile)) {
uifc.msg("Error reading node data!"); uifc.msg("Error reading node data!");
continue; continue;
} }
node.misc^=NODE_INTR; node.misc^=NODE_INTR;
putnodedat(&cfg,main_dflt,&node,nodefile); putnodedat(&cfg,main_dflt,&node,FALSE,nodefile);
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment