home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / desk / examples / Desk / Examples / OSBuffer / Old / Parall < prev    next >
Encoding:
Text File  |  1997-05-20  |  810 b   |  34 lines

  1. #include "swis.h"
  2.  
  3. #include "Desk.DeskMem.h"
  4. #include "Desk.Debug.h"
  5. #include "Desk.Error2.h"
  6.  
  7. #include "OSBuffer.h"
  8.  
  9.  
  10. Desk_osbuffer_block*    Desk_OSBuffer_Init( int bufferhandle)
  11.     {
  12.     Desk_osbuffer_block*    osbuffer = Desk_DeskMem_MallocType( Desk_osbuffer_block);
  13.     
  14.     Desk_Error2_CheckOS( _swix( Buffer_InternalInfo, _IN(0)|_OUTR(0,2), bufferhandle, &osbuffer->id, &osbuffer->serviceroutine, &osbuffer->pw));
  15.         // See PRMs 5a-226
  16.     
  17.     Desk_Debug_Printf( Desk_error_PLACE "PointerBuffer_Init called, id=0x%p, service routine=0x%p, pw=0x%p\n", 
  18.         osbuffer->id, 
  19.         osbuffer->serviceroutine, 
  20.         osbuffer->pw
  21.         );
  22.     
  23.     return osbuffer;
  24.     }
  25.  
  26.  
  27. void    Desk_OSBuffer_Final( Desk_osbuffer_block* osbuffer)
  28.     {
  29.     osbuffer->id            = (void*) -1;
  30.     osbuffer->serviceroutine    = NULL;
  31.     osbuffer->pw            = NULL;
  32.     Desk_DeskMem_Free( osbuffer);
  33.     }
  34.