/*->c.main */


#include <stdio.h>
#include <stdlib.h>


#include "kernel.h"
#include "swis.h"


#include "h.os"
#include "h.wimp"


#include "h.TWAIN"


#include "h.allerrs"


#include "h.acq"
#include "h.tw"

#include "h.main"



/* This is the SWI handler */


_kernel_oserror *TWAIN_swi(int swi_number,_kernel_swi_regs *r,
                                                       void *private_word)
{
 _kernel_oserror * err;

 private_word = private_word;

 err=NULL;

 if(!err)

 switch(swi_number)
 {
   case 0:
          err=(_kernel_oserror *)twaininit(r->r[0]);
          break;

   case 1:
          twainfinit(r->r[0]);
          break;

   case 2:
          r->r[0]=twainpoll((wimp_eventstr *)r->r[0]);
          break;

   case 3:
          err=(_kernel_oserror *)twainselect();
          break;

   case 4:
          err=(_kernel_oserror *)twainacquire((TWAcquireblockstr*)r->r[0]);
          break;

  default:
          err=&mb_nfserr_DummyFSDoesNothing;
          break;
 }

 return(err);
}





/* This is the finalisation code for DummyFS */

static void TWAIN_finalise(void)
{

 /*
   Close your filing system down here and free up all your memory NOW.
   If you do not then all your filing system's junk is going to be left
   cluttering up the RMA as this module is just about to be killed.
 */


}






/* This is the initialisation code for DummyFS */

_kernel_oserror *TWAIN_initialise(char *cmd_tail,int podule_base,
                                                   void *private_word)
{
 _kernel_oserror *err;

 /* These keep the compiler quiet. */

 cmd_tail=cmd_tail;
 podule_base=podule_base;
 private_word=private_word;

 err=NULL;

 if(!err)
 {
  atexit(TWAIN_finalise);
 }

 return(err);
}


void TWAIN_service(int service_number,_kernel_swi_regs *r,
                                                  void *private_word)
{

 switch(service_number)
 {


 }

 r=r;
 private_word=private_word;

}

