Azure IoT common library
Dependents: STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more
gb_time.c@49:6bb8b9a66642, 2018-10-04 (annotated)
- Committer:
- AzureIoTClient
- Date:
- Thu Oct 04 09:17:16 2018 -0700
- Revision:
- 49:6bb8b9a66642
- Parent:
- 48:81866008bba4
1.2.10
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Azure.IoT Build | 0:fa2de1b79154 | 1 | // Copyright (c) Microsoft. All rights reserved. |
Azure.IoT Build | 0:fa2de1b79154 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
Azure.IoT Build | 0:fa2de1b79154 | 3 | |
Azure.IoT Build | 0:fa2de1b79154 | 4 | /*depending if the symbol GB_TIME_INTERCEPT is defined, this file does the following |
Azure.IoT Build | 0:fa2de1b79154 | 5 | |
Azure.IoT Build | 0:fa2de1b79154 | 6 | a) if GB_TIME_INTERCEPT is NOT defined, then the file shall be empty (almost:) |
Azure.IoT Build | 0:fa2de1b79154 | 7 | b) if GB_TIME_INTERCEPT is defined, then the file shall call to the 'real' time.h functions from their gb_* synonyms*/ |
AzureIoTClient | 20:95abdea56064 | 8 | #ifdef _MSC_VER |
AzureIoTClient | 48:81866008bba4 | 9 | /* compiler warning C4206: nonstandard extension used: translation unit is empty */ |
AzureIoTClient | 48:81866008bba4 | 10 | /* linker warning 4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library */ |
AzureIoTClient | 48:81866008bba4 | 11 | const int avoid_warnings_0CA668EF_F2C4_49A8_A30D_7257C67173A4 = 0; |
AzureIoTClient | 20:95abdea56064 | 12 | #endif |
Azure.IoT Build | 0:fa2de1b79154 | 13 | #ifdef GB_TIME_INTERCEPT |
Azure.IoT Build | 0:fa2de1b79154 | 14 | |
Azure.IoT Build | 0:fa2de1b79154 | 15 | #ifdef __cplusplus |
Azure.IoT Build | 0:fa2de1b79154 | 16 | #include <ctime> |
Azure.IoT Build | 0:fa2de1b79154 | 17 | #else |
Azure.IoT Build | 0:fa2de1b79154 | 18 | #include <time.h> |
Azure.IoT Build | 0:fa2de1b79154 | 19 | #endif |
Azure.IoT Build | 0:fa2de1b79154 | 20 | |
Azure.IoT Build | 0:fa2de1b79154 | 21 | #include "azure_c_shared_utility/gb_time.h" |
Azure.IoT Build | 0:fa2de1b79154 | 22 | |
Azure.IoT Build | 0:fa2de1b79154 | 23 | /*this is time*/ |
Azure.IoT Build | 0:fa2de1b79154 | 24 | time_t gb_time(time_t *timer); |
Azure.IoT Build | 0:fa2de1b79154 | 25 | { |
Azure.IoT Build | 0:fa2de1b79154 | 26 | return time(timer); |
Azure.IoT Build | 0:fa2de1b79154 | 27 | } |
Azure.IoT Build | 0:fa2de1b79154 | 28 | |
Azure.IoT Build | 0:fa2de1b79154 | 29 | /*this is localtime*/ |
Azure.IoT Build | 0:fa2de1b79154 | 30 | struct tm *gb_localtime(const time_t *timer) |
Azure.IoT Build | 0:fa2de1b79154 | 31 | { |
Azure.IoT Build | 0:fa2de1b79154 | 32 | return gb_localtime(timer); |
Azure.IoT Build | 0:fa2de1b79154 | 33 | } |
Azure.IoT Build | 0:fa2de1b79154 | 34 | |
Azure.IoT Build | 0:fa2de1b79154 | 35 | size_t gb_strftime(char * s, size_t maxsize, const char * format, const struct tm * timeptr) |
Azure.IoT Build | 0:fa2de1b79154 | 36 | { |
Azure.IoT Build | 0:fa2de1b79154 | 37 | return strftime(s, maxsize, format, timeptr); |
Azure.IoT Build | 0:fa2de1b79154 | 38 | } |
Azure.IoT Build | 0:fa2de1b79154 | 39 | |
Azure.IoT Build | 0:fa2de1b79154 | 40 | #endif |