2023-07-12 09:00:08 +02:00
|
|
|
MODULE Fetcher;
|
|
|
|
IMPORT OS, Browser, Desktop;
|
|
|
|
|
|
|
|
EXTERN terminalStreamPtr: POINTER TO CHAR;
|
|
|
|
EXTERN arg0Ptr: POINTER TO CHAR;
|
2023-07-12 19:41:11 +02:00
|
|
|
EXTERN arg1Ptr: POINTER TO CHAR;
|
|
|
|
EXTERN arg2Ptr: POINTER TO CHAR;
|
|
|
|
EXTERN arg3Ptr: POINTER TO CHAR;
|
2023-07-12 09:00:08 +02:00
|
|
|
|
|
|
|
PROCEDURE Main();
|
|
|
|
BEGIN
|
|
|
|
IF (terminalStreamPtr = 0) & (arg0Ptr = 0) THEN
|
|
|
|
(* probably launched from startup.cfg *)
|
|
|
|
DesktopMain();
|
|
|
|
ELSIF arg0Ptr <|= 5 THEN
|
|
|
|
(* launched from an existing instance of fetcher *)
|
2023-07-12 19:41:11 +02:00
|
|
|
BrowserMain(arg0Ptr,arg1Ptr,arg2Ptr,arg3Ptr);
|
2023-07-12 09:00:08 +02:00
|
|
|
ELSE
|
|
|
|
(* probably launched from the terminal *)
|
2023-07-12 19:41:11 +02:00
|
|
|
BrowserMain(string_to_int(arg0Ptr, 10),0,0,0);
|
2023-07-12 09:00:08 +02:00
|
|
|
END;
|
|
|
|
END;
|
|
|
|
END.
|