home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / analg211.zip / win32.c < prev   
C/C++ Source or Header  |  1997-03-14  |  761b  |  37 lines

  1. /*** analog 2.1 ***/
  2. /* Please read Readme.html, or http://www.statslab.cam.ac.uk/~sret1/analog/  */
  3.  
  4. /*** win32.c; stuff only required for the Win32 port ***/
  5. /* This stuff is due to Magnus Hagander (mha@edu.sollentuna.se) */
  6. #include "analhea2.h"
  7. #ifdef WIN32
  8. #include <windows.h>
  9.  
  10. /*
  11.  * Initialize the required Win32 structures and routines
  12.  */
  13.  
  14. void Win32Init(void) {
  15. #ifndef NODNS
  16.   WSADATA wsaData;
  17.  
  18.   if (WSAStartup(MAKEWORD(1,1),&wsaData)) {
  19.      fprintf(stderr,"Error: Unable to initialize winsock.dll!\n");
  20.      exit(1);
  21.   }
  22. #endif
  23. #ifndef NOPRIORITY
  24.   SetThreadPriority(GetCurrentThread(),THREAD_PRIORITY_BELOW_NORMAL);
  25. #endif
  26. }
  27.  
  28. /*
  29.  * Cleanup Win32 structures and routines
  30.  */
  31. void Win32Cleanup(void) {
  32. #ifndef NODNS
  33.   WSACleanup();
  34. #endif
  35. }
  36. #endif
  37.