home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / tservs.exe / TSERVERS.C next >
C/C++ Source or Header  |  1994-09-22  |  3KB  |  104 lines

  1. /****************************************************************************
  2. **    File:    TSERVERS.C
  3. **
  4. **    Desc:    Sample telephony program
  5. **
  6. **        This NetWare Telephony Services program lists the names of the
  7. **        available TServers.
  8. **
  9. **        This program is written for Borland C 4.0 for Windows 3.1. It
  10. **        is compiled as an EASYWIN program, so that I didn't have to
  11. **        include all the Windows "overhead" code but can just get to
  12. **        the good stuff.
  13. **
  14. **
  15. **        DISCLAIMER
  16. **
  17. **    Novell, Inc. makes no representations or warranties with respect to
  18. **    any NetWare software, and specifically disclaims any express or
  19. **    implied warranties of merchantability, title, or fitness for a
  20. **    particular purpose.
  21. **
  22. **    Distribution of any NetWare software is forbidden without the
  23. **    express written consent of Novell, Inc.  Further, Novell reserves
  24. **    the right to discontinue distribution of any NetWare software.
  25. **
  26. **    Novell is not responsible for lost profits or revenue, loss of use
  27. **    of the software, loss of data, costs of re-creating lost data, the
  28. **    cost of any substitute equipment or program, or claims by any party
  29. **    other than you.  Novell strongly recommends a backup be made before
  30. **    any software is installed.   Technical support for this software
  31. **    may be provided at the discretion of Novell.
  32. **
  33. **    Programmers:
  34. **
  35. **        Ini    Who                        Firm
  36. **        -----------------------------------------------------------------------
  37. **        KVW    Kevin V White                Novell Developer Support.
  38. **
  39. **    History:
  40. **
  41. **        When        Who    What
  42. **        -----------------------------------------------------------------------
  43. **        9/22/94    kvw    initial Windows program
  44. */
  45.  
  46. /****************************************************************************
  47. **    Include headers, macros, function prototypes, etc.
  48. */
  49.  
  50.     /*------------------------------------------------------------------------
  51.     **    ANSI
  52.     */
  53.     #include <stdio.h>
  54.     #include <string.h>
  55.     #include <conio.h>
  56.  
  57.     /*------------------------------------------------------------------------
  58.     **    Windows
  59.     */
  60.     #include <windows.h>
  61.  
  62.     /*------------------------------------------------------------------------
  63.     **    Telephony
  64.     */
  65.     #include <acs.h>
  66.     #include <csta.h>
  67.  
  68.  
  69. /****************************************************************************
  70. **    This is the callback function that we need to have acsEnumServerNames()
  71. **    call.  It will be called once for each Telephony Server that is found, or
  72. **    until a FALSE value is returned, instructing TServer to halt enumerating
  73. **    the available TServers.
  74. */
  75. Boolean FAR PASCAL _export ListTServers(char *serverName,unsigned long lParam)
  76. {
  77.     printf("\nServer Name:   %48s   lParam: %lu",serverName,lParam);
  78.     return TRUE;
  79. }
  80.  
  81. void main(void)
  82. {
  83.  
  84.     /*------------------------------------------------------------------
  85.     **    Variables necessary for the acsEnumServerNames() call.
  86.     */
  87.  
  88.     EnumServerNamesCB    listTServers;
  89.     StreamType_t        streamType=ST_CSTA;
  90.     unsigned long        paramToPass=1234L;
  91.  
  92.     /*------------------------------------------------------------------
  93.     **    First, get the "proc instance" of the function pointer and type cast
  94.     **    it to the EnumServerNamesCB type
  95.     */
  96.     listTServers=(EnumServerNamesCB) MakeProcInstance ((FARPROC)ListTServers,NULL);
  97.  
  98.     /*------------------------------------------------------------------
  99.     **    Then make the function call to start the EnumServers going
  100.     */
  101.     acsEnumServerNames(streamType,listTServers,paramToPass);
  102.     return;
  103. }
  104.