diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:22 +0000 |
commit | c21c3b0befeb46a51b6bf3758ffa30813bea0ff0 (patch) | |
tree | 9754ff1ca740f6346cf8483ec915d4054bc5da2d /fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-framework/base/app/wa-inc/timer_wasm_app.h | |
parent | Adding upstream version 1.43.2. (diff) | |
download | netdata-c21c3b0befeb46a51b6bf3758ffa30813bea0ff0.tar.xz netdata-c21c3b0befeb46a51b6bf3758ffa30813bea0ff0.zip |
Adding upstream version 1.44.3.upstream/1.44.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-framework/base/app/wa-inc/timer_wasm_app.h')
-rw-r--r-- | fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-framework/base/app/wa-inc/timer_wasm_app.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-framework/base/app/wa-inc/timer_wasm_app.h b/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-framework/base/app/wa-inc/timer_wasm_app.h new file mode 100644 index 000000000..cf158a365 --- /dev/null +++ b/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/core/app-framework/base/app/wa-inc/timer_wasm_app.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2019 Intel Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ + +#ifndef _AEE_TIMER_H_ +#define _AEE_TIMER_H_ + +#include "bh_platform.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* board producer define user_timer */ +struct user_timer; +typedef struct user_timer *user_timer_t; + +/** + * @typedef on_user_timer_update_f + * + * @brief Define the signature of callback function for API api_timer_create(). + * + * @param timer the timer + * + * @see api_timer_create + */ +typedef void (*on_user_timer_update_f)(user_timer_t timer); + +/* + ***************** + * Timer APIs + ***************** + */ + +/** + * @brief Create timer. + * + * @param interval timer interval + * @param is_period whether the timer is periodic + * @param auto_start whether start the timer immediately after created + * @param on_timer_update callback function called when timer expired + * + * @return the timer created if success, NULL otherwise + */ +user_timer_t +api_timer_create(int interval, bool is_period, bool auto_start, + on_user_timer_update_f on_timer_update); + +/** + * @brief Cancel timer. + * + * @param timer the timer to cancel + */ +void +api_timer_cancel(user_timer_t timer); + +/** + * @brief Restart timer. + * + * @param timer the timer to cancel + * @param interval the timer interval + */ +void +api_timer_restart(user_timer_t timer, int interval); + +#ifdef __cplusplus +} +#endif + +#endif |