1
0
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:
Falk Werner
2020-02-29 21:06:40 +01:00
parent b2d6ed8754
commit 79318c47b8
40 changed files with 765 additions and 618 deletions

View 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

View 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

View 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

View 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

View 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