OPT	LINK='powerd.lib'

// String/EString functions ////////////
LPROC EStrAdd(dstr:PTR TO CHAR,sstr:PTR TO CHAR,length=-1)(PTR TO CHAR)
LPROC EStrCopy(dstr:PTR TO CHAR,sstr:PTR TO CHAR,length=-1)(PTR TO CHAR)
LPROC EStringF(dstr:PTR TO CHAR,fstr:PTR TO CHAR,list=NIL:LIST OF LONG)(PTR TO CHAR)
LPROC EStrLen(dstr:PTR TO CHAR)(LONG)
LPROC EStrMax(dstr:PTR TO CHAR)(LONG)
LPROC InStr(dstr:PTR TO CHAR,str:PTR TO CHAR,start=0:LONG)(LONG)
LPROC MidEStr(estr:PTR TO CHAR,str:PTR TO CHAR,start,length)(PTR TO CHAR)
//LPROC MidStr(string:PTR TO CHAR,str:PTR TO CHAR,start,length)(PTR TO CHAR)
LPROC IsAlpha(char:LONG)(BOOL)
//LPROC IsBin(char:LONG)(BOOL)
LPROC IsHex(char:LONG)(BOOL)
LPROC IsNum(char:LONG)(BOOL)
LPROC LowerStr(str:PTR TO CHAR)(PTR TO CHAR)
LPROC NewEStr(length:ULONG)(PTR TO CHAR)
LPROC OStrCmp(dstr:PTR TO CHAR,sstr:PTR TO CHAR,length=-1)(LONG)
LPROC ReadEStr(fh:BPTR,estr:PTR TO CHAR)(LONG)
//LPROC ReadStr(fh:BPTR,str:PTR TO CHAR)(LONG)
LPROC ReEStr(str:PTR TO CHAR)
LPROC RemEStr(str:PTR TO CHAR)
LPROC RightEStr(dstr:PTR TO CHAR,sstr:PTR TO CHAR,length)(PTR TO CHAR)
//LPROC RightStr(dstr:PTR TO CHAR,sstr:PTR TO CHAR,length)(PTR TO CHAR)
LPROC SetEStr(str:PTR TO CHAR,length:LONG)
LPROC StrAdd(dstr:PTR TO CHAR,sstr:PTR TO CHAR,length=-1)(BOOL)
LPROC StrCmp(dstr:PTR TO CHAR,sstr:PTR TO CHAR,length=-1)(BOOL)
LPROC StrCopy(dstr:PTR TO CHAR,sstr:PTR TO CHAR,length=-1)(BOOL)
LPROC StringF(dstr:PTR TO CHAR,fstr:PTR TO CHAR,list=NIL:LIST OF LONG)(PTR TO CHAR)
LPROC StrLen(dstr:PTR TO CHAR)(LONG)
LPROC TrimStr(str:PTR TO CHAR)(PTR TO CHAR)
LPROC UpperStr(str:PTR TO CHAR)(PTR TO CHAR)

// Math functions //////////////////////
RPROC Abs(d0:LONG)(LONG)//='\ttst.l\td0\n\tbge.s\t.noneg\n\tneg.l\td0\n.noneg\n'
RPROC And(d0:LONG,d1:LONG)(LONG)='\tand.l\td1,d0\n'
RPROC EOr(d0:LONG,d1:LONG)(LONG)='\teor.l\td1,d0\n'
RPROC Or(d0:LONG,d1:LONG)(LONG)='\tor.l\td1,d0\n'
RPROC Neg(d0:LONG)(LONG)='\tneg.l\td0\n'
RPROC Not(d0:LONG)(LONG)='\tnot.l\td0\n'
RPROC Rol(d0:LONG,d1:LONG)(LONG)='\trol.l\td1,d0\n'
RPROC Ror(d0:LONG,d1:LONG)(LONG)='\tror.l\td1,d0\n'
RPROC Shl(d0:LONG,d1:LONG)(LONG)='\tasl.l\td1,d0\n'
RPROC Shr(d0:LONG,d1:LONG)(LONG)='\tasr.l\td1,d0\n'
RPROC Sign(d0:LONG)(LONG)

// FPU functions ///////////////////////
RPROC Pow(fp0:DOUBLE,fp1:DOUBLE)(DOUBLE)

// Intuition support functions /////////
LPROC Mouse()(LONG)
LPROC MouseX(window)(LONG)
LPROC MouseXY(window)(LONG,LONG)
LPROC MouseY(window)(LONG)
EPROC WaitIMessage(window)(LONG,LONG,LONG,LONG)

// Miscellaneous functions /////////////
LPROC CtrlC()(BOOL)
LPROC CtrlD()(BOOL)
LPROC CtrlE()(BOOL)
LPROC CtrlF()(BOOL)

RPROC Byte(a0:PTR TO BYTE)(LONG)
RPROC Word(a0:PTR TO WORD)(LONG)
RPROC Long(a0:PTR TO LONG)(LONG)

LPROC PutByte(a0:PTR TO BYTE,d0:LONG)(LONG)
LPROC PutWord(a0:PTR TO WORD,d0:LONG)(LONG)
LPROC PutLong(a0:PTR TO LONG,d0:LONG)(LONG)

LPROC Bounds(d0:LONG,d1:LONG,d2:LONG)(LONG)
LPROC Even(d0:LONG)(BOOL)
LPROC Odd(d0:LONG)(BOOL)
LPROC Max(d0:LONG,d1:LONG)(LONG)
LPROC Min(d0:LONG,d1:LONG)(LONG)

LPROC Rnd(top:LONG)(LONG)
LPROC RndQ(top:LONG)(LONG)

EPROC FileLength(name:PTR TO CHAR)(LONG)
LPROC KickVersion(requied:LONG)(BOOL)

LPROC Inp(fh:BPTR)(LONG)
LPROC Out(fh:BPTR,ch:LONG)

EPROC RealStr(str:PTR TO UBYTE,f:DOUBLE,n=1)(PTR TO UBYTE)
EPROC RealEStr(estr:PTR TO UBYTE,f:DOUBLE,n=1)(PTR TO UBYTE)
EPROC RealVal(str:PTR TO UBYTE,pos=0)(DOUBLE)
EPROC Val(s:PTR TO UBYTE,n=0)(LONG)


/*
RPROC OpenW()
RPROC OpenS()
RPROC CloseW()
RPROC CloseS()

RPROC SetDefRast(w:PTR TO Window)(PTR TO RastPort)
RPROC GetDefRast(w:PTR TO Window)(PTR TO RastPort)
RPROC Colour(c,b=-1)
RPROC Line(x1,y1,x2,y2,c=-1)
RPROC Plot(x,y,c=-1)
RPROC Box(x1,y1,x2,y2,c=-1)
RPROC IBox(x,y,w,h,c=-1)
RPROC Ellipse(x,y,w,h,c=-1)
RPROC TextF(x,y,fmt,args)
*/
