home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / mmpm2tk / mmpmtlk2 / fssht / shrouter.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-06  |  5.6 KB  |  132 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*                    Copyright (c) IBM Corporation 1992                    */
  4. /*                           All Rights Reserved                            */
  5. /*                                                                          */
  6. /* SOURCE FILE NAME: SHROUTER.C                                             */
  7. /*                                                                          */
  8. /* DESCRIPTIVE NAME:  Stream Handler Command Router.                        */
  9. /*                                                                          */
  10. /* FUNCTION: This file contains the stream handler router routine.  It      */
  11. /*           takes SHC commands from the stream manager and routes them     */
  12. /*           to the appropriate routine.                                    */
  13. /*                                                                          */
  14. /* ENTRY POINTS: ShcRouter                                                  */
  15. /*                                                                          */
  16. /*************************** END OF SPECIFICATIONS **************************/
  17. #define  INCL_NOPMAPI                  /* no PM include files required */
  18. #define  INCL_DOSSEMAPHORES
  19. #define  INCL_DOSERRORS
  20. #define  INCL_DOSPROCESS
  21. #include <os2.h>
  22. #include <os2me.h>
  23. #include <hhpheap.h>
  24. #include <shi.h>
  25.  
  26. /************************** START OF SPECIFICATIONS *************************/
  27. /*                                                                          */
  28. /* SUBROUTINE NAME: ShcRouter                                               */
  29. /*                                                                          */
  30. /* DESCRIPTIVE NAME: Stream Handler Command Router routine                  */
  31. /*                                                                          */
  32. /* FUNCTION: This is the entry point routine that the stream manager will   */
  33. /*   call.  It should take the first parameter (function) and call the      */
  34. /*   appropriate routine to service this request.                           */
  35. /*                                                                          */
  36. /* NOTES:                                                                   */
  37. /*                                                                          */
  38. /* ENTRY POINT: ShcRouter                                                   */
  39. /*   LINKAGE:   CALL NEAR (0:32)                                            */
  40. /*                                                                          */
  41. /* INPUT: pParmIn    - Addr of input parm structure.  The contents of this  */
  42. /*                     structure is dependent on the function called.       */
  43. /*                                                                          */
  44. /* EXIT-NORMAL: NO_ERROR                                                    */
  45. /*                                                                          */
  46. /* EXIT-ERROR:                                                              */
  47. /*                                                                          */
  48. /* SIDE EFFECTS:                                                            */
  49. /*                                                                          */
  50. /* INTERNAL REFERENCES:                                                     */
  51. /*        ROUTINES:                                                         */
  52. /*                                                                          */
  53. /* EXTERNAL REFERENCES:                                                     */
  54. /*        ROUTINES:                                                         */
  55. /*        DATA STRUCTURES:                                                  */
  56. /*                                                                          */
  57. /*************************** END OF SPECIFICATIONS **************************/
  58.  
  59. ULONG APIENTRY ShcRouter(pshc)
  60. PVOID pshc;
  61.  
  62. { /* Start of ShcRouter */
  63.  
  64. PSHC_COMMON pshcNow;
  65. RC rc = NO_ERROR;                       // local return code
  66.  
  67.   pshcNow = (PSHC_COMMON)pshc;
  68.  
  69.   switch (pshcNow->ulFunction)
  70.   {
  71.     case SHC_ASSOCIATE:
  72.          {
  73.            rc = ShcAssociate((PPARM_ASSOC)pshcNow);
  74.            break;
  75.          }
  76.     case SHC_CREATE:
  77.          {
  78.            rc = ShcCreate((PPARM_CREATE)pshcNow);
  79.            break;
  80.          }
  81.     case SHC_DESTROY:
  82.          {
  83.            rc = ShcDestroy((PPARM_DESTROY)pshcNow);
  84.            break;
  85.          }
  86.     case SHC_SEEK:
  87.          {
  88.            rc = ShcSeek((PPARM_SEEK)pshcNow);
  89.            break;
  90.          }
  91.     case SHC_START:
  92.          {
  93.            rc = ShcStart((PPARM_START)pshcNow);
  94.            break;
  95.          }
  96.     case SHC_STOP:
  97.          {
  98.            rc = ShcStop((PPARM_STOP)pshcNow);
  99.            break;
  100.          }
  101.     case SHC_GET_PROTOCOL:
  102.          {
  103.            rc = ShcGetProtocol((PPARM_GPROT)pshcNow);
  104.            break;
  105.          }
  106.     case SHC_INSTALL_PROTOCOL:
  107.          {
  108.            rc = ShcInstallProtocol((PPARM_INSTPROT)pshcNow);
  109.            break;
  110.          }
  111.     case SHC_ENUMERATE_PROTOCOLS:
  112.          {
  113.            rc = ShcEnumerateProtocols((PPARM_ENUMPROT)pshcNow);
  114.            break;
  115.          }
  116.     case SHC_NEGOTIATE_RESULT:
  117.          {
  118.            rc = ShcNegotiateResult((PPARM_NEGOTIATE)pshcNow);
  119.            break;
  120.          }
  121.     default:
  122.          {
  123.            rc = ERROR_INVALID_FUNCTION;
  124.            break;
  125.          }
  126.  
  127.   } /* endswitch */
  128.  
  129.   return(rc);
  130.  
  131. } /* End of ShcRouter */
  132.