home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************************/
- /* */
- /* Module Name: CALookup */
- /* */
- /* File Name: CALookup.c */
- /* */
- /* © Apple Computer, Inc. 1991-1995 */
- /* All Rights Reserved */
- /* */
- /* Revision History: */
- /* */
- /* Date Who Modification */
- /* */
- /* 1991-07-16 Jaakko Railo Original version */
- /* */
- /************************************************************************************************/
-
- /****************************************** DESCRIPTION ******************************************
-
- This module calls TELCALookup with different IntExt parameter.
-
- *************************************************************************************************/
-
- /******************************************** HEADERS *******************************************/
-
- #include "TestModule.h"
-
- /****************************************** DEFINITIONS *****************************************/
-
- /****************************************** PROTOTYPES ******************************************/
-
- void DoTest (CHRSPtr paramPtr);
-
- /************************************************************************************************/
- /************************************************************************************************/
-
-
- pascal short TestModule (CHRSPtr paramPtr)
- {
- short returnValue = noErr;
-
- if (paramPtr->version <= kTestModuleVersion) {
-
- DoTest (paramPtr);
-
- }
- else
- returnValue = kWrongVersion;
-
- return (returnValue);
- }
-
-
- void DoTest (CHRSPtr paramPtr)
- {
- TELHandle termHand = GetCurrentTELHandle (paramPtr);
- TELDNHandle dnHand;
- TELCAHandle caHand;
- OSErr errCode;
- short numOfCAs, index;
-
- if ((dnHand = GetDNHandle (paramPtr)) != nil) {
- numOfCAs = TELCountCAs (dnHand, telAllCallOrigins);
- Print (paramPtr, "Number of CAs found = %d", numOfCAs);
-
- for (index = 1; index <= numOfCAs; ++index) {
- if ((errCode = TELCALookup (dnHand, telAllCallOrigins, index, &caHand)) == noErr) {
-
- Print (paramPtr, "CAHand (telAllCallOrigins) = %08x", caHand);
-
- if ((errCode = TELCADispose (caHand)) != noErr)
- Print (paramPtr, "### TELCADispose fails : %d", errCode);
- }
- else
- Print (paramPtr, "### TELCALookup (telAllCallOrigins) fails : %d", errCode);
-
- if ((errCode = TELCALookup (dnHand, telInternalCall, index, &caHand)) == noErr) {
-
- Print (paramPtr, "CAHand (telInternalCall) = %08x", caHand);
-
- if ((errCode = TELCADispose (caHand)) != noErr)
- Print (paramPtr, "### TELCADispose fails : %d", errCode);
- }
- else
- Print (paramPtr, "### TELCALookup (telInternalCall) fails : %d", errCode);
-
- if ((errCode = TELCALookup (dnHand, telExternalCall, index, &caHand)) == noErr) {
-
- Print (paramPtr, "CAHand (telExternalCall) = %08x", caHand);
-
- if ((errCode = TELCADispose (caHand)) != noErr)
- Print (paramPtr, "### TELCADispose fails : %d", errCode);
- }
- else
- Print (paramPtr, "### TELCALookup (telExternalCall) fails : %d", errCode);
- }
- }
- else
- Print (paramPtr, "### Unable to retrieve the DN handle");
- }
-
-
-