Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
c-utility/src/gb_time.c@0:f7f1f0d76dd6, 2018-08-23 (annotated)
- Committer:
- XinZhangMS
- Date:
- Thu Aug 23 06:52:14 2018 +0000
- Revision:
- 0:f7f1f0d76dd6
azure-c-sdk for mbed os supporting NUCLEO_F767ZI
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
XinZhangMS | 0:f7f1f0d76dd6 | 1 | // Copyright (c) Microsoft. All rights reserved. |
XinZhangMS | 0:f7f1f0d76dd6 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
XinZhangMS | 0:f7f1f0d76dd6 | 3 | |
XinZhangMS | 0:f7f1f0d76dd6 | 4 | /*depending if the symbol GB_TIME_INTERCEPT is defined, this file does the following |
XinZhangMS | 0:f7f1f0d76dd6 | 5 | |
XinZhangMS | 0:f7f1f0d76dd6 | 6 | a) if GB_TIME_INTERCEPT is NOT defined, then the file shall be empty (almost:) |
XinZhangMS | 0:f7f1f0d76dd6 | 7 | b) if GB_TIME_INTERCEPT is defined, then the file shall call to the 'real' time.h functions from their gb_* synonyms*/ |
XinZhangMS | 0:f7f1f0d76dd6 | 8 | #ifdef _MSC_VER |
XinZhangMS | 0:f7f1f0d76dd6 | 9 | static const int avoid_a_warning_C4206 = 0; /* warning C4206: nonstandard extension used: translation unit is empty*/ |
XinZhangMS | 0:f7f1f0d76dd6 | 10 | #endif |
XinZhangMS | 0:f7f1f0d76dd6 | 11 | #ifdef GB_TIME_INTERCEPT |
XinZhangMS | 0:f7f1f0d76dd6 | 12 | |
XinZhangMS | 0:f7f1f0d76dd6 | 13 | #ifdef __cplusplus |
XinZhangMS | 0:f7f1f0d76dd6 | 14 | #include <ctime> |
XinZhangMS | 0:f7f1f0d76dd6 | 15 | #else |
XinZhangMS | 0:f7f1f0d76dd6 | 16 | #include <time.h> |
XinZhangMS | 0:f7f1f0d76dd6 | 17 | #endif |
XinZhangMS | 0:f7f1f0d76dd6 | 18 | |
XinZhangMS | 0:f7f1f0d76dd6 | 19 | #include "azure_c_shared_utility/gb_time.h" |
XinZhangMS | 0:f7f1f0d76dd6 | 20 | |
XinZhangMS | 0:f7f1f0d76dd6 | 21 | /*this is time*/ |
XinZhangMS | 0:f7f1f0d76dd6 | 22 | time_t gb_time(time_t *timer); |
XinZhangMS | 0:f7f1f0d76dd6 | 23 | { |
XinZhangMS | 0:f7f1f0d76dd6 | 24 | return time(timer); |
XinZhangMS | 0:f7f1f0d76dd6 | 25 | } |
XinZhangMS | 0:f7f1f0d76dd6 | 26 | |
XinZhangMS | 0:f7f1f0d76dd6 | 27 | /*this is localtime*/ |
XinZhangMS | 0:f7f1f0d76dd6 | 28 | struct tm *gb_localtime(const time_t *timer) |
XinZhangMS | 0:f7f1f0d76dd6 | 29 | { |
XinZhangMS | 0:f7f1f0d76dd6 | 30 | return gb_localtime(timer); |
XinZhangMS | 0:f7f1f0d76dd6 | 31 | } |
XinZhangMS | 0:f7f1f0d76dd6 | 32 | |
XinZhangMS | 0:f7f1f0d76dd6 | 33 | size_t gb_strftime(char * s, size_t maxsize, const char * format, const struct tm * timeptr) |
XinZhangMS | 0:f7f1f0d76dd6 | 34 | { |
XinZhangMS | 0:f7f1f0d76dd6 | 35 | return strftime(s, maxsize, format, timeptr); |
XinZhangMS | 0:f7f1f0d76dd6 | 36 | } |
XinZhangMS | 0:f7f1f0d76dd6 | 37 | |
XinZhangMS | 0:f7f1f0d76dd6 | 38 | #endif |