/**
 * Scout - The Amiga System Monitor
 *
 *------------------------------------------------------------------
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * You must not use this source code to gain profit of any kind!
 *
 *------------------------------------------------------------------
 *
 * @author Andreas Gelhausen
 * @author Richard Körber <rkoerber@gmx.de>
 */

#ifndef SCOUT_DEFS_H
#define SCOUT_DEFS_H

/*************************************************************/
/*                  Compiler specific stuff                  */
/*************************************************************/

#define REG(x) register __ ## x
#define ASM    __asm
#define SAVEDS __saveds

/*************************************************************/
/*                      User definitions                     */
/*************************************************************/

#define aprintf             Printf
#define points2ram          TypeOfMem

#define FIRSTLIBRARY        ((struct Library *)  (SysBase->LibList.lh_Head))
#define FIRSTDEVICE         ((struct Library *)  (SysBase->DeviceList.lh_Head))
#define FIRSTRESOURCE       ((struct Library *)  (SysBase->ResourceList.lh_Head))
#define FIRSTTASKWAIT       ((struct Task *)     (SysBase->TaskWait.lh_Head))
#define FIRSTTASKREADY      ((struct Task *)     (SysBase->TaskReady.lh_Head))
#define FIRSTPORT           ((struct MsgPort *)  (SysBase->PortList.lh_Head))
#define FIRSTMEMORY         ((struct MemHeader *) (SysBase->MemList.lh_Head))
#define FIRSTINTERRUPT      ((struct Interrupt *) (SysBase->IntrList.lh_Head))
#define FIRSTSEMAPHORE      ((struct SignalSemaphore *) (SysBase->SemaphoreList.lh_Head))
#define FIRSTRESIDENT       ((struct Resident *) (SysBase->ResModules))
#define FIRSTSCREEN         ((struct Screen *)   (((struct IntuitionBase *)IntuitionBase)->FirstScreen))
#define FIRSTFONT           ((struct TextFont *) (((struct GfxBase *) GfxBase)->TextFonts.lh_Head))

#define DEVINFO             ((struct DosInfo *)  (BADDR(((struct DosLibrary *)DOSBase)->dl_Root->rn_Info)))
#define DOSLIST             ((struct DosList *)  (BADDR(DEVINFO->di_DevInfo)))
#define FIRSTLOCK           ((struct FileLock *) (BADDR(DEVLIST->dl_Lock)))

#define FILENAME_LENGTH     256
#define VERSION_LENGTH      16
#define ADDRESS_LENGTH      16
#define PATH_LENGTH         256
#define PATH_LENGTH_CHAR    "256"
#define NODENAME_LENGTH     256
#define TEXT_LENGTH         256
#define TEXT_LENGTH_CHAR    "256"
#define NODETYPE_LENGTH     16
#define NUMBER_LENGTH       16
#define TASK_STATE_LENGTH   16
#define TMP_STRING_LENGTH   1024
#define TS_FROZEN           0xff
#define PATTERN_LENGTH      (PATH_LENGTH * 2 + 2)

#define MakeID(a,b,c,d)     ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))

#define MyTextFrame         TextFrame,MUIA_Background,MUII_TextBack

#define LabelA(label)   TextObject,MUIA_Text_PreParse,"\033r",\
            MUIA_Text_Contents,label,TextFrame,MUIA_FramePhantomHoriz,\
            TRUE,End

#define LabelB(label)   TextObject,MUIA_Text_PreParse,"\033r",\
            MUIA_Text_Contents,label,TextFrame,MUIA_FramePhantomHoriz,\
            TRUE,MUIA_Weight,0,MUIA_InnerLeft,0,MUIA_InnerRight,0,End

#endif /* SCOUT_DEFS_H */
