mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
refactor: extracted timer function of adapter into separate library
This commit is contained in:
9
lib/wf/timer/include/wf/timer.h
Normal file
9
lib/wf/timer/include/wf/timer.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef WF_TIMER_H
|
||||
#define WF_TIMER_H
|
||||
|
||||
#include <wf/timer/api.h>
|
||||
#include <wf/timer/on_timer_fn.h>
|
||||
#include <wf/timer/timer.h>
|
||||
#include <wf/timer/manager.h>
|
||||
|
||||
#endif
|
||||
8
lib/wf/timer/include/wf/timer/api.h
Normal file
8
lib/wf/timer/include/wf/timer/api.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef WF_TIMER_API_H
|
||||
#define WF_TIMER_API_H
|
||||
|
||||
#ifndef WF_TIMER_API
|
||||
#define WF_TIMER_API
|
||||
#endif
|
||||
|
||||
#endif
|
||||
29
lib/wf/timer/include/wf/timer/manager.h
Normal file
29
lib/wf/timer/include/wf/timer/manager.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef WF_TIMER_MANAGER_H
|
||||
#define WF_TIMER_MANAGER_H
|
||||
|
||||
#include <wf/timer/api.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wf_timer_manager;
|
||||
|
||||
extern WF_TIMER_API struct wf_timer_manager *
|
||||
wf_timer_manager_create(void);
|
||||
|
||||
extern WF_TIMER_API void
|
||||
wf_timer_manager_dispose(
|
||||
struct wf_timer_manager * manager);
|
||||
|
||||
extern WF_TIMER_API void
|
||||
wf_timer_manager_check(
|
||||
struct wf_timer_manager * manager);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
19
lib/wf/timer/include/wf/timer/on_timer_fn.h
Normal file
19
lib/wf/timer/include/wf/timer/on_timer_fn.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef WF_TIMER_ON_TIMER_FN_H
|
||||
#define WF_TIMER_ON_TIMER_FN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wf_timer;
|
||||
|
||||
typedef void wf_timer_on_timer_fn(
|
||||
struct wf_timer * timer,
|
||||
void * user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
38
lib/wf/timer/include/wf/timer/timer.h
Normal file
38
lib/wf/timer/include/wf/timer/timer.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef WF_TIMER_TIMER_H
|
||||
#define WF_TIMER_TIMER_H
|
||||
|
||||
#include <wf/timer/api.h>
|
||||
#include <wf/timer/on_timer_fn.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
struct wf_timer;
|
||||
struct wf_timer_manager;
|
||||
|
||||
extern WF_TIMER_API struct wf_timer *
|
||||
wf_timer_create(
|
||||
struct wf_timer_manager * manager,
|
||||
wf_timer_on_timer_fn * on_timer,
|
||||
void * user_data);
|
||||
|
||||
extern WF_TIMER_API void
|
||||
wf_timer_dispose(
|
||||
struct wf_timer * timer);
|
||||
|
||||
extern WF_TIMER_API void
|
||||
wf_timer_start(
|
||||
struct wf_timer * timer,
|
||||
int timeout_ms);
|
||||
|
||||
extern WF_TIMER_API void
|
||||
wf_timer_cancel(
|
||||
struct wf_timer * timer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user