Debian Codegraph @

src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/pal/inc/sntp.h

raw
1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4 /** @file threadapi.h
5 * @brief This module implements support for creating new threads,
6 * terminating threads and sleeping threads.
7 */
8
9 #ifndef AZURE_IOT_SNTP_H
10 #define AZURE_IOT_SNTP_H
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 #include "azure_macro_utils/macro_utils.h"
17 #include "umock_c/umock_c_prod.h"
18
19
20 /**
21 * @brief Set the url for the ntp server to be used. Must be called before
22 * SNTP_Init.
23 *
24 * @param serverName The url of the ntp server to be used. The char array
25 * passed in must remain valid between the SNTP_SetServerName and
26 * the SNTP_Deinit calls.
27 *
28 * @return @c 0 if the API call is successful or an error
29 * code in case it fails.
30 */
31 MOCKABLE_FUNCTION(, int, SNTP_SetServerName, const char*, serverName);
32
33 /**
34 * @brief Performs platform-specific sntp initialization, then loops until
35 * system time has been set from the ntp server.
36 *
37 *
38 * @return @c 0 if the API call is successful or an error
39 * code in case it fails.
40 */
41 MOCKABLE_FUNCTION(, int, SNTP_Init);
42
43 /**
44 * @brief This function is called by a thread when the thread exits.
45 */
46 MOCKABLE_FUNCTION(, void, SNTP_Deinit);
47
48
49 #ifdef __cplusplus
50 }
51 #endif
52
53 #endif /* AZURE_IOT_SNTP_H */