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/inc/azure_c_shared_utility/agenttime.h
- Committer:
- XinZhangMS
- Date:
- 2018-08-23
- Revision:
- 0:f7f1f0d76dd6
File content as of revision 0:f7f1f0d76dd6:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
/** @file agenttime.h
* @brief Function prototypes for time related functions.
*
* @details These functions are implemented with C standard functions,
* and therefore they are platform independent. But then a platform
* can replace these functions with its own implementation as necessary.
*/
#ifndef AGENTTIME_H
#define AGENTTIME_H
#include <time.h>
#include "azure_c_shared_utility/umock_c_prod.h"
#ifdef __cplusplus
extern "C"
{
#endif
/** @brief Get current calendar time.
*
* @details This function provides the same functionality as the
* standard C @c time() function.
*/
MOCKABLE_FUNCTION(, time_t, get_time, time_t*, currentTime);
/** @brief Get UTC in @c tm struct.
*
* @details This function provides the same functionality as the
* standard C @c gmtime() function.
*/
MOCKABLE_FUNCTION(, struct tm*, get_gmtime, time_t*, currentTime);
/** @brief Get current time representation of the given calendar time.
*
* @details This function provides the same functionality as the
* standard C @c mktime() function.
*/
MOCKABLE_FUNCTION(, time_t, get_mktime, struct tm*, cal_time);
/** @brief Gets a C-string representation of the given time.
*
* @details This function provides the same functionality as the
* standard C @c ctime() function.
*/
MOCKABLE_FUNCTION(, char*, get_ctime, time_t*, timeToGet);
/** @brief Gets the difference in seconds between @c stopTime and
* @c startTime.
*
* @details This function provides the same functionality as the
* standard C @c difftime() function.
*/
MOCKABLE_FUNCTION(, double, get_difftime, time_t, stopTime, time_t, startTime);
#ifdef __cplusplus
}
#endif
#endif // AGENTTIME_H