1 /*  ncbitime.h
2 * ===========================================================================
3 *
4 *                            PUBLIC DOMAIN NOTICE
5 *               National Center for Biotechnology Information
6 *
7 *  This software/database is a "United States Government Work" under the
8 *  terms of the United States Copyright Act.  It was written as part of
9 *  the author's official duties as a United States Government employee and
10 *  thus cannot be copyrighted.  This software/database is freely available
11 *  to the public for use. The National Library of Medicine and the U.S.
12 *  Government have not placed any restriction on its use or reproduction.
13 *
14 *  Although all reasonable efforts have been taken to ensure the accuracy
15 *  and reliability of the software and data, the NLM and the U.S.
16 *  Government do not and cannot warrant the performance or results that
17 *  may be obtained by using this software or data. The NLM and the U.S.
18 *  Government disclaim all warranties, express or implied, including
19 *  warranties of performance, merchantability or fitness for any particular
20 *  purpose.
21 *
22 *  Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * File Name:  ncbitime.h
27 *
28 * Author:  Ostell, Kans
29 *
30 * Version Creation Date:  1/1/90
31 *
32 * $Revision: 6.0 $
33 *
34 * File Description:
35 *   misc portable routines with
36 *   dates, times, timers
37 *   prototypes and defines
38 *
39 * Modifications:
40 * --------------------------------------------------------------------------
41 * Date     Name        Description of modification
42 * -------  ----------  -----------------------------------------------------
43 * 09-19-91 Schuler     Redefined DayTime struct as ASNI struct tm.
44 * 09-19-91 Schuler     Use ANSI functions for time services instead of
45 *                       the Macintosh and Windows functions.
46 * 04-15-93 Schuler     Changed _cdecl to LIBCALL
47 *
48 *
49 * $Log: ncbitime.h,v $
50 * Revision 6.0  1997/08/25 18:17:23  madden
51 * Revision changed to 6.0
52 *
53 * Revision 5.4  1997/07/17 16:09:33  vakatov
54 * Encapsulated "NCBI_months" global variable into a {function + cpp macros}
55 *
56 * Revision 5.3  1996/12/03 21:48:33  vakatov
57 * Adopted for 32-bit MS-Windows DLLs
58 *
59  * Revision 5.2  1996/09/16  20:19:57  kans
60  * corrected prototype misspelling
61  *
62  * Revision 5.1  1996/09/16  19:37:19  sad
63  * Added set of functions for measuring CPU time.
64  * Added StopWatch set of functions.
65  *
66 * Revision 5.0  1996/05/28 13:18:57  ostell
67 * Set to revision 5.0
68 *
69  * Revision 4.0  1995/07/26  13:46:50  ostell
70  * force revision to 4.0
71  *
72  * Revision 2.2  1995/05/15  18:45:58  ostell
73  * added Log line
74  *
75 *
76 * ==========================================================================
77 */
78 
79 #ifndef _NCBITIME_
80 #define _NCBITIME_
81 
82 #include <time.h>
83 
84 #undef NLM_EXTERN
85 #ifdef NLM_IMPORT
86 #define NLM_EXTERN NLM_IMPORT
87 #else
88 #define NLM_EXTERN extern
89 #endif
90 
91 
92 #ifdef __cplusplus
93 extern "C" {
94 #endif
95 
96 NLM_EXTERN char **x_NCBI_months(void);
97 #define NCBI_months x_NCBI_months()
98 
99 typedef struct tm   Nlm_DayTime, PNTR Nlm_DayTimePtr;
100 
101 NLM_EXTERN time_t LIBCALL  Nlm_GetSecs PROTO((void));
102 NLM_EXTERN Nlm_Boolean LIBCALL  Nlm_GetDayTime PROTO((Nlm_DayTimePtr dtp));
103 NLM_EXTERN Nlm_Boolean LIBCALL  Nlm_DayTimeStr PROTO((Nlm_CharPtr buf, Nlm_Boolean date, Nlm_Boolean time));
104 
105 #define DayTime Nlm_DayTime
106 #define DayTimePtr Nlm_DayTimePtr
107 #define GetSecs Nlm_GetSecs
108 #define GetDayTime Nlm_GetDayTime
109 #define DayTimeStr Nlm_DayTimeStr
110 
111 
112 struct _StopWatch;
113 typedef struct _StopWatch PNTR Nlm_StopWatchPtr;
114 
115 NLM_EXTERN Nlm_StopWatchPtr	Nlm_StopWatchNew	PROTO((void));
116 NLM_EXTERN Nlm_StopWatchPtr	Nlm_StopWatchFree	PROTO((Nlm_StopWatchPtr pStopWatch));
117 NLM_EXTERN Nlm_StopWatchPtr	Nlm_StopWatchStart	PROTO((Nlm_StopWatchPtr pSW));
118 NLM_EXTERN Nlm_StopWatchPtr	Nlm_StopWatchStop	PROTO((Nlm_StopWatchPtr pSW));
119 NLM_EXTERN Nlm_FloatHi		Nlm_GetElapsedTime	PROTO((Nlm_StopWatchPtr pSW));
120 
121 #define StopWatchPtr	Nlm_StopWatchPtr
122 #define StopWatchNew	Nlm_StopWatchNew
123 #define StopWatchFree	Nlm_StopWatchFree
124 #define StopWatchStart	Nlm_StopWatchStart
125 #define StopWatchStop	Nlm_StopWatchStop
126 #define GetElapsedTime	Nlm_GetElapsedTime
127 
128 
129 struct _CPUTime;
130 typedef struct _CPUTime PNTR Nlm_CPUTimePtr;
131 
132 NLM_EXTERN Nlm_CPUTimePtr	Nlm_CPUTimeMeasure	PROTO((void));
133 NLM_EXTERN Nlm_CPUTimePtr	Nlm_CPUTimeFree		PROTO((Nlm_CPUTimePtr pTime));
134 NLM_EXTERN Nlm_FloatHi	Nlm_CPUTimeGetSys	PROTO((Nlm_CPUTimePtr pTime));
135 NLM_EXTERN Nlm_FloatHi	Nlm_CPUTimeGetUser	PROTO((Nlm_CPUTimePtr pTime));
136 
137 #define CPUTimePtr	Nlm_CPUTimePtr
138 #define CPUTimeMeasure	Nlm_CPUTimeMeasure
139 #define CPUTimeFree	Nlm_CPUTimeFree
140 #define CPUTimeGetSys	Nlm_CPUTimeGetSys
141 #define CPUTimeGetUser	Nlm_CPUTimeGetUser
142 
143 #ifdef __cplusplus
144 }
145 #endif
146 
147 
148 #undef NLM_EXTERN
149 #ifdef NLM_EXPORT
150 #define NLM_EXTERN NLM_EXPORT
151 #endif
152 
153 #endif
154 
155