Bumping manifests a=b2g-bump
[gecko.git] / js / src / prmjtime.h
blobc85b214034b4b5cb2e3c0018215ee7c68a78fe83
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * vim: set ts=8 sts=4 et sw=4 tw=99:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef prmjtime_h
8 #define prmjtime_h
10 #include <stddef.h>
11 #include <stdint.h>
14 * Broken down form of 64 bit time value.
16 struct PRMJTime {
17 int32_t tm_usec; /* microseconds of second (0-999999) */
18 int8_t tm_sec; /* seconds of minute (0-59) */
19 int8_t tm_min; /* minutes of hour (0-59) */
20 int8_t tm_hour; /* hour of day (0-23) */
21 int8_t tm_mday; /* day of month (1-31) */
22 int8_t tm_mon; /* month of year (0-11) */
23 int8_t tm_wday; /* 0=sunday, 1=monday, ... */
24 int32_t tm_year; /* absolute year, AD */
25 int16_t tm_yday; /* day of year (0 to 365) */
26 int8_t tm_isdst; /* non-zero if DST in effect */
29 /* Some handy constants */
30 #define PRMJ_USEC_PER_SEC 1000000L
31 #define PRMJ_USEC_PER_MSEC 1000L
33 /* Return the current local time in micro-seconds */
34 extern int64_t
35 PRMJ_Now();
37 /* Initialize the resources associated with PRMJ_Now. */
38 #if defined(XP_WIN)
39 extern void
40 PRMJ_NowInit();
41 #else
42 inline void
43 PRMJ_NowInit() {}
44 #endif
46 /* Release the resources associated with PRMJ_Now; don't call PRMJ_Now again */
47 #ifdef XP_WIN
48 extern void
49 PRMJ_NowShutdown();
50 #else
51 inline void
52 PRMJ_NowShutdown() {}
53 #endif
55 /* Format a time value into a buffer. Same semantics as strftime() */
56 extern size_t
57 PRMJ_FormatTime(char *buf, int buflen, const char *fmt, PRMJTime *tm);
59 #endif /* prmjtime_h */