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

  1. /************************************************************************************************/
  2. /*                                                                                                */
  3. /*    Module Name:    OtherFunction601                                                            */
  4. /*                                                                                                */
  5. /*    File Name:        OtherFunction601.c                                                            */
  6. /*                                                                                                */
  7. /*    © Apple Computer, Inc. 1995                                                                    */
  8. /*    All Rights Reserved                                                                            */
  9. /*                                                                                                */
  10. /*    Revision History:                                                                            */
  11. /*                                                                                                */
  12. /*        Date        Who                    Modification                                            */
  13. /*                                                                                                */
  14. /*        1995-01-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 "TelOther601.h"
  29.  
  30. #include "TestModule.h"
  31.  
  32. /****************************************** DEFINITIONS *****************************************/
  33.  
  34. /****************************************** PROTOTYPES ******************************************/
  35.  
  36. void         DoTest (CHRSPtr paramPtr);
  37.  
  38. /************************************************************************************************/
  39. /************************************************************************************************/
  40.  
  41.  
  42. pascal short TestModule (CHRSPtr paramPtr)
  43. {
  44.     short    returnValue = noErr;
  45.     
  46.     if (paramPtr->version <= kTestModuleVersion) {
  47.         
  48.         DoTest (paramPtr);
  49.         
  50.     }
  51.     else
  52.         returnValue = kWrongVersion;
  53.         
  54.     return (returnValue);
  55. }
  56.  
  57.  
  58. void DoTest (CHRSPtr paramPtr)
  59. {
  60.     TELHandle                termHand = GetCurrentTELHandle (paramPtr);
  61.     OSErr                    errCode;
  62.     TELToolDeviceInfoPtr    paramBlock;
  63.  
  64.     paramBlock = (TELToolDeviceInfoPtr) NewPtr (sizeof(TELToolDeviceInfoRecord));
  65.     if (paramBlock != NULL) {
  66.         paramBlock->csCode = kTELOtherToolDeviceInfo;
  67.         if ((errCode = TELOtherFunction (termHand, (Ptr) paramBlock, sizeof(TELToolDeviceInfoRecord))) == noErr) {
  68.             Print (paramPtr, "csCode               = %d", paramBlock->csCode);
  69.             Print (paramPtr, "structVersion        = %d", paramBlock->structVersion);
  70.             Print (paramPtr, "toolManufacturer     = %c%c%c%c", (paramBlock->toolManufacturer >> 24),
  71.                                                                 (paramBlock->toolManufacturer >> 16),
  72.                                                                 (paramBlock->toolManufacturer >> 8),
  73.                                                                  paramBlock->toolManufacturer);
  74.             Print (paramPtr, "toolDeviceType       = %c%c%c%c", (paramBlock->toolDeviceType >> 24),
  75.                                                                 (paramBlock->toolDeviceType >> 16),
  76.                                                                 (paramBlock->toolDeviceType >> 8),
  77.                                                                  paramBlock->toolDeviceType);
  78.             Print (paramPtr, "deviceVersionNumber  = %d", paramBlock->deviceVersionNumber);
  79.             Print (paramPtr, "CountryCode          = %d", paramBlock->CountryCode);
  80.             Print (paramPtr, "toolManufacturerName = %P", paramBlock->toolManufacturerName);
  81.             Print (paramPtr, "toolDeviceName       = %P", paramBlock->toolDeviceName);
  82.         }
  83.         else
  84.             Print (paramPtr, "### TELOtherFunction failed : %d", errCode);
  85.         DisposePtr ((Ptr) paramBlock);
  86.     }
  87. }
  88.