3 #include <dos/dostags.h>
5 #include <proto/exec.h>
6 #include <kern/amiga_gui.h>
7 #include <kern/amiga_netdb.h>
10 extern UBYTE InitFlags
;
11 extern TEXT db_path
[];
12 struct Task
* AmiTCP_Task
;
13 UBYTE RcCommand
[FILENAME_MAX
];
14 UBYTE RcStartDone
= 0;
17 void SAVEDS
rc_start_process(void)
22 lock
= Lock(db_path
, ACCESS_READ
);
24 oldcd
= CurrentDir(lock
);
26 for (rc
= (struct RcentNode
*)NDB
->ndb_Rc
.mlh_Head
;
28 rc
= (struct RcentNode
*)rc
->rn_Node
.mln_Succ
) {
29 snprintf(RcCommand
, sizeof(RcCommand
), "%s start", rc
->rn_Ent
);
30 RcCommand
[sizeof(RcCommand
)-1]=0;
31 Execute(RcCommand
, BNULL
, BNULL
);
32 /* FIXME: Why doesn't SystemTags() doesn't work here?
33 SystemTags(rc->rn_Ent, NP_Arguments, "start", TAG_DONE);*/
43 void SAVEDS
rc_stop_process(void)
48 lock
= Lock(db_path
, ACCESS_READ
);
50 oldcd
= CurrentDir(lock
);
52 for (rc
= (struct RcentNode
*)NDB
->ndb_Rc
.mlh_TailPred
;
54 rc
= (struct RcentNode
*)rc
->rn_Node
.mln_Pred
) {
55 snprintf(RcCommand
, sizeof(RcCommand
), "%s stop", rc
->rn_Ent
);
56 RcCommand
[sizeof(RcCommand
)-1] = 0;
57 Execute(RcCommand
, BNULL
, BNULL
);
58 /* SystemTags(rc->rn_Ent, NP_Arguments, "stop", TAG_DONE);*/
67 Signal(AmiTCP_Task
, SIGBREAKF_CTRL_F
);
74 if (!(CreateNewProcTags(NP_Entry
, (IPTR
)&rc_start_process
,
75 NP_Name
, (IPTR
)"AROSTCP RC startup",
78 NP_CodeType
, CODETYPE_PPC
,
89 if (!(CreateNewProcTags(NP_Entry
, (IPTR
)&rc_stop_process
,
90 NP_Name
, (IPTR
)"AROSTCP RC shutdown",
93 NP_CodeType
, CODETYPE_PPC
,