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 / ModuleSources / GetDNStatus.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-11  |  2.4 KB  |  79 lines  |  [TEXT/MPS ]

  1. /************************************************************************************************/
  2. /*                                                                                                */
  3. /*    Module Name:    GetDNStatus                                                                    */
  4. /*                                                                                                */
  5. /*    File Name:        GetDNStatus.c                                                                */
  6. /*                                                                                                */
  7. /*    © Apple Computer, Inc. 1994-1995                                                            */
  8. /*    All Rights Reserved                                                                            */
  9. /*                                                                                                */
  10. /*    Revision History:                                                                            */
  11. /*                                                                                                */
  12. /*        Date        Who                    Modification                                            */
  13. /*                                                                                                */
  14. /*        1994-10-27    Jaakko Railo        Original version                                        */
  15. /*                                                                                                */
  16. /************************************************************************************************/
  17.  
  18. /****************************************** DESCRIPTION ******************************************
  19.  
  20. *************************************************************************************************/
  21.  
  22. /******************************************** HEADERS *******************************************/
  23.  
  24. #ifndef __TELEPHONES__
  25. #include "Telephones.h"
  26. #endif
  27.  
  28. #include "TestModule.h"
  29.  
  30. /****************************************** DEFINITIONS *****************************************/
  31.  
  32. /****************************************** PROTOTYPES ******************************************/
  33.  
  34. void         DoTest (CHRSPtr paramPtr);
  35.  
  36. /************************************************************************************************/
  37. /************************************************************************************************/
  38.  
  39.  
  40. pascal short TestModule (CHRSPtr paramPtr)
  41. {
  42.     short    returnValue = noErr;
  43.     
  44.     if (paramPtr->version <= kTestModuleVersion) {
  45.         
  46.         DoTest (paramPtr);
  47.         
  48.     }
  49.     else
  50.         returnValue = kWrongVersion;
  51.         
  52.     return (returnValue);
  53. }
  54.  
  55.  
  56. void DoTest (CHRSPtr paramPtr)
  57. {
  58.     TELHandle        termHand = GetCurrentTELHandle (paramPtr);
  59.     TELDNHandle        dnHand;
  60.     OSErr            errCode;
  61.     long            inUse;
  62.     char *             array[] = {    "telDNNotUsed",
  63.                                 "telDNPOTSCall",
  64.                                 "telDNFaxCall",
  65.                                 "telDNDataCall",
  66.                                 "telDNAlerting",
  67.                                 "telDNUnkonwnState"
  68.                               };
  69.  
  70.     if ((dnHand = GetDNHandle (paramPtr)) != nil) {
  71.         if ((errCode = TELGetDNStatus (dnHand, &inUse)) == noErr)
  72.             Print (paramPtr, "TELGetDNStatus --> inUse = %s", array[inUse]);
  73.         else
  74.             Print (paramPtr, "### TELGetDNStatus failed : %d", errCode);
  75.     }
  76.     else
  77.         Print (paramPtr, "### Unable to retrieve the DN handle");
  78. }
  79.