home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
monitors
/
rsys
/
rsyssrc.lha
/
RSysMain.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-24
|
5KB
|
192 lines
/*
***************************************************************************
*
* Datei:
* RSysMain.c
*
* Inhalt:
*
* --- Globale Routinen ---
*
* void _icon_parse ( char *progname );
* void _main ( long alen , char *aptr );
* void _wb_parse ( void );
*
* --- Lokale Routinen ---
*
*
* Bemerkungen:
* Startup-Routinen von RSys; ruft das Hauptprogramm auf.
*
* Erstellungsdatum:
* 07-Jul-93 Rolf Böhme
*
* Änderungen:
* 07-Jul-93 Rolf Böhme Erstellung
*
***************************************************************************
*/
#include "RSys.h"
extern int Enable_Abort;
extern int _argc;
extern char **_argv;
extern struct WBStartup *WBenchMsg;
void _cli_parse(struct Process *pp, long alen, char *aptr);
extern char _dir[], _file[];
void
_wb_parse(void)
{
return;
};
static struct DiskObject *dop;
static char *
ToolType(char *type)
{
return (char *)FindToolType((UBYTE **) dop->do_ToolTypes,(UBYTE *) (type));
}
void
_icon_parse(char *progname)
{
register char *cp;
if (IconBase = OpenLibrary((UBYTE *) "icon.library", 0L))
{
if (dop = GetDiskObject((UBYTE *) progname))
{
if (cp = ToolType("CX_HOTKEY")) strcpy(&hotkey[0][0], cp);
if (cp = ToolType("CX_CRYPT")) strcpy(&hotkey[1][0], cp);
if (cp = ToolType("CX_FINDFILE")) strcpy(&hotkey[2][0], cp);
if (cp = ToolType("CX_FORMAT")) strcpy(&hotkey[3][0], cp);
if (cp = ToolType("CX_HUNKLIST")) strcpy(&hotkey[4][0], cp);
if (cp = ToolType("CX_CRC")) strcpy(&hotkey[5][0], cp);
if (cp = ToolType("CX_SAVEWINDOW")) strcpy(&hotkey[6][0], cp);
if (cp = ToolType("CX_FILEREQUEST")) strcpy(&hotkey[7][0], cp);
if (cp = ToolType("NOFASTMODE")) Flags.fastmode = 0;
if (cp = ToolType("NOSORT")) Flags.sortmode = 0;
if (cp = ToolType("WORKINGBAR")) Flags.workingbar = 1;
if (cp = ToolType("AUTOFRONT")) Flags.autofront = 1;
if (cp = ToolType("MOUSEWINDOW")) Flags.mousewindow = 1;
if (cp = ToolType("TOPAZFONT")) Flags.sysfont = 1;
if (cp = ToolType("NOSAVEASKING")) Flags.saveasking = 0;
if (cp = ToolType("TEXTFORMATTER")) Flags.textformat = 1;
if (cp = ToolType("NOAPPICON")) Flags.appicon = 0;
if (cp = ToolType("BACKPATTERNCOL")) bpc = atoi(cp);
if (cp = ToolType("BACKGROUNDCOL")) bgc = atoi(cp);
if (cp = ToolType("BACKPATTERN")) bpp = ahtoi(cp);
if (cp = ToolType("DETAILPEN")) winddetail = atoi(cp);
if (cp = ToolType("BLOCKPEN")) windblock = atoi(cp);
if (cp = ToolType("MENUPEN")) menudetail = atoi(cp);
if (cp = ToolType("HARDWAREDATA")) strcpy((char *)RSysFiles.Hardware, cp);
if (cp = ToolType("LIBOFFDATA")) strcpy((char *)RSysFiles.LibOffsets, cp);
if (cp = ToolType("AGUIDEDOC")) strcpy((char *)RSysFiles.Guide, cp);
if (cp = ToolType("AGUIDECONTEXT")) strcpy((char *)RSysFiles.GuideContext, cp);
if (cp = ToolType("ACTIONFILE")) strcpy((char *)RSysFiles.ActionFile, cp);
if (cp = ToolType("ICONX")) iconx = atoi(cp);
if (cp = ToolType("ICONY")) icony = atoi(cp);
if (cp = ToolType("OUTWINDOW")) strcpy((char *)autocon,cp);
else
strcpy((char *)autocon,"CON:/40//150/Sys - Window/auto/close");
if (cp = ToolType("LISTHEIGHT"))
{
listviewheight = atoi(cp);
if(listviewheight == -1) listviewheight = 1000;
else
if(listviewheight < 2) listviewheight = 10;
SysHeight += (listviewheight - 10) * 8;
}
FreeDiskObject(dop);
}
CloseLibrary(IconBase);
IconBase = NULL;
}
return;
}
void
_main(long alen, char *aptr)
{
register struct Process *pp;
SysBase = *(struct ExecBase **) 4;
if (SysBase->LibNode.lib_Version < 36)
{
if (alen) Write(Output(), (UBYTE *)"WB 2.0 ONLY!\n", 13);
exit(0);
}
if(DOSBase = (struct DosLibrary *)OpenLibrary((STRPTR)"dos.library", 36L))
{
LastID = SYSTEMINFO;
pp = (struct Process *) FindTask(0L);
strcpy(hotkey[0], "lshift rshift y");
strcpy(hotkey[1], "lshift rshift k");
strcpy(hotkey[2], "lshift rshift s");
strcpy(hotkey[3], "lshift rshift f");
strcpy(hotkey[4], "lshift rshift h");
strcpy(hotkey[5], "lshift rshift c");
strcpy(hotkey[6], "lshift rshift w");
strcpy(hotkey[7], "lshift rshift esc");
if (pp->pr_CLI)
{
_cli_parse(pp, alen, aptr);
RSysName = AllocVec(MAXFULLNAME, MEMF_CLEAR);
if (RSysName)
{
NameFromLock(GetProgramDir(), (UBYTE *) RSysName, MAXFULLNAME);
strcpy(_dir,RSysName);
strcpy(_file,(char *)FilePart((UBYTE *) _argv[0]));
AddPart((UBYTE *) RSysName, FilePart((UBYTE *) _argv[0]), MAXFULLNAME);
}
Enable_Abort = 1;
}
else
{
WaitPort(&pp->pr_MsgPort);
WBenchMsg = (struct WBStartup *) GetMsg(&pp->pr_MsgPort);
if (WBenchMsg->sm_ArgList)
{
NameFromLock(WBenchMsg->sm_ArgList->wa_Lock, (UBYTE *) _dir, MAXFULLNAME);
strcpy(_file, (char *)FilePart((UBYTE *)WBenchMsg->sm_ArgList->wa_Name));
RSysName = AllocVec(strlen(WBenchMsg->sm_ArgList->wa_Name) + 1, MEMF_CLEAR);
if (RSysName) strcpy(RSysName, WBenchMsg->sm_ArgList->wa_Name);
CurrentDir(WBenchMsg->sm_ArgList->wa_Lock);
}
_argv = (char **)WBenchMsg;
}
if (RSysName) _icon_parse(RSysName);
main(_argc, _argv);
}
return;
}