home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Telephone Manager / Stiletto Sources / Sources / CallBackRoutines.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-04  |  3.1 KB  |  119 lines  |  [TEXT/MPS ]

  1. /************************************************************************************************/
  2. /*                                                                                                */
  3. /*    Program Name:    Stiletto                                                                    */
  4. /*                                                                                                */
  5. /*    File Name:        CallBackRoutines.c                                                            */
  6. /*                                                                                                */
  7. /*    © Apple Computer, Inc. 1991-1995                                                            */
  8. /*    All Rights Reserved                                                                            */
  9. /*                                                                                                */
  10. /*    Revision History:                                                                            */
  11. /*                                                                                                */
  12. /*        Date        Who                    Modification                                            */
  13. /*                                                                                                */
  14. /*        1991-09-28    Chris Halim            Original version                                        */
  15. /*        1995-06-26    Jaakko Railo        Version 2.0                                                */
  16. /*                                                                                                */
  17. /************************************************************************************************/
  18.  
  19. /****************************************** DESCRIPTION ******************************************
  20.  
  21. *************************************************************************************************/
  22.  
  23. /******************************************** HEADERS *******************************************/
  24.  
  25. #ifndef __STDARG__
  26. #include "stdarg.h"
  27. #endif
  28.  
  29. #ifndef __TELEPHONES__
  30. #include "Telephones.h"
  31. #endif
  32.  
  33. #ifndef    __CALLBACKROUTINES__
  34. #include "CallBackRoutines.h"
  35. #endif
  36.  
  37. #ifndef    __CHRSMODULES__
  38. #include "CHRSModules.h"
  39. #endif
  40.  
  41. #ifndef    __LOGWINDOW__
  42. #include "LogWindow.h"
  43. #endif
  44.  
  45. #ifndef    __TERMWINDOW__
  46. #include "TermWindow.h"
  47. #endif
  48.  
  49. /****************************************** DEFINITIONS *****************************************/
  50.  
  51. /****************************************** PROTOTYPES ******************************************/
  52.  
  53. TELHandle    GetCurrentTELHandleStub ();
  54. TELCAHandle    GetCAHandleStub ();
  55. TELDNHandle    GetDNHandleStub ();
  56. void PrintStub (CHRSPtr paramPtr, const char * format, va_list ap);
  57.  
  58. /******************************************** GLOBALS *******************************************/
  59.  
  60. extern    TelWindowPtr        gTelWindow;
  61.  
  62. extern    LogWindowPtr        gLogWindow;
  63.  
  64. /************************************************************************************************/
  65. /************************************************************************************************/
  66.  
  67.  
  68. void    EntryPoint (CHRSPtr paramPtr)
  69. {
  70.     short    resultCode = requestSuccess;
  71.     
  72.     switch (paramPtr->request)
  73.     {
  74.         case getCurrentTELHandleRequest :
  75.             paramPtr->outArgs[0] = (long) GetCurrentTELHandleStub ();
  76.             break;
  77.             
  78.         case getCAHandleRequest :
  79.             paramPtr->outArgs[0] = (long) GetCAHandleStub ();
  80.             break;
  81.             
  82.         case getDNHandleRequest :
  83.             paramPtr->outArgs[0] = (long) GetDNHandleStub ();
  84.             break;
  85.             
  86.         case printRequest :
  87.             PrintStub (paramPtr, (char *) paramPtr->inArgs[0], (va_list) paramPtr->inArgs[1]);
  88.             break;
  89.             
  90.         default :
  91.             resultCode = requestNotImplemented;
  92.     }
  93.     
  94.     paramPtr->result = resultCode;
  95. }
  96.  
  97.  
  98. TELHandle    GetCurrentTELHandleStub ()
  99. {    
  100.     return (gTelWindow->fTELHandle);
  101. }
  102.  
  103.  
  104. TELCAHandle    GetCAHandleStub ()
  105. {    
  106.     return (GetAnyCA (gTelWindow));
  107. }
  108.  
  109. TELDNHandle    GetDNHandleStub ()
  110. {    
  111.     return (GetAnyDN (gTelWindow));
  112. }
  113.  
  114. void PrintStub (CHRSPtr paramPtr, const char * format, va_list ap)
  115. {
  116.     VPutLine (gLogWindow, format, ap);
  117.     
  118.     paramPtr->result = requestSuccess;
  119. }