1
0
mirror of https://github.com/haiwen/ccnet-server.git synced 2025-09-06 15:20:18 +00:00

Initial commit of Ccnet server.

This commit is contained in:
Jiaqiang Xu
2016-08-18 17:39:55 +08:00
commit ed8404c061
206 changed files with 37441 additions and 0 deletions

28
include/ccnet/timer.h Normal file
View File

@@ -0,0 +1,28 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#ifndef CCNET_TIMER_H
#define CCNET_TIMER_H
/* return TRUE to reschedule the timer, return FALSE to cancle the timer */
typedef int (*TimerCB) (void *data);
struct CcnetTimer;
typedef struct CcnetTimer CcnetTimer;
/**
* Calls timer_func(user_data) after the specified interval.
* The timer is freed if timer_func returns zero.
* Otherwise, it's called again after the same interval.
*/
CcnetTimer* ccnet_timer_new (TimerCB func,
void *user_data,
uint64_t timeout_milliseconds);
/**
* Frees a timer and sets the timer pointer to NULL.
*/
void ccnet_timer_free (CcnetTimer **timer);
#endif