home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / nsprpub / pr / src / md / windows / w16null.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.3 KB  |  98 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /*
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  * 
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  * 
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #include "primpl.h"
  20. #include <sys/timeb.h>
  21.  
  22.  
  23. struct _MDLock          _pr_ioq_lock;
  24. HINSTANCE               _pr_hInstance = NULL;
  25. char *                  _pr_top_of_task_stack;
  26. _PRInterruptTable       _pr_interruptTable[] = { { 0 } };
  27.  
  28. /*
  29.  *-----------------------------------------------------------------------
  30.  *
  31.  * PR_Now --
  32.  *
  33.  *     Returns the current time in microseconds since the epoch.
  34.  *     The epoch is midnight January 1, 1970 GMT.
  35.  *     The implementation is machine dependent.  This is the
  36.  *     implementation for Windows.
  37.  *     Cf. time_t time(time_t *tp)
  38.  *
  39.  *-----------------------------------------------------------------------
  40.  */
  41.  
  42. #if defined(HAVE_WATCOM_BUG_2)
  43. PRTime __pascal __export __loadds
  44. #else
  45. PRTime
  46. #endif
  47. PR_Now(void)
  48. {
  49.     PRInt64 s, ms, ms2us, s2us;
  50.     struct timeb b;
  51.  
  52.     ftime(&b);
  53.     LL_I2L(ms2us, PR_USEC_PER_MSEC);
  54.     LL_I2L(s2us, PR_USEC_PER_SEC);
  55.     LL_I2L(s, b.time);
  56.     LL_I2L(ms, (PRInt32)b.millitm);
  57.     LL_MUL(ms, ms, ms2us);
  58.     LL_MUL(s, s, s2us);
  59.     LL_ADD(s, s, ms);
  60.     return s;       
  61. }
  62.  
  63.  
  64.  
  65. char *_PR_MD_GET_ENV(const char *name)
  66. {
  67.     return NULL;
  68. }
  69.  
  70. PRIntn
  71. _PR_MD_PUT_ENV(const char *name)
  72. {
  73.     return NULL;
  74. }
  75.  
  76. int CALLBACK LibMain( HINSTANCE hInst, WORD wDataSeg, 
  77.                       WORD cbHeapSize, LPSTR lpszCmdLine )
  78. {
  79.     _pr_hInstance = hInst;
  80.     return TRUE;
  81. }
  82.  
  83.  
  84.  
  85. void
  86. _PR_MD_EARLY_INIT()
  87. {
  88.     _tzset();
  89.     return;
  90. }
  91.  
  92. void
  93. _PR_MD_WAKEUP_CPUS( void )
  94. {
  95.     return;
  96. }    
  97.  
  98.