home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 300-399 / ff384.lzh / NorthC / NorthC1.LZH / clibs / AmigaDOS.doc < prev    next >
Text File  |  1990-09-04  |  15KB  |  524 lines

  1.  (c) 1990 S.Hawtin.Permission is granted to copy this file provided
  2.   1) It is not used for commercial gain
  3.   2) This notice is included in all copies
  4.   3) Altered copies are marked as such
  5.  
  6.   No liability is accepted for the contents of the file.
  7.  
  8.    AmigaDOS.doc within        Public Domain C library
  9.  
  10.   This file contains a list of the AmigaDOS stubs that are included 
  11. within the NorthC standard library.  The routines are listed by library.
  12.  
  13.   When your program starts the routines in "crt0.asm" will automagically 
  14. load "dos.library", "exec.library" and "mathffp.library", the 
  15. "mathtrans.library" is loaded as soon as you try to use it, all other 
  16. libraries must be loaded explicitly by your program.
  17.  
  18.   The OpenLibrary() routine in the NorthC 'C' library does more than 
  19. just open the library, it keeps a record of the library pointers and closes 
  20. them when the program ends, if you want to call the real OpenLibrary() 
  21. routine it is called _OpenLibrary().  Similarly the CloseLibrary() routine 
  22. tidies some things up, the real routine is called _CloseLibrary().  
  23. Calling the real routines in NorthC programs may result in nasty errors.
  24.  
  25.   If you use the OpenLibrary() routine all the linking is done for you, 
  26. you do not need to remember the name of the global variable that needs 
  27. thelibrary pointer, for example
  28.  
  29.     int
  30.     next_name(new_str,old_str)
  31.         char *new_str;
  32.         char *old_str;
  33.        {/* All library calls require long arguments everywhere */
  34.         static int first = -1;
  35.  
  36.         if(first)
  37.            {/* Assumes load suceeds, in a real program test for NULL
  38.                return */
  39.             OpenLibrary("icon.library",0L);
  40.             first = 0;
  41.             }
  42.         return(BumpRevision(new_str,old_str));
  43.         }
  44.  
  45. you do not even have to remember to close the library, the OpenLibrary() 
  46. routine sets things so that the exit() routine will do it for you.
  47.  
  48.   All the arguments to AmigaDOS routines are 4 bytes long, even when 
  49. the documentation claims they are not.  For example the "graphics.library" 
  50. Move() function should be defined as
  51.  
  52.     Move(rp,x,y)
  53.         struct RastPort *rp;
  54.         SHORT x,y;
  55.  
  56. within this version of the NorthC library it is defined as
  57.  
  58.     Move(rp,x,y)
  59.         struct RastPort *rp;
  60.         LONG x,y;
  61.  
  62. this means that you may have to alter your source code to read, for example 
  63.  
  64.     short x;
  65.  
  66.     #ifdef NORTHC
  67.         Move(rp,(long)x,50L);
  68.     #else
  69.         Move(rp,x,50);
  70.     #endif
  71.  
  72. or risk getting some nasty behaviour from your machine.  The routines 
  73. within"graphics.library" are the only ones I have seen so far that say 
  74. they take short arguments.
  75.  
  76.   The "mathsieeedoubbas.library" and "mathsieeedoubtrans.library" are 
  77. notsupported, I could not work out how to return 64 bits in the D0 
  78. register,maybe I will for a future release.
  79.  
  80.   Right having introduced the functions here they are, the rest of this 
  81. file lists the AmigaDOS routines that are supported by the standard NorthC 
  82. 'C' library.
  83.  
  84.  
  85. diskfont.library
  86.  
  87.     AvailFonts(buffer,bufBytes,flags)
  88.     DisposeFontContents(fontContentsHeader)
  89.     NewFontContents(fontsLock,fontName)
  90.     OpenDiskFont(textAttr)
  91.  
  92. dos.library
  93.  
  94.     Close(file)
  95.     CreateDir(name)
  96.     CreateProc(name,pri,segList,stackSize)
  97.     CurrentDir(lock)
  98.     DateStamp(date)
  99.     Delay(timeout)
  100.     DeleteFile(name)
  101.     DeviceProc(name)
  102.     DupLock(lock)
  103.     Examine(lock,fileInfoBlock)
  104.     Execute(string,fileIn,fileOut)
  105.     Exit(returnCode)
  106.     ExNext(lock,fileInfoBlock)
  107.     GetPacket(wait)
  108.     Info(lock,parameterBlock)
  109.     Input()
  110.     IoErr()
  111.     IsInteractive(file)
  112.     LoadSeg(fileName)
  113.     Lock(name,type)
  114.     Open(name,AccessMode)
  115.     Output()
  116.     ParentDir(lock)
  117.     QueuePacket(packet)
  118.     Read(file,buffer,length)
  119.     Rename(oldName,newName)
  120.     Seek(file,position,offset)
  121.     SetComment(name,comment)
  122.     SetProtection(name,mask)
  123.     UnLoadSeg(segment)
  124.     UnLock(lock)
  125.     WaitForChar(file,timeout)
  126.     Write(file,buffer,length)
  127.  
  128. exec.library
  129.  
  130.     AbortIO(ioRequest)
  131.     AddDevice(device)
  132.     AddHead(list,node)
  133.     AddIntServer(intNumber,interrupt)
  134.     AddLibrary(library)
  135.     AddMemList(size,attrib,pri,base,name)
  136.     AddPort(port)
  137.     AddResource(resource)
  138.     AddSemaphore(sigSem)
  139.     AddTail(list,node)
  140.     AddTask(task,initPC,finalPC)
  141.     Alert(alertNum,parameters)
  142.     AllocAbs(byteSize,location)
  143.     Allocate(freeList,byteSize)
  144.     AllocEntry(entry)
  145.     AllocMem(byteSize,requirements)
  146.     AllocSignal(signalNum)
  147.     AllocTrap(trapNum)
  148.     AttemptSemaphore(sigSem)
  149.     AvailMem(requirements)
  150.     Cause(interrupt)
  151.     CheckIO(ioRequest)
  152.     CloseDevice(ioRequest)
  153.     _CloseLibrary(library)
  154.     CopyMem(source,dest,size)
  155.     CopyMemQuick(source,dest,size)
  156.     Deallocate(freeList,memBlock,byteSize)
  157.     Debug()
  158.     Disable()
  159.     Dispatch()
  160.     DoIO(ioRequest)
  161.     Enable()
  162.     Enqueue(list,node)
  163.     Exception()
  164.     ExitIntr()
  165.     FindName(list,name)
  166.     FindPort(name)
  167.     FindResident(name)
  168.     FindSemaphore(sigSem)
  169.     FindTask(name)
  170.     Forbid()
  171.     FreeEntry(entry)
  172.     FreeMem(memBlock,byteSize)
  173.     FreeSignal(signalNum)
  174.     FreeTrap(trapNum)
  175.     GetCC()
  176.     GetMsg(port)
  177.     InitCode(startClass,version)
  178.     InitResident(resident,segList)
  179.     InitSemaphore(sigSem)
  180.     InitStruct(initTable,memory,size)
  181.     Insert(list,node,pred)
  182.     MakeFunctions(target,funcArray,funcDispBase)
  183.     MakeLibrary(fInit,sInit,lInit,dsize,cSize)
  184.     ObtainSemaphore(sigSem)
  185.     ObtainSemaphoreList(sigSem)
  186.     OldOpenLibrary(libName)
  187.     OpenDevice(devName,unit,ioRequest,flags)
  188.     _OpenLibrary(libName,version)
  189.     OpenResource(resName,version)
  190.     Permit()
  191.     Procure(semaport,bidMsg)
  192.     PutMsg(port,message)
  193.     RawDoFmt()
  194.     RawIOInit()
  195.     RawMayGetChar()
  196.     RawPutChar(char)
  197.     ReleaseSemaphore(sigSem)
  198.     ReleaseSemaphoreList(sigSem)
  199.     RemDevice(device)
  200.     RemHead(list)
  201.     RemIntServer(intNumber,interrupt)
  202.     RemLibrary(library)
  203.     Remove(node)
  204.     RemPort(port)
  205.     RemResource(resource)
  206.     RemSemaphore(sigSem)
  207.     RemTail(list)
  208.     RemTask(task)
  209.     ReplyMsg(message)
  210.     Reschedule()
  211.     Schedule()
  212.     SendIO(ioRequest)
  213.     SetExcept(newSig,signalSet)
  214.     SetFunction(library,funcOffset,funcEntry)
  215.     SetIntVector(intNumber,interrupt)
  216.     SetSignal(newSig,signalSet)
  217.     SetSR(newSR,mask)
  218.     SetTaskPri(task,priority)
  219.     Signal(task,signalSet)
  220.     SumKickData()
  221.     SumLibrary(library)
  222.     SuperState()
  223.     Supervisor()
  224.     Switch()
  225.     TypeOfMem(address)
  226.     UserState(sysStack)
  227.     Vacate(semaport)
  228.     Wait(signalSet)
  229.     WaitIO(ioRequest)
  230.     WaitPort(port)
  231.  
  232. expansion.library
  233.  
  234.     AddConfigDev(configDev)
  235.     AddDosNode(bootPri,flags,dosNode)
  236.     AllocBoardMem(slotSpec)
  237.     AllocConfigDev()
  238.     AllocExpansionMem(numSlots,slotAlign,slotOffset)
  239.     ConfigBoard(board,configDev)
  240.     ConfigChain(baseAddr)
  241.     expansionUnused()
  242.     FindConfigDev(oldConfigDev,manufacturer,product)
  243.     FreeBoardMem(startSlot,slotSpec)
  244.     FreeConfigDev(configDev)
  245.     FreeExpansionMem(startSlot,numSlots)
  246.     GetCurrentBinding(curBind,bindSize)
  247.     MakeDosNode(parmPacket)
  248.     ObtainConfigBinding()
  249.     ReadExpansionByte(board,offset)
  250.     ReadExpansionRom(board,configDev)
  251.     ReleaseConfigBinding()
  252.     RemConfigDev(configDev)
  253.     SetCurrentBinding(curBind,bindSize)
  254.     WriteExpansionByte(board,offset,byte)
  255.  
  256. graphics.library
  257.  
  258.     AddAnimOb(obj,animationKey,rastPort)
  259.     AddBob(bob,rastPort)
  260.     AddFont(textFont)
  261.     AddVSprite(vSprite,rastPort)
  262.     AllocRaster(width,height)
  263.     AndRectRegion(rgn,rect)
  264.     AndRegionRegion(src,dst)
  265.     Animate(animationKey,rastPort)
  266.     AreaDraw(rastPort,x,y)
  267.     AreaElipse(rPort,cx,cy,a,b)
  268.     AreaEnd(rastPort)
  269.     AreaMove(rastPort,x,y)
  270.     AskFont(rastPort,textAttr)
  271.     AskSoftStyle(rastPort)
  272.     AttemptLockLayerRom(layer)
  273.     BltBitMap(sBitMap,sX,sY,dBitMap,dX,dY,szX,szY,mnt,msk,t)
  274.     BltBitMapRastPort(src,sx,sy,dest,dX,dY,szX,szY,mint)
  275.     BltClear(memory,size,flags)
  276.     BltMaskBitMapRastPort(src,sx,sy,dest,dX,dY,szX,szY,mint,bMask)
  277.     BltPattern(rastPort,ras,xl,yl,maxX,maxY,fillBytes)
  278.     BltTemplate(src,sX,sMod,dRastPort,dX,dY,szX,szY)
  279.     CBump(copperList)
  280.     ChangeSprite(vp,simplesprite,data)
  281.     ClearEOL(rastPort)
  282.     ClearRegion(rgn)
  283.     ClearScreen(rastPort)
  284.     ClipBlit(src,sX,sY,dest,dX,dY,szX,szY,mint)
  285.     CloseFont(textFont)
  286.     CMove(copperList,destination,data)
  287.     CopySBitMap(l1,l2)
  288.     CWait(copperList,x,y)
  289.     DisownBlitter()
  290.     DisposeRegion(rgn)
  291.     DoCollision(rasPort)
  292.     Draw(rastPort,x,y)
  293.     DrawElipse(rPort,cx,cy,a,b)
  294.     DrawGList(rastPort,viewPort)
  295.     Flood(rastPort,mode,x,y)
  296.     FreeColorMap(colormap)
  297.     FreeCopList(coplist)
  298.     FreeCprList(cprlist)
  299.     FreeGBuffers(animationObj,rastPort,doubleBuffer)
  300.     FreeRaster(planeptr,width,height)
  301.     FreeSprite(num)
  302.     FreeVPortCopLists(viewport)
  303.     GetColorMap(entries)
  304.     GetGBuffers(animationObj,rastPort,doubleBuffer)
  305.     GetRGB4(colormap,entry)
  306.     GetSprite(simplesprite,num)
  307.     GraphicsReserved1()
  308.     GraphicsReserved2()
  309.     InitArea(areaInfo,vectorTable,vectorTableSize)
  310.     InitBitMap(bitMap,depth,width,height)
  311.     InitGels(dummyHead,dummyTail,GelsInfo)
  312.     InitGMasks(animationObj)
  313.     InitMasks(vSprite)
  314.     InitRastPort(rastPort)
  315.     InitTmpRas(tmpras,buff,size)
  316.     InitView(view)
  317.     InitVPort(viewPort)
  318.     LoadRGB4(viewPort,colors,count)
  319.     LoadView(view)
  320.     LockLayerRom(layer)
  321.     MakeVPort(view,viewPort)
  322.     Move(rastPort,x,y)
  323.     MoveSprite(viewport,simplesprite,x,y)
  324.     MrgCop(view)
  325.     NewRegion()
  326.     NotRegion(rgn)
  327.     OpenFont(textAttr)
  328.     OrRectRegion(rgn,rect)
  329.     OrRegionRegion(src,dst)
  330.     OwnBlitter()
  331.     PolyDraw(rastPort,count,polyTable)
  332.     QBlit(blit)
  333.     QBSBlit(blit)
  334.     ReadPixel(rastPort,x,y)
  335.     RectFill(rastPort,xl,yl,xu,yu)
  336.     RemFont(textFont)
  337.     RemIBob(bob,rastPort,viewPort)
  338.     RemVSprite(vSprite)
  339.     ScrollRaster(rastPort,dX,dY,minx,miny,maxx,maxy)
  340.     ScrollVPort(vp)
  341.     SetAPen(rastPort,pen)
  342.     SetBPen(rastPort,pen)
  343.     SetCollision(type,routine,gelsInfo)
  344.     SetDrMd(rastPort,drawMode)
  345.     SetFont(RastPortID,textFont)
  346.     SetRast(rastPort,color)
  347.     SetRGB4(viewPort,index,r,g,b)
  348.     SetRGB4CM(cm,i,r,g,b)
  349.     SetSoftStyle(rastPort,style,enable)
  350.     SortGList(rastPort)
  351.     SyncSBitMap(l)
  352.     Text(RastPort,string,count)
  353.     TextLength(RastPort,string,count)
  354.     UCopperListInit(copperlist,num)
  355.     UnlockLayerRom(layer)
  356.     VBeamPos()
  357.     WaitBlit()
  358.     WaitBOVP(viewport)
  359.     WaitTOF()
  360.     WritePixel(rastPort,x,y)
  361.     XorRectRegion(rgn,rect)
  362.     XorRegionRegion(src,dst)
  363.  
  364. icon.library
  365.  
  366.     AddFreeList(freelist,mem,size)
  367.     AllocWBObject()
  368.     BumpRevision(newname,oldname)
  369.     FindToolType(toolTypeArray,typeName)
  370.     FreeDiskObject(diskobj)
  371.     FreeFreeList(freelist)
  372.     FreeWBObject(WBObject)
  373.     GetDiskObject(name)
  374.     GetIcon(name,icon,freelist)
  375.     GetWBObject(name)
  376.     MatchToolValue(typeString,value)
  377.     PutDiskObject(name,diskobj)
  378.     PutIcon(name,icon)
  379.     PutWBObject(name,object)
  380.  
  381. intuition.library
  382.  
  383.     ActivateGadget(Gad,Window,Req)
  384.     ActivateWindow(Window)
  385.     AddGadget(AddPtr,Gadget,Position)
  386.     AddGList(aPtr,Gad,Pos,NumGad,Req)
  387.     AllocRemember(RememberKey,Size,Flags)
  388.     AlohaWorkbench(wbport)
  389.     AutoRequest(Window,Body,PText,NText,PFlag,NFlag,W,H)
  390.     BeginRefresh(Window)
  391.     BuildSysRequest(Window,Body,PosText,NegText,Flags,W,H)
  392.     ClearDMRequest(Window)
  393.     ClearMenuStrip(Window)
  394.     ClearPointer(Window)
  395.     CloseScreen(Screen)
  396.     CloseWindow(Window)
  397.     CloseWorkBench()
  398.     CurrentTime(Seconds,Micros)
  399.     DisplayAlert(AlertNumber,String,Height)
  400.     DisplayBeep(Screen)
  401.     DoubleClick(sseconds,smicros,cseconds,cmicros)
  402.     DrawBorder(RPort,Border,LeftOffset,TopOffset)
  403.     DrawImage(RPort,Image,LeftOffset,TopOffset)
  404.     EndRefresh(Window,Complete)
  405.     EndRequest(requester,window)
  406.     FreeRemember(RememberKey,ReallyForget)
  407.     FreeSysRequest(Window)
  408.     GetDefPrefs(preferences,size)
  409.     GetPrefs(preferences,size)
  410.     GetScreenData(buffer,size,type,screen)
  411.     InitRequester(req)
  412.     IntuiTextLength(itext)
  413.     Intuition(ievent)
  414.     ItemAddress(MenuStrip,MenuNumber)
  415.     LockIBase(dontknow)
  416.     MakeScreen(Screen)
  417.     ModifyIDCMP(Window,Flags)
  418.     ModifyProp(Gadget,Ptr,Req,Flags,HPos,VPos,HBody,VBody)
  419.     MoveScreen(Screen,dx,dy)
  420.     MoveWindow(window,dx,dy)
  421.     NewModifyProp(Gad,Ptr,Req,Flg,hPs,vPs,hBdy,vBdy,NumG)
  422.     OffGadget(Gadget,Ptr,Req)
  423.     OffMenu(Window,MenuNumber)
  424.     OnGadget(Gadget,Ptr,Req)
  425.     OnMenu(Window,MenuNumber)
  426.     OpenIntuition()
  427.     OpenScreen(OSargs)
  428.     OpenWindow(OWargs)
  429.     OpenWorkBench()
  430.     PrintIText(rp,itext,left,top)
  431.     RefreshGadgets(Gadgets,Ptr,Req)
  432.     RefreshGList(Gadgets,Ptr,Req,NumGad)
  433.     RefreshWindowFrame(Window)
  434.     RemakeDisplay()
  435.     RemoveGadget(RemPtr,Gadget)
  436.     RemoveGList(RemPtr,Gad,NumGad)
  437.     ReportMouse(Window,Boolean)
  438.     Request(Requester,Window)
  439.     RethinkDisplay()
  440.     ScreenToBack(Screen)
  441.     ScreenToFront(Screen)
  442.     SetDMRequest(Window,req)
  443.     SetMenuStrip(Window,Menu)
  444.     SetPointer(Window,Pointer,Height,Width,Xoffset,Yoffset)
  445.     SetPrefs(preferences,size,flag)
  446.     SetWindowTitles(window,windowtitle,screentitle)
  447.     ShowTitle(Screen,ShowIt)
  448.     SizeWindow(window,dx,dy)
  449.     UnlockIBase(IBLock)
  450.     ViewAddress()
  451.     ViewPortAddress(window)
  452.     WBenchToBack()
  453.     WBenchToFront()
  454.     WindowLimits(window,minwidth,minheight,maxwidth,maxheight)
  455.     WindowToBack(window)
  456.     WindowToFront(window)
  457.  
  458. layers.library
  459.  
  460.     BeginUpdate(layer)
  461.     BehindLayer(li,layer)
  462.     CreateBehindLayer(li,bm,x0,y0,x1,y1,flags,bm2)
  463.     CreateUpfrontLayer(li,bm,x0,y0,x1,y1,flags,bm2)
  464.     DeleteLayer(li,layer)
  465.     DisposeLayerInfo(li)
  466.     EndUpdate(layer,flag)
  467.     FattenLayerInfo(li)
  468.     InitLayers(li)
  469.     InstallClipRegion(layer,region)
  470.     LockLayer(li,layer)
  471.     LockLayerInfo(li)
  472.     LockLayers(li)
  473.     MoveLayer(li,layer,dx,dy)
  474.     MoveLayerInFrontOf(layer_to_move,layer_to_be_infront_of)
  475.     NewLayerInfo()
  476.     ScrollLayer(li,layer,dx,dy)
  477.     SizeLayer(li,layer,dx,dy)
  478.     SwapBitsRastPortClipRect(rp,cr)
  479.     ThinLayerInfo(li)
  480.     UnlockLayer(layer)
  481.     UnlockLayerInfo(li)
  482.     UnlockLayers(li)
  483.     UpfrontLayer(li,layer)
  484.     WhichLayer(li,x,y)
  485.  
  486. mathffp.library
  487.  
  488.     SPAbs(fnum1)
  489.     SPAdd(fnum1,fnum2)
  490.     SPCeil(fnum1)
  491.     SPCmp(fnum1,fnum2)
  492.     SPDiv(fnum1,fnum2)
  493.     SPFix(fnum1)
  494.     SPFloor(fnum1)
  495.     SPFlt(num1)
  496.     SPMul(fnum1,fnum2)
  497.     SPNeg(fnum1)
  498.     SPSub(fnum1,fnum2)
  499.     SPTst(fnum1)
  500.  
  501. mathtrans.library
  502.  
  503.     SPAcos(num1)
  504.     SPAsin(num1)
  505.     SPAtan(num1)
  506.     SPCos(num1)
  507.     SPCosh(num1)
  508.     SPExp(num1)
  509.     SPFieee(num1)
  510.     SPLog(num1)
  511.     SPLog10(num1)
  512.     SPPow(num1,num2)
  513.     SPSin(num1)
  514.     SPSincos(num1,num2)
  515.     SPSinh(num1)
  516.     SPSqrt(num1)
  517.     SPTan(num1)
  518.     SPTanh(num1)
  519.     SPTieee(num1)
  520.  
  521. translator.library
  522.  
  523.     Translate(inStr,inLen,oBuf,bSize)
  524.